Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 1aac9cb

Browse files
committed
Merge tag 'x86_urgent_for_v6.9_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: - Make sure single object builds in arch/x86/virt/ ala make ... arch/x86/virt/vmx/tdx/seamcall.o work again - Do not do ROM range scans and memory validation when the kernel is running as a SEV-SNP guest as those can get problematic and, before that, are not really needed in such a guest - Exclude the build-time generated vdso-image-x32.o object from objtool validation and in particular the return sites in there due to a warning which fires when an unpatched return thunk is being used - Improve the NMI CPUs stall message to show additional information about the state of each CPU wrt the NMI handler - Enable gcc named address spaces support only on !KCSAN configs due to compiler options incompatibility - Revert a change which was trying to use GB pages for mapping regions only when the regions would be large enough but that change lead to kexec failing - A documentation fixlet * tag 'x86_urgent_for_v6.9_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/build: Use obj-y to descend into arch/x86/virt/ x86/sev: Skip ROM range scans and validation for SEV-SNP guests x86/vdso: Fix rethunk patching for vdso-image-x32.o too x86/nmi: Upgrade NMI backtrace stall checks & messages x86/percpu: Disable named address spaces for KCSAN Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped." Documentation/x86: Fix title underline length
2 parents 712e142 + 3f1a9bc commit 1aac9cb

File tree

16 files changed

+64
-64
lines changed

16 files changed

+64
-64
lines changed

Documentation/arch/x86/resctrl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ Memory b/w domain is L3 cache.
574574
MB:<cache_id0>=bandwidth0;<cache_id1>=bandwidth1;...
575575

576576
Memory bandwidth Allocation specified in MiBps
577-
---------------------------------------------
577+
----------------------------------------------
578578

579579
Memory bandwidth domain is L3 cache.
580580
::

arch/x86/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ obj-y += net/
2828

2929
obj-$(CONFIG_KEXEC_FILE) += purgatory/
3030

31-
obj-y += virt/svm/
31+
obj-y += virt/
3232

3333
# for cleaning
3434
subdir- += boot tools

arch/x86/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,6 +2439,8 @@ config USE_X86_SEG_SUPPORT
24392439
# with named address spaces - see GCC PR sanitizer/111736.
24402440
#
24412441
depends on !KASAN
2442+
# -fsanitize=thread (KCSAN) is also incompatible.
2443+
depends on !KCSAN
24422444

24432445
config CC_HAS_SLS
24442446
def_bool $(cc-option,-mharden-sls=all)

arch/x86/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ archheaders:
251251

252252
libs-y += arch/x86/lib/
253253

254-
core-y += arch/x86/virt/
255-
256254
# drivers-y are linked after core-y
257255
drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
258256
drivers-$(CONFIG_PCI) += arch/x86/pci/

arch/x86/entry/vdso/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ obj-$(CONFIG_X86_X32_ABI) += vdso-image-x32.o
4141
obj-$(CONFIG_COMPAT_32) += vdso-image-32.o vdso32-setup.o
4242

4343
OBJECT_FILES_NON_STANDARD_vdso-image-32.o := n
44+
OBJECT_FILES_NON_STANDARD_vdso-image-x32.o := n
4445
OBJECT_FILES_NON_STANDARD_vdso-image-64.o := n
4546
OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
4647

arch/x86/include/asm/sev.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ void early_snp_set_memory_private(unsigned long vaddr, unsigned long paddr,
218218
unsigned long npages);
219219
void early_snp_set_memory_shared(unsigned long vaddr, unsigned long paddr,
220220
unsigned long npages);
221-
void __init snp_prep_memory(unsigned long paddr, unsigned int sz, enum psc_op op);
222221
void snp_set_memory_shared(unsigned long vaddr, unsigned long npages);
223222
void snp_set_memory_private(unsigned long vaddr, unsigned long npages);
224223
void snp_set_wakeup_secondary_cpu(void);
225224
bool snp_init(struct boot_params *bp);
226225
void __noreturn snp_abort(void);
226+
void snp_dmi_setup(void);
227227
int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, struct snp_guest_request_ioctl *rio);
228228
void snp_accept_memory(phys_addr_t start, phys_addr_t end);
229229
u64 snp_get_unsupported_features(u64 status);
@@ -244,12 +244,12 @@ static inline void __init
244244
early_snp_set_memory_private(unsigned long vaddr, unsigned long paddr, unsigned long npages) { }
245245
static inline void __init
246246
early_snp_set_memory_shared(unsigned long vaddr, unsigned long paddr, unsigned long npages) { }
247-
static inline void __init snp_prep_memory(unsigned long paddr, unsigned int sz, enum psc_op op) { }
248247
static inline void snp_set_memory_shared(unsigned long vaddr, unsigned long npages) { }
249248
static inline void snp_set_memory_private(unsigned long vaddr, unsigned long npages) { }
250249
static inline void snp_set_wakeup_secondary_cpu(void) { }
251250
static inline bool snp_init(struct boot_params *bp) { return false; }
252251
static inline void snp_abort(void) { }
252+
static inline void snp_dmi_setup(void) { }
253253
static inline int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, struct snp_guest_request_ioctl *rio)
254254
{
255255
return -ENOTTY;

arch/x86/include/asm/x86_init.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ struct x86_init_mpparse {
3030
* @reserve_resources: reserve the standard resources for the
3131
* platform
3232
* @memory_setup: platform specific memory setup
33-
*
33+
* @dmi_setup: platform specific DMI setup
3434
*/
3535
struct x86_init_resources {
3636
void (*probe_roms)(void);
3737
void (*reserve_resources)(void);
3838
char *(*memory_setup)(void);
39+
void (*dmi_setup)(void);
3940
};
4041

4142
/**

arch/x86/kernel/eisa.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*
33
* EISA specific code
44
*/
5+
#include <linux/cc_platform.h>
56
#include <linux/ioport.h>
67
#include <linux/eisa.h>
78
#include <linux/io.h>
@@ -12,7 +13,7 @@ static __init int eisa_bus_probe(void)
1213
{
1314
void __iomem *p;
1415

15-
if (xen_pv_domain() && !xen_initial_domain())
16+
if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
1617
return 0;
1718

1819
p = ioremap(0x0FFFD9, 4);

arch/x86/kernel/nmi.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ EXPORT_SYMBOL_GPL(asm_exc_nmi_kvm_vmx);
580580

581581
static char *nmi_check_stall_msg[] = {
582582
/* */
583-
/* +--------- nsp->idt_seq_snap & 0x1: CPU is in NMI handler. */
583+
/* +--------- nmi_seq & 0x1: CPU is currently in NMI handler. */
584584
/* | +------ cpu_is_offline(cpu) */
585585
/* | | +--- nsp->idt_calls_snap != atomic_long_read(&nsp->idt_calls): */
586586
/* | | | NMI handler has been invoked. */
@@ -628,22 +628,26 @@ void nmi_backtrace_stall_check(const struct cpumask *btp)
628628
nmi_seq = READ_ONCE(nsp->idt_nmi_seq);
629629
if (nsp->idt_nmi_seq_snap + 1 == nmi_seq && (nmi_seq & 0x1)) {
630630
msgp = "CPU entered NMI handler function, but has not exited";
631-
} else if ((nsp->idt_nmi_seq_snap & 0x1) != (nmi_seq & 0x1)) {
632-
msgp = "CPU is handling NMIs";
633-
} else {
634-
idx = ((nsp->idt_seq_snap & 0x1) << 2) |
631+
} else if (nsp->idt_nmi_seq_snap == nmi_seq ||
632+
nsp->idt_nmi_seq_snap + 1 == nmi_seq) {
633+
idx = ((nmi_seq & 0x1) << 2) |
635634
(cpu_is_offline(cpu) << 1) |
636635
(nsp->idt_calls_snap != atomic_long_read(&nsp->idt_calls));
637636
msgp = nmi_check_stall_msg[idx];
638637
if (nsp->idt_ignored_snap != READ_ONCE(nsp->idt_ignored) && (idx & 0x1))
639638
modp = ", but OK because ignore_nmis was set";
640-
if (nmi_seq & 0x1)
641-
msghp = " (CPU currently in NMI handler function)";
642-
else if (nsp->idt_nmi_seq_snap + 1 == nmi_seq)
639+
if (nsp->idt_nmi_seq_snap + 1 == nmi_seq)
643640
msghp = " (CPU exited one NMI handler function)";
641+
else if (nmi_seq & 0x1)
642+
msghp = " (CPU currently in NMI handler function)";
643+
else
644+
msghp = " (CPU was never in an NMI handler function)";
645+
} else {
646+
msgp = "CPU is handling NMIs";
644647
}
645-
pr_alert("%s: CPU %d: %s%s%s, last activity: %lu jiffies ago.\n",
646-
__func__, cpu, msgp, modp, msghp, j - READ_ONCE(nsp->recv_jiffies));
648+
pr_alert("%s: CPU %d: %s%s%s\n", __func__, cpu, msgp, modp, msghp);
649+
pr_alert("%s: last activity: %lu jiffies ago.\n",
650+
__func__, j - READ_ONCE(nsp->recv_jiffies));
647651
}
648652
}
649653

arch/x86/kernel/probe_roms.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,6 @@ void __init probe_roms(void)
203203
unsigned char c;
204204
int i;
205205

206-
/*
207-
* The ROM memory range is not part of the e820 table and is therefore not
208-
* pre-validated by BIOS. The kernel page table maps the ROM region as encrypted
209-
* memory, and SNP requires encrypted memory to be validated before access.
210-
* Do that here.
211-
*/
212-
snp_prep_memory(video_rom_resource.start,
213-
((system_rom_resource.end + 1) - video_rom_resource.start),
214-
SNP_PAGE_STATE_PRIVATE);
215-
216206
/* video rom */
217207
upper = adapter_rom_resources[0].start;
218208
for (start = video_rom_resource.start; start < upper; start += 2048) {

0 commit comments

Comments
 (0)