Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - Ensure context synchronisation after a write to APIAKey. - Fix bullet list formatting in Documentation/arm64/amu.rst to eliminate doc warnings. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: Documentation: arm64: fix amu.rst doc warnings arm64: sync kernel APIAKey when installing
This commit is contained in:
@@ -23,6 +23,7 @@ optional external memory-mapped interface.
|
|||||||
|
|
||||||
Version 1 of the Activity Monitors architecture implements a counter group
|
Version 1 of the Activity Monitors architecture implements a counter group
|
||||||
of four fixed and architecturally defined 64-bit event counters.
|
of four fixed and architecturally defined 64-bit event counters.
|
||||||
|
|
||||||
- CPU cycle counter: increments at the frequency of the CPU.
|
- CPU cycle counter: increments at the frequency of the CPU.
|
||||||
- Constant counter: increments at the fixed frequency of the system
|
- Constant counter: increments at the fixed frequency of the system
|
||||||
clock.
|
clock.
|
||||||
@@ -57,6 +58,7 @@ counters, only the presence of the extension.
|
|||||||
|
|
||||||
Firmware (code running at higher exception levels, e.g. arm-tf) support is
|
Firmware (code running at higher exception levels, e.g. arm-tf) support is
|
||||||
needed to:
|
needed to:
|
||||||
|
|
||||||
- Enable access for lower exception levels (EL2 and EL1) to the AMU
|
- Enable access for lower exception levels (EL2 and EL1) to the AMU
|
||||||
registers.
|
registers.
|
||||||
- Enable the counters. If not enabled these will read as 0.
|
- Enable the counters. If not enabled these will read as 0.
|
||||||
@@ -78,6 +80,7 @@ are not trapped in EL2/EL3.
|
|||||||
|
|
||||||
The fixed counters of AMUv1 are accessible though the following system
|
The fixed counters of AMUv1 are accessible though the following system
|
||||||
register definitions:
|
register definitions:
|
||||||
|
|
||||||
- SYS_AMEVCNTR0_CORE_EL0
|
- SYS_AMEVCNTR0_CORE_EL0
|
||||||
- SYS_AMEVCNTR0_CONST_EL0
|
- SYS_AMEVCNTR0_CONST_EL0
|
||||||
- SYS_AMEVCNTR0_INST_RET_EL0
|
- SYS_AMEVCNTR0_INST_RET_EL0
|
||||||
@@ -93,6 +96,7 @@ Userspace access
|
|||||||
----------------
|
----------------
|
||||||
|
|
||||||
Currently, access from userspace to the AMU registers is disabled due to:
|
Currently, access from userspace to the AMU registers is disabled due to:
|
||||||
|
|
||||||
- Security reasons: they might expose information about code executed in
|
- Security reasons: they might expose information about code executed in
|
||||||
secure mode.
|
secure mode.
|
||||||
- Purpose: AMU counters are intended for system management use.
|
- Purpose: AMU counters are intended for system management use.
|
||||||
@@ -105,6 +109,7 @@ Virtualization
|
|||||||
|
|
||||||
Currently, access from userspace (EL0) and kernelspace (EL1) on the KVM
|
Currently, access from userspace (EL0) and kernelspace (EL1) on the KVM
|
||||||
guest side is disabled due to:
|
guest side is disabled due to:
|
||||||
|
|
||||||
- Security reasons: they might expose information about code executed
|
- Security reasons: they might expose information about code executed
|
||||||
by other guests or the host.
|
by other guests or the host.
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ static inline void ptrauth_keys_init_user(struct ptrauth_keys_user *keys)
|
|||||||
get_random_bytes(&keys->apga, sizeof(keys->apga));
|
get_random_bytes(&keys->apga, sizeof(keys->apga));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define __ptrauth_key_install(k, v) \
|
#define __ptrauth_key_install_nosync(k, v) \
|
||||||
do { \
|
do { \
|
||||||
struct ptrauth_key __pki_v = (v); \
|
struct ptrauth_key __pki_v = (v); \
|
||||||
write_sysreg_s(__pki_v.lo, SYS_ ## k ## KEYLO_EL1); \
|
write_sysreg_s(__pki_v.lo, SYS_ ## k ## KEYLO_EL1); \
|
||||||
@@ -62,8 +62,11 @@ static __always_inline void ptrauth_keys_init_kernel(struct ptrauth_keys_kernel
|
|||||||
|
|
||||||
static __always_inline void ptrauth_keys_switch_kernel(struct ptrauth_keys_kernel *keys)
|
static __always_inline void ptrauth_keys_switch_kernel(struct ptrauth_keys_kernel *keys)
|
||||||
{
|
{
|
||||||
if (system_supports_address_auth())
|
if (!system_supports_address_auth())
|
||||||
__ptrauth_key_install(APIA, keys->apia);
|
return;
|
||||||
|
|
||||||
|
__ptrauth_key_install_nosync(APIA, keys->apia);
|
||||||
|
isb();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ptrauth_prctl_reset_keys(struct task_struct *tsk, unsigned long arg);
|
extern int ptrauth_prctl_reset_keys(struct task_struct *tsk, unsigned long arg);
|
||||||
|
Reference in New Issue
Block a user