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@xxxxxxxxxxxxxxx> --- v7: - New added. --- lib/x86/processor.h | 6 ++++++ x86/pcid.c | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) 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; -- 2.43.2