]> xenbits.xensource.com Git - xen.git/commit
x86/paging: Delete update_cr3()'s do_locking parameter
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 20 Sep 2023 19:06:53 +0000 (20:06 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 22 Sep 2023 15:00:17 +0000 (16:00 +0100)
commite71157d1ac2a7fbf413130663cf0a93ff9fbcf7e
treedd40c8ddf3b6c7c873c497c3ea772cb45791af4f
parente282067cf298ca6df319c3be86269858e2b26ae8
x86/paging: Delete update_cr3()'s do_locking parameter

Nicola reports that the XSA-438 fix introduced new MISRA violations because of
some incidental tidying it tried to do.  The parameter is useless, so resolve
the MISRA regression by removing it.

hap_update_cr3() discards the parameter entirely, while sh_update_cr3() uses
it to distinguish internal and external callers and therefore whether the
paging lock should be taken.

However, we have paging_lock_recursive() for this purpose, which also avoids
the ability for the shadow internal callers to accidentally not hold the lock.

Fixes: fb0ff49fe9f7 ("x86/shadow: defer releasing of PV's top-level shadow reference")
Reported-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
xen/arch/x86/include/asm/paging.h
xen/arch/x86/mm/hap/hap.c
xen/arch/x86/mm/shadow/common.c
xen/arch/x86/mm/shadow/multi.c
xen/arch/x86/mm/shadow/none.c