From ca39b45bd2a2a394bdb81cc1b3240bab9aece92e Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 20 Dec 2017 10:12:11 +0100 Subject: [PATCH] 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 --- xen/arch/x86/mm/shadow/common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 */ -- 2.30.2