diff mbox series

[kvm-unit-tests,v7,1/5] x86: Move struct invpcid_desc to processor.h

Message ID 20240701073010.91417-2-binbin.wu@linux.intel.com (mailing list archive)
State New
Headers show
Series x86: Add test cases for LAM | expand

Commit Message

Binbin Wu July 1, 2024, 7:30 a.m. UTC
Move struct invpcid_desc to processor.h so that new test cases need
to do invpcid can use the definition.

Opportunistically add packed attribute, because according to C standard,
the allocation of storage unit for bit-field is implementation specific.

Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com>
---
v7:
- New added.
---
 lib/x86/processor.h | 6 ++++++
 x86/pcid.c          | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/lib/x86/processor.h b/lib/x86/processor.h
index da1ed662..85a1781b 100644
--- a/lib/x86/processor.h
+++ b/lib/x86/processor.h
@@ -959,4 +959,10 @@  static inline void generate_cr0_em_nm(void)
 	fnop();
 }
 
+struct invpcid_desc {
+	u64 pcid : 12;
+	u64 rsv  : 52;
+	u64 addr : 64;
+} __attribute__((packed));
+
 #endif
diff --git a/x86/pcid.c b/x86/pcid.c
index c503efb8..7425e0fe 100644
--- a/x86/pcid.c
+++ b/x86/pcid.c
@@ -4,12 +4,6 @@ 
 #include "processor.h"
 #include "desc.h"
 
-struct invpcid_desc {
-    u64 pcid : 12;
-    u64 rsv  : 52;
-    u64 addr : 64;
-};
-
 static void test_pcid_enabled(void)
 {
     int passed = 0;