[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 1/7] i386: Extra x86 definitions needed by AMD SKINIT Secure
From: |
Sergii Dmytruk |
Subject: |
[RFC PATCH 1/7] i386: Extra x86 definitions needed by AMD SKINIT Secure Launch |
Date: |
Wed, 18 Dec 2024 21:07:57 +0200 |
From: Ross Philipson <ross.philipson@oracle.com>
A few MSR/CPUID/PCI x86 definitions added.
Signed-off-by: Ross Philipson <ross.philipson@oracle.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
---
include/grub/i386/cpuid.h | 7 ++++---
include/grub/i386/msr.h | 6 ++++++
include/grub/i386/pci.h | 1 +
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/grub/i386/cpuid.h b/include/grub/i386/cpuid.h
index e1c45dfc2..36e4ee05e 100644
--- a/include/grub/i386/cpuid.h
+++ b/include/grub/i386/cpuid.h
@@ -28,9 +28,10 @@
#define GRUB_SMX_CPUID_FEATURE (1<<6)
/* AMD */
-#define GRUB_AMD_CPUID_FEATURES 0x80000001
-#define GRUB_SVM_CPUID_FEATURE (1<<2)
-#define GRUB_AMD_CPUID_FUNC 0x8000000a
+#define GRUB_AMD_CPUID_FEATURES 0x80000001
+#define GRUB_SVM_CPUID_FEATURE (1<<2)
+#define GRUB_AMD_CPUID_FUNC 0x8000000a
+#define GRUB_SKINIT_CPUID_FEATURE (1<<12)
extern unsigned char grub_cpuid_has_longmode;
extern unsigned char grub_cpuid_has_pae;
diff --git a/include/grub/i386/msr.h b/include/grub/i386/msr.h
index 9f29c6eb2..726aba9d4 100644
--- a/include/grub/i386/msr.h
+++ b/include/grub/i386/msr.h
@@ -30,6 +30,12 @@
#define GRUB_MSR_X86_APICBASE_ENABLE (1<<11)
#define GRUB_MSR_X86_APICBASE_BASE (0xfffff<<12) /* Mask for APIC base
address */
+#define GRUB_MSR_X86_X2APICBASE_ENABLE (1<<10)
+#define GRUB_MSR_X86_X2APICBASE_ICR 0x830
+#define GRUB_MSR_X86_LAPIC_ICR_LO 0x300
+#define GRUB_MSR_X86_ICR_MODE_INIT (5<<8)
+#define GRUB_MSR_X86_ICR_DELIVER_EXCL_SELF (3<<18)
+
#define GRUB_MSR_X86_FEATURE_CONTROL 0x0000003a
#define GRUB_MSR_X86_ENABLE_VMX_IN_SMX (1<<1) /* Enable VMX inside SMX */
#define GRUB_MSR_X86_SENTER_FUNCTIONS (0x7f<<8) /* Bitmap of SENTER
function enables */
diff --git a/include/grub/i386/pci.h b/include/grub/i386/pci.h
index dffeb5695..952e8bcca 100644
--- a/include/grub/i386/pci.h
+++ b/include/grub/i386/pci.h
@@ -27,6 +27,7 @@
#define GRUB_PCI_DATA_REG 0xcfc
#define GRUB_PCI_NUM_BUS 256
#define GRUB_PCI_NUM_DEVICES 32
+#define GRUB_PCI_NUM_FUNCTIONS 8
static inline grub_uint32_t
grub_pci_read (grub_pci_address_t addr)
--
2.47.1
- [RFC PATCH 0/7] x86: Trenchboot Secure Launch DRTM for AMD SKINIT (GRUB), Sergii Dmytruk, 2024/12/18
- [RFC PATCH 4/7] slaunch/psp: Setup TMRs to protect RAM from DMA, Sergii Dmytruk, 2024/12/18
- [RFC PATCH 1/7] i386: Extra x86 definitions needed by AMD SKINIT Secure Launch,
Sergii Dmytruk <=
- [RFC PATCH 7/7] multiboot2: Support SKINIT Secure Launch, Sergii Dmytruk, 2024/12/18
- [RFC PATCH 5/7] slaunch/skinit: AMD SKINIT Secure Launch core implementation, Sergii Dmytruk, 2024/12/18
- [RFC PATCH 6/7] efi/slaunch: Add AMD Secure Launch support for Linux EFI stub boot, Sergii Dmytruk, 2024/12/18
- [RFC PATCH 2/7] i386: Add PSP discovery code, Sergii Dmytruk, 2024/12/18
- [RFC PATCH 3/7] slaunch/psp: Add core PSP commands and get capability command, Sergii Dmytruk, 2024/12/18