[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events
On 3/7/2016 2:07 PM, Corneliu ZUZU
wrote:
On 3/7/2016 11:45 AM, Tamas K Lengyel
wrote:
Good, with that out of the way, one more issue to solve. What I'm
actually trying to do is to move that part of the code to the
scheduling tail - i.e. enabling/disabling
CPU_BASED_CR3_LOAD_EXITING only when we actually enter the vcpu.
To do this I also need to know exactly in what cases
CPU_BASED_CR3_LOAD_EXITING can/is enabled, besides the already
mentioned case when a domain's paging is disabled.
I'm searching through the codebase right now but it's a bit
dizzying, can someone provide some feedback on this matter?
Thanks,
Corneliu.
Ok, by searching for places v->arch.hvm_vmx.exec_control is set,
it seems that vmx_update_guest_cr is the only place where CR3
load-exiting is set/unset.
It also seems that in non-hap case CPU_BASED_CR3_LOAD_EXITING is
indeed unconditionally enabled, i.e. @ vmx_vcpu_initialise ->
vmx_create_vmcs -> construct_vmcs:
v->arch.hvm_vmx.secondary_exec_control =
vmx_secondary_exec_control;
/* Disable VPID for now: we decide when to enable it on VMENTER.
*/
v->arch.hvm_vmx.secondary_exec_control &=
~SECONDARY_EXEC_ENABLE_VPID;
if ( paging_mode_hap(d) )
{
v->arch.hvm_vmx.exec_control &=
~(CPU_BASED_INVLPG_EXITING |
CPU_BASED_CR3_LOAD_EXITING
|
CPU_BASED_CR3_STORE_EXITING);
}
Can somebody else confirm this, just to be sure?
Tamas, if this were true, that would mean that we can move that part
to the scheduling tail, and we could write there smth like this
pseudocode:
/* if ! hap => CR3 writes unconditionally trap */
if (paging_mode_hap) return;
if (monitor.write_ctrlreg_enabled for CR3) and
(CPU_BASED_CR3_LOAD_EXITING currently disabled)
enable CPU_BASED_CR3_LOAD_EXITING;
else if (NOT monitor.write_ctrlreg_enabled for CR3) and
(CPU_BASED_CR3_LOAD_EXITING currently enabled) and (paging is
enabled)
disable CPU_BASED_CR3_LOAD_EXITING;
Would that be suitable?
Thanks,
Corneliu.
|
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|