Skip to contentSkip to conversation

Fix "hda lost interrupt issue" on PAE host

PATCH Jiang, Yunhong 2 participants 3 messages Apr 20, 2006 – Apr 21, 2006

lore
Share & tools
lore
#0 lore raw

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

Quoted 26 lines

-----Original Message-----
From: Keir Fraser [mailto:[email protected]]
Sent: 2006年4月20日 0:31
To: Jiang, Yunhong
Cc: [email protected]
Subject: Re: [Xen-devel] [PATCH] Fix "hda lost interrupt issue" on PAE host

Quoted 7 lines · Yunhong

Hi, Keir
This patch fix the “hda lost interrupt” issue when create vmx guest on PAE host.

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

#1 lore raw
Quoted 6 lines · Yunhong

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

#2 lore raw
In reply to Jiang, Yunhong
Quoted 6 lines · Yunhong

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