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

Re: [Xen-devel] [PATCH 2/4] VMX/vPMU: fix DebugCtl MSR handling



>>> On 12.08.14 at 19:47, <boris.ostrovsky@xxxxxxxxxx> wrote:
> On 08/12/2014 05:15 AM, Jan Beulich wrote:
>> -            if ( msr_content & supported )
>> -            {
>> -                if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
>> -                    return 1;
>> -                gdprintk(XENLOG_WARNING, "Debug Store is not supported on 
>> this cpu\n");
>> -                hvm_inject_hw_exception(TRAP_gp_fault, 0);
>> -                return 0;
>> -            }
>> +            if ( !(msr_content & ~supported) &&
>> +                 vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
>> +                return 1;
>> +            if ( (msr_content & supported) &&
>> +                 !vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
>> +                printk(XENLOG_G_WARNING
>> +                       "%pv: Debug Store unsupported on this CPU\n",
>> +                       current);
> 
> Can we move this if statement out of VPMU code into 
> vmx_msr_write_intercept()? There is not a whole lot of VPMU-specific 
> logic here and I am not sure I see much reason to go through 
> vendor-independent code (vpmu.c) to do something that is very much 
> Intel-specific.

I'd rather not (at least not in this patch), not the least that I can
see the "supported" function parameter to potentially be useful
elsewhere when use of certain bits within an MSR is split across
components.

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