[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>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 12 Jan 2023 14:26:30 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=hH7GRJMJLboLqQxfrRCU7JHmsgaKy1telQ3E6ETmio0=; b=g00V5ZNpwNG69VkcoIYGvUStRUXt0OvuIY46caJpHof0em34B4GfvR6VS7aMeSbd/aaGHJeRR5v1wExTVoSVkOC+yV1NiJs51lMOwofb/nLWnKb/NphLR0ZOi364j0QGffyMJvAJxwVo4ZBtdJqGJ9H2pt75wJwKyZ0rmIyvQLG4RnEUlETy8L1IR26a7mJXahX4Q+g7iMJq4dDKX0nQsAbkq7ohn2Yqd51FcPE6CGuPZycENcWBt2WL8/0fcYga/JzPxCBUBL1v/24SmbKYmQKEVwsb8TsX3XooxanGgZpv7nC40Hn8buvbZ0N2Vkr0sZgvOzonCtyOus0egr+G6w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PIxgZpukXDuuEhe/KP2JHX7ZArgrhbQ5xGGRtJ2Dk4bUEJIkAdusV5++PK4DeE0CwSfw0VTHh7JdwNBgzI768ZP7TTXniFAaUP3l5VianpM16VplY2Iy3uVSc3RnfftvzjTn+88I2UTALCgrj7ad6vK2U8gTjjP8gPBDLGStbZc1cTollKPs9rHjbymkbEwsstLoVKxDUKyYABxskZcDrwfzqLRAlxNr4RssXlKf71g9kxT60x8eCWju+TnSaIGNGu782b1g6NSSd7BeuXiFoCnhFCV097iMwoglmX1rWA2mDiDh7cbhHWaE87GkvHFxFGVm/8nPCunzWDdl6w3tcw==
  • 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>, Kevin Tian <kevin.tian@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 12 Jan 2023 13:26:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.01.2023 18:18, Andrew Cooper wrote:
> @@ -2471,6 +2477,9 @@ static uint64_t cf_check vmx_get_reg(struct vcpu *v, 
> unsigned int reg)
>          }
>          return val;
>  
> +    case MSR_PKRS:
> +        return (v == curr) ? rdpkrs() : msrs->pkrs;

Nothing here or ...

> @@ -2514,6 +2525,12 @@ static void cf_check vmx_set_reg(struct vcpu *v, 
> unsigned int reg, uint64_t val)
>              domain_crash(d);
>          }
>          return;
> +
> +    case MSR_PKRS:
> +        msrs->pkrs = val;
> +        if ( v == curr )
> +            wrpkrs(val);
> +        return;

... here is VMX or (if we were to support it, just as a abstract
consideration) HVM specific. Which makes me wonder why this needs
handling in [gs]et_reg() in the first place. I guess I'm still not
fully in sync with your longer term plans here ...

The other thing I'd like to understand (and having an answer to this
would have been better before re-applying my R-b to this re-based
logic) is towards the lack of feature checks here. hvm_get_reg()
can be called from other than guest_rdmsr(), for an example see
arch_get_info_guest().

Jan



 


Rackspace

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