Skip to content

Commit 682f7bb

Browse files
committed
Merge tag 'x86_cleanups_for_v6.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cleanups from Borislav Petkov: - Unify duplicated __pa() and __va() definitions - Simplify sysctl tables registration - Remove unused symbols - Correct function name in comment * tag 'x86_cleanups_for_v6.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Centralize __pa()/__va() definitions x86: Simplify one-level sysctl registration for itmt_kern_table x86: Simplify one-level sysctl registration for abi_table2 x86/platform/intel-mid: Remove unused definitions from intel-mid.h x86/uaccess: Remove memcpy_page_flushcache() x86/entry: Change stale function name in comment to error_return()
2 parents 33afd4b + 5462ade commit 682f7bb

9 files changed

Lines changed: 12 additions & 63 deletions

File tree

arch/x86/boot/compressed/ident_map_64.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
* Copyright (C) 2016 Kees Cook
99
*/
1010

11-
/*
12-
* Since we're dealing with identity mappings, physical and virtual
13-
* addresses are the same, so override these defines which are ultimately
14-
* used by the headers in misc.h.
15-
*/
16-
#define __pa(x) ((unsigned long)(x))
17-
#define __va(x) ((void *)((unsigned long)(x)))
18-
1911
/* No PAGE_TABLE_ISOLATION support needed either: */
2012
#undef CONFIG_PAGE_TABLE_ISOLATION
2113

arch/x86/boot/compressed/misc.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
/* cpu_feature_enabled() cannot be used this early */
2020
#define USE_EARLY_PGTABLE_L5
2121

22+
/*
23+
* Boot stub deals with identity mappings, physical and virtual addresses are
24+
* the same, so override these defines.
25+
*
26+
* <asm/page.h> will not define them if they are already defined.
27+
*/
28+
#define __pa(x) ((unsigned long)(x))
29+
#define __va(x) ((void *)((unsigned long)(x)))
30+
2231
#include <linux/linkage.h>
2332
#include <linux/screen_info.h>
2433
#include <linux/elf.h>

arch/x86/boot/compressed/sev.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ static enum es_result vc_read_mem(struct es_em_ctxt *ctxt,
104104
}
105105

106106
#undef __init
107-
#undef __pa
108107
#define __init
109-
#define __pa(x) ((unsigned long)(x))
110108

111109
#define __BOOT_COMPRESSED
112110

arch/x86/entry/entry_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ SYM_CODE_START_LOCAL(paranoid_exit)
10271027
*
10281028
* NB to anyone to try to optimize this code: this code does
10291029
* not execute at all for exceptions from user mode. Those
1030-
* exceptions go through error_exit instead.
1030+
* exceptions go through error_return instead.
10311031
*/
10321032
RESTORE_CR3 scratch_reg=%rax save_reg=%r14
10331033

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,9 @@ static struct ctl_table abi_table2[] = {
7070
{}
7171
};
7272

73-
static struct ctl_table abi_root_table2[] = {
74-
{
75-
.procname = "abi",
76-
.mode = 0555,
77-
.child = abi_table2
78-
},
79-
{}
80-
};
81-
8273
static __init int ia32_binfmt_init(void)
8374
{
84-
register_sysctl_table(abi_root_table2);
75+
register_sysctl("abi", abi_table2);
8576
return 0;
8677
}
8778
__initcall(ia32_binfmt_init);

arch/x86/include/asm/intel-mid.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,4 @@ extern void intel_mid_pwr_power_off(void);
2020

2121
extern int intel_mid_pwr_get_lss_id(struct pci_dev *pdev);
2222

23-
#ifdef CONFIG_X86_INTEL_MID
24-
25-
extern void intel_scu_devices_create(void);
26-
extern void intel_scu_devices_destroy(void);
27-
28-
#else /* !CONFIG_X86_INTEL_MID */
29-
30-
static inline void intel_scu_devices_create(void) { }
31-
static inline void intel_scu_devices_destroy(void) { }
32-
33-
#endif /* !CONFIG_X86_INTEL_MID */
34-
35-
/* Bus Select SoC Fuse value */
36-
#define BSEL_SOC_FUSE_MASK 0x7
37-
/* FSB 133MHz */
38-
#define BSEL_SOC_FUSE_001 0x1
39-
/* FSB 100MHz */
40-
#define BSEL_SOC_FUSE_101 0x5
41-
/* FSB 83MHz */
42-
#define BSEL_SOC_FUSE_111 0x7
43-
4423
#endif /* _ASM_X86_INTEL_MID_H */

arch/x86/include/asm/uaccess_64.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ raw_copy_to_user(void __user *dst, const void *src, unsigned long size)
5454

5555
extern long __copy_user_nocache(void *dst, const void __user *src, unsigned size);
5656
extern long __copy_user_flushcache(void *dst, const void __user *src, unsigned size);
57-
extern void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
58-
size_t len);
5957

6058
static inline int
6159
__copy_from_user_inatomic_nocache(void *dst, const void __user *src,

arch/x86/kernel/itmt.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,6 @@ static struct ctl_table itmt_kern_table[] = {
7777
{}
7878
};
7979

80-
static struct ctl_table itmt_root_table[] = {
81-
{
82-
.procname = "kernel",
83-
.mode = 0555,
84-
.child = itmt_kern_table,
85-
},
86-
{}
87-
};
88-
8980
static struct ctl_table_header *itmt_sysctl_header;
9081

9182
/**
@@ -114,7 +105,7 @@ int sched_set_itmt_support(void)
114105
return 0;
115106
}
116107

117-
itmt_sysctl_header = register_sysctl_table(itmt_root_table);
108+
itmt_sysctl_header = register_sysctl("kernel", itmt_kern_table);
118109
if (!itmt_sysctl_header) {
119110
mutex_unlock(&itmt_update_mutex);
120111
return -ENOMEM;

arch/x86/lib/usercopy_64.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,4 @@ void __memcpy_flushcache(void *_dst, const void *_src, size_t size)
140140
}
141141
}
142142
EXPORT_SYMBOL_GPL(__memcpy_flushcache);
143-
144-
void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
145-
size_t len)
146-
{
147-
char *from = kmap_atomic(page);
148-
149-
memcpy_flushcache(to, from + offset, len);
150-
kunmap_atomic(from);
151-
}
152143
#endif

0 commit comments

Comments
 (0)