Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755506AbbBTXWP (ORCPT ); Fri, 20 Feb 2015 18:22:15 -0500 Received: from mail.skyhub.de ([78.46.96.112]:51777 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755010AbbBTXWM (ORCPT ); Fri, 20 Feb 2015 18:22:12 -0500 Date: Sat, 21 Feb 2015 00:21:16 +0100 From: Borislav Petkov To: Joel Schopp Cc: Gleb Natapov , Paolo Bonzini , kvm@vger.kernel.org, Joerg Roedel , linux-kernel@vger.kernel.org, David Kaplan Subject: Re: [PATCH v2] x86: svm: use kvm_register_write()/read() Message-ID: <20150220232116.GN19378@pd.tnic> References: <20150220220210.14409.84036.stgit@joelvmguard2.amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150220220210.14409.84036.stgit@joelvmguard2.amd.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1523 Lines: 50 On Fri, Feb 20, 2015 at 04:02:10PM -0600, Joel Schopp wrote: > From: David Kaplan > > KVM has nice wrappers to access the register values, clean up a few places > that should use them but currently do not. > > Signed-off-by: David Kaplan > [forward port and testing] > Signed-off-by: Joel Schopp Looks good. Acked-by: Borislav Petkov > --- > arch/x86/kvm/svm.c | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index d319e0c..a7d88e4 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c ... > @@ -3142,8 +3142,8 @@ static int rdmsr_interception(struct vcpu_svm *svm) > } else { > trace_kvm_msr_read(ecx, data); > > - svm->vcpu.arch.regs[VCPU_REGS_RAX] = data & 0xffffffff; > - svm->vcpu.arch.regs[VCPU_REGS_RDX] = data >> 32; > + kvm_register_write(&svm->vcpu, VCPU_REGS_RAX, data & 0xffffffff); > + kvm_register_write(&svm->vcpu, VCPU_REGS_RDX, data >> 32); Right, kvm is missing kvm_write_edx_eax() in addition to the read variant. Someone might want to do a patch and such, ^^hint hint^^... :-) -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/