lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 27 Sep 2021 08:58:17 +0200
From:   Christian Borntraeger <borntraeger@...ibm.com>
To:     Sean Christopherson <seanjc@...gle.com>,
        Marc Zyngier <maz@...nel.org>,
        Huacai Chen <chenhuacai@...nel.org>,
        Aleksandar Markovic <aleksandar.qemu.devel@...il.com>,
        Paul Mackerras <paulus@...abs.org>,
        Janosch Frank <frankja@...ux.ibm.com>,
        Paolo Bonzini <pbonzini@...hat.com>
Cc:     James Morse <james.morse@....com>,
        Alexandru Elisei <alexandru.elisei@....com>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        David Hildenbrand <david@...hat.com>,
        Cornelia Huck <cohuck@...hat.com>,
        Claudio Imbrenda <imbrenda@...ux.ibm.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>,
        linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
        linux-mips@...r.kernel.org, kvm@...r.kernel.org,
        kvm-ppc@...r.kernel.org, linux-kernel@...r.kernel.org,
        David Matlack <dmatlack@...gle.com>,
        Jing Zhang <jingzhangos@...gle.com>
Subject: Re: [PATCH 05/14] KVM: s390: Clear valid_wakeup in
 kvm_s390_handle_wait(), not in arch hook



Am 25.09.21 um 02:55 schrieb Sean Christopherson:
> Move the clearing of valid_wakeup out of kvm_arch_vcpu_block_finish() so
> that a future patch can drop said arch hook.  Unlike the other blocking-
> related arch hooks (vcpu_blocking/unblocking()), vcpu_block_finish() needs
> to be called even if the KVM doesn't actually block the vCPU.  This will
> allow future patches to differentiate between truly blocking the vCPU and
> emulating a halt condition without introducing a contradiction.
> 
> Alternatively, the hook could be renamed to kvm_arch_vcpu_halt_finish(),
> but there's literally one call site in s390, and future cleanup can also
> be done to handle valid_wakeup fully within kvm_s390_handle_wait() and
> allow generic KVM to drop vcpu_valid_wakeup().
> 
> No functional change intended.
> 
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>

Reviewed-by: Christian Borntraeger <borntraeger@...ibm.com>
> ---
>   arch/s390/kvm/interrupt.c | 1 +
>   arch/s390/kvm/kvm-s390.c  | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
> index 10722455fd02..520450a7956f 100644
> --- a/arch/s390/kvm/interrupt.c
> +++ b/arch/s390/kvm/interrupt.c
> @@ -1336,6 +1336,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
>   no_timer:
>   	srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
>   	kvm_vcpu_block(vcpu);
> +	vcpu->valid_wakeup = false;
>   	__unset_cpu_idle(vcpu);
>   	vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
>   
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 7cabe6778b1b..08ed68639a21 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -5082,7 +5082,7 @@ static inline unsigned long nonhyp_mask(int i)
>   
>   void kvm_arch_vcpu_block_finish(struct kvm_vcpu *vcpu)
>   {
> -	vcpu->valid_wakeup = false;
> +

maybe just remove the line instead of adding an empty one?

>   }
>   
>   static int __init kvm_s390_init(void)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ