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

Re: [Xen-devel] [PATCH RFC v12 09/21] pvh: Do not allow PVH guests to change paging modes



>>> On 13.09.13 at 18:25, George Dunlap <george.dunlap@xxxxxxxxxxxxx> wrote:
> Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
> Signed-off-by: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

once again with a minor comment:

> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1743,7 +1743,17 @@ int hvm_set_cr0(unsigned long value)
>           (value & (X86_CR0_PE | X86_CR0_PG)) == X86_CR0_PG )
>          goto gpf;
>  
> -    if ( (value & X86_CR0_PG) && !(old_value & X86_CR0_PG) )
> +    
> +
> +    /* A pvh is not expected to change to real mode. */
> +    if ( is_pvh_vcpu(v)
> +         && (value & (X86_CR0_PE | X86_CR0_PG)) != (X86_CR0_PG | X86_CR0_PE) 
> )
> +    {
> +        printk(XENLOG_G_WARNING
> +               "PVH attempting to turn off PE/PG. CR0:%lx\n", value);
> +        goto gpf;
> +    }
> +    else if ( (value & X86_CR0_PG) && !(old_value & X86_CR0_PG) )

It is pointless to follow a "goto" with an "else if".

Jan


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


 


Rackspace

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