Skip to content

Commit 66a5abe

Browse files
committed
Merge pull request #51 from torvalds/master
Sync up with Linus
2 parents 4f3a14c + 7b09ac7 commit 66a5abe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+346
-229
lines changed

arch/arm/crypto/aesbs-core.S_shipped

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,18 @@
5858
# define VFP_ABI_FRAME 0
5959
# define BSAES_ASM_EXTENDED_KEY
6060
# define XTS_CHAIN_TWEAK
61-
# define __ARM_ARCH__ 7
61+
# define __ARM_ARCH__ __LINUX_ARM_ARCH__
62+
# define __ARM_MAX_ARCH__ 7
6263
#endif
6364

6465
#ifdef __thumb__
6566
# define adrl adr
6667
#endif
6768

68-
#if __ARM_ARCH__>=7
69+
#if __ARM_MAX_ARCH__>=7
70+
.arch armv7-a
71+
.fpu neon
72+
6973
.text
7074
.syntax unified @ ARMv7-capable assembler is expected to handle this
7175
#ifdef __thumb2__
@@ -74,8 +78,6 @@
7478
.code 32
7579
#endif
7680

77-
.fpu neon
78-
7981
.type _bsaes_decrypt8,%function
8082
.align 4
8183
_bsaes_decrypt8:
@@ -2095,9 +2097,11 @@ bsaes_xts_decrypt:
20952097
vld1.8 {q8}, [r0] @ initial tweak
20962098
adr r2, .Lxts_magic
20972099

2100+
#ifndef XTS_CHAIN_TWEAK
20982101
tst r9, #0xf @ if not multiple of 16
20992102
it ne @ Thumb2 thing, sanity check in ARM
21002103
subne r9, #0x10 @ subtract another 16 bytes
2104+
#endif
21012105
subs r9, #0x80
21022106

21032107
blo .Lxts_dec_short

arch/arm/crypto/bsaes-armv7.pl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,14 +701,18 @@ sub bitslice {
701701
# define VFP_ABI_FRAME 0
702702
# define BSAES_ASM_EXTENDED_KEY
703703
# define XTS_CHAIN_TWEAK
704-
# define __ARM_ARCH__ 7
704+
# define __ARM_ARCH__ __LINUX_ARM_ARCH__
705+
# define __ARM_MAX_ARCH__ 7
705706
#endif
706707
707708
#ifdef __thumb__
708709
# define adrl adr
709710
#endif
710711
711-
#if __ARM_ARCH__>=7
712+
#if __ARM_MAX_ARCH__>=7
713+
.arch armv7-a
714+
.fpu neon
715+
712716
.text
713717
.syntax unified @ ARMv7-capable assembler is expected to handle this
714718
#ifdef __thumb2__
@@ -717,8 +721,6 @@ sub bitslice {
717721
.code 32
718722
#endif
719723
720-
.fpu neon
721-
722724
.type _bsaes_decrypt8,%function
723725
.align 4
724726
_bsaes_decrypt8:
@@ -2076,9 +2078,11 @@ sub bitslice_key {
20762078
vld1.8 {@XMM[8]}, [r0] @ initial tweak
20772079
adr $magic, .Lxts_magic
20782080
2081+
#ifndef XTS_CHAIN_TWEAK
20792082
tst $len, #0xf @ if not multiple of 16
20802083
it ne @ Thumb2 thing, sanity check in ARM
20812084
subne $len, #0x10 @ subtract another 16 bytes
2085+
#endif
20822086
subs $len, #0x80
20832087
20842088
blo .Lxts_dec_short

arch/x86/boot/compressed/aslr.c

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@"
1515
LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION;
1616

17-
struct kaslr_setup_data {
18-
__u64 next;
19-
__u32 type;
20-
__u32 len;
21-
__u8 data[1];
22-
} kaslr_setup_data;
23-
2417
#define I8254_PORT_CONTROL 0x43
2518
#define I8254_PORT_COUNTER0 0x40
2619
#define I8254_CMD_READBACK 0xC0
@@ -302,29 +295,7 @@ static unsigned long find_random_addr(unsigned long minimum,
302295
return slots_fetch_random();
303296
}
304297

305-
static void add_kaslr_setup_data(struct boot_params *params, __u8 enabled)
306-
{
307-
struct setup_data *data;
308-
309-
kaslr_setup_data.type = SETUP_KASLR;
310-
kaslr_setup_data.len = 1;
311-
kaslr_setup_data.next = 0;
312-
kaslr_setup_data.data[0] = enabled;
313-
314-
data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
315-
316-
while (data && data->next)
317-
data = (struct setup_data *)(unsigned long)data->next;
318-
319-
if (data)
320-
data->next = (unsigned long)&kaslr_setup_data;
321-
else
322-
params->hdr.setup_data = (unsigned long)&kaslr_setup_data;
323-
324-
}
325-
326-
unsigned char *choose_kernel_location(struct boot_params *params,
327-
unsigned char *input,
298+
unsigned char *choose_kernel_location(unsigned char *input,
328299
unsigned long input_size,
329300
unsigned char *output,
330301
unsigned long output_size)
@@ -335,17 +306,14 @@ unsigned char *choose_kernel_location(struct boot_params *params,
335306
#ifdef CONFIG_HIBERNATION
336307
if (!cmdline_find_option_bool("kaslr")) {
337308
debug_putstr("KASLR disabled by default...\n");
338-
add_kaslr_setup_data(params, 0);
339309
goto out;
340310
}
341311
#else
342312
if (cmdline_find_option_bool("nokaslr")) {
343313
debug_putstr("KASLR disabled by cmdline...\n");
344-
add_kaslr_setup_data(params, 0);
345314
goto out;
346315
}
347316
#endif
348-
add_kaslr_setup_data(params, 1);
349317

350318
/* Record the various known unsafe memory ranges. */
351319
mem_avoid_init((unsigned long)input, input_size,

arch/x86/boot/compressed/misc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,7 @@ asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap,
401401
* the entire decompressed kernel plus relocation table, or the
402402
* entire decompressed kernel plus .bss and .brk sections.
403403
*/
404-
output = choose_kernel_location(real_mode, input_data, input_len,
405-
output,
404+
output = choose_kernel_location(input_data, input_len, output,
406405
output_len > run_size ? output_len
407406
: run_size);
408407

arch/x86/boot/compressed/misc.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,15 @@ int cmdline_find_option_bool(const char *option);
5757

5858
#if CONFIG_RANDOMIZE_BASE
5959
/* aslr.c */
60-
unsigned char *choose_kernel_location(struct boot_params *params,
61-
unsigned char *input,
60+
unsigned char *choose_kernel_location(unsigned char *input,
6261
unsigned long input_size,
6362
unsigned char *output,
6463
unsigned long output_size);
6564
/* cpuflags.c */
6665
bool has_cpuflag(int flag);
6766
#else
6867
static inline
69-
unsigned char *choose_kernel_location(struct boot_params *params,
70-
unsigned char *input,
68+
unsigned char *choose_kernel_location(unsigned char *input,
7169
unsigned long input_size,
7270
unsigned char *output,
7371
unsigned long output_size)

arch/x86/crypto/aesni-intel_glue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ static int __driver_rfc4106_decrypt(struct aead_request *req)
11551155
src = kmalloc(req->cryptlen + req->assoclen, GFP_ATOMIC);
11561156
if (!src)
11571157
return -ENOMEM;
1158-
assoc = (src + req->cryptlen + auth_tag_len);
1158+
assoc = (src + req->cryptlen);
11591159
scatterwalk_map_and_copy(src, req->src, 0, req->cryptlen, 0);
11601160
scatterwalk_map_and_copy(assoc, req->assoc, 0,
11611161
req->assoclen, 0);
@@ -1180,7 +1180,7 @@ static int __driver_rfc4106_decrypt(struct aead_request *req)
11801180
scatterwalk_done(&src_sg_walk, 0, 0);
11811181
scatterwalk_done(&assoc_sg_walk, 0, 0);
11821182
} else {
1183-
scatterwalk_map_and_copy(dst, req->dst, 0, req->cryptlen, 1);
1183+
scatterwalk_map_and_copy(dst, req->dst, 0, tempCipherLen, 1);
11841184
kfree(src);
11851185
}
11861186
return retval;

arch/x86/include/asm/fpu-internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ static inline void drop_fpu(struct task_struct *tsk)
370370
preempt_disable();
371371
tsk->thread.fpu_counter = 0;
372372
__drop_fpu(tsk);
373-
clear_used_math();
373+
clear_stopped_child_used_math(tsk);
374374
preempt_enable();
375375
}
376376

arch/x86/include/asm/page_types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ extern int devmem_is_allowed(unsigned long pagenr);
5151
extern unsigned long max_low_pfn_mapped;
5252
extern unsigned long max_pfn_mapped;
5353

54-
extern bool kaslr_enabled;
55-
5654
static inline phys_addr_t get_max_mapped(void)
5755
{
5856
return (phys_addr_t)max_pfn_mapped << PAGE_SHIFT;

arch/x86/include/uapi/asm/bootparam.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define SETUP_DTB 2
88
#define SETUP_PCI 3
99
#define SETUP_EFI 4
10-
#define SETUP_KASLR 5
1110

1211
/* ram_size flags */
1312
#define RAMDISK_IMAGE_START_MASK 0x07FF

arch/x86/kernel/acpi/boot.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,26 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
13371337
return 0;
13381338
}
13391339

1340+
/*
1341+
* ACPI offers an alternative platform interface model that removes
1342+
* ACPI hardware requirements for platforms that do not implement
1343+
* the PC Architecture.
1344+
*
1345+
* We initialize the Hardware-reduced ACPI model here:
1346+
*/
1347+
static void __init acpi_reduced_hw_init(void)
1348+
{
1349+
if (acpi_gbl_reduced_hardware) {
1350+
/*
1351+
* Override x86_init functions and bypass legacy pic
1352+
* in Hardware-reduced ACPI mode
1353+
*/
1354+
x86_init.timers.timer_init = x86_init_noop;
1355+
x86_init.irqs.pre_vector_init = x86_init_noop;
1356+
legacy_pic = &null_legacy_pic;
1357+
}
1358+
}
1359+
13401360
/*
13411361
* If your system is blacklisted here, but you find that acpi=force
13421362
* works for you, please contact [email protected]
@@ -1536,6 +1556,11 @@ int __init early_acpi_boot_init(void)
15361556
*/
15371557
early_acpi_process_madt();
15381558

1559+
/*
1560+
* Hardware-reduced ACPI mode initialization:
1561+
*/
1562+
acpi_reduced_hw_init();
1563+
15391564
return 0;
15401565
}
15411566

0 commit comments

Comments
 (0)