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

[PATCH] x86/amd: Only call setup_force_cpu_cap for boot CPU


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Thu, 11 Aug 2022 11:59:56 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Delivery-date: Thu, 11 Aug 2022 11:00:54 +0000
  • Ironport-data: A9a23:HZsWc6OyJV84ZVjvrR3Ml8FynXyQoLVcMsEvi/4bfWQNrUol0TICz WMWCGrVa/qMYTDxc9x3Oo3k/EtS6J/Uy9VjQQto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH3dOCJQUBUjcmgXqD7BPPPJhd/TAplTDZJoR94kqsyj5UAbeKRWmthg vuv5ZyEULOZ82QsaDhMu/va8EoHUMna41v0gHRvPZing3eG/5UlJMp3Db28KXL+Xr5VEoaSL woU5Ojklo9x105F5uKNyt4XQGVTKlLhFVHmZk5tc7qjmnB/Shkaic7XAha+hXB/0F1ll/gpo DlEWAfZpQ0BZsUgk8xFO/VU/r0X0QSrN9YrLFDm2fF/wXEqfFPTws9SFVk9G7YH0cFaCmIft vsFARokO0Xra+KemNpXS8Fpj8UnasLqIJkeqjdryjSx4fQOGM6ZBf+QvJkBgWl21psm8fX2P qL1bRJ1aw/bJRlGNVoNF5s6mM+jh2Xlci0eo1WQzUYyyziLkFUsj+C2WDbTUvnTFOVN2WeWm kDH2kvzDShLGIbP0BPQpxpAgceQxHimCer+DoaQ6fpCkFCVgGsJB3U+V1G2vP24gU6WQM9EJ gof/S9Ghbg/8gmnQ8fwWzW8oWWYpVgMVtxICeo45QqRjK3O7G6k6nMsF2AbLoZ87YlvGGJsh gThc87V6SJHj7yvdWuF/ZGvshiVFCMWfCwFeAYuZF5QizX8m73fni4jX/46TvDt1oyqQGiuq 9yZhHNg3utO1Kbnw43+pAma2Gz0+/AlWyZvvm3qsnSZAhSVjWJPT6ih8hDl4PlJN+51pXHR7 SFfy6ByAA3jZKxhdRBho81XRdlFH97fbFXhbadHRvHNDQiF9X+5Zpx36zpjPkpvOctsUWa3P heL5lsItc8OZiHCgUpLj2WZVawXIVXIT4y5Bpg4kPIXCnSOSON31H43PhPBt4wcuEMtjbs+K f+mTCpYNl5DUPwP5GfnGI8gPUoDnH9WKZX7Gc+mlHxKENO2OBaodFvyGAHQNLBpvPjV/F69H hQ2H5Li9iizmdbWOkH/mbP/53hTdRDX2bieRxRrS9O+
  • Ironport-hdrordr: A9a23:pO0ht6oMXISkm6wL0QFq10waV5oneYIsimQD101hICG8cqSj+f xG+85rsSMc6QxhPk3I9urhBEDtex/hHP1OkOws1NWZLWrbUQKTRekIh+bfKlXbakrDH4VmtJ uIHZIQNDSJNykZsfrH
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This should only be called for the boot CPU to avoid calling _init code
after it has been unloaded.

Fixes: 062868a5a8b4 ("x86/amd: Work around CLFLUSH ordering on older parts")
Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
---

This replaces "x86/cpu: Drop _init from *_cpu_cap functions".

 xen/arch/x86/cpu/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 29c59bcba4..d5f8e5e899 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -845,7 +845,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
         * everything, including reads and writes to address, and
         * LFENCE/SFENCE instructions.
         */
-       if (!cpu_has_clflushopt)
+       if (c == &boot_cpu_data && !cpu_has_clflushopt)
                setup_force_cpu_cap(X86_BUG_CLFLUSH_MFENCE);
 
        switch(c->x86)
-- 
2.31.1




 


Rackspace

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