All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Fedin <p.fedin@samsung.com>
To: 'Marc Zyngier' <marc.zyngier@arm.com>,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: RE: [PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses
Date: Thu, 03 Dec 2015 14:08:29 +0300	[thread overview]
Message-ID: <00cd01d12dba$f14ac070$d3e04150$@samsung.com> (raw)
In-Reply-To: <56601E36.5070700@arm.com>

 Hello!

> > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> > index 87a64e8..a667228 100644
> > --- a/arch/arm64/kvm/sys_regs.c
> > +++ b/arch/arm64/kvm/sys_regs.c
> > @@ -102,7 +102,7 @@ static bool access_vm_reg(struct kvm_vcpu *vcpu,
> >
> >  	BUG_ON(!p->is_write);
> >
> > -	val = *vcpu_reg(vcpu, p->Rt);
> > +	val = *p->val;
> 
> Why does it have to be a pointer? You could just have "val = p->val" if
> you carried the actual value instead of a pointer to the stack variable
> holding that value.

 There's only one concern for pointer approach. Actually, this refactor is based on my vGICv3 live migration API patch set:
http://www.spinics.net/lists/kvm/msg124205.html
http://www.spinics.net/lists/kvm/msg124202.html

 It's simply more convenient to use a pointer for exchange with userspace, see vgic_v3_cpu_regs_access() and callers. I wouldn't
like to refactor the code again. What's your opinion on this?
 And of course i'll fix up the rest.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

  reply	other threads:[~2015-12-03 11:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03  9:58 [PATCH 0/3] KVM: arm64: BUG FIX: Correctly handle zero register transfers Pavel Fedin
2015-12-03  9:58 ` [PATCH 1/3] KVM: arm64: Correctly handle zero register during MMIO Pavel Fedin
2015-12-03 10:51   ` Marc Zyngier
2015-12-03  9:58 ` [PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses Pavel Fedin
2015-12-03 10:49   ` Marc Zyngier
2015-12-03 11:08     ` Pavel Fedin [this message]
2015-12-03 11:36       ` Marc Zyngier
2015-12-03 11:55         ` Pavel Fedin
2015-12-03 13:12           ` Marc Zyngier
2015-12-03  9:58 ` [PATCH 3/3] KVM: arm64: Get rid of old vcpu_reg() Pavel Fedin
2015-12-03 10:05 ` [PATCH 0/3] KVM: arm64: BUG FIX: Correctly handle zero register transfers Marc Zyngier
2015-12-03 10:53   ` Pavel Fedin
2015-12-03 11:39     ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00cd01d12dba$f14ac070$d3e04150$@samsung.com' \
    --to=p.fedin@samsung.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=marc.zyngier@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.