Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8911775imu; Tue, 4 Dec 2018 16:56:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vb4fGQUyQ18UXFmy8TwuoSHeaLqQq9opGtQwQawQvMXDHv4FH+FZxeJ5t9kLL7YKgeHQ/7 X-Received: by 2002:a17:902:3181:: with SMTP id x1mr21947829plb.58.1543971400540; Tue, 04 Dec 2018 16:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543971400; cv=none; d=google.com; s=arc-20160816; b=xfr93rfzqv0dhwaqUZRV+5igL/jd3I3+UTN7LNvQmXR/gP+/akWS3TOM4ugqnHh9RW 0JeyGQQjAyPCfKqPTNhw+JE6th0PyMuHwS88K/tLjvKhwLfixo2w5k1EOPAltmIoDDBh oUXaI7GFBQm59NyFHh9WgV6XDGp9r21VcAzcXFHtISLjbnejw0I4VPrACtvlZs9VRbHI hhAoSbRa0kJF9Oi5QfFiziYVj2QwFr+ooLV2OgqJ2fMrVCfUGeAAuKJv734GJJqgX6li qQbqQ/IDNwbfB/C09K+4dEOT/eNCBZt71DCQlzdStADPcKM7FiD8fXQ8k88K/iU7ZkeH ywsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Jmuc+itNNzzBpd1ytuAMwXxLRvdropR0+rAobR+VKcI=; b=jbwT9wu9Mgh/PNXNuJjAn0SOvWdUmX8FM3MvEkNDSRL7QbG+mJbZPTc8ybz/ELHU68 1RLVnCVhTMDlXhl9PNMyiuLtmDsE1Fr1FO+yKf3D9kY9fMgJ2u5mycJuHqZ/75HojwA1 M9Ch/d8HDEg87D0fe72XDEvl+ePPuJjTQ8/nmmKnHpI127UO8MbxtTZDfuTRdNGqask7 hF9oavwUaA/i6p4qsdZAxcUKWd3Fz62Y3/fNL5gYyF9q8t8Xw05MaKRNt2P+noq/LpBt qHqYgItlpasVWsQgVbwTWJfWvTExq9WjmKIGykaDTyOYgXFaL6eZBUJgnyQa0JPQn/8V BrpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i62si17049103pgd.556.2018.12.04.16.56.25; Tue, 04 Dec 2018 16:56:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726404AbeLEAyk (ORCPT + 99 others); Tue, 4 Dec 2018 19:54:40 -0500 Received: from out1.zte.com.cn ([202.103.147.172]:56482 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725905AbeLEAyk (ORCPT ); Tue, 4 Dec 2018 19:54:40 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 70BF2FA57192F284CD9B; Wed, 5 Dec 2018 08:54:37 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id wB50sVtn050945; Wed, 5 Dec 2018 08:54:31 +0800 (GMT-8) (envelope-from peng.hao2@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.74.120.59]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018120508544998-14779780 ; Wed, 5 Dec 2018 08:54:49 +0800 From: Peng Hao To: christoffer.dall@arm.com, marc.zyngier@arm.com Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Peng Hao Subject: [PATCH] kvm/arm: return 0 when the number of objects is not less than min Date: Wed, 5 Dec 2018 09:15:51 +0800 Message-Id: <1543972551-60951-1-git-send-email-peng.hao2@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-12-05 08:54:50, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-12-05 08:54:23, Serialize complete at 2018-12-05 08:54:23 X-MAIL: mse01.zte.com.cn wB50sVtn050945 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return 0 when there is enough kvm_mmu_memory_cache object. Signed-off-by: Peng Hao --- 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; cache->objects[cache->nobjs++] = page; } return 0; -- 1.8.3.1