mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-11 09:00:12 +00:00
arm64 fixes:
- Do not return false if !preemptible() in current_in_efi(). EFI
runtime services can now run with preemption enabled
- Fix uninitialised variable in the arm MPAM driver, reported by sparse
- Fix partial kasan_reset_tag() use in change_memory_common() when
calculating page indices or comparing ranges
- Save/restore TCR2_EL1 during suspend/resume, otherwise the E0POE bit
is lost
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAmlhSCwACgkQa9axLQDI
XvFj5w/+MUtRj+UL2p2Z2BsQvU6eheiKvvoVYr6kRURlYE1YahXh1lmp8S7t2St5
VYi41VUyT+udAmzIyQvM9GHB1co4d0BPOJcrmU+lKNM5uz/obQ6+Gf8RrHBh6XDM
ZuoEaWB1cRlLQF3NNUNO8IHHW2PwU88jxriZSbq0jnsqFudu1n70XxSH6FH+ilb7
MSkjP1NwaqiA+lTLAL6vCWL0XFA+qgXKMKfUPgW2QwVOM0irPAvmAciXHSwUJe69
W3Fj5UApJVAlwCNkXh6phzwqzorCMshXebVi/Kjxoo8XA/FJ6ezIzjLIsfxTzkgp
GrBW2sAH0xb5BQDsDsihcikKUZBF9Rpf7HtsVaaGcV5yJabo4Yz/cIyKzs9KLfI0
INl9Scno21FK2wqH1dZn+hbLUoRewbtw5+j3HK99Y9b0vNGccHU1g0uS6Kf8Bda3
if8adLIozRz3tcNQn9EWFAlkUYHH8XOKS0kaKTt1VVZWhRRBBTnnFqlDYxQ7Q3WH
t1S1a568UYi6Op0kAHNm5Gl2w0xF3oMQMHnI/hNn94q63m6S/rpvjyoT4Cmg0f0F
xW1Olxlqeve/4Siv5pBrl9SdwQT/0yZsCEqHi1NffDGooQOosXiWYR1xx+PsFRqf
qNvBsREqWkCg/KygtFeDSajrDjOKiN+vsleMR/absogBzvHF8vc=
=GVR8
-----END PGP SIGNATURE-----
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas:
- Do not return false if !preemptible() in current_in_efi(). EFI
runtime services can now run with preemption enabled
- Fix uninitialised variable in the arm MPAM driver, reported by sparse
- Fix partial kasan_reset_tag() use in change_memory_common() when
calculating page indices or comparing ranges
- Save/restore TCR2_EL1 during suspend/resume, otherwise the E0POE bit
is lost
* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: Fix cleared E0POE bit after cpu_suspend()/resume()
arm64: mm: Fix incomplete tag reset in change_memory_common()
arm_mpam: Stop using uninitialized variables in __ris_msmon_read()
arm64/efi: Don't fail check current_in_efi() if preemptible
This commit is contained in:
commit
e28ddd0b7a
@ -45,7 +45,7 @@ void arch_efi_call_virt_teardown(void);
|
||||
* switching to the EFI runtime stack.
|
||||
*/
|
||||
#define current_in_efi() \
|
||||
(!preemptible() && efi_rt_stack_top != NULL && \
|
||||
(efi_rt_stack_top != NULL && \
|
||||
on_task_stack(current, READ_ONCE(efi_rt_stack_top[-1]), 1))
|
||||
|
||||
#define ARCH_EFI_IRQ_FLAGS_MASK (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#ifndef __ASM_SUSPEND_H
|
||||
#define __ASM_SUSPEND_H
|
||||
|
||||
#define NR_CTX_REGS 13
|
||||
#define NR_CTX_REGS 14
|
||||
#define NR_CALLEE_SAVED_REGS 12
|
||||
|
||||
/*
|
||||
|
||||
@ -171,7 +171,8 @@ static int change_memory_common(unsigned long addr, int numpages,
|
||||
*/
|
||||
area = find_vm_area((void *)addr);
|
||||
if (!area ||
|
||||
end > (unsigned long)kasan_reset_tag(area->addr) + area->size ||
|
||||
((unsigned long)kasan_reset_tag((void *)end) >
|
||||
(unsigned long)kasan_reset_tag(area->addr) + area->size) ||
|
||||
((area->flags & (VM_ALLOC | VM_ALLOW_HUGE_VMAP)) != VM_ALLOC))
|
||||
return -EINVAL;
|
||||
|
||||
@ -184,7 +185,8 @@ static int change_memory_common(unsigned long addr, int numpages,
|
||||
*/
|
||||
if (rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||
|
||||
pgprot_val(clear_mask) == PTE_RDONLY)) {
|
||||
unsigned long idx = (start - (unsigned long)kasan_reset_tag(area->addr))
|
||||
unsigned long idx = ((unsigned long)kasan_reset_tag((void *)start) -
|
||||
(unsigned long)kasan_reset_tag(area->addr))
|
||||
>> PAGE_SHIFT;
|
||||
for (; numpages; idx++, numpages--) {
|
||||
ret = __change_memory_common((u64)page_address(area->pages[idx]),
|
||||
|
||||
@ -110,6 +110,10 @@ SYM_FUNC_START(cpu_do_suspend)
|
||||
* call stack.
|
||||
*/
|
||||
str x18, [x0, #96]
|
||||
alternative_if ARM64_HAS_TCR2
|
||||
mrs x2, REG_TCR2_EL1
|
||||
str x2, [x0, #104]
|
||||
alternative_else_nop_endif
|
||||
ret
|
||||
SYM_FUNC_END(cpu_do_suspend)
|
||||
|
||||
@ -144,6 +148,10 @@ SYM_FUNC_START(cpu_do_resume)
|
||||
msr tcr_el1, x8
|
||||
msr vbar_el1, x9
|
||||
msr mdscr_el1, x10
|
||||
alternative_if ARM64_HAS_TCR2
|
||||
ldr x2, [x0, #104]
|
||||
msr REG_TCR2_EL1, x2
|
||||
alternative_else_nop_endif
|
||||
|
||||
msr sctlr_el1, x12
|
||||
set_this_cpu_offset x13
|
||||
|
||||
@ -1072,7 +1072,7 @@ static void __ris_msmon_read(void *arg)
|
||||
u64 now;
|
||||
bool nrdy = false;
|
||||
bool config_mismatch;
|
||||
bool overflow;
|
||||
bool overflow = false;
|
||||
struct mon_read *m = arg;
|
||||
struct mon_cfg *ctx = m->ctx;
|
||||
bool reset_on_next_read = false;
|
||||
@ -1176,10 +1176,11 @@ static void __ris_msmon_read(void *arg)
|
||||
}
|
||||
mpam_mon_sel_unlock(msc);
|
||||
|
||||
if (nrdy) {
|
||||
if (nrdy)
|
||||
m->err = -EBUSY;
|
||||
|
||||
if (m->err)
|
||||
return;
|
||||
}
|
||||
|
||||
*m->val += now;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user