Re: [PATCH v4 28/36] KVM: s390: protvirt: Report CPU state to Ultravisor

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

 



On Tue, 25 Feb 2020 09:29:42 +0100
Christian Borntraeger <borntraeger@xxxxxxxxxx> wrote:

> On 24.02.20 20:05, David Hildenbrand wrote:
> > On 24.02.20 12:40, Christian Borntraeger wrote:  
> >> From: Janosch Frank <frankja@xxxxxxxxxxxxx>
> >>
> >> VCPU states have to be reported to the ultravisor for SIGP
> >> interpretation, kdump, kexec and reboot.
> >>
> >> Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx>
> >> Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>
> >> Reviewed-by: Cornelia Huck <cohuck@xxxxxxxxxx>
> >> [borntraeger@xxxxxxxxxx: patch merging, splitting, fixing]
> >> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>  
> > 

> Looks now like:
> 
> @@ -4445,18 +4451,27 @@ static void __enable_ibs_on_vcpu(struct kvm_vcpu *vcpu)
>         kvm_s390_sync_request(KVM_REQ_ENABLE_IBS, vcpu);
>  }
> 
> -void kvm_s390_vcpu_start(struct kvm_vcpu *vcpu)
> +int kvm_s390_vcpu_start(struct kvm_vcpu *vcpu)
>  {
> -       int i, online_vcpus, started_vcpus = 0;
> +       int i, online_vcpus, r = 0, started_vcpus = 0;
> 
>         if (!is_vcpu_stopped(vcpu))
> -               return;
> +               return 0;
> 
>         trace_kvm_s390_vcpu_start_stop(vcpu->vcpu_id, 1);
>         /* Only one cpu at a time may enter/leave the STOPPED state. */
>         spin_lock(&vcpu->kvm->arch.start_stop_lock);
>         online_vcpus = atomic_read(&vcpu->kvm->online_vcpus);
> 
> +       /* Let's tell the UV that we want to change into the operating state */
> +       if (kvm_s390_pv_cpu_is_protected(vcpu)) {
> +               r = kvm_s390_pv_set_cpu_state(vcpu, PV_CPU_STATE_OPR);
> +               if (r) {
> +                       spin_unlock(&vcpu->kvm->arch.start_stop_lock);
> +                       return r;
> +               }
> +       }
> +
>         for (i = 0; i < online_vcpus; i++) {
>                 if (!is_vcpu_stopped(vcpu->kvm->vcpus[i]))
>                         started_vcpus++;
> @@ -4481,22 +4496,31 @@ void kvm_s390_vcpu_start(struct kvm_vcpu *vcpu)
>          */
>         kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);
>         spin_unlock(&vcpu->kvm->arch.start_stop_lock);
> -       return;
> +       return r;
>  }
> 
> 

Hm, this is actually one of the cases where posting a new patch would
be less confusing than not doing so :)




[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