From patchwork Sat Oct 18 11:56:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 39012 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A79B7202DB for ; Sat, 18 Oct 2014 12:01:00 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id b57sf1310689eek.4 for ; Sat, 18 Oct 2014 05:00:59 -0700 (PDT) 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:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=TzZ+C9+6TJrnBnj4bE2wcYtP8qAForMXN7hdj0aLhJw=; b=cJhwez10/Bdt4owYddKARdjY64Q6zAYWU7ZK1qX97I5pbGpBxo1zZ70QQZAcJafsdM 2mzK3pKsE7G0wM788whDPAsmGblL+b5PcZ6Iyf3DL6i/cdiYIGScDDQYN5ipXpkm5SmY kZ8axY7FDaFMXyqQrFvDNcbBVxRzIf7O6UeKplyJjrk1CAvBLPBUY5RyX2LLDsppe72v SqrpYBfXCD19/uV0EmMsw/qhdpc62UOH/2oykRtuO4ZLV2stTc61k0M/508HThsZa6H0 9oveFOK0kP/GUAJ6NeIzvbDqVmqn060FOFtvNaVoqI3gHVRc5VXZbVKteFM0TYkgnSff nE8w== X-Gm-Message-State: ALoCoQnnVmK0boVU6SBDpacetrut8I2rn7yI//8rLCHE/RbXGNrG5g6XcZp+YGnl1f+tCAqsaMfA X-Received: by 10.112.63.103 with SMTP id f7mr301944lbs.9.1413633659737; Sat, 18 Oct 2014 05:00:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.1 with SMTP id 1ls18350laq.59.gmail; Sat, 18 Oct 2014 05:00:59 -0700 (PDT) X-Received: by 10.152.163.101 with SMTP id yh5mr14442054lab.68.1413633659163; Sat, 18 Oct 2014 05:00:59 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id z3si6004212lad.17.2014.10.18.05.00.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 18 Oct 2014 05:00:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id z12so1892354lbi.16 for ; Sat, 18 Oct 2014 05:00:59 -0700 (PDT) X-Received: by 10.152.6.228 with SMTP id e4mr14754911laa.71.1413633659089; Sat, 18 Oct 2014 05:00:59 -0700 (PDT) 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.112.84.229 with SMTP id c5csp37828lbz; Sat, 18 Oct 2014 05:00:58 -0700 (PDT) X-Received: by 10.70.93.65 with SMTP id cs1mr14743360pdb.80.1413633657472; Sat, 18 Oct 2014 05:00:57 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id nl6si160430pbc.220.2014.10.18.05.00.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Oct 2014 05:00:57 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XfSfH-0008EJ-DX; Sat, 18 Oct 2014 11:59:19 +0000 Received: from inca-roads.misterjones.org ([213.251.177.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XfSdj-0007Rn-Mz for linux-arm-kernel@lists.infradead.org; Sat, 18 Oct 2014 11:57:48 +0000 Received: from [90.219.10.17] (helo=zomby-woof.wild-wind.fr.eu.org) by cheepnis.misterjones.org with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.80) (envelope-from ) id 1XfSdB-0005Fz-6c; Sat, 18 Oct 2014 13:57:09 +0200 From: Marc Zyngier To: Gleb Natapov , Paolo Bonzini Subject: [PATCH 03/12] arm/arm64: KVM: use __GFP_ZERO not memset() to get zeroed pages Date: Sat, 18 Oct 2014 12:56:53 +0100 Message-Id: <1413633422-14907-4-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1413633422-14907-1-git-send-email-marc.zyngier@arm.com> References: <1413633422-14907-1-git-send-email-marc.zyngier@arm.com> X-SA-Exim-Connect-IP: 90.219.10.17 X-SA-Exim-Rcpt-To: gleb@kernel.org, pbonzini@redhat.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, christoffer.dall@linaro.org, ard.biesheuvel@linaro.org X-SA-Exim-Mail-From: marc.zyngier@arm.com X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141018_045743_950168_1001BF83 X-CRM114-Status: UNSURE ( 8.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) Cc: linux-arm-kernel@lists.infradead.org, Christoffer Dall , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) 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 From: Ard Biesheuvel Pass __GFP_ZERO to __get_free_pages() instead of calling memset() explicitly. Acked-by: Marc Zyngier Signed-off-by: Ard Biesheuvel Signed-off-by: Christoffer Dall --- arch/arm/kvm/mmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index eea0306..8f0c7a4 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -528,11 +528,10 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm) return -EINVAL; } - pgd = (pgd_t *)__get_free_pages(GFP_KERNEL, S2_PGD_ORDER); + pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, S2_PGD_ORDER); if (!pgd) return -ENOMEM; - memset(pgd, 0, PTRS_PER_S2_PGD * sizeof(pgd_t)); kvm_clean_pgd(pgd); kvm->arch.pgd = pgd;