From patchwork Tue Feb 18 15:27:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 24898 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E64E9202B2 for ; Tue, 18 Feb 2014 15:35:08 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id z6sf35539459yhz.6 for ; Tue, 18 Feb 2014 07:35:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=lvPfU+5X4ahnXej6wESKcUEA0m29yj5sfY2h/eHagpU=; b=mmt08/SF6pQDFd/Ozz+aJrT+SL2fz4o+1A2wJSwh1unoixU14UEd48ixNlaJ99nyoX fflssTGoZQmA705e6GGiWNTn58HQ0A1xwU865KB/CGpGqi2kZL633O5cq0TqjukVJWI1 KwNJDPcquSjBEU+rEPtVdyN/lGVRswiqCWiY5FPQ2s0xxqSqor2/7ktkxLG7UngpW2lH 69iO9lKOiRIPej6cdnA1B63zDVAr0+J5uKXm5JI2CxZbZsb90fN0BYw5ayf/0p9kLU3D 2IOe/C94eUtt3GVayzkqPd8jU+pvRxbMUvCO8/V65hh7NwQOuAQLjIW/llx5SGM3slIR 7PQQ== X-Gm-Message-State: ALoCoQmudK9sCGftZWQnF0Kczpbvnsh729NJAz1wCS7HHeD2oz4HMTwW4KSIjDpxYY9LXtugaoZw X-Received: by 10.236.101.195 with SMTP id b43mr519797yhg.57.1392737707762; Tue, 18 Feb 2014 07:35:07 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.180 with SMTP id z49ls1243863qgd.59.gmail; Tue, 18 Feb 2014 07:35:07 -0800 (PST) X-Received: by 10.52.99.227 with SMTP id et3mr2161147vdb.53.1392737707677; Tue, 18 Feb 2014 07:35:07 -0800 (PST) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id kl10si5586827vdb.103.2014.02.18.07.35.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 07:35:07 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id id10so13388783vcb.13 for ; Tue, 18 Feb 2014 07:35:07 -0800 (PST) X-Received: by 10.221.22.71 with SMTP id qv7mr5924749vcb.34.1392737707575; Tue, 18 Feb 2014 07:35:07 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp225587vcz; Tue, 18 Feb 2014 07:35:07 -0800 (PST) X-Received: by 10.180.189.10 with SMTP id ge10mr18565675wic.47.1392737706192; Tue, 18 Feb 2014 07:35:06 -0800 (PST) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id mx8si12435203wic.29.2014.02.18.07.35.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Feb 2014 07:35:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFmeC-0007VM-Jg; Tue, 18 Feb 2014 15:31:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFmdI-0001bC-G0; Tue, 18 Feb 2014 15:30:52 +0000 Received: from fw-tnat.austin.arm.com ([217.140.110.23] helo=collaborate-mta1.arm.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFmb7-0001NM-9l for linux-arm-kernel@lists.infradead.org; Tue, 18 Feb 2014 15:28:39 +0000 Received: from e102391-lin.cambridge.arm.com (e102391-lin.cambridge.arm.com [10.1.209.166]) by collaborate-mta1.arm.com (Postfix) with ESMTP id CC3DE1401CD; Tue, 18 Feb 2014 09:27:45 -0600 (CST) From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Subject: [PATCH v4 12/12] ARM: KVM: fix warning in mmu.c Date: Tue, 18 Feb 2014 15:27:33 +0000 Message-Id: <1392737253-10480-13-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1392737253-10480-1-git-send-email-marc.zyngier@arm.com> References: <1392737253-10480-1-git-send-email-marc.zyngier@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140218_102837_459547_E771BC2B X-CRM114-Status: GOOD ( 11.72 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Catalin Marinas , Christoffer Dall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: marc.zyngier@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Compiling with THP enabled leads to the following warning: arch/arm/kvm/mmu.c: In function ‘unmap_range’: arch/arm/kvm/mmu.c:177:39: warning: ‘pte’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (kvm_pmd_huge(*pmd) || page_empty(pte)) { ^ Code inspection reveals that these two cases are mutually exclusive, so GCC is a bit overzealous here. Silence it anyway by initializing pte to NULL and testing it later on. Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall --- arch/arm/kvm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 209f20f..5e56cbc 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -144,6 +144,7 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp, while (addr < end) { pgd = pgdp + pgd_index(addr); pud = pud_offset(pgd, addr); + pte = NULL; if (pud_none(*pud)) { addr = kvm_pud_addr_end(addr, end); continue; @@ -174,7 +175,7 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp, /* * If the pmd entry is to be cleared, walk back up the ladder */ - if (kvm_pmd_huge(*pmd) || page_empty(pte)) { + if (kvm_pmd_huge(*pmd) || (pte && page_empty(pte))) { clear_pmd_entry(kvm, pmd, addr); next = kvm_pmd_addr_end(addr, end); if (page_empty(pmd) && !page_empty(pud)) {