Skip to content

Commit cd557bc

Browse files
committed
Merge tag 'x86_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: - Ignore invalid x2APIC entries in order to not waste per-CPU data - Fix a back-to-back signals handling scenario when shadow stack is in use - A documentation fix - Add Kirill as TDX maintainer * tag 'x86_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/acpi: Ignore invalid x2APIC entries x86/shstk: Delay signal entry SSP write until after user accesses x86/Documentation: Indent 'note::' directive for protocol version number note MAINTAINERS: Add Intel TDX entry
2 parents b001455 + ec9aedb commit cd557bc

File tree

4 files changed

+33
-23
lines changed

4 files changed

+33
-23
lines changed

Documentation/arch/x86/boot.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Protocol 2.14 BURNT BY INCORRECT COMMIT
7777
Protocol 2.15 (Kernel 5.5) Added the kernel_info and kernel_info.setup_type_max.
7878
============= ============================================================
7979

80-
.. note::
80+
.. note::
8181
The protocol version number should be changed only if the setup header
8282
is changed. There is no need to update the version number if boot_params
8383
or kernel_info are changed. Additionally, it is recommended to use

MAINTAINERS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23702,6 +23702,20 @@ F: arch/x86/kernel/dumpstack.c
2370223702
F: arch/x86/kernel/stacktrace.c
2370323703
F: arch/x86/kernel/unwind_*.c
2370423704

23705+
X86 TRUST DOMAIN EXTENSIONS (TDX)
23706+
M: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
23707+
R: Dave Hansen <dave.hansen@linux.intel.com>
23708+
L: x86@kernel.org
23709+
L: linux-coco@lists.linux.dev
23710+
S: Supported
23711+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/tdx
23712+
F: arch/x86/boot/compressed/tdx*
23713+
F: arch/x86/coco/tdx/
23714+
F: arch/x86/include/asm/shared/tdx.h
23715+
F: arch/x86/include/asm/tdx.h
23716+
F: arch/x86/virt/vmx/tdx/
23717+
F: drivers/virt/coco/tdx-guest
23718+
2370523719
X86 VDSO
2370623720
M: Andy Lutomirski <luto@kernel.org>
2370723721
L: linux-kernel@vger.kernel.org

arch/x86/kernel/acpi/boot.c

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ int acpi_fix_pin2_polarity __initdata;
6363

6464
#ifdef CONFIG_X86_LOCAL_APIC
6565
static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
66+
static bool has_lapic_cpus __initdata;
6667
static bool acpi_support_online_capable;
6768
#endif
6869

@@ -232,6 +233,14 @@ acpi_parse_x2apic(union acpi_subtable_headers *header, const unsigned long end)
232233
if (!acpi_is_processor_usable(processor->lapic_flags))
233234
return 0;
234235

236+
/*
237+
* According to https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#processor-local-x2apic-structure
238+
* when MADT provides both valid LAPIC and x2APIC entries, the APIC ID
239+
* in x2APIC must be equal or greater than 0xff.
240+
*/
241+
if (has_lapic_cpus && apic_id < 0xff)
242+
return 0;
243+
235244
/*
236245
* We need to register disabled CPU as well to permit
237246
* counting disabled CPUs. This allows us to size
@@ -1114,10 +1123,7 @@ static int __init early_acpi_parse_madt_lapic_addr_ovr(void)
11141123

11151124
static int __init acpi_parse_madt_lapic_entries(void)
11161125
{
1117-
int count;
1118-
int x2count = 0;
1119-
int ret;
1120-
struct acpi_subtable_proc madt_proc[2];
1126+
int count, x2count = 0;
11211127

11221128
if (!boot_cpu_has(X86_FEATURE_APIC))
11231129
return -ENODEV;
@@ -1126,21 +1132,11 @@ static int __init acpi_parse_madt_lapic_entries(void)
11261132
acpi_parse_sapic, MAX_LOCAL_APIC);
11271133

11281134
if (!count) {
1129-
memset(madt_proc, 0, sizeof(madt_proc));
1130-
madt_proc[0].id = ACPI_MADT_TYPE_LOCAL_APIC;
1131-
madt_proc[0].handler = acpi_parse_lapic;
1132-
madt_proc[1].id = ACPI_MADT_TYPE_LOCAL_X2APIC;
1133-
madt_proc[1].handler = acpi_parse_x2apic;
1134-
ret = acpi_table_parse_entries_array(ACPI_SIG_MADT,
1135-
sizeof(struct acpi_table_madt),
1136-
madt_proc, ARRAY_SIZE(madt_proc), MAX_LOCAL_APIC);
1137-
if (ret < 0) {
1138-
pr_err("Error parsing LAPIC/X2APIC entries\n");
1139-
return ret;
1140-
}
1141-
1142-
count = madt_proc[0].count;
1143-
x2count = madt_proc[1].count;
1135+
count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC,
1136+
acpi_parse_lapic, MAX_LOCAL_APIC);
1137+
has_lapic_cpus = count > 0;
1138+
x2count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_X2APIC,
1139+
acpi_parse_x2apic, MAX_LOCAL_APIC);
11441140
}
11451141
if (!count && !x2count) {
11461142
pr_err("No LAPIC entries present\n");

arch/x86/kernel/signal_64.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ int x64_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
175175
frame = get_sigframe(ksig, regs, sizeof(struct rt_sigframe), &fp);
176176
uc_flags = frame_uc_flags(regs);
177177

178-
if (setup_signal_shadow_stack(ksig))
179-
return -EFAULT;
180-
181178
if (!user_access_begin(frame, sizeof(*frame)))
182179
return -EFAULT;
183180

@@ -198,6 +195,9 @@ int x64_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
198195
return -EFAULT;
199196
}
200197

198+
if (setup_signal_shadow_stack(ksig))
199+
return -EFAULT;
200+
201201
/* Set up registers for signal handler */
202202
regs->di = ksig->sig;
203203
/* In case the signal handler was declared without prototypes */

0 commit comments

Comments
 (0)