diff options
author | Maxim Levitsky <mlevitsk@redhat.com> | 2020-10-01 14:29:52 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-10-22 00:36:34 +0300 |
commit | 7dffecaf4eabb700e7aef3cc6da333517cfc242a (patch) | |
tree | dfa7ab8bfa30fa948ce0d0fc2494c69eaf9c27eb /arch/x86/kvm/emulate.c | |
parent | 36385ccc9b185e6958e2911d41202dd0f386298d (diff) | |
download | linux-7dffecaf4eabb700e7aef3cc6da333517cfc242a.tar.xz |
KVM: x86: report negative values from wrmsr emulation to userspace
This will allow the KVM to report such errors (e.g -ENOMEM)
to the userspace.
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20201001112954.6258-3-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 0cc0db500f71..0d917eb70319 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3712,10 +3712,10 @@ static int em_wrmsr(struct x86_emulate_ctxt *ctxt) if (r == X86EMUL_IO_NEEDED) return r; - if (r) + if (r > 0) return emulate_gp(ctxt, 0); - return X86EMUL_CONTINUE; + return r < 0 ? X86EMUL_UNHANDLEABLE : X86EMUL_CONTINUE; } static int em_rdmsr(struct x86_emulate_ctxt *ctxt) |