diff options
author | James Morse <james.morse@arm.com> | 2017-06-20 19:11:48 +0300 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2017-06-22 19:37:36 +0300 |
commit | 196f878a7ac2e727a1ded5197e552e6e2d3dfe2c (patch) | |
tree | 1586010593797689bb504bc165befec4634e549d /arch/arm64/include/asm/kvm_mmu.h | |
parent | 02d50cdaff36c135d222015cffdca3ff11d168ea (diff) | |
download | linux-196f878a7ac2e727a1ded5197e552e6e2d3dfe2c.tar.xz |
KVM: arm/arm64: Signal SIGBUS when stage2 discovers hwpoison memory
Once we enable ARCH_SUPPORTS_MEMORY_FAILURE on arm64, notifications for
broken memory can call memory_failure() in mm/memory-failure.c to offline
pages of memory, possibly signalling user space processes and notifying all
the in-kernel users.
memory_failure() has two modes, early and late. Early is used by
machine-managers like Qemu to receive a notification when a memory error is
notified to the host. These can then be relayed to the guest before the
affected page is accessed. To enable this, the process must set
PR_MCE_KILL_EARLY in PR_MCE_KILL_SET using the prctl() syscall.
Once the early notification has been handled, nothing stops the
machine-manager or guest from accessing the affected page. If the
machine-manager does this the page will fail to be mapped and SIGBUS will
be sent. This patch adds the equivalent path for when the guest accesses
the page, sending SIGBUS to the machine-manager.
These two signals can be distinguished by the machine-manager using their
si_code: BUS_MCEERR_AO for 'action optional' early notifications, and
BUS_MCEERR_AR for 'action required' synchronous/late notifications.
Do as x86 does, and deliver the SIGBUS when we discover pfn ==
KVM_PFN_ERR_HWPOISON. Use the hugepage size as si_addr_lsb if this vma was
allocated as a hugepage. Transparent hugepages will be split by
memory_failure() before we see them here.
Cc: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/kvm_mmu.h')
0 files changed, 0 insertions, 0 deletions