Jiang, Yunhong
2006-Apr-20 01:23 UTC
[Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host
Hi, Keir This patch fix the "hda lost interrupt" issue when create vmx guest on PAE host. Signed-off-by: Yunhong Jiang Yunhong.jiang@intel.com Signed-off-by: Eddie Dong eddie.dong@intel.com Thanks Yunhong Jiang _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Apr-20 07:31 UTC
Re: [Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host
On 20 Apr 2006, at 02:23, Jiang, Yunhong wrote:> Hi, Keir > This patch fix the “hda lost interrupt” issue when create vmx guest on > PAE host. > > Signed-off-by: Yunhong Jiang Yunhong.jiang@intel.com > Signed-off-by: Eddie Dong eddie.dong@intel.com >It''d be nice to have some description of *how* the patch fixes the bug. I''d like to have some idea what the purpose of the piece of code you move around is: what''s the difference between IDT-vectoring exception info and ordinary VM-exit exception info? Why is reflecting the info back into VM-entry fields always the right thing to do? etc. In general, patches that appear to simply shuffle code around worry me. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jiang, Yunhong
2006-Apr-20 20:41 UTC
RE: [Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host
Hi,Keir I''m very sorry that I didn''t descript it more clearly in previous mail. I will try to use following scenario to descript the purpose of the patch and how it fix the issue. An IDE DMA interrupt is injected into guest, through setting the VM_ENTRY_INTR_INFO_FIELD field on VMCS. When vmentry to vmx guest, vmx will try to inject this event to guest. However, in this process, a page fault occurred because the page for IDT is not set on shadow page table, maybe because of cr3 switch. This will cause a immediately vmexit again. On this situation, because the vmexit is occurred because of the event delivery, so the original VM_ENTRY_INTR_INFO_FIELD information is kept in IDT_VECTORING_INFO_FIELD. If we copy the information from IDT_VECTORING_INFO_FIELD to VM_ENTRY_INTR_INFO_FIELD, then this interrupt will be injected again on next vmresume. However, on original code, there is a corner case. If before the next vmresume, a timer interrupt happened, then vmx_intr_assist may overwrite the information on VM_ENTRY_INTR_INFO_FIELD, that will cause the IDE DMA interrupt lost. This patch checkes the IDT_VECTORING_INFO_FIELD on vmx_intr_assist, and if it is set, then copy it to VM_ENTRY_INTR_INFO_FIELD and return. Though this method, we can avoid interrupt lost. More information for IDT_VECTORING_INFO_FIELD can be seen on "Information for VM Exits That Occur During Event Delivery" section on vmx specification. Hope I explained the issue clearly. Thanks Yunhong Jiang>-----Original Message----- >From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk] >Sent: 2006年4月20日 0:31 >To: Jiang, Yunhong >Cc: xen-devel@lists.xensource.com >Subject: Re: [Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host > > >On 20 Apr 2006, at 02:23, Jiang, Yunhong wrote: > >> Hi, Keir >> This patch fix the “hda lost interrupt” issue when create vmx guest on >> PAE host. >> >> Signed-off-by: Yunhong Jiang Yunhong.jiang@intel.com >> Signed-off-by: Eddie Dong eddie.dong@intel.com >> > >It''d be nice to have some description of *how* the patch fixes the bug. >I''d like to have some idea what the purpose of the piece of code you >move around is: what''s the difference between IDT-vectoring exception >info and ordinary VM-exit exception info? Why is reflecting the info >back into VM-entry fields always the right thing to do? etc. In >general, patches that appear to simply shuffle code around worry me. > > -- Keir_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Apr-20 22:37 UTC
Re: [Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host
On 20 Apr 2006, at 21:41, Jiang, Yunhong wrote:> This patch checkes the IDT_VECTORING_INFO_FIELD on vmx_intr_assist, > and if it is set, then copy it to VM_ENTRY_INTR_INFO_FIELD and return. > Though this method, we can avoid interrupt lost. > > More information for IDT_VECTORING_INFO_FIELD can be seen on > "Information for VM Exits That Occur During Event Delivery" section on > vmx specification. > > Hope I explained the issue clearly.Thanks, it''s certainly more helpful than your reference manual. :-) -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jiang, Yunhong
2006-Apr-21 05:21 UTC
RE: [Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host
:) So can you please add it to 3.0 testing also? I think it fix several bugs. Thanks Yunhong Jiang>-----Original Message----- >From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk] >Sent: 2006年4月20日 15:38 >To: Jiang, Yunhong >Cc: xen-devel@lists.xensource.com >Subject: Re: [Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host > > >On 20 Apr 2006, at 21:41, Jiang, Yunhong wrote: > >> This patch checkes the IDT_VECTORING_INFO_FIELD on vmx_intr_assist, >> and if it is set, then copy it to VM_ENTRY_INTR_INFO_FIELD and return. >> Though this method, we can avoid interrupt lost. >> >> More information for IDT_VECTORING_INFO_FIELD can be seen on >> "Information for VM Exits That Occur During Event Delivery" section on >> vmx specification. >> >> Hope I explained the issue clearly. > >Thanks, it''s certainly more helpful than your reference manual. :-) > > -- Keir_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Apr-21 08:26 UTC
Re: [Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host
On 20 Apr 2006, at 21:41, Jiang, Yunhong wrote:> This patch checkes the IDT_VECTORING_INFO_FIELD on vmx_intr_assist, > and if it is set, then copy it to VM_ENTRY_INTR_INFO_FIELD and return. > Though this method, we can avoid interrupt lost. > > More information for IDT_VECTORING_INFO_FIELD can be seen on > "Information for VM Exits That Occur During Event Delivery" section on > vmx specification. > > Hope I explained the issue clearly.Is there a special value of VM_EXIT_REASON when IDT_VECTORING_INFO_FIELD is in use? I''m guessing not (since the reason tells you what caused the vmexit, not that there was some special action (like event injection) happening at the same time). If I understand correctly now, presumably if we get to vmx_intr_assist(), see the IDT_VECTORING_INFO_FIELD is valid, but also that we now have *another* exception already queued up in VM_ENTRY_INFO_FIELD, then we should in fact ignore both events and inject a double fault (or go straight to ''triple fault'' and crash the domain)? This would happen if, for example, the guest had not properly mapped the IDT in its page tables. Thanks! Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dong, Eddie
2006-Apr-23 15:42 UTC
RE: [Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host
Keir Fraser wrote:> This would happen if, for example, the guest had not properly > mapped the IDT in its page tables. >I think IDT mapping must be set earlier than any exception/IRQ deliver in native. Otherwise "double fault" itself will trigger further fault. Eddie _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel