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: <20181205083236.5tzhnxfhi4h4nknn@kamzik.brq.redhat.com>
Date:   Wed, 5 Dec 2018 09:32:36 +0100
From:   Andrew Jones <drjones@...hat.com>
To:     Peng Hao <peng.hao2@....com.cn>
Cc:     christoffer.dall@....com, marc.zyngier@....com,
        kvmarm@...ts.cs.columbia.edu, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kvm/arm: return 0 when the number of objects is not less
 than min

On Wed, Dec 05, 2018 at 09:15:51AM +0800, Peng Hao wrote:
> Return 0 when there is enough kvm_mmu_memory_cache object.
> 
> Signed-off-by: Peng Hao <peng.hao2@....com.cn>
> ---
>  virt/kvm/arm/mmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
> index ed162a6..fcda0ce 100644
> --- a/virt/kvm/arm/mmu.c
> +++ b/virt/kvm/arm/mmu.c
> @@ -127,7 +127,7 @@ static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache,
>  	while (cache->nobjs < max) {
>  		page = (void *)__get_free_page(PGALLOC_GFP);
>  		if (!page)
> -			return -ENOMEM;
> +			return cache->nobjs >= min ? 0 : -ENOMEM;

This condition will never be true here, as the exact same condition is
already checked above, and if it had been true, then we wouldn't be here.

What problem are you attempting to solve?

>  		cache->objects[cache->nobjs++] = page;
>  	}
>  	return 0;
> -- 
> 1.8.3.1
> 
> _______________________________________________
> kvmarm mailing list
> kvmarm@...ts.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ