On 4/11/24 20:42, Andrew Cooper wrote:
On 10/04/2024 4:36 pm, Andrei Semenov wrote:
Signed-off-by: Andrei Semenov <andrei.seme...@vates.fr>
---
  xen/arch/x86/include/asm/psp-sev.h | 655 +++++++++++++++++++++++
  xen/drivers/Kconfig                |   2 +
  xen/drivers/Makefile               |   1 +
  xen/drivers/crypto/Kconfig         |  10 +
  xen/drivers/crypto/Makefile        |   1 +
  xen/drivers/crypto/asp.c           | 808 +++++++++++++++++++++++++++++
  xen/include/xen/types.h            |   2 +-
  7 files changed, 1478 insertions(+), 1 deletion(-)
  create mode 100644 xen/arch/x86/include/asm/psp-sev.h
  create mode 100644 xen/drivers/crypto/Kconfig
  create mode 100644 xen/drivers/crypto/Makefile
  create mode 100644 xen/drivers/crypto/asp.c
I'm not going to dive into all of this, but give some high level
feedback to start with.

CCP is driver/crypto in Linux for historical reasons, but is it really
right here?  We can pick whatever we think is suitable.

Yes, I only picked SEV interface (for instance) and I called the the
directory "crypto", for

some reasons as  this is the name in Linux, so to "compliant" and SEV is
related to crypto too.

Later we potentially will need to export some of interfaces to guest so
will need to extend the driver.

As Marek remarked some AMD GPU may need this to load GPU firmware ...

That's beeing said, I have not very strong opinion on "crypto" name.


psp-sev.h looks like it's only the MMIO protocol to the ASP, and that it
shouldn't need including anywhere else?  If so, we're trying to move
those header files to be local to the asp.c dir.

SVM operations (at least) will need this.  Very probably toolstack also will

need a part of this, so potentially this part will move to "public"
interface.

 For instance hard to say what parts (are moving), so all this in the same

psp-sev.h file.


Can you discuss this comment:
     CET shadow stack: adapt #CP handler???
some more.  What's going on?

Yep. Actually CET Shadow Stack raised #21 exception  (near ret) on older

versions of Xen (when I said older I talk about 4.19 unstable). This is
no more

the case on staging branch. So it was fixed somehow. Sorry didn't check

- will fix.



diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index 449947b353..f7599845fd 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -6,7 +6,7 @@

  /* Linux inherited types which are being phased out */
  typedef int8_t s8;
-typedef uint8_t u8;
+typedef uint8_t u8, __u8;
  typedef int16_t s16;
  typedef uint16_t u16, __u16;
  typedef int32_t s32;
The comment is here for a reason, so reviewers don't accept hunks like this.

psp-sev.h should be written using normal C99 integer types please.
Got it. Will fix

~Andrew


Reply via email to