RE: Does KVM use one EPT table per Guest CR3?

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

 



Sorry for the late reply.

Seems to me that the EPTP pointer is changing because of kvm_set_cr0.

Here is what I did and please correct me if I am doing the trace incorrectly:

- Added a trace entry in vmx_set_cr3 where a trace message is outputted whenever vmcs_read64(EPT_POINTER) != eptp after construct_eptp(cr3).

I then looked at the trace log and seems to show up with 

kvm_exit: reason cr_access rip 0xc0122003
kvm_cr: cr_write 0 = 0x8005003b

I also noticed that kvm_mmu_reset_context(vcpu) is being called at the end of kvm_set_cr0. 

The CR0 value of 0x8005003b doesn't seem to trigger any of the if cases which would indicate that kvm_mmu_reset_context(vcpu) is being called and could be the reason why eptp is changing.

Thanks for your help again.

Enjoy,

Lok




________________________________________
From: Avi Kivity [avi@xxxxxxxxxx]
Sent: Sunday, December 19, 2010 9:31 AM
To: Lok Kwong Yan
Cc: Anthony Liguori; kvm@xxxxxxxxxxxxxxx
Subject: Re: Does KVM use one EPT table per Guest CR3?

On 12/17/2010 05:24 PM, Avi Kivity wrote:
> On 12/17/2010 12:14 AM, Lok Kwong Yan wrote:
>> Thanks for the reply and it makes a lot of sense.
>>
>> I am not seeing any EPT tables being zapped after the guest has fully
>> started up although the value of EPTP continuously changes as the
>> guest is running.
>
> Really strange, this is likely a bug.
>

I tried to reproduce, the only times I see eptp changes are when the
guest reprograms the vga adapter:

  qemu-system-x86-20944 [033]  1327.151819: kvm_pio:
pio_write at 0x3ce size 2 count 1
  qemu-system-x86-20944 [033]  1327.151819: kvm_userspace_exit:   reason
KVM_EXIT_IO (2)
  qemu-system-x86-20944 [033]  1327.152405: kvm_mmu_prepare_zap_page:
[FAILED TO PARSE] gfn=237568 role=122881 root_count=0 unsync=0
...
  qemu-system-x86-20944 [033]  1327.153230: kvm_mmu_prepare_zap_page:
[FAILED TO PARSE] gfn=0 role=253956 root_count=2 unsync=0
  qemu-system-x86-20944 [033]  1327.153339: kvm_mmu_get_page:     sp gfn
0 0/4 q0 direct --- !pge !nxe root 0sync
  qemu-system-x86-20944 [033]  1327.153344: print:
a0265cde vmx_set_cr3: eptp fef14101

Under what scenario do you see eptp changing?

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux