[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 6/8] x86/hvm: Enable guest access to MSR_PKRS
- To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Tue, 10 Jan 2023 18:07:39 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; 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=MdqVEpphdJImzJSpUifrpqkuvfmbJ6VAe+5o7miVXh4=; b=YgIY07I2xALE9rqhYEBzb7o9jSmlISrIIKRMunRvUlxMzOpx+gNSW/DqLwldt8ZqQTvgavM4c0pXyDAzcHUv2+xJtyL6EHDoIVH5JK6OupPvow4C5iLvxoiUJbuSIu21KQn7urOoR97pEXH/wr+ZiGAZ+oGnjpuh2h8dVMMvfKmvFxHkR30ANkkNWmFe1RE4gWeIfiqUNGbuAbyOQrhLn0k6EQqq+zPKcLpeYcOAXf7eaaY/E+iAOwBQLH77EbNQeVjhQGz0FsQvFkiHLOd8fMbDS6YwfW+Hxk3yGWDFU6NHOrppf7EdCrWgVrrRxpCLdVrnN6Oaad3UbL5spRC63g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KXBj/6Jbjdkl1GrEhBfUc7QJYFH6Gft0Mp72o2p1JIzWTIKZZ3SGZzOF4HrhCriTkdt8pU9kYC8637Q+whhWLXuUe2iGUmDV7abMLiVR80cKQSMaV/ERcAv4Pq0kOGK6Zilgx7LE4DX0thrwywVaKaVCdynEvMcaTbwTcUCEskjbj9tM/AcpvFXbQP/KC3dm2+pVXu57OqKV5MtETWoZUz3n4iYjmd340CgFz/RU3VqR+l3rwtqNEuiJm6U4YgzeS78TGgZ4uG9Izd5du7wyqTOHLkud0P3L4QlVfsQmkc/PNAqrMi7EJ76P+2O1FAj3oSWg2e0dmF9bSqldxqXjPQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
- Delivery-date: Tue, 10 Jan 2023 18:08:08 +0000
- Ironport-data: A9a23:6Aifuq668Slxi4rXLDSqowxRtAHGchMFZxGqfqrLsTDasY5as4F+v mYfWDyCbP2JZWOgeN10bN+0pxtT65/VmII1TQY5/300Hi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraBYnoqLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9VU+4pwehBtC5gZlPakS5AeF/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m7 /wFAjctYim/qM2v2pGKG+BHos0vFZy+VG8fkikIITDxK98DGcqGaYOToNhS0XE3m9xEGuvYa 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6OlUotgdABM/KMEjCObexTklyVu STt+GPhDwtBHNee1SCE4jSngeqncSbTCd5OSODppq4CbFu712kBKiwIWGmH+9aemEOcBe5He xMG0397xUQ13AnxJjXnZDWorXjBshMCVt54F+wh9B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/hn+eyuXS2lFy4mllUBg==
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHZJReeV/6Z/BfYW0W8YgpP3+cAB66X8qqA
- Thread-topic: [PATCH v2 6/8] x86/hvm: Enable guest access to MSR_PKRS
On 10/01/2023 5:18 pm, Andrew Cooper wrote:
> Have guest_{rd,wr}msr(), via hvm_{get,set}_reg(), access either the live
> register, or stashed state, depending on context. Include MSR_PKRS for
> migration, and let the guest have full access.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> CC: Kevin Tian <kevin.tian@xxxxxxxxx>
>
> v2:
> * Rebase over the get/set_reg() infrastructure.
> ---
> xen/arch/x86/hvm/hvm.c | 1 +
> xen/arch/x86/hvm/vmx/vmx.c | 17 +++++++++++++++++
> xen/arch/x86/msr.c | 10 ++++++++++
> 3 files changed, 28 insertions(+)
>
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 927a221660e8..c6c1eea18003 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1333,6 +1333,7 @@ static int cf_check hvm_load_cpu_xsave_states(
> static const uint32_t msrs_to_send[] = {
> MSR_SPEC_CTRL,
> MSR_INTEL_MISC_FEATURES_ENABLES,
> + MSR_PKRS,
> MSR_IA32_BNDCFGS,
> MSR_IA32_XSS,
> MSR_VIRT_SPEC_CTRL,
Needs the following hunk too:
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c6c1eea18003..86cab7aa2627 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1487,6 +1487,7 @@ static int cf_check hvm_load_cpu_msrs(struct
domain *d, hvm_domain_context_t *h)
case MSR_SPEC_CTRL:
case MSR_INTEL_MISC_FEATURES_ENABLES:
+ case MSR_PKRS:
case MSR_IA32_BNDCFGS:
case MSR_IA32_XSS:
case MSR_VIRT_SPEC_CTRL:
for the receive side of migration to work.
~Andrew
|