Skip to content

Commit 17e0a7c

Browse files
committed
Merge tag 'x86-cleanups-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cleanups from Ingo Molnar: "Misc cleanups, with an emphasis on removing obsolete/dead code" * tag 'x86-cleanups-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/spinlock: Remove obsolete ticket spinlock macros and types x86/mm: Drop deprecated DISCONTIGMEM support for 32-bit x86/apb_timer: Drop unused declaration and macro x86/apb_timer: Drop unused TSC calibration x86/io_apic: Remove unused function mp_init_irq_at_boot() x86/mm: Stop printing BRK addresses x86/audit: Fix a -Wmissing-prototypes warning for ia32_classify_syscall() x86/nmi: Remove edac.h include leftover mm: Remove MPX leftovers x86/mm/mmap: Fix -Wmissing-prototypes warnings x86/early_printk: Remove unused includes crash_dump: Remove no longer used saved_max_pfn x86/smpboot: Remove the last ICPU() macro
2 parents bb548be + 2ca41f5 commit 17e0a7c

File tree

21 files changed

+21
-221
lines changed

21 files changed

+21
-221
lines changed

arch/x86/Kconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,19 +1611,10 @@ config NODES_SHIFT
16111611
Specify the maximum number of NUMA Nodes available on the target
16121612
system. Increases memory reserved to accommodate various tables.
16131613

1614-
config ARCH_HAVE_MEMORY_PRESENT
1615-
def_bool y
1616-
depends on X86_32 && DISCONTIGMEM
1617-
16181614
config ARCH_FLATMEM_ENABLE
16191615
def_bool y
16201616
depends on X86_32 && !NUMA
16211617

1622-
config ARCH_DISCONTIGMEM_ENABLE
1623-
def_bool n
1624-
depends on NUMA && X86_32
1625-
depends on BROKEN
1626-
16271618
config ARCH_SPARSEMEM_ENABLE
16281619
def_bool y
16291620
depends on X86_64 || NUMA || X86_32 || X86_32_NON_STANDARD

arch/x86/ia32/audit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <asm/unistd_32.h>
3+
#include <asm/audit.h>
34

45
unsigned ia32_dir_class[] = {
56
#include <asm-generic/audit_dir_write.h>

arch/x86/include/asm/apb_timer.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
#define APBT_MIN_FREQ 1000000
2626
#define APBT_MMAP_SIZE 1024
2727

28-
#define APBT_DEV_USED 1
29-
3028
extern void apbt_time_init(void);
31-
extern unsigned long apbt_quick_calibrate(void);
32-
extern int arch_setup_apbt_irqs(int irq, int trigger, int mask, int cpu);
3329
extern void apbt_setup_secondary_clock(void);
3430

3531
extern struct sfi_timer_table_entry *sfi_get_mtmr(int hint);
@@ -38,7 +34,6 @@ extern int sfi_mtimer_num;
3834

3935
#else /* CONFIG_APB_TIMER */
4036

41-
static inline unsigned long apbt_quick_calibrate(void) {return 0; }
4237
static inline void apbt_time_init(void) { }
4338

4439
#endif

arch/x86/include/asm/audit.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_X86_AUDIT_H
3+
#define _ASM_X86_AUDIT_H
4+
5+
int ia32_classify_syscall(unsigned int syscall);
6+
7+
#endif /* _ASM_X86_AUDIT_H */

arch/x86/include/asm/mmzone_32.h

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,4 @@ extern struct pglist_data *node_data[];
1414
#define NODE_DATA(nid) (node_data[nid])
1515
#endif /* CONFIG_NUMA */
1616

17-
#ifdef CONFIG_DISCONTIGMEM
18-
19-
/*
20-
* generic node memory support, the following assumptions apply:
21-
*
22-
* 1) memory comes in 64Mb contiguous chunks which are either present or not
23-
* 2) we will not have more than 64Gb in total
24-
*
25-
* for now assume that 64Gb is max amount of RAM for whole system
26-
* 64Gb / 4096bytes/page = 16777216 pages
27-
*/
28-
#define MAX_NR_PAGES 16777216
29-
#define MAX_SECTIONS 1024
30-
#define PAGES_PER_SECTION (MAX_NR_PAGES/MAX_SECTIONS)
31-
32-
extern s8 physnode_map[];
33-
34-
static inline int pfn_to_nid(unsigned long pfn)
35-
{
36-
#ifdef CONFIG_NUMA
37-
return((int) physnode_map[(pfn) / PAGES_PER_SECTION]);
38-
#else
39-
return 0;
40-
#endif
41-
}
42-
43-
static inline int pfn_valid(int pfn)
44-
{
45-
int nid = pfn_to_nid(pfn);
46-
47-
if (nid >= 0)
48-
return (pfn < node_end_pfn(nid));
49-
return 0;
50-
}
51-
52-
#define early_pfn_valid(pfn) pfn_valid((pfn))
53-
54-
#endif /* CONFIG_DISCONTIGMEM */
55-
5617
#endif /* _ASM_X86_MMZONE_32_H */

arch/x86/include/asm/pgtable_32.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ do { \
6666
#endif /* !__ASSEMBLY__ */
6767

6868
/*
69-
* kern_addr_valid() is (1) for FLATMEM and (0) for
70-
* SPARSEMEM and DISCONTIGMEM
69+
* kern_addr_valid() is (1) for FLATMEM and (0) for SPARSEMEM
7170
*/
7271
#ifdef CONFIG_FLATMEM
7372
#define kern_addr_valid(addr) (1)

arch/x86/include/asm/spinlock_types.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,7 @@
33
#define _ASM_X86_SPINLOCK_TYPES_H
44

55
#include <linux/types.h>
6-
7-
#ifdef CONFIG_PARAVIRT_SPINLOCKS
8-
#define __TICKET_LOCK_INC 2
9-
#define TICKET_SLOWPATH_FLAG ((__ticket_t)1)
10-
#else
11-
#define __TICKET_LOCK_INC 1
12-
#define TICKET_SLOWPATH_FLAG ((__ticket_t)0)
13-
#endif
14-
15-
#if (CONFIG_NR_CPUS < (256 / __TICKET_LOCK_INC))
16-
typedef u8 __ticket_t;
17-
typedef u16 __ticketpair_t;
18-
#else
19-
typedef u16 __ticket_t;
20-
typedef u32 __ticketpair_t;
21-
#endif
22-
23-
#define TICKET_LOCK_INC ((__ticket_t)__TICKET_LOCK_INC)
24-
25-
#define TICKET_SHIFT (sizeof(__ticket_t) * 8)
26-
276
#include <asm-generic/qspinlock_types.h>
28-
297
#include <asm-generic/qrwlock_types.h>
308

319
#endif /* _ASM_X86_SPINLOCK_TYPES_H */

arch/x86/kernel/apb_timer.c

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -345,56 +345,3 @@ void __init apbt_time_init(void)
345345
apb_timer_block_enabled = 0;
346346
panic("failed to enable APB timer\n");
347347
}
348-
349-
/* called before apb_timer_enable, use early map */
350-
unsigned long apbt_quick_calibrate(void)
351-
{
352-
int i, scale;
353-
u64 old, new;
354-
u64 t1, t2;
355-
unsigned long khz = 0;
356-
u32 loop, shift;
357-
358-
apbt_set_mapping();
359-
dw_apb_clocksource_start(clocksource_apbt);
360-
361-
/* check if the timer can count down, otherwise return */
362-
old = dw_apb_clocksource_read(clocksource_apbt);
363-
i = 10000;
364-
while (--i) {
365-
if (old != dw_apb_clocksource_read(clocksource_apbt))
366-
break;
367-
}
368-
if (!i)
369-
goto failed;
370-
371-
/* count 16 ms */
372-
loop = (apbt_freq / 1000) << 4;
373-
374-
/* restart the timer to ensure it won't get to 0 in the calibration */
375-
dw_apb_clocksource_start(clocksource_apbt);
376-
377-
old = dw_apb_clocksource_read(clocksource_apbt);
378-
old += loop;
379-
380-
t1 = rdtsc();
381-
382-
do {
383-
new = dw_apb_clocksource_read(clocksource_apbt);
384-
} while (new < old);
385-
386-
t2 = rdtsc();
387-
388-
shift = 5;
389-
if (unlikely(loop >> shift == 0)) {
390-
printk(KERN_INFO
391-
"APBT TSC calibration failed, not enough resolution\n");
392-
return 0;
393-
}
394-
scale = (int)div_u64((t2 - t1), loop >> shift);
395-
khz = (scale * (apbt_freq / 1000)) >> shift;
396-
printk(KERN_INFO "TSC freq calculated by APB timer is %lu khz\n", khz);
397-
return khz;
398-
failed:
399-
return 0;
400-
}

arch/x86/kernel/apic/io_apic.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,6 @@ static inline bool mp_is_legacy_irq(int irq)
154154
return irq >= 0 && irq < nr_legacy_irqs();
155155
}
156156

157-
/*
158-
* Initialize all legacy IRQs and all pins on the first IOAPIC
159-
* if we have legacy interrupt controller. Kernel boot option "pirq="
160-
* may rely on non-legacy pins on the first IOAPIC.
161-
*/
162-
static inline int mp_init_irq_at_boot(int ioapic, int irq)
163-
{
164-
if (!nr_legacy_irqs())
165-
return 0;
166-
167-
return ioapic == 0 || mp_is_legacy_irq(irq);
168-
}
169-
170157
static inline struct irq_domain *mp_ioapic_irqdomain(int ioapic)
171158
{
172159
return ioapics[ioapic].irqdomain;

arch/x86/kernel/audit_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <linux/types.h>
44
#include <linux/audit.h>
55
#include <asm/unistd.h>
6+
#include <asm/audit.h>
67

78
static unsigned dir_class[] = {
89
#include <asm-generic/audit_dir_write.h>
@@ -41,7 +42,6 @@ int audit_classify_arch(int arch)
4142
int audit_classify_syscall(int abi, unsigned syscall)
4243
{
4344
#ifdef CONFIG_IA32_EMULATION
44-
extern int ia32_classify_syscall(unsigned);
4545
if (abi == AUDIT_ARCH_I386)
4646
return ia32_classify_syscall(syscall);
4747
#endif

0 commit comments

Comments
 (0)