WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 15/16] vmx: nest: capability reporting MSRs

To: Qing He <qing.he@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 15/16] vmx: nest: capability reporting MSRs
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Mon, 13 Sep 2010 13:45:04 +0100
Cc: Eddie, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Dong <eddie.dong@xxxxxxxxx>
Delivery-date: Mon, 13 Sep 2010 05:46:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1283959344-3837-16-git-send-email-qing.he@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1283959344-3837-1-git-send-email-qing.he@xxxxxxxxx> <1283959344-3837-16-git-send-email-qing.he@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
At 16:22 +0100 on 08 Sep (1283962943), Qing He wrote:
> handles VMX capability reporting MSRs.
> Some features are masked so L1 would see a rather
> simple configuration

As I said last time, would it be better to whitelist features that we
know are safely virtualized?

> Signed-off-by: Qing He <qing.he@xxxxxxxxx>
> Signed-off-by: Eddie Dong <eddie.dong@xxxxxxxxx>
> 
> ---
> 
> diff -r 694dcf6c3f06 xen/arch/x86/hvm/vmx/nest.c
> --- a/xen/arch/x86/hvm/vmx/nest.c     Wed Sep 08 19:47:14 2010 +0800
> +++ b/xen/arch/x86/hvm/vmx/nest.c     Wed Sep 08 19:47:39 2010 +0800
> @@ -1352,3 +1352,91 @@
>  
>      return bypass_l0;
>  }
> +
> +/*
> + * Capability reporting
> + */
> +int vmx_nest_msr_read_intercept(unsigned int msr, u64 *msr_content)
> +{
> +    u32 eax, edx;
> +    u64 data = 0;
> +    int r = 1;
> +    u32 mask = 0;
> +
> +    if ( !is_nested_avail(current->domain) )
> +        return 0;
> +
> +    switch (msr) {
> +    case MSR_IA32_VMX_BASIC:
> +        rdmsr(msr, eax, edx);
> +        data = edx;
> +        data = (data & ~0x1fff) | 0x1000;     /* request 4KB for guest VMCS 
> */
> +        data &= ~(1 << 23);                   /* disable TRUE_xxx_CTLS */

Magic number - please use a macro to define it. 

> +        data = (data << 32) | VVMCS_REVISION; /* VVMCS revision */
> +        break;
> +    case MSR_IA32_VMX_PINBASED_CTLS:
> +#define REMOVED_PIN_CONTROL_CAP (PIN_BASED_PREEMPT_TIMER)

You define this mask but don't actually mask anything with it.

Cheers, 

Tim.

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>