Re: [PATCH 2/4] KVM: s390: fix wrong lookup of VCPUs by array index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Signed-off-by: David Hildenbrand <dahi@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
> [split stable/non-stable parts]
> Cc: stable@xxxxxxxxxxxxxxx # 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);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux