Commit 62dec7ee authored by Hugh Dickins's avatar Hugh Dickins Committed by Kleber Sacilotto de Souza

kaiser: cleanups while trying for gold link

While trying to get our gold link to work, four cleanups:
matched the gdt_page declaration to its definition;
in fiddling unsuccessfully with PERCPU_INPUT(), lined up backslashes;
lined up the backslashes according to convention in percpu-defs.h;
deleted the unused irq_stack_pointer addition to irq_stack_union.

Sad to report that aligning backslashes does not appear to help gold
align to 8192: but while these did not help, they are worth keeping.
Acked-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

CVE-2017-5754
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 2023a842
...@@ -43,7 +43,7 @@ struct gdt_page { ...@@ -43,7 +43,7 @@ struct gdt_page {
struct desc_struct gdt[GDT_ENTRIES]; struct desc_struct gdt[GDT_ENTRIES];
} __attribute__((aligned(PAGE_SIZE))); } __attribute__((aligned(PAGE_SIZE)));
DECLARE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page); DECLARE_PER_CPU_PAGE_ALIGNED_USER_MAPPED(struct gdt_page, gdt_page);
static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
{ {
......
...@@ -333,11 +333,6 @@ union irq_stack_union { ...@@ -333,11 +333,6 @@ union irq_stack_union {
char gs_base[40]; char gs_base[40];
unsigned long stack_canary; unsigned long stack_canary;
}; };
struct {
char irq_stack_pointer[64];
char unused[IRQ_STACK_SIZE - 64];
};
}; };
DECLARE_PER_CPU_FIRST(union irq_stack_union, irq_stack_union) __visible; DECLARE_PER_CPU_FIRST(union irq_stack_union, irq_stack_union) __visible;
......
...@@ -725,16 +725,14 @@ ...@@ -725,16 +725,14 @@
*/ */
#define PERCPU_INPUT(cacheline) \ #define PERCPU_INPUT(cacheline) \
VMLINUX_SYMBOL(__per_cpu_start) = .; \ VMLINUX_SYMBOL(__per_cpu_start) = .; \
\ VMLINUX_SYMBOL(__per_cpu_user_mapped_start) = .; \
VMLINUX_SYMBOL(__per_cpu_user_mapped_start) = .; \ *(.data..percpu..first) \
*(.data..percpu..first) \ . = ALIGN(cacheline); \
. = ALIGN(cacheline); \ *(.data..percpu..user_mapped) \
*(.data..percpu..user_mapped) \ *(.data..percpu..user_mapped..shared_aligned) \
*(.data..percpu..user_mapped..shared_aligned) \ . = ALIGN(PAGE_SIZE); \
. = ALIGN(PAGE_SIZE); \ *(.data..percpu..user_mapped..page_aligned) \
*(.data..percpu..user_mapped..page_aligned) \ VMLINUX_SYMBOL(__per_cpu_user_mapped_end) = .; \
VMLINUX_SYMBOL(__per_cpu_user_mapped_end) = .; \
\
. = ALIGN(PAGE_SIZE); \ . = ALIGN(PAGE_SIZE); \
*(.data..percpu..page_aligned) \ *(.data..percpu..page_aligned) \
. = ALIGN(cacheline); \ . = ALIGN(cacheline); \
......
...@@ -121,10 +121,10 @@ ...@@ -121,10 +121,10 @@
#define DEFINE_PER_CPU(type, name) \ #define DEFINE_PER_CPU(type, name) \
DEFINE_PER_CPU_SECTION(type, name, "") DEFINE_PER_CPU_SECTION(type, name, "")
#define DECLARE_PER_CPU_USER_MAPPED(type, name) \ #define DECLARE_PER_CPU_USER_MAPPED(type, name) \
DECLARE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION) DECLARE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION)
#define DEFINE_PER_CPU_USER_MAPPED(type, name) \ #define DEFINE_PER_CPU_USER_MAPPED(type, name) \
DEFINE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION) DEFINE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION)
/* /*
...@@ -156,11 +156,11 @@ ...@@ -156,11 +156,11 @@
DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \
____cacheline_aligned_in_smp ____cacheline_aligned_in_smp
#define DECLARE_PER_CPU_SHARED_ALIGNED_USER_MAPPED(type, name) \ #define DECLARE_PER_CPU_SHARED_ALIGNED_USER_MAPPED(type, name) \
DECLARE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION PER_CPU_SHARED_ALIGNED_SECTION) \ DECLARE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION PER_CPU_SHARED_ALIGNED_SECTION) \
____cacheline_aligned_in_smp ____cacheline_aligned_in_smp
#define DEFINE_PER_CPU_SHARED_ALIGNED_USER_MAPPED(type, name) \ #define DEFINE_PER_CPU_SHARED_ALIGNED_USER_MAPPED(type, name) \
DEFINE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION PER_CPU_SHARED_ALIGNED_SECTION) \ DEFINE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION PER_CPU_SHARED_ALIGNED_SECTION) \
____cacheline_aligned_in_smp ____cacheline_aligned_in_smp
...@@ -185,18 +185,18 @@ ...@@ -185,18 +185,18 @@
/* /*
* Declaration/definition used for per-CPU variables that must be page aligned and need to be mapped in user mode. * Declaration/definition used for per-CPU variables that must be page aligned and need to be mapped in user mode.
*/ */
#define DECLARE_PER_CPU_PAGE_ALIGNED_USER_MAPPED(type, name) \ #define DECLARE_PER_CPU_PAGE_ALIGNED_USER_MAPPED(type, name) \
DECLARE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION"..page_aligned") \ DECLARE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION"..page_aligned") \
__aligned(PAGE_SIZE) __aligned(PAGE_SIZE)
#define DEFINE_PER_CPU_PAGE_ALIGNED_USER_MAPPED(type, name) \ #define DEFINE_PER_CPU_PAGE_ALIGNED_USER_MAPPED(type, name) \
DEFINE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION"..page_aligned") \ DEFINE_PER_CPU_SECTION(type, name, USER_MAPPED_SECTION"..page_aligned") \
__aligned(PAGE_SIZE) __aligned(PAGE_SIZE)
/* /*
* Declaration/definition used for per-CPU variables that must be read mostly. * Declaration/definition used for per-CPU variables that must be read mostly.
*/ */
#define DECLARE_PER_CPU_READ_MOSTLY(type, name) \ #define DECLARE_PER_CPU_READ_MOSTLY(type, name) \
DECLARE_PER_CPU_SECTION(type, name, "..read_mostly") DECLARE_PER_CPU_SECTION(type, name, "..read_mostly")
#define DEFINE_PER_CPU_READ_MOSTLY(type, name) \ #define DEFINE_PER_CPU_READ_MOSTLY(type, name) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment