public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* What's the difference between EPT_MISCONFIG and EPT_VIOLATION?
@ 2014-12-03  9:50 Zhang Haoyu
  2014-12-03  9:56 ` Gleb Natapov
  0 siblings, 1 reply; 5+ messages in thread
From: Zhang Haoyu @ 2014-12-03  9:50 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, Gleb Natapov, Michael S.Tsirkin

Hi,

EXIT_REASON_EPT_VIOLATION's corresponding handle is handle_ept_violation(),
and EXIT_REASON_EPT_MISCONFIG's corresponding handle is handle_ept_misconfig(),
what's the difference between them?

I read the SDM-3C 28.2.3 EPT-Induced VM Exits, and found below description,
"An EPT misconfiguration occurs when, in the course of translating 
a guest-physical address, the logical processor encounters an EPT 
paging-structure entry that contains an unsupported value. An EPT 
violation occurs when there is no EPT misconfiguration but the EPT 
paging-structure entries disallow an access using the guest physical
address."

According to above description, EPT-MISCONFIG is from error settings ,
but from the its exit-handle handle_ept_misconfig(),
it seems that handle_ept_misconfig() handles mmio pagefault,
I'm really confused, I think I'm missing something,
any advices?

Thanks,
Zhang Haoyu


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What's the difference between EPT_MISCONFIG and EPT_VIOLATION?
  2014-12-03  9:50 What's the difference between EPT_MISCONFIG and EPT_VIOLATION? Zhang Haoyu
@ 2014-12-03  9:56 ` Gleb Natapov
  2014-12-03 10:12   ` Zhang Haoyu
  0 siblings, 1 reply; 5+ messages in thread
From: Gleb Natapov @ 2014-12-03  9:56 UTC (permalink / raw)
  To: Zhang Haoyu; +Cc: kvm, Paolo Bonzini, Michael S.Tsirkin

On Wed, Dec 03, 2014 at 05:50:33PM +0800, Zhang Haoyu wrote:
> Hi,
> 
> EXIT_REASON_EPT_VIOLATION's corresponding handle is handle_ept_violation(),
> and EXIT_REASON_EPT_MISCONFIG's corresponding handle is handle_ept_misconfig(),
> what's the difference between them?
> 
> I read the SDM-3C 28.2.3 EPT-Induced VM Exits, and found below description,
> "An EPT misconfiguration occurs when, in the course of translating 
> a guest-physical address, the logical processor encounters an EPT 
> paging-structure entry that contains an unsupported value. An EPT 
> violation occurs when there is no EPT misconfiguration but the EPT 
> paging-structure entries disallow an access using the guest physical
> address."
> 
> According to above description, EPT-MISCONFIG is from error settings ,
> but from the its exit-handle handle_ept_misconfig(),
> it seems that handle_ept_misconfig() handles mmio pagefault,
> I'm really confused, I think I'm missing something,
> any advices?
> 
EXIT_REASON_EPT_VIOLATION is similar to a "page not present" pagefault
EXIT_REASON_EPT_MISCONFIG is similar to a "reserved bit set" pagefault.
handle_ept_misconfig() handles mmio pagefault because KVM has an
optimization that uses reserved bits to mark mmio regions.

--
			Gleb.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What's the difference between EPT_MISCONFIG and EPT_VIOLATION?
  2014-12-03  9:56 ` Gleb Natapov
@ 2014-12-03 10:12   ` Zhang Haoyu
  2014-12-03 10:23     ` Gleb Natapov
  2014-12-03 10:24     ` Paolo Bonzini
  0 siblings, 2 replies; 5+ messages in thread
From: Zhang Haoyu @ 2014-12-03 10:12 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: kvm, Paolo Bonzini, Michael S.Tsirkin

> > Hi,
> > 
> > EXIT_REASON_EPT_VIOLATION's corresponding handle is handle_ept_violation(),
> > and EXIT_REASON_EPT_MISCONFIG's corresponding handle is handle_ept_misconfig(),
> > what's the difference between them?
> > 
> > I read the SDM-3C 28.2.3 EPT-Induced VM Exits, and found below description,
> > "An EPT misconfiguration occurs when, in the course of translating 
> > a guest-physical address, the logical processor encounters an EPT 
> > paging-structure entry that contains an unsupported value. An EPT 
> > violation occurs when there is no EPT misconfiguration but the EPT 
> > paging-structure entries disallow an access using the guest physical
> > address."
> > 
> > According to above description, EPT-MISCONFIG is from error settings ,
> > but from the its exit-handle handle_ept_misconfig(),
> > it seems that handle_ept_misconfig() handles mmio pagefault,
> > I'm really confused, I think I'm missing something,
> > any advices?
> > 
> EXIT_REASON_EPT_VIOLATION is similar to a "page not present" pagefault
> EXIT_REASON_EPT_MISCONFIG is similar to a "reserved bit set" pagefault.
> handle_ept_misconfig() handles mmio pagefault because KVM has an
> optimization that uses reserved bits to mark mmio regions.
>
Thanks, Gleb, 
where does kvm use the reserved bits to mark mmio regions?

> --
> 			Gleb.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What's the difference between EPT_MISCONFIG and EPT_VIOLATION?
  2014-12-03 10:12   ` Zhang Haoyu
@ 2014-12-03 10:23     ` Gleb Natapov
  2014-12-03 10:24     ` Paolo Bonzini
  1 sibling, 0 replies; 5+ messages in thread
From: Gleb Natapov @ 2014-12-03 10:23 UTC (permalink / raw)
  To: Zhang Haoyu; +Cc: kvm, Paolo Bonzini, Michael S.Tsirkin

On Wed, Dec 03, 2014 at 06:12:10PM +0800, Zhang Haoyu wrote:
> > > Hi,
> > > 
> > > EXIT_REASON_EPT_VIOLATION's corresponding handle is handle_ept_violation(),
> > > and EXIT_REASON_EPT_MISCONFIG's corresponding handle is handle_ept_misconfig(),
> > > what's the difference between them?
> > > 
> > > I read the SDM-3C 28.2.3 EPT-Induced VM Exits, and found below description,
> > > "An EPT misconfiguration occurs when, in the course of translating 
> > > a guest-physical address, the logical processor encounters an EPT 
> > > paging-structure entry that contains an unsupported value. An EPT 
> > > violation occurs when there is no EPT misconfiguration but the EPT 
> > > paging-structure entries disallow an access using the guest physical
> > > address."
> > > 
> > > According to above description, EPT-MISCONFIG is from error settings ,
> > > but from the its exit-handle handle_ept_misconfig(),
> > > it seems that handle_ept_misconfig() handles mmio pagefault,
> > > I'm really confused, I think I'm missing something,
> > > any advices?
> > > 
> > EXIT_REASON_EPT_VIOLATION is similar to a "page not present" pagefault
> > EXIT_REASON_EPT_MISCONFIG is similar to a "reserved bit set" pagefault.
> > handle_ept_misconfig() handles mmio pagefault because KVM has an
> > optimization that uses reserved bits to mark mmio regions.
> >
> Thanks, Gleb, 
> where does kvm use the reserved bits to mark mmio regions?
> 
arch/x86/kvm/mmu.c:mark_mmio_spte

--
			Gleb.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What's the difference between EPT_MISCONFIG and EPT_VIOLATION?
  2014-12-03 10:12   ` Zhang Haoyu
  2014-12-03 10:23     ` Gleb Natapov
@ 2014-12-03 10:24     ` Paolo Bonzini
  1 sibling, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2014-12-03 10:24 UTC (permalink / raw)
  To: Zhang Haoyu, Gleb Natapov; +Cc: kvm, Michael S.Tsirkin



On 03/12/2014 11:12, Zhang Haoyu wrote:
>> > EXIT_REASON_EPT_VIOLATION is similar to a "page not present" pagefault
>> > EXIT_REASON_EPT_MISCONFIG is similar to a "reserved bit set" pagefault.
>> > handle_ept_misconfig() handles mmio pagefault because KVM has an
>> > optimization that uses reserved bits to mark mmio regions.
>> >
> Thanks, Gleb, 
> where does kvm use the reserved bits to mark mmio regions?

ept_set_mmio_spte_mask is where KVM tells mmu.c how to mark MMIO
regions.  You can search mmu.c for shadow_mmio_mask and is_mmio_spte in
order to find out more about this optimization, you'll also get to the
mark_mmio_spte function that Gleb mentioned.

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-03 10:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-03  9:50 What's the difference between EPT_MISCONFIG and EPT_VIOLATION? Zhang Haoyu
2014-12-03  9:56 ` Gleb Natapov
2014-12-03 10:12   ` Zhang Haoyu
2014-12-03 10:23     ` Gleb Natapov
2014-12-03 10:24     ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox