Skip to content

Commit 6da49d1

Browse files
committed
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cleanups from Ingo Molnar: "Misc cleanups all around the map" * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/CPU/AMD: Remove amd_get_topology_early() x86/tsc: Remove redundant assignment x86/crash: Use resource_size() x86/cpu: Add a missing prototype for arch_smt_update() x86/nospec: Remove unused RSB_FILL_LOOPS x86/vdso: Provide missing include file x86/Kconfig: Correct spelling and punctuation Documentation/x86/boot: Fix typo x86/boot: Fix a comment's incorrect file reference x86/process: Remove set but not used variables prev and next x86/Kconfig: Fix Kconfig indentation
2 parents 4244057 + 3c749b8 commit 6da49d1

File tree

11 files changed

+44
-54
lines changed

11 files changed

+44
-54
lines changed

Documentation/x86/boot.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ setting fields in the header, you must make sure only to set fields
251251
supported by the protocol version in use.
252252

253253

254-
Details of Harder Fileds
254+
Details of Header Fields
255255
========================
256256

257257
For each field, some are information from the kernel to the bootloader

arch/x86/Kconfig

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ config X86_MPPARSE
440440
(esp with 64bit cpus) with acpi support, MADT and DSDT will override it
441441

442442
config GOLDFISH
443-
def_bool y
444-
depends on X86_GOLDFISH
443+
def_bool y
444+
depends on X86_GOLDFISH
445445

446446
config RETPOLINE
447447
bool "Avoid speculative indirect branches in kernel"
@@ -479,7 +479,7 @@ config X86_BIGSMP
479479
bool "Support for big SMP systems with more than 8 CPUs"
480480
depends on SMP
481481
---help---
482-
This option is needed for the systems that have more than 8 CPUs
482+
This option is needed for the systems that have more than 8 CPUs.
483483

484484
config X86_EXTENDED_PLATFORM
485485
bool "Support for extended (non-PC) x86 platforms"
@@ -563,9 +563,9 @@ config X86_UV
563563
# Please maintain the alphabetic order if and when there are additions
564564

565565
config X86_GOLDFISH
566-
bool "Goldfish (Virtual Platform)"
567-
depends on X86_EXTENDED_PLATFORM
568-
---help---
566+
bool "Goldfish (Virtual Platform)"
567+
depends on X86_EXTENDED_PLATFORM
568+
---help---
569569
Enable support for the Goldfish virtual platform used primarily
570570
for Android development. Unless you are building for the Android
571571
Goldfish emulator say N here.
@@ -808,9 +808,9 @@ config KVM_GUEST
808808
timing infrastructure such as time of day, and system time
809809

810810
config ARCH_CPUIDLE_HALTPOLL
811-
def_bool n
812-
prompt "Disable host haltpoll when loading haltpoll driver"
813-
help
811+
def_bool n
812+
prompt "Disable host haltpoll when loading haltpoll driver"
813+
help
814814
If virtualized under KVM, disable host haltpoll.
815815

816816
config PVH
@@ -889,16 +889,16 @@ config HPET_EMULATE_RTC
889889
depends on HPET_TIMER && (RTC=y || RTC=m || RTC_DRV_CMOS=m || RTC_DRV_CMOS=y)
890890

891891
config APB_TIMER
892-
def_bool y if X86_INTEL_MID
893-
prompt "Intel MID APB Timer Support" if X86_INTEL_MID
894-
select DW_APB_TIMER
895-
depends on X86_INTEL_MID && SFI
896-
help
897-
APB timer is the replacement for 8254, HPET on X86 MID platforms.
898-
The APBT provides a stable time base on SMP
899-
systems, unlike the TSC, but it is more expensive to access,
900-
as it is off-chip. APB timers are always running regardless of CPU
901-
C states, they are used as per CPU clockevent device when possible.
892+
def_bool y if X86_INTEL_MID
893+
prompt "Intel MID APB Timer Support" if X86_INTEL_MID
894+
select DW_APB_TIMER
895+
depends on X86_INTEL_MID && SFI
896+
help
897+
APB timer is the replacement for 8254, HPET on X86 MID platforms.
898+
The APBT provides a stable time base on SMP
899+
systems, unlike the TSC, but it is more expensive to access,
900+
as it is off-chip. APB timers are always running regardless of CPU
901+
C states, they are used as per CPU clockevent device when possible.
902902

903903
# Mark as expert because too many people got it wrong.
904904
# The code disables itself when not needed.
@@ -1037,8 +1037,8 @@ config SCHED_MC_PRIO
10371037
If unsure say Y here.
10381038

10391039
config UP_LATE_INIT
1040-
def_bool y
1041-
depends on !SMP && X86_LOCAL_APIC
1040+
def_bool y
1041+
depends on !SMP && X86_LOCAL_APIC
10421042

10431043
config X86_UP_APIC
10441044
bool "Local APIC support on uniprocessors" if !PCI_MSI
@@ -1187,8 +1187,8 @@ config X86_LEGACY_VM86
11871187
If unsure, say N here.
11881188

11891189
config VM86
1190-
bool
1191-
default X86_LEGACY_VM86
1190+
bool
1191+
default X86_LEGACY_VM86
11921192

11931193
config X86_16BIT
11941194
bool "Enable support for 16-bit segments" if EXPERT
@@ -1209,10 +1209,10 @@ config X86_ESPFIX64
12091209
depends on X86_16BIT && X86_64
12101210

12111211
config X86_VSYSCALL_EMULATION
1212-
bool "Enable vsyscall emulation" if EXPERT
1213-
default y
1214-
depends on X86_64
1215-
---help---
1212+
bool "Enable vsyscall emulation" if EXPERT
1213+
default y
1214+
depends on X86_64
1215+
---help---
12161216
This enables emulation of the legacy vsyscall page. Disabling
12171217
it is roughly equivalent to booting with vsyscall=none, except
12181218
that it will also disable the helpful warning if a program
@@ -1545,12 +1545,12 @@ config AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
15451545

15461546
# Common NUMA Features
15471547
config NUMA
1548-
bool "Numa Memory Allocation and Scheduler Support"
1548+
bool "NUMA Memory Allocation and Scheduler Support"
15491549
depends on SMP
15501550
depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
15511551
default y if X86_BIGSMP
15521552
---help---
1553-
Enable NUMA (Non Uniform Memory Access) support.
1553+
Enable NUMA (Non-Uniform Memory Access) support.
15541554

15551555
The kernel will try to allocate memory used by a CPU on the
15561556
local memory controller of the CPU and add some more
@@ -1650,9 +1650,9 @@ config ARCH_PROC_KCORE_TEXT
16501650
depends on X86_64 && PROC_KCORE
16511651

16521652
config ILLEGAL_POINTER_VALUE
1653-
hex
1654-
default 0 if X86_32
1655-
default 0xdead000000000000 if X86_64
1653+
hex
1654+
default 0 if X86_32
1655+
default 0xdead000000000000 if X86_64
16561656

16571657
config X86_PMEM_LEGACY_DEVICE
16581658
bool

arch/x86/entry/vdso/vdso32-setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/smp.h>
1212
#include <linux/kernel.h>
1313
#include <linux/mm_types.h>
14+
#include <linux/elf.h>
1415

1516
#include <asm/processor.h>
1617
#include <asm/vdso.h>

arch/x86/include/asm/nospec-branch.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
*/
3838

3939
#define RSB_CLEAR_LOOPS 32 /* To forcibly overwrite all entries */
40-
#define RSB_FILL_LOOPS 16 /* To avoid underflow */
4140

4241
/*
4342
* Google experimented with loop-unrolling and this turned out to be

arch/x86/include/asm/realmode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <linux/types.h>
1515
#include <asm/io.h>
1616

17-
/* This must match data at realmode.S */
17+
/* This must match data at realmode/rm/header.S */
1818
struct real_mode_header {
1919
u32 text_start;
2020
u32 ro_end;
@@ -36,7 +36,7 @@ struct real_mode_header {
3636
#endif
3737
};
3838

39-
/* This must match data at trampoline_32/64.S */
39+
/* This must match data at realmode/rm/trampoline_{32,64}.S */
4040
struct trampoline_header {
4141
#ifdef CONFIG_X86_32
4242
u32 start;

arch/x86/kernel/cpu/amd.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,6 @@ static void legacy_fixup_core_id(struct cpuinfo_x86 *c)
319319
c->cpu_core_id %= cus_per_node;
320320
}
321321

322-
323-
static void amd_get_topology_early(struct cpuinfo_x86 *c)
324-
{
325-
if (cpu_has(c, X86_FEATURE_TOPOEXT))
326-
smp_num_siblings = ((cpuid_ebx(0x8000001e) >> 8) & 0xff) + 1;
327-
}
328-
329322
/*
330323
* Fixup core topology information for
331324
* (1) AMD multi-node processors
@@ -717,7 +710,8 @@ static void early_init_amd(struct cpuinfo_x86 *c)
717710
}
718711
}
719712

720-
amd_get_topology_early(c);
713+
if (cpu_has(c, X86_FEATURE_TOPOEXT))
714+
smp_num_siblings = ((cpuid_ebx(0x8000001e) >> 8) & 0xff) + 1;
721715
}
722716

723717
static void init_amd_k8(struct cpuinfo_x86 *c)

arch/x86/kernel/cpu/common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/sched/mm.h>
1515
#include <linux/sched/clock.h>
1616
#include <linux/sched/task.h>
17+
#include <linux/sched/smt.h>
1718
#include <linux/init.h>
1819
#include <linux/kprobes.h>
1920
#include <linux/kgdb.h>

arch/x86/kernel/crash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
370370
/* Add crashk_low_res region */
371371
if (crashk_low_res.end) {
372372
ei.addr = crashk_low_res.start;
373-
ei.size = crashk_low_res.end - crashk_low_res.start + 1;
373+
ei.size = resource_size(&crashk_low_res);
374374
ei.type = E820_TYPE_RAM;
375375
add_e820_entry(params, &ei);
376376
}

arch/x86/kernel/process.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,12 +615,8 @@ void speculation_ctrl_update_current(void)
615615

616616
void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)
617617
{
618-
struct thread_struct *prev, *next;
619618
unsigned long tifp, tifn;
620619

621-
prev = &prev_p->thread;
622-
next = &next_p->thread;
623-
624620
tifn = READ_ONCE(task_thread_info(next_p)->flags);
625621
tifp = READ_ONCE(task_thread_info(prev_p)->flags);
626622

arch/x86/kernel/tsc_sync.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ static cycles_t check_tsc_warp(unsigned int timeout)
233233
* The measurement runs for 'timeout' msecs:
234234
*/
235235
end = start + (cycles_t) tsc_khz * timeout;
236-
now = start;
237236

238237
for (i = 0; ; i++) {
239238
/*

0 commit comments

Comments
 (0)