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

Re: [Xen-devel] [PATCH 9/18 V2]: PVH xen: create PVH vmcs, and initialization



>>> On 16.03.13 at 01:39, Mukesh Rathor <mukesh.rathor@xxxxxxxxxx> wrote:
> +        /* pure hvm doesn't do this. safe? see: long_mode_do_msr_write() */
> +#if 0
> +        vmx_disable_intercept_for_msr(v, MSR_STAR);
> +        vmx_disable_intercept_for_msr(v, MSR_LSTAR);
> +        vmx_disable_intercept_for_msr(v, MSR_CSTAR);
> +        vmx_disable_intercept_for_msr(v, MSR_SYSCALL_MASK);
> +#endif

This is the sort of comment/code that I think should never be in a
non-RFC patch. Either you're convinced not intercepting these
MSRs is correct (and secure) for PVH guests (in which case no more
than a comment saying so is needed), or the code is needed and
hence the conditional should be dropped.

> +    } else {

Formatting (not just here).

> +        printk("PVH: CPU does NOT have msr bitmap\n");
> +        return -EINVAL;
> +    }
> +
> +    if ( !cpu_has_vmx_vpid ) {
> +        printk("PVH: At present VPID support is required to run PVH\n");
> +        return -EINVAL;
> +    }
> +
> +    v->arch.hvm_vmx.secondary_exec_control = vmx_secondary_exec_control;
> +
> +    if ( cpu_has_vmx_secondary_exec_control ) {
> +        v->arch.hvm_vmx.secondary_exec_control &= ~0x4FF; /* turn off all */
> +        v->arch.hvm_vmx.secondary_exec_control |= 
> +                                              
> SECONDARY_EXEC_PAUSE_LOOP_EXITING;
> +        v->arch.hvm_vmx.secondary_exec_control |= SECONDARY_EXEC_ENABLE_VPID;
> +
> +        v->arch.hvm_vmx.secondary_exec_control |= SECONDARY_EXEC_ENABLE_EPT;
> +        __vmwrite(SECONDARY_VM_EXEC_CONTROL,
> +                  v->arch.hvm_vmx.secondary_exec_control);
> +    } else {
> +        printk("PVH: NO Secondary Exec control\n");
> +        return -EINVAL;
> +    }
> +
> +    __vmwrite(VM_EXIT_CONTROLS, vmexit_ctl);
> +
> +    #define VM_ENTRY_LOAD_DEBUG_CTLS 0x4
> +    #define VM_ENTRY_LOAD_EFER 0x8000

Please don't indent #defines (at least not the #).

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®.