From: Jan Beulich Date: Wed, 20 Dec 2017 09:12:11 +0000 (+0100) Subject: x86/shadow: make 1-bit-disable match 1-bit-enable X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~887 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ca39b45bd2a2a394bdb81cc1b3240bab9aece92e;p=xen.git x86/shadow: make 1-bit-disable match 1-bit-enable shadow_one_bit_enable() sets PG_SH_enable (if not already set of course) in addition to the bit being requested. Make shadow_one_bit_disable() behave similarly - clear PG_SH_enable if that's the only bit remaining. Signed-off-by: Jan Beulich Acked-by: Tim Deegan --- diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index 600df0cedc..0e9e1912ca 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -3377,7 +3377,10 @@ static int shadow_one_bit_disable(struct domain *d, u32 mode) } /* Update the bits */ - sh_new_mode(d, d->arch.paging.mode & ~mode); + mode = d->arch.paging.mode & ~mode; + if ( mode == PG_SH_enable ) + mode = 0; + sh_new_mode(d, mode); if ( d->arch.paging.mode == 0 ) { /* Get this domain off shadows */