[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v7 44/50] x86/MCE: pass NULL to x86_mc_mceinject()



x86_mc_mceinject() simulates a machine check on the CPU it runs on, and
never reads its argument.  The XEN_MC_inject_v2 calls pass it NULL, but
the two XEN_MC_mceinject calls pass a pointer to do_mca()'s copy of the
hypercall argument, which is on do_mca()'s stack.

Pass NULL there too, and name the parameter "unused".

No functional change.

Groundwork for per-CPU stack mappings, to come as part of Address
Space Isolation, which take away a CPU's access to other CPUs' stacks:
a subsequent change asserts that a call-function payload passed by
pointer does not point into the initiator's stack, and these calls
have no payload to pass.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: George Dunlap <gwd@xxxxxxxxxxxxxx>
---
Changes in v7:
- New in this version.
---
 xen/arch/x86/cpu/mcheck/mce.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 1888f22d15..842a80977c 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1247,7 +1247,7 @@ static void cf_check __maybe_unused x86_mc_msrinject(void 
*data)
         x86_mc_hwcr_wren_restore(hwcr);
 }
 
-static void cf_check __maybe_unused x86_mc_mceinject(void *data)
+static void cf_check __maybe_unused x86_mc_mceinject(void *unused)
 {
     printk("Simulating #MC on cpu %d\n", smp_processor_id());
     __asm__ __volatile__("int $0x12");
@@ -1556,10 +1556,9 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
         add_taint(TAINT_ERROR_INJECT);
 
         if ( mce_broadcast )
-            on_each_cpu(x86_mc_mceinject, mc_mceinject, 1);
+            on_each_cpu(x86_mc_mceinject, NULL, 1);
         else
-            on_selected_cpus(cpumask_of(target), x86_mc_mceinject,
-                             mc_mceinject, 1);
+            on_selected_cpus(cpumask_of(target), x86_mc_mceinject, NULL, 1);
         break;
 
     case XEN_MC_inject_v2:
-- 
2.56.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.