[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 9/9] x86/cpuid: Enable MSR_SPEC_CTRL in SVM guests by default


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 31 Jan 2022 11:39:12 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qvx2QQ/LnGaw9dsPPVOmw95k8uI8ey4KjFg7218puqI=; b=PY3BY6uqIJjHHbodSL57pU8aE3hAlhz2k/3BzLvIHLnVC38DbckwUH0BD4f136s0UaFgRdMC/qrObH56JAoOK9uxCNR7ExiSXGvm79HVlTQLTRqLofLe5Z6430rAiw9OAzoHG4mOG4oY4HgH3Ju4HicjkRve6uui7UXV5T6BwneWCv5tfgP9BrM0MtWFfzaLfKdcTs5wXt5tTJADIqX1S+gaucYhqmF7kiwnM34bl0bL/k7XGTjI4EfKINkjLoksQ9GjVsrkyiJ5H0gKLFhbgFqJla6Ibexhlf+ow40ze/bzSndmehh5AkqSW/S6acgHHSl8qCKh0IPVsM1aL1N1wA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eF0Y5KOvElVLkgzF42sSn+xiMtS0wlMMk5OsYnzP8VtgEIobSXRdneHc8uvy+XufEYAZn0qrcmuft0m52L98CQS4tHQrchJIBDIswJPNZNuhiovqPlPfHSoR7CFl/7Qu8zQMxDqkoSm5t8hj7fsXUHuYMdIgabXo2CpqVgep8EpBSFNHG5/KRT4n4dLNEjHJGs9IluY3tAQ1ad7WKxZLnkHNLRLhd+rQIgvE/QRIQCMb/ZqS4tm83r6IGGR6nuWRQw0zuVaV8GK086cCF89BToehywzz+TQpYVdKYChcnaDeq8VeiJei3jgw2UTC/NJrOn2daP8J3cvraQFm5VRM8Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 31 Jan 2022 10:39:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28.01.2022 14:29, Andrew Cooper wrote:
> With all other pieces in place, MSR_SPEC_CTRL is fully working for HVM guests.
> 
> Update the CPUID derivation logic (both PV and HVM to avoid losing subtle
> changes), drop the MSR intercept, and explicitly enable the CPUID bits for HVM
> guests.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Oneremark:

> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -606,6 +606,10 @@ static void svm_cpuid_policy_changed(struct vcpu *v)
>  
>      vmcb_set_exception_intercepts(vmcb, bitmap);
>  
> +    /* Give access to MSR_SPEC_CTRL if the guest has been told about it. */
> +    svm_intercept_msr(v, MSR_SPEC_CTRL,
> +                      cp->extd.ibrs ? MSR_INTERCEPT_NONE : MSR_INTERCEPT_RW);

Technically I suppose the intercept would also be unneeded if the MSR
doesn't exist at all, as then the CPU would raise #GP(0) for any guest
attempt to access it.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.