lkml.org 
[lkml]   [2015]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] x86: svm: use kvm_register_write()/read()
On Fri, Feb 20, 2015 at 04:02:10PM -0600, Joel Schopp wrote:
> From: David Kaplan <david.kaplan@amd.com>
>
> 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 <david.kaplan@amd.com>
> [forward port and testing]
> Signed-off-by: Joel Schopp <joel.schopp@amd.com>

Looks good.

Acked-by: Borislav Petkov <bp@suse.de>

> ---
> 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.
--


\
 
 \ /
  Last update: 2015-02-21 00:41    [W:0.042 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site