The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
Possible dependencies:
df5b035b5683 ("x86/cacheinfo: Add a cpu_llc_shared_mask() UP variant")
66558b730f25 ("sched: Add cluster scheduler level for x86")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From df5b035b5683d6a25f077af889fb88e09827f8bc Mon Sep 17 00:00:00 2001
From: Borislav Petkov <bp(a)suse.de>
Date: Fri, 19 Aug 2022 19:47:44 +0200
Subject: [PATCH] x86/cacheinfo: Add a cpu_llc_shared_mask() UP variant
On a CONFIG_SMP=n kernel, the LLC shared mask is 0, which prevents
__cache_amd_cpumap_setup() from doing the L3 masks setup, and more
specifically from setting up the shared_cpu_map and shared_cpu_list
files in sysfs, leading to lscpu from util-linux getting confused and
segfaulting.
Add a cpu_llc_shared_mask() UP variant which returns a mask with a
single bit set, i.e., for CPU0.
Fixes: 2b83809a5e6d ("x86/cpu/amd: Derive L3 shared_cpu_map from cpu_llc_shared_mask")
Reported-by: Saurabh Sengar <ssengar(a)linux.microsoft.com>
Signed-off-by: Borislav Petkov <bp(a)suse.de>
Cc: <stable(a)vger.kernel.org>
Link: https://lore.kernel.org/r/1660148115-302-1-git-send-email-ssengar@linux.mic…
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 81a0211a372d..a73bced40e24 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -21,16 +21,6 @@ DECLARE_PER_CPU_READ_MOSTLY(u16, cpu_llc_id);
DECLARE_PER_CPU_READ_MOSTLY(u16, cpu_l2c_id);
DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);
-static inline struct cpumask *cpu_llc_shared_mask(int cpu)
-{
- return per_cpu(cpu_llc_shared_map, cpu);
-}
-
-static inline struct cpumask *cpu_l2c_shared_mask(int cpu)
-{
- return per_cpu(cpu_l2c_shared_map, cpu);
-}
-
DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_cpu_to_apicid);
DECLARE_EARLY_PER_CPU_READ_MOSTLY(u32, x86_cpu_to_acpiid);
DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_bios_cpu_apicid);
@@ -172,6 +162,16 @@ extern int safe_smp_processor_id(void);
# define safe_smp_processor_id() smp_processor_id()
#endif
+static inline struct cpumask *cpu_llc_shared_mask(int cpu)
+{
+ return per_cpu(cpu_llc_shared_map, cpu);
+}
+
+static inline struct cpumask *cpu_l2c_shared_mask(int cpu)
+{
+ return per_cpu(cpu_l2c_shared_map, cpu);
+}
+
#else /* !CONFIG_SMP */
#define wbinvd_on_cpu(cpu) wbinvd()
static inline int wbinvd_on_all_cpus(void)
@@ -179,6 +179,11 @@ static inline int wbinvd_on_all_cpus(void)
wbinvd();
return 0;
}
+
+static inline struct cpumask *cpu_llc_shared_mask(int cpu)
+{
+ return (struct cpumask *)cpumask_of(0);
+}
#endif /* CONFIG_SMP */
extern unsigned disabled_cpus;
Return value of a function 'xdp_convert_buff_to_frame' is dereferenced
without checking for null, but it is usually checked for this function.
This fixed in upstream commit <e8223eeff02> while refactoring. So,
simpler patch is offered for a stable version.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
This is the start of the stable review cycle for the 5.4.216 release.
There are 30 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed, 05 Oct 2022 07:07:06 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.216-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.216-rc1
Florian Fainelli <f.fainelli(a)gmail.com>
clk: iproc: Do not rely on node name for correct PLL setup
Han Xu <han.xu(a)nxp.com>
clk: imx: imx6sx: remove the SET_RATE_PARENT flag for QSPI clocks
Wang Yufen <wangyufen(a)huawei.com>
selftests: Fix the if conditions of in test_extra_filter()
Michael Kelley <mikelley(a)microsoft.com>
nvme: Fix IOC_PR_CLEAR and IOC_PR_RELEASE ioctls for nvme devices
Chaitanya Kulkarni <chaitanya.kulkarni(a)wdc.com>
nvme: add new line after variable declatation
Peilin Ye <peilin.ye(a)bytedance.com>
usbnet: Fix memory leak in usbnet_disconnect()
Yang Yingliang <yangyingliang(a)huawei.com>
Input: melfas_mip4 - fix return value check in mip4_probe()
Brian Norris <briannorris(a)chromium.org>
Revert "drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time"
Samuel Holland <samuel(a)sholland.org>
soc: sunxi: sram: Fix debugfs info for A64 SRAM C
Samuel Holland <samuel(a)sholland.org>
soc: sunxi: sram: Fix probe function ordering issues
Cai Huoqing <caihuoqing(a)baidu.com>
soc: sunxi_sram: Make use of the helper function devm_platform_ioremap_resource()
Samuel Holland <samuel(a)sholland.org>
soc: sunxi: sram: Prevent the driver from being unbound
Samuel Holland <samuel(a)sholland.org>
soc: sunxi: sram: Actually claim SRAM regions
YuTong Chang <mtwget(a)gmail.com>
ARM: dts: am33xx: Fix MMCHS0 dma properties
Faiz Abbas <faiz_abbas(a)ti.com>
ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver
Hangyu Hua <hbh25y(a)gmail.com>
media: dvb_vb2: fix possible out of bound access
Minchan Kim <minchan(a)kernel.org>
mm: fix madivse_pageout mishandling on non-LRU page
Alistair Popple <apopple(a)nvidia.com>
mm/migrate_device.c: flush TLB while holding PTL
Maurizio Lombardi <mlombard(a)redhat.com>
mm: prevent page_frag_alloc() from corrupting the memory
Mel Gorman <mgorman(a)techsingularity.net>
mm/page_alloc: fix race condition between build_all_zonelists and page allocation
Sergei Antonov <saproj(a)gmail.com>
mmc: moxart: fix 4-bit bus width and remove 8-bit bus width
Niklas Cassel <niklas.cassel(a)wdc.com>
libata: add ATA_HORKAGE_NOLPM for Pioneer BDR-207M and BDR-205
Sasha Levin <sashal(a)kernel.org>
Revert "net: mvpp2: debugfs: fix memory leak when using debugfs_lookup()"
ChenXiaoSong <chenxiaosong2(a)huawei.com>
ntfs: fix BUG_ON in ntfs_lookup_inode_by_name()
Linus Walleij <linus.walleij(a)linaro.org>
ARM: dts: integrator: Tag PCI host with device_type
Aidan MacDonald <aidanmacdonald.0x0(a)gmail.com>
clk: ingenic-tcu: Properly enable registers before accessing timers
Frank Wunderlich <frank-w(a)public-files.de>
net: usb: qmi_wwan: Add new usb-id for Dell branded EM7455
Hongling Zeng <zenghongling(a)kylinos.cn>
uas: ignore UAS for Thinkplus chips
Hongling Zeng <zenghongling(a)kylinos.cn>
usb-storage: Add Hiksemi USB3-FW to IGNORE_UAS
Hongling Zeng <zenghongling(a)kylinos.cn>
uas: add no-uas quirk for Hiksemi usb_disk
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/dts/am335x-baltos.dtsi | 2 +-
arch/arm/boot/dts/am335x-boneblack-common.dtsi | 1 +
arch/arm/boot/dts/am335x-boneblack-wireless.dts | 1 -
arch/arm/boot/dts/am335x-boneblue.dts | 1 -
arch/arm/boot/dts/am335x-bonegreen-wireless.dts | 1 -
arch/arm/boot/dts/am335x-evm.dts | 3 +-
arch/arm/boot/dts/am335x-evmsk.dts | 2 +-
arch/arm/boot/dts/am335x-lxm.dts | 2 +-
arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi | 2 +-
arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts | 2 +-
arch/arm/boot/dts/am335x-pepper.dts | 4 +-
arch/arm/boot/dts/am335x-phycore-som.dtsi | 2 +-
arch/arm/boot/dts/am33xx-l4.dtsi | 9 +--
arch/arm/boot/dts/am33xx.dtsi | 3 +-
arch/arm/boot/dts/am4372.dtsi | 3 +-
arch/arm/boot/dts/am437x-cm-t43.dts | 2 +-
arch/arm/boot/dts/am437x-gp-evm.dts | 4 +-
arch/arm/boot/dts/am437x-l4.dtsi | 5 +-
arch/arm/boot/dts/am437x-sk-evm.dts | 2 +-
arch/arm/boot/dts/integratorap.dts | 1 +
drivers/ata/libata-core.c | 4 ++
drivers/clk/bcm/clk-iproc-pll.c | 12 ++--
drivers/clk/imx/clk-imx6sx.c | 4 +-
drivers/clk/ingenic/tcu.c | 15 ++---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 13 -----
drivers/input/touchscreen/melfas_mip4.c | 2 +-
drivers/media/dvb-core/dvb_vb2.c | 11 ++++
drivers/mmc/host/moxart-mmc.c | 17 +-----
drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c | 4 +-
drivers/net/usb/qmi_wwan.c | 1 +
drivers/net/usb/usbnet.c | 7 ++-
drivers/nvme/host/core.c | 9 ++-
drivers/soc/sunxi/sunxi_sram.c | 27 ++++-----
drivers/usb/storage/unusual_uas.h | 21 +++++++
fs/ntfs/super.c | 3 +-
mm/madvise.c | 7 ++-
mm/migrate.c | 5 +-
mm/page_alloc.c | 65 ++++++++++++++++++----
tools/testing/selftests/net/reuseport_bpf.c | 2 +-
40 files changed, 173 insertions(+), 112 deletions(-)
This backport introduces IBRS support to 5.4.y in order to mitigate Retbleed on
Intel parts. Though some very small pieces for AMD have been picked up as well,
"UNRET" mitigations are not backported, nor IBPB. It is expected, though, that
the backport will report AMD systems as vulnerable or not affected, depending
on the parts and the BTC_NO bit.
One note here is that the PBRSB mitigation was backported previously to the 5.4
series, and this would have made things a little bit more complicated. So, I
reverted it and applied it later on.
This has been boot-tested and smoke-tested on a bunch of AMD and Intel systems.
Alexandre Chartre (2):
x86/bugs: Report AMD retbleed vulnerability
x86/bugs: Add AMD retbleed= boot parameter
Andrew Cooper (1):
x86/cpu/amd: Enumerate BTC_NO
Daniel Sneddon (1):
x86/speculation: Add RSB VM Exit protections
Josh Poimboeuf (9):
x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n
x86/speculation: Fix firmware entry SPEC_CTRL handling
x86/speculation: Fix SPEC_CTRL write on SMT state change
x86/speculation: Use cached host SPEC_CTRL value for guest entry/exit
x86/speculation: Remove x86_spec_ctrl_mask
KVM: VMX: Flatten __vmx_vcpu_run()
KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS
KVM: VMX: Fix IBRS handling after vmexit
x86/speculation: Fill RSB on vmexit for IBRS
Mark Gross (1):
x86/cpu: Add a steppings field to struct x86_cpu_id
Nathan Chancellor (1):
x86/speculation: Use DECLARE_PER_CPU for x86_spec_ctrl_current
Pawan Gupta (4):
x86/speculation: Add spectre_v2=ibrs option to support Kernel IBRS
x86/bugs: Add Cannon lake to RETBleed affected CPU list
x86/speculation: Disable RRSBA behavior
x86/bugs: Warn when "ibrs" mitigation is selected on Enhanced IBRS
parts
Peter Zijlstra (11):
x86/kvm/vmx: Make noinstr clean
x86/cpufeatures: Move RETPOLINE flags to word 11
x86/bugs: Keep a per-CPU IA32_SPEC_CTRL value
x86/entry: Remove skip_r11rcx
x86/entry: Add kernel IBRS implementation
x86/bugs: Optimize SPEC_CTRL MSR writes
x86/bugs: Split spectre_v2_select_mitigation() and
spectre_v2_user_select_mitigation()
x86/bugs: Report Intel retbleed vulnerability
intel_idle: Disable IBRS during long idle
x86/speculation: Change FILL_RETURN_BUFFER to work with objtool
x86/common: Stamp out the stepping madness
Thadeu Lima de Souza Cascardo (3):
Revert "x86/speculation: Add RSB VM Exit protections"
Revert "x86/cpu: Add a steppings field to struct x86_cpu_id"
KVM: VMX: Convert launched argument to flags
Thomas Gleixner (2):
x86/devicetable: Move x86 specific macro out of generic code
x86/cpu: Add consistent CPU match macros
Uros Bizjak (2):
KVM/VMX: Use TEST %REG,%REG instead of CMP $0,%REG in vmenter.S
KVM/nVMX: Use __vmx_vcpu_run in nested_vmx_check_vmentry_hw
.../admin-guide/kernel-parameters.txt | 13 +
arch/x86/entry/calling.h | 68 +++-
arch/x86/entry/entry_32.S | 2 -
arch/x86/entry/entry_64.S | 34 +-
arch/x86/entry/entry_64_compat.S | 11 +-
arch/x86/include/asm/cpu_device_id.h | 132 ++++++-
arch/x86/include/asm/cpufeatures.h | 13 +-
arch/x86/include/asm/intel-family.h | 6 +
arch/x86/include/asm/msr-index.h | 10 +
arch/x86/include/asm/nospec-branch.h | 54 +--
arch/x86/kernel/cpu/amd.c | 21 +-
arch/x86/kernel/cpu/bugs.c | 365 ++++++++++++++----
arch/x86/kernel/cpu/common.c | 61 +--
arch/x86/kernel/cpu/match.c | 13 +-
arch/x86/kernel/cpu/scattered.c | 1 +
arch/x86/kernel/process.c | 2 +-
arch/x86/kvm/svm.c | 1 +
arch/x86/kvm/vmx/nested.c | 32 +-
arch/x86/kvm/vmx/run_flags.h | 8 +
arch/x86/kvm/vmx/vmenter.S | 161 ++++----
arch/x86/kvm/vmx/vmx.c | 72 ++--
arch/x86/kvm/vmx/vmx.h | 5 +
arch/x86/kvm/x86.c | 4 +-
drivers/base/cpu.c | 8 +
drivers/cpufreq/acpi-cpufreq.c | 1 +
drivers/cpufreq/amd_freq_sensitivity.c | 1 +
drivers/idle/intel_idle.c | 43 ++-
include/linux/cpu.h | 2 +
include/linux/kvm_host.h | 2 +-
include/linux/mod_devicetable.h | 4 +-
tools/arch/x86/include/asm/cpufeatures.h | 2 +-
31 files changed, 840 insertions(+), 312 deletions(-)
create mode 100644 arch/x86/kvm/vmx/run_flags.h
--
2.34.1