Skip to contentSkip to conversation

Should shadow_fault_fast_fail abort?

DISCUSSION Herbert Xu 2 participants 3 messages Dec 15, 2006

lore
Share & tools
lore

Herbert Xu

author
#0 lore raw

Hi Tim:

I noticed your recent patch turned off PFEC_reserved_bit in case another CPU had already modified a magic PTE. It seems that it still leaves PFEC_page_present enabled. This could confuse the guest if the PTE modification is such that the PTE is now present and valid. In fact the guest may treat it as a protection fault.

You could turn the present bit off, but that is not strictly correct if say an MMIO va was reused for normal memory.

The safest solution is probably to just return EXCRET_fault_fixed and let the CPU figure it out.

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#1 lore raw
Quoted 5 lines · Herbert Xu

I noticed your recent patch turned off PFEC_reserved_bit in case another CPU had already modified a magic PTE. It seems that it still leaves PFEC_page_present enabled. This could confuse the guest if the PTE modification is such that the PTE is now present and valid. In fact the guest may treat it as a protection fault.

It's just a spurious page fault -- the hardware is happy to throw these at operating systems and so am I. :)

Quoted 2 lines

The safest solution is probably to just return EXCRET_fault_fixed and let the CPU figure it out.

That does seem cleaner. Is this a problem you were seeing on a particular system, or just a general improvement?

Cheers,

Tim.

author
#2 lore raw
Quoted 9 lines · Tim Deegan
Quoted 5 lines · Herbert Xu

I noticed your recent patch turned off PFEC_reserved_bit in case another CPU had already modified a magic PTE. It seems that it still leaves PFEC_page_present enabled. This could confuse the guest if the PTE modification is such that the PTE is now present and valid. In fact the guest may treat it as a protection fault.

It's just a spurious page fault -- the hardware is happy to throw these at operating systems and so am I. :)

It's only a spurious page fault if PFEC_page_present is clear. Otherwise the OS (Linux in particular) may treat this as a protection error which may:

1) Kill a user-space process if in user-mode.
2) Oops the kernel otherwise.

Quoted 2 lines

That does seem cleaner. Is this a problem you were seeing on a particular system, or just a general improvement?

I just happened to be looking at the code :)

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt