Occasionally we see pcid test fail as INVPCID_DESC[127:64] is uninitialized before execute invpcid. According to Intel spec: "#GP If INVPCID_TYPE is 0 and the linear address in INVPCID_DESC[127:64] is not canonical." Assign desc's address which is guaranteed to be a real memory address and canonical. Fixes: b44d84dae10c ("Add PCID/INVPCID test") Signed-off-by: Zhenzhong Duan <zhenzhong.duan@xxxxxxxxx> --- x86/pcid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x86/pcid.c b/x86/pcid.c index 527a4a9..4828bbc 100644 --- a/x86/pcid.c +++ b/x86/pcid.c @@ -75,6 +75,9 @@ static void test_invpcid_enabled(int pcid_enabled) struct invpcid_desc desc; desc.rsv = 0; + /* Initialize INVPCID_DESC[127:64] with a canonical address */ + desc.addr = (u64)&desc; + /* try executing invpcid when CR4.PCIDE=0, desc.pcid=0 and type=0..3 * no exception expected */ -- 2.25.1