From patchwork Wed Sep 17 21:56:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 37548 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5DA4B2054D for ; Wed, 17 Sep 2014 21:58:54 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id ty20sf1226478lab.8 for ; Wed, 17 Sep 2014 14:58:52 -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=U9KGfrmkojgcNbO3H9bb5Gwc654JIn2SQTtqNv/werw=; b=YynZL26IlXI4PReyFYO90Ou0BU+7uNKQzXp7VrC6nVAHupEpykxCvwsPd7C+hnaD+E bEdWpVHnHPv45PJ9wL4hS/qRXLWCAoYvHM4J3ggw3+JxJW60NNAsBekpF59JajXySAN8 4S7+/kUtHpv17j6O8KGInRRC6ixBdo+9MQ4dWgIpI1fOV+ABswzEADwb7fi+zAxs8/tH qbSrlP/dCkaYb/l5/+DuWzRtFd1BDw8yLWgJlv8MihQiw1o/E1iR6AIcUt6otc5vOTD2 u5YJ33HGojFB4r5xxgo9/V/RXEHpoJ83SkX/P/D6Euarfh+FKXcjYoS8PQvYGBW5GKxQ O/eg== X-Gm-Message-State: ALoCoQlF7Ihb/rRt821QZEAQemgpuuVwYjvRHn9oNmP9t3PiwmzAAZCwu1OkQYSm2FtSfSLQoLs2 X-Received: by 10.181.8.226 with SMTP id dn2mr201126wid.4.1410991132829; Wed, 17 Sep 2014 14:58:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.132 with SMTP id ay4ls153959lab.46.gmail; Wed, 17 Sep 2014 14:58:52 -0700 (PDT) X-Received: by 10.112.130.101 with SMTP id od5mr169737lbb.76.1410991132614; Wed, 17 Sep 2014 14:58:52 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by mx.google.com with ESMTPS id jo5si30163727lbc.130.2014.09.17.14.58.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 14:58:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id ty20so2724695lab.7 for ; Wed, 17 Sep 2014 14:58:52 -0700 (PDT) X-Received: by 10.112.76.6 with SMTP id g6mr230962lbw.22.1410991132100; Wed, 17 Sep 2014 14:58:52 -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.130.169 with SMTP id of9csp661961lbb; Wed, 17 Sep 2014 14:58:51 -0700 (PDT) X-Received: by 10.70.89.206 with SMTP id bq14mr72622pdb.123.1410991129980; Wed, 17 Sep 2014 14:58:49 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ci4si23594883pad.21.2014.09.17.14.58.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 14:58:49 -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 1XUNDm-0001r7-Li; Wed, 17 Sep 2014 21:57:06 +0000 Received: from mail-pa0-f54.google.com ([209.85.220.54]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XUNDW-0001kp-Ml for linux-arm-kernel@lists.infradead.org; Wed, 17 Sep 2014 21:56:51 +0000 Received: by mail-pa0-f54.google.com with SMTP id lj1so3052814pab.41 for ; Wed, 17 Sep 2014 14:56:29 -0700 (PDT) X-Received: by 10.68.125.227 with SMTP id mt3mr436269pbb.97.1410990989716; Wed, 17 Sep 2014 14:56:29 -0700 (PDT) Received: from ards-macbook-pro.swisscom.com (70-35-38-154.static.wiline.com. [70.35.38.154]) by mx.google.com with ESMTPSA id v1sm17771310pdn.93.2014.09.17.14.56.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 14:56:28 -0700 (PDT) From: Ard Biesheuvel To: christoffer.dall@linaro.org, marc.zyngier@arm.com, linux@arm.linux.org.uk, catalin.marinas@arm.com Subject: [PATCH 1/6] arm/arm64: KVM: use __GFP_ZERO not memset() to get zeroed pages Date: Wed, 17 Sep 2014 14:56:16 -0700 Message-Id: <1410990981-665-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1410990981-665-1-git-send-email-ard.biesheuvel@linaro.org> References: <1410990981-665-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140917_145650_764469_6C54915F X-CRM114-Status: UNSURE ( 8.84 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.54 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.220.54 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.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: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 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 Pass __GFP_ZERO to __get_free_pages() instead of calling memset() explicitly. Signed-off-by: Ard Biesheuvel Acked-by: Christoffer Dall Acked-by: Marc Zyngier --- 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 c68ec28f17c3..152e0f896e63 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;