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

Re: [Xen-devel] [PATCH v2 for-4.7 5/5] x86/hvm: Fix invalidation for emulated invlpg instructions



On 10/05/16 08:51, Jan Beulich wrote:
>>>> On 09.05.16 at 20:27, <andrew.cooper3@xxxxxxxxxx> wrote:
>> --- a/xen/arch/x86/hvm/svm/svm.c
>> +++ b/xen/arch/x86/hvm/svm/svm.c
>> @@ -2222,10 +2222,13 @@ static void svm_invlpga_intercept(
>>  
>>  static void svm_invlpg_intercept(unsigned long vaddr)
>>  {
>> -    struct vcpu *curr = current;
>>      HVMTRACE_LONG_2D(INVLPG, 0, TRC_PAR_LONG(vaddr));
>> -    if ( paging_invlpg(curr, vaddr) )
>> -        svm_asid_g_invlpg(curr, vaddr);
>> +    paging_invlpg(current, vaddr);
>> +}
>> +
>> +static void svm_invlpg(struct vcpu *v, unsigned long vaddr)
>> +{
>> +    svm_asid_g_invlpg(v, vaddr);
>>  }
> I don't see the need for the wrapper: svm_asid_g_invlpg() is itself
> suitable to be used ...
>
>> @@ -2258,12 +2261,12 @@ static struct hvm_function_table __initdata 
>> svm_function_table = {
>>      .inject_trap          = svm_inject_trap,
>>      .init_hypercall_page  = svm_init_hypercall_page,
>>      .event_pending        = svm_event_pending,
>> +    .invlpg               = svm_invlpg,
> ... here.

So it can.  I will do this...

>
>> @@ -2137,6 +2137,7 @@ static struct hvm_function_table __initdata 
>> vmx_function_table = {
>>      .inject_trap          = vmx_inject_trap,
>>      .init_hypercall_page  = vmx_init_hypercall_page,
>>      .event_pending        = vmx_event_pending,
>> +    .invlpg               = vmx_invlpg,
> Similarly here, except that the pointer would need zapping if
> !cpu_has_vmx_vpid, requiring ...

but not this.  For testing "older" configurations, I have a plan to make
options like vpid configurable per domain, at which point the function
pointer necessarily needs following.

~Andrew

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