[PATCH] x86/shadow: make a local variable in sh_page_fault() HVM-only

Jan Beulich posted 1 patch 2 years, 5 months ago
Failed in applying to current master (apply log)
[PATCH] x86/shadow: make a local variable in sh_page_fault() HVM-only
Posted by Jan Beulich 2 years, 5 months ago
I recall checking that "r" would still have a user, but when doing so I
failed to recognize that all uses are inside a CONFIG_HVM conditional
section.

Fixes: 9f4f20b27b07 ("x86/shadow: adjust some shadow_set_l<N>e() callers")
Reported-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2155,8 +2155,8 @@ static int sh_page_fault(struct vcpu *v,
 #ifdef CONFIG_HVM
     struct sh_emulate_ctxt emul_ctxt;
     const struct x86_emulate_ops *emul_ops;
-#endif
     int r;
+#endif
     p2m_type_t p2mt;
     uint32_t rc, error_code;
     bool walk_ok;


Re: [PATCH] x86/shadow: make a local variable in sh_page_fault() HVM-only
Posted by Andrew Cooper 2 years, 5 months ago
On 18/10/2021 07:44, Jan Beulich wrote:
> I recall checking that "r" would still have a user, but when doing so I
> failed to recognize that all uses are inside a CONFIG_HVM conditional
> section.
>
> Fixes: 9f4f20b27b07 ("x86/shadow: adjust some shadow_set_l<N>e() callers")
> Reported-by: Stefano Stabellini <sstabellini@kernel.org>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>