summaryrefslogtreecommitdiff
path: root/net/ethtool/debug.c
diff options
context:
space:
mode:
authorKevin Brodsky <kevin.brodsky@arm.com>2025-06-19 17:00:41 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-17 18:37:04 +0200
commit778f4e1730205e75b7c96272a95b308f7d29f0c8 (patch)
tree2d2c89c64a48b271a11551b9b23f5562d9af924a /net/ethtool/debug.c
parent2e0cb0c74d96348fd7406cbc38b9a7355a706a84 (diff)
arm64: poe: Handle spurious Overlay faults
[ Upstream commit 22f3a4f6085951eff28bd1e44d3f388c1d9a5f44 ] We do not currently issue an ISB after updating POR_EL0 when context-switching it, for instance. The rationale is that if the old value of POR_EL0 is more restrictive and causes a fault during uaccess, the access will be retried [1]. In other words, we are trading an ISB on every context-switching for the (unlikely) possibility of a spurious fault. We may also miss faults if the new value of POR_EL0 is more restrictive, but that's considered acceptable. However, as things stand, a spurious Overlay fault results in uaccess failing right away since it causes fault_from_pkey() to return true. If an Overlay fault is reported, we therefore need to double check POR_EL0 against vma_pkey(vma) - this is what arch_vma_access_permitted() already does. As it turns out, we already perform that explicit check if no Overlay fault is reported, and we need to keep that check (see comment added in fault_from_pkey()). Net result: the Overlay ISS2 bit isn't of much help to decide whether a pkey fault occurred. Remove the check for the Overlay bit from fault_from_pkey() and add a comment to try and explain the situation. While at it, also add a comment to permission_overlay_switch() in case anyone gets surprised by the lack of ISB. [1] https://lore.kernel.org/linux-arm-kernel/ZtYNGBrcE-j35fpw@arm.com/ Fixes: 160a8e13de6c ("arm64: context switch POR_EL0 register") Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com> Link: https://lore.kernel.org/r/20250619160042.2499290-2-kevin.brodsky@arm.com Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ethtool/debug.c')
0 files changed, 0 insertions, 0 deletions