mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 03:24:13 +07:00
KVM: MIPS: Override HVA error values for EVA
MIPS Enhanced Virtual Addressing (EVA) allows the user mode and kernel
mode address spaces to overlap, breaking the assumption that PAGE_OFFSET
is an appropriate KVM HVA error value, since PAGE_OFFSET may be as low
as zero.
Fix this in the same way that s390 does in commit bf640876e2
("KVM:
s390: Make KVM_HVA_ERR_BAD usable on s390"), by overriding
KVM_HVA_ERR_[RO_]BAD and kvm_is_error_hva() in asm/kvm_host.h.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
This commit is contained in:
parent
fa8410b355
commit
f6f7017192
@ -107,6 +107,20 @@
|
|||||||
#define KVM_INVALID_INST 0xdeadbeef
|
#define KVM_INVALID_INST 0xdeadbeef
|
||||||
#define KVM_INVALID_ADDR 0xdeadbeef
|
#define KVM_INVALID_ADDR 0xdeadbeef
|
||||||
|
|
||||||
|
/*
|
||||||
|
* EVA has overlapping user & kernel address spaces, so user VAs may be >
|
||||||
|
* PAGE_OFFSET. For this reason we can't use the default KVM_HVA_ERR_BAD of
|
||||||
|
* PAGE_OFFSET.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define KVM_HVA_ERR_BAD (-1UL)
|
||||||
|
#define KVM_HVA_ERR_RO_BAD (-2UL)
|
||||||
|
|
||||||
|
static inline bool kvm_is_error_hva(unsigned long addr)
|
||||||
|
{
|
||||||
|
return IS_ERR_VALUE(addr);
|
||||||
|
}
|
||||||
|
|
||||||
extern atomic_t kvm_mips_instance;
|
extern atomic_t kvm_mips_instance;
|
||||||
|
|
||||||
struct kvm_vm_stat {
|
struct kvm_vm_stat {
|
||||||
|
Loading…
Reference in New Issue
Block a user