From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Alexander Graf <agraf@suse.de>, Paul Mackerras <paulus@samba.org>,
David Hildenbrand <dahi@linux.vnet.ibm.com>
Cc: KVM <kvm@vger.kernel.org>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
Jens Freimann <jfrei@linux.vnet.ibm.com>,
linux-s390 <linux-s390@vger.kernel.org>,
kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 2/4] KVM: s390: fix wrong lookup of VCPUs by array index
Date: Thu, 19 Nov 2015 09:52:31 +0100 [thread overview]
Message-ID: <564D8DCF.4090409@de.ibm.com> (raw)
In-Reply-To: <1447922251-54261-3-git-send-email-borntraeger@de.ibm.com>
Sigh.
Seems that my mail script got confused by the # after stable. So please
strip down the cc list.
On 11/19/2015 09:37 AM, Christian Borntraeger wrote:
> From: David Hildenbrand <dahi@linux.vnet.ibm.com>
>
> For now, VCPUs were always created sequentially with incrementing
> VCPU ids. Therefore, the index in the VCPUs array matched the id.
>
> As sequential creation might change with cpu hotplug, let's use
> the correct lookup function to find a VCPU by id, not array index.
>
> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> [split stable/non-stable parts]
> Cc: stable@vger.kernel.org # c3853a8: KVM: Provide function for VCPU lookup by id
> ---
> arch/s390/kvm/sigp.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
> index da690b6..081dbd0 100644
> --- a/arch/s390/kvm/sigp.c
> +++ b/arch/s390/kvm/sigp.c
> @@ -291,12 +291,8 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
> u16 cpu_addr, u32 parameter, u64 *status_reg)
> {
> int rc;
> - struct kvm_vcpu *dst_vcpu;
> + struct kvm_vcpu *dst_vcpu = kvm_lookup_vcpu(vcpu->kvm, cpu_addr);
>
> - if (cpu_addr >= KVM_MAX_VCPUS)
> - return SIGP_CC_NOT_OPERATIONAL;
> -
> - dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
> if (!dst_vcpu)
> return SIGP_CC_NOT_OPERATIONAL;
>
> @@ -478,7 +474,7 @@ int kvm_s390_handle_sigp_pei(struct kvm_vcpu *vcpu)
> trace_kvm_s390_handle_sigp_pei(vcpu, order_code, cpu_addr);
>
> if (order_code == SIGP_EXTERNAL_CALL) {
> - dest_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
> + dest_vcpu = kvm_lookup_vcpu(vcpu->kvm, cpu_addr);
> BUG_ON(dest_vcpu == NULL);
>
> kvm_s390_vcpu_wakeup(dest_vcpu);
>
next prev parent reply other threads:[~2015-11-19 8:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 8:37 [PATCH 0/4] Preview: vcpu lookup by id changes Christian Borntraeger
2015-11-19 8:37 ` [PATCH 1/4] KVM: Provide function for VCPU lookup by id Christian Borntraeger
2015-11-19 12:11 ` Thomas Huth
2015-11-19 12:55 ` David Hildenbrand
2015-11-19 13:13 ` Paolo Bonzini
2015-11-19 13:23 ` Christian Borntraeger
2015-11-19 13:36 ` David Hildenbrand
2015-11-19 8:37 ` [PATCH 2/4] KVM: s390: fix wrong lookup of VCPUs by array index Christian Borntraeger
2015-11-19 8:52 ` Christian Borntraeger [this message]
2015-11-19 8:37 ` [PATCH 3/4] KVM: use heuristic for fast VCPU lookup by id Christian Borntraeger
2015-11-19 8:37 ` [PATCH 4/4] KVM: Use common function for " Christian Borntraeger
2015-11-19 9:38 ` [PATCH 0/4] Preview: vcpu lookup by id changes Paolo Bonzini
2015-11-19 9:51 ` Christian Borntraeger
2015-11-19 9:52 ` Paolo Bonzini
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=564D8DCF.4090409@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=agraf@suse.de \
--cc=cornelia.huck@de.ibm.com \
--cc=dahi@linux.vnet.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=paulus@samba.org \
--cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).