[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230615115255.GBZIr7l2XNKau16ayl@fat_crate.local>
Date: Thu, 15 Jun 2023 13:52:55 +0200
From: Borislav Petkov <bp@...en8.de>
To: John Allen <john.allen@....com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
pbonzini@...hat.com, weijiang.yang@...el.com,
rick.p.edgecombe@...el.com, seanjc@...gle.com, x86@...nel.org,
thomas.lendacky@....com
Subject: Re: [RFC PATCH v2] x86/sev-es: Include XSS value in GHCB CPUID
request
On Wed, May 24, 2023 at 03:56:19PM +0000, John Allen wrote:
> + if (has_cpuflag(X86_FEATURE_SHSTK) && regs->ax == 0xd && regs->cx <= 1) {
> + unsigned long lo, hi;
> + u64 xss;
> +
> + /*
> + * Since vc_handle_cpuid may be used during early boot, the
> + * rdmsr wrappers are incompatible and should not be used.
> + * Invoke the instruction directly.
> + */
> + asm volatile("rdmsr" : "=a" (lo), "=d" (hi)
> + : "c" (MSR_IA32_XSS));
> + xss = (hi << 32) | lo;
> + ghcb_set_xss(ghcb, xss);
$ git grep ghcb_set_xss
$
So this patch needs some tree which I'm not aware of.
Also, this passing through of host XSS to the guest looks like it is
bypassing the vcpu->arch.ia32_xss copy which KVM seems to maintain. It
looks to me like the handling needs to be synchronized with it or so.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists