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]
Message-ID: <e39f2819-aaf4-b076-f71d-42bf813eefbf@linux.ibm.com>
Date:   Mon, 7 Feb 2022 12:06:33 +0100
From:   Janosch Frank <frankja@...ux.ibm.com>
To:     Claudio Imbrenda <imbrenda@...ux.ibm.com>, kvm@...r.kernel.org
Cc:     borntraeger@...ibm.com, thuth@...hat.com, pasic@...ux.ibm.com,
        david@...hat.com, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org, scgl@...ux.ibm.com
Subject: Re: [PATCH v7 12/17] KVM: s390: pv: refactoring of
 kvm_s390_pv_deinit_vm

On 2/4/22 16:53, Claudio Imbrenda wrote:
> Refactor kvm_s390_pv_deinit_vm to improve readability and simplify the
> improvements that are coming in subsequent patches.
> 
> No functional change intended.
> 
> [note: this can potentially be squashed into the next patch, I factored
> it out to simplify the review process]
> 

Reviewed-by: Janosch Frank <frankja@...ux.ibm.com>

> Signed-off-by: Claudio Imbrenda <imbrenda@...ux.ibm.com>
> ---
>   arch/s390/kvm/pv.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c
> index d3b8fd9b5b3e..4e4728ec83a7 100644
> --- a/arch/s390/kvm/pv.c
> +++ b/arch/s390/kvm/pv.c
> @@ -180,17 +180,17 @@ int kvm_s390_pv_deinit_vm(struct kvm *kvm, u16 *rc, u16 *rrc)
>   	cc = uv_cmd_nodata(kvm_s390_pv_get_handle(kvm),
>   			   UVC_CMD_DESTROY_SEC_CONF, rc, rrc);
>   	WRITE_ONCE(kvm->arch.gmap->guest_handle, 0);
> -	if (!cc)
> -		atomic_dec(&kvm->mm->context.protected_count);
> -	KVM_UV_EVENT(kvm, 3, "PROTVIRT DESTROY VM: rc %x rrc %x", *rc, *rrc);
> -	WARN_ONCE(cc, "protvirt destroy vm failed rc %x rrc %x", *rc, *rrc);
> -	/* Intended memory leak on "impossible" error */
>   	if (!cc) {
> +		atomic_dec(&kvm->mm->context.protected_count);
>   		kvm_s390_pv_dealloc_vm(kvm);
> -		return 0;
> +	} else {
> +		/* Intended memory leak on "impossible" error */
> +		s390_replace_asce(kvm->arch.gmap);
>   	}
> -	s390_replace_asce(kvm->arch.gmap);
> -	return -EIO;
> +	KVM_UV_EVENT(kvm, 3, "PROTVIRT DESTROY VM: rc %x rrc %x", *rc, *rrc);
> +	WARN_ONCE(cc, "protvirt destroy vm failed rc %x rrc %x", *rc, *rrc);
> +
> +	return cc ? -EIO : 0;
>   }
>   
>   static void kvm_s390_pv_mmu_notifier_release(struct mmu_notifier *subscription,
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ