mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
[XEN] Extend fix from 12403:680b37789200 to other emulation paths.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
This commit is contained in:
1 parent
7186363e84
commit
acdee1b65e
1 file changed
+3
-3
@@ -3778,7 +3778,7 @@ sh_x86_emulate_write(struct vcpu *v, unsigned long vaddr, void *src,
|
||||
shadow_validate_guest_pt_write(v, mfn, addr, bytes_on_page);
|
||||
bytes -= bytes_on_page;
|
||||
/* If we are writing zeros to this page, might want to unshadow */
|
||||
if ( *(u32 *)addr == 0 )
|
||||
if ( likely(bytes_on_page >= 4) && (*(u32 *)addr == 0) )
|
||||
check_for_early_unshadow(v, mfn);
|
||||
sh_unmap_domain_page(addr);
|
||||
}
|
||||
@@ -3823,7 +3823,7 @@ sh_x86_emulate_cmpxchg(struct vcpu *v, unsigned long vaddr,
|
||||
vaddr, prev, old, new, *(unsigned long *)addr, bytes);
|
||||
|
||||
/* If we are writing zeros to this page, might want to unshadow */
|
||||
if ( *(u8 *)addr == 0 )
|
||||
if ( likely(bytes >= 4) && (*(u32 *)addr == 0) )
|
||||
check_for_early_unshadow(v, mfn);
|
||||
|
||||
sh_unmap_domain_page(addr);
|
||||
@@ -3858,7 +3858,7 @@ sh_x86_emulate_cmpxchg8b(struct vcpu *v, unsigned long vaddr,
|
||||
rv = X86EMUL_CMPXCHG_FAILED;
|
||||
|
||||
/* If we are writing zeros to this page, might want to unshadow */
|
||||
if ( *(u8 *)addr == 0 )
|
||||
if ( *(u32 *)addr == 0 )
|
||||
check_for_early_unshadow(v, mfn);
|
||||
|
||||
sh_unmap_domain_page(addr);
|
||||
|
||||