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

Re: [Xen-devel] [PATCH] x86/hvm: implement save/restore for posted interrupts



Olaf Hering wrote on 2014-08-02:
> On Tue, Jul 29, Zhang, Yang Z wrote:
> 
>> Olaf Hering wrote on 2014-07-28:
>>> On Fri, Jul 25, Tian, Kevin wrote:
>>>> btw, did you run any workload cross save/restore? does it only
>>>> happen with xen-platform-pci device?
>>> Yes, only with xen-platform-pci. And in my testing only when the
>>> interface provided by netfront is up (ip link set up dev eth0).
>> Hi Olaf, can you try the following patch? I expect this patch will fix the 
>> issue.
> 
> No, that did not help. I tried it on top of Xen 4.2 from sles11sp3 update 
> channel.

This is really strange. With this patch, i cannot reproduce the issue with 
sles11sp3 on latest Xen. 

Besides, according the response from John, the issue they observed is exactly 
the eoi bitmap update issue.

BTW, my patch is based on your sync_pir_to_irr changes. I am not sure whether 
you applied the following changes when doing testing. But you should see the 
failure ratio is reduced obviously even without it, right?

@@ -1179,6 +1179,9 @@ static int lapic_save_regs(struct domain *d, 
hvm_domain_context_t *h)
 
     for_each_vcpu ( d, v ) 
     {   
+        if ( hvm_funcs.sync_pir_to_irr )
+            hvm_funcs.sync_pir_to_irr(v);
+
         s = vcpu_vlapic(v);
         if ( (rc = hvm_save_entry(LAPIC_REGS, v->vcpu_id, h, s->regs)) != 0 ) 
             break;


> 
> Olaf
> 
>> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
>> index f6409d6..f0a371b 100644
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -1517,6 +1517,8 @@ static void vmx_process_isr(int isr, struct
>> vcpu
>> *v)  {
>>      unsigned long status;
>>      u8 old;
>> +    int vector;
>> +    struct vlapic *s = vcpu_vlapic(v);
>> 
>>      if ( isr < 0 )
>>          isr = 0;
>> @@ -1530,6 +1532,14 @@ static void vmx_process_isr(int isr, struct
>> vcpu
> *v)
>>          status |= isr << VMX_GUEST_INTR_STATUS_SVI_OFFSET;
>>          __vmwrite(GUEST_INTR_STATUS, status);
>>      }
>> +    for ( vector = 0; vector < NR_VECTORS; vector++ )
>> +        if (vlapic_test_vector(vector, &s->regs->data[APIC_ISR]))
>> +            set_bit(vector,  v->arch.hvm_vmx.eoi_exit_bitmap);
>> +
>> +    __vmwrite(0x201c, v->arch.hvm_vmx.eoi_exit_bitmap[0]);
>> +    __vmwrite(0x201e, v->arch.hvm_vmx.eoi_exit_bitmap[1]);
>> +    __vmwrite(0x2020, v->arch.hvm_vmx.eoi_exit_bitmap[2]);
>> +    __vmwrite(0x2022, v->arch.hvm_vmx.eoi_exit_bitmap[3]);
>>      vmx_vmcs_exit(v);
>>  }
>> diff --git a/xen/include/asm-x86/hvm/vlapic.h
>> b/xen/include/asm-x86/hvm/vlapic.h
>> index 66f0aff..2a83a1e 100644
>> --- a/xen/include/asm-x86/hvm/vlapic.h
>> +++ b/xen/include/asm-x86/hvm/vlapic.h
>> @@ -58,6 +58,8 @@
>> 
>>  #define VEC_POS(v) ((v) % 32)
>>  #define REG_POS(v) (((v) / 32) * 0x10)
>> +#define vlapic_test_vector(vec, bitmap)                         \
>> +    test_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
>>  #define vlapic_test_and_set_vector(vec, bitmap)
> \
>>      test_and_set_bit(VEC_POS(vec), (uint32_t *)((bitmap) +
>> REG_POS(vec)))  #define vlapic_test_and_clear_vector(vec, bitmap)


Best regards,
Yang

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