x86/shadow: Drop dubious lastpage diagnostic
PATCH 1/1 x86/shadow: Drop dubious lastpage diagnostic
This is a global variable (actually 3, one per GUEST_PAGING_LEVEL), operated on using atomics only (with no regard to what else shares the same cacheline), which emits a diagnostic (in debug builds only) without changing any program behaviour.
Based on read-only p2m types including logdirty, this diagnostic can be tripped by entirely legitimate guest behaviour.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
CC: George Dunlap <[email protected]>
CC: Tim Deegan <[email protected]>
--- xen/arch/x86/mm/shadow/multi.c | 7 ------- 1 file changed, 7 deletions(-)
xen/arch/x86/mm/shadow/multi.c +0 -7
@@ -2597,14 +2597,7 @@ static int cf_check sh_page_fault(/* Ignore attempts to write to read-only memory. */ if (p2m_is_readonly (p2mt) && (ft == ft_demand_write) ) - { -static unsigned long lastpage; -if (xchg (&lastpage, va &PAGE_MASK ) != (va &PAGE_MASK ) ) -gdprintk (XENLOG_DEBUG ,"guest attempted write to read-only memory" -" page. va page=%#lx, mfn=%#lx\n" , - va &PAGE_MASK ,mfn_x (gmfn)); goto emulate_readonly;/* skip over the instruction */ - }/* In HVM guests, we force CR0.WP always to be set, so that the * pagetables are always write-protected. If the guest thinks
Signature · 1 line
2.11.0
Quoted 7 lines · Andrew Cooper
This is a global variable (actually 3, one per
GUEST_PAGING_LEVEL), operated on using atomics only (with no regard to what else shares the same cacheline), which emits a diagnostic (in debug builds only) without changing any program behaviour.Based on read-only p2m types including logdirty, this diagnostic can be tripped by entirely legitimate guest behaviour.
Can it? At the very least shadow doesn't use p2m_ram_logdirty, but "cooks" log-dirty handling its own way.
Quoted 1 line
Signed-off-by Andrew Cooper <[email protected]>
with the last sentence above corrected (if need be: removed).
Jan
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper
This is a global variable (actually 3, one per
GUEST_PAGING_LEVEL), operated on using atomics only (with no regard to what else shares the same cacheline), which emits a diagnostic (in debug builds only) without changing any program behaviour.
Quoted 7 lines
Quoted 2 lines
Based on read-only p2m types including logdirty, this diagnostic can be tripped by entirely legitimate guest behaviour.
Can it? At the very least shadow doesn't use
p2m_ram_logdirty, but "cooks" log-dirty handling its own way.Quoted 1 line
Signed-off-by Andrew Cooper <[email protected]>Acked-by Jan Beulich <[email protected]>
Thanks.
Quoted 1 line
with the last sentence above corrected (if need be: removed).
I can remove it, but I feel as if there ought to be something there.
The other RO types are ram_ro, grant_map_ro and ram_shared. shared has hopefully been unshared before getting to this point, while the other two have unclear semantics (as neither exist in real systems).
Writing to something which is actually a ROM either does silent discard, or #MC.
Read-only grants really ought to #PF, but I bet this ABI change between PV and HVM guests wasn't noticed because I'm not aware of any common uses of read-only grants.
~Andrew
Quoted 17 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper
This is a global variable (actually 3, one per
GUEST_PAGING_LEVEL), operated on using atomics only (with no regard to what else shares the same cacheline), which emits a diagnostic (in debug builds only) without changing any program behaviour.Quoted 7 lines
Quoted 2 lines
Based on read-only p2m types including logdirty, this diagnostic can be tripped by entirely legitimate guest behaviour.
Can it? At the very least shadow doesn't use
p2m_ram_logdirty, but "cooks" log-dirty handling its own way.Quoted 1 line
Signed-off-by Andrew Cooper <[email protected]>Acked-by Jan Beulich <[email protected]>Thanks.
Quoted 7 lines
Quoted 1 line
with the last sentence above corrected (if need be: removed).
I can remove it, but I feel as if there ought to be something there.
The other RO types are
ram_ro,grant_map_roand ram_shared. shared has hopefully been unshared before getting to this point, while the other two have unclear semantics (as neither exist in real systems).
I'd be okay as long as the "including logdirty" part isn't there. If we're unsure, perhaps then also instead of "can" either "might" or "can possibly"?
Jan
Quoted 18 lines · Jan Beulich
Quoted 17 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper
This is a global variable (actually 3, one per
GUEST_PAGING_LEVEL), operated on using atomics only (with no regard to what else shares the same cacheline), which emits a diagnostic (in debug builds only) without changing any program behaviour.Quoted 7 lines
Quoted 2 lines
Based on read-only p2m types including logdirty, this diagnostic can be tripped by entirely legitimate guest behaviour.
Can it? At the very least shadow doesn't use
p2m_ram_logdirty, but "cooks" log-dirty handling its own way.Quoted 1 line
Signed-off-by Andrew Cooper <[email protected]>Acked-by Jan Beulich <[email protected]>Thanks.
Quoted 1 line
with the last sentence above corrected (if need be: removed).
Quoted 8 lines
Quoted 5 lines
I can remove it, but I feel as if there ought to be something there.
The other RO types are
ram_ro,grant_map_roand ram_shared. shared has hopefully been unshared before getting to this point, while the other two have unclear semantics (as neither exist in real systems).I'd be okay as long as the "including logdirty" part isn't there. If we're unsure, perhaps then also instead of "can" either "might" or "can possibly"?
I'll just delete it. It's not important enough for the time it's taking.
~Andrew
Quoted 21 lines · Andrew Cooper
Quoted 20 lines · Jan Beulich
Quoted 19 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper
This is a global variable (actually 3, one per
GUEST_PAGING_LEVEL), operated on using atomics only (with no regard to what else shares the same cacheline), which emits a diagnostic (in debug builds only) without changing any program behaviour.Quoted 7 lines
Quoted 2 lines
Based on read-only p2m types including logdirty, this diagnostic can be tripped by entirely legitimate guest behaviour.
Can it? At the very least shadow doesn't use
p2m_ram_logdirty, but "cooks" log-dirty handling its own way.Quoted 1 line
Signed-off-by Andrew Cooper <[email protected]>Acked-by Jan Beulich <[email protected]>Thanks.
Quoted 1 line
with the last sentence above corrected (if need be: removed).
I can remove it, but I feel as if there ought to be something there.
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
The other RO types are
ram_ro,grant_map_roand ram_shared. shared has hopefully been unshared before getting to this point, while the other two have unclear semantics (as neither exist in real systems).I'd be okay as long as the "including logdirty" part isn't there. If we're unsure, perhaps then also instead of "can" either "might" or "can possibly"?
I'll just delete it. It's not important enough for the time it's taking.
Oh, I see what you mean. Yeah, that will work.
~Andrew