Skip to contentSkip to conversation

Informatio required on VMEXit settings and process.

DISCUSSION aditya shevalkar 2 participants 2 messages Jan 30, 2007

lore
Share & tools
lore
#0 lore raw

Hi all,
Please help me in understanding who update the VMEXIT_REASON and VMEXIT_QUALIFICATION fields in the VMCS field i.e. Xen or CPU and how when the VMExit occurs.And how the VMexit occurs(porcess of vmexit). Also explain this process in case of page fault if possible.
Give the code reference if possible.

Thanks and Regards,
Aditya Shevalkar.

__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/

#1 lore raw
Quoted 11 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of aditya shevalkar
Sent: 30 January 2007 12:47
To: xen devel
Subject: [Xen-devel] Informatio required on VMEXit settings and process.

Quoted 5 lines

Hi all,
Please help me in understanding who update the VMEXIT_REASON and VMEXIT_QUALIFICATION fields in the VMCS field i.e. Xen or CPU and how when the VMExit occurs.And how the VMexit occurs(porcess of vmexit).

The VMEXIT_REASON is set by the CPU when it sees a condition that generates a vmexit (i.e. the guest is doing something that the hypervisor/host has set to exit in "EXEC_CONTROLS"). The VMEXIT_QUALIFICATION is likewise filled in with the relevant information by the CPU (such as the address of a page-fault or the interrupt vector on an interrupt exit).

[I'm not an Intel expert, but seeing as the overall concept is almost identical for AMD and Intel, the question can be answered in a way that applies to both, with the slight difference that the AMD uses a VMCB and different names for the fields. For example, exit_reason in Intel is called exitcode in AMD's world, and exit_qualification is called exitinfo{1,2} and exitintinfo]

Quoted 1 line

Also explain this process in case of page fault if possible.

Processor sees a memory access. The processor checks the page-tables, and if the access is not allowed, the processor gives a vmexit to the hypervisor. The hypervisor checks the exit_reason to see that it's a page-fault, and determines if it's a "hypervisor" related page-fault (such as a page-table update or a MMIO access to a virtual device) or a "guest fault". For the former, the hypervisor will then perform the relevant work to either update the page-table or to send MMIO operation to QEMU. If it's not a hypervisor fault, it is by process of elimination a guest-fault (for example a page-access that hits a page that is stored in the swap or a write to a page that is shared with "copy-on-write" in a forked process). Guest faults are forwarded to the guest by "injection".

A more concrete question would probably give you a more precise answer - there are MANY pages in the manual on the subject, so it's pretty much a waste of everyones time to rewrite it here...

Quoted 1 line

Give the code reference if possible.

.../xen/arch/x86/hvm/svm/svm.c for AMD code.
.../xen/arch/x86/hvm/vmx/vmx.c for Intel code.

--
Mats

Quoted 17 lines

Thanks and Regards,
Aditya Shevalkar.

__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel