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

Re: [Xen-devel] [PATCH 3/6] x86/vmx: Introduce and use struct vmx_msr_bitmap


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Thu, 27 Jul 2017 06:02:59 +0000
  • Accept-language: en-US
  • Cc: "Nakajima, Jun" <jun.nakajima@xxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>
  • Delivery-date: Thu, 27 Jul 2017 06:03:10 +0000
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 10.0.102.7
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: AQHTAIZN4OdJ4pGoGEm4GmOfXh4cSKJnNoOQ
  • Thread-topic: [PATCH 3/6] x86/vmx: Introduce and use struct vmx_msr_bitmap

> From: Andrew Cooper [mailto:andrew.cooper3@xxxxxxxxxx]
> Sent: Wednesday, July 19, 2017 7:58 PM
> 
> This avoids opencoding the bitmap bases in accessor functions.  Introduce a
> build_assertions() function to check the structure layout against the manual
> definiton.  In addition, drop some stale comments and ASSERT() that callers
> pass an in-range MSR.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>, with a small comment:
[...]

> diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-
> x86/hvm/vmx/vmcs.h
> index e318dc2..926e792 100644
> --- a/xen/include/asm-x86/hvm/vmx/vmcs.h
> +++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
> @@ -64,6 +64,14 @@ struct vmx_domain {
>      unsigned int status;
>  };
> 
> +/* Layout of the MSR bitmap, as interpreted by hardware. */
> +struct vmx_msr_bitmap {
> +    unsigned long read_low  [0x2000 / BITS_PER_LONG];
> +    unsigned long read_high [0x2000 / BITS_PER_LONG];
> +    unsigned long write_low [0x2000 / BITS_PER_LONG];
> +    unsigned long write_high[0x2000 / BITS_PER_LONG];
> +};
> +

what about taking this chance to define 0x2000 into a macro
for better readability?

Thanks
Kevin

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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