On 16/05/2023 8:41 am, Jan Beulich wrote: > While benign at present, it is still a little fragile to operate on a > wrong "old_mode" value in sh_update_paging_modes(). This can happen when > no monitor table was present initially - we'd create one for the new > mode without updating old_mode. Correct this in two ways, each of which > would be sufficient on its own: Once by adding "else" to the second of > the involved if()s in the function, and then by setting the correct > initial mode for HVM domains in shadow_vcpu_init(). > > Further use the same predicate (paging_mode_external()) consistently > when dealing with shadow mode init/update/cleanup, rather than a mix of > is_hvm_vcpu() (init), is_hvm_domain() (update), and > paging_mode_external() (cleanup). > > Finally drop a redundant is_hvm_domain() from inside the bigger if() > (which is being converted to paging_mode_external()) in > sh_update_paging_modes(). > > Signed-off-by: Jan Beulich <[email protected]>
Acked-by: Andrew Cooper <[email protected]>
