Message ID | CAKv+Gu9qE1wezDn+uF8AVR=2eHormcSQO_6TPiRF=h8KhC4p7g@mail.gmail.com |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1092733qga; Fri, 22 Jul 2016 09:47:00 -0700 (PDT) X-Received: by 10.66.193.163 with SMTP id hp3mr8052005pac.73.1469206020161; Fri, 22 Jul 2016 09:47:00 -0700 (PDT) Return-Path: <linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org> Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id f9si16657345pfa.18.2016.07.22.09.47.00 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jul 2016 09:47:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bQdaB-0001Et-Lq; Fri, 22 Jul 2016 16:45:51 +0000 Received: from mail-io0-x22a.google.com ([2607:f8b0:4001:c06::22a]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bQda7-0001D0-Jc for linux-arm-kernel@lists.infradead.org; Fri, 22 Jul 2016 16:45:48 +0000 Received: by mail-io0-x22a.google.com with SMTP id m101so110036497ioi.2 for <linux-arm-kernel@lists.infradead.org>; Fri, 22 Jul 2016 09:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1ox5knkw+gPlDIp/YAxv2N5DI/iTASRa6AduPdvCUtQ=; b=fDMylBmWPgGWPkVKvrKIHGq1wlChVE4TIPv7fFMbzXaqLUA1mT32vzJYb9cNBubMt0 v6rJ10s0wyspOdapgOrEocnAtxB248kW5BUih2ZX0x3fhvNklVWgohnau6kxeWfIrd/g QixtS3aawFhbaBl6aHzh/FbJbKV0/9d3HPn0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1ox5knkw+gPlDIp/YAxv2N5DI/iTASRa6AduPdvCUtQ=; b=Ef2C4tJiqOkYphc4FYL98c9cuxDXPEa0bXuwkRUGuNva1o2KkipBvSujt2Sr+ThowG FMdNmdGV2t27t7ODSOHUmRDBGpNVVC3/GSYqYU3GyAtQbE8l66ifRAf8IzZMJbPeSCTr EI2cjuA5OOOA7wWQVV4EM5wO+oP6znM8Z6O5l6KgBph/EPzdrvFFe1feOz4QqIj1ryKU +OB2CwSI1C3DCBCBWIeYPttWj3TrmUekrT2NOqXmGLW/6R1ioH0eD1FKL91rCsx9J0j/ JdvLD8vVapSWLEXouSICt1+0K6yk9Eat48ZvoBU9k6Xa9YMCrztJWYTqFXfCxeY76euK /0+g== X-Gm-Message-State: AEkoouvKxboi902+CzzoahGkU57aKA4hFAqWtVxaR+Mo7uNOS0bjYypo2YtIncPSwA3uaQ2PvQXL7lk6h2erf0DG X-Received: by 10.107.135.22 with SMTP id j22mr6371457iod.56.1469205925338; Fri, 22 Jul 2016 09:45:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.214.6 with HTTP; Fri, 22 Jul 2016 09:45:24 -0700 (PDT) In-Reply-To: <fa285509-2135-43a9-439b-256d4667be05@arm.com> References: <1467204690-10790-1-git-send-email-ard.biesheuvel@linaro.org> <1467204690-10790-3-git-send-email-ard.biesheuvel@linaro.org> <64a731b2-1ddb-78f5-fd02-204f19f0a432@arm.com> <CAKv+Gu_62V1Ww5UEJd3KP+TRj_kw3PW+wZaxQDnn-0ookLBBDg@mail.gmail.com> <fa285509-2135-43a9-439b-256d4667be05@arm.com> From: Ard Biesheuvel <ard.biesheuvel@linaro.org> Date: Fri, 22 Jul 2016 18:45:24 +0200 Message-ID: <CAKv+Gu9qE1wezDn+uF8AVR=2eHormcSQO_6TPiRF=h8KhC4p7g@mail.gmail.com> Subject: Re: [PATCH 2/5] arm64: efi: always map runtime services code and data regions down to pages To: Suzuki K Poulose <Suzuki.Poulose@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160722_094547_879535_710F9755 X-CRM114-Status: GOOD ( 26.03 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4001:c06:0:0:0:22a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Mark Rutland <mark.rutland@arm.com>, "linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>, Matt Fleming <matt@codeblueprint.co.uk>, Catalin Marinas <catalin.marinas@arm.com>, Leif Lindholm <leif.lindholm@linaro.org>, Sudeep Holla <sudeep.holla@arm.com>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org |
diff --git a/mm/memory.c b/mm/memory.c index 15322b73636b..dc6145129170 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1852,8 +1852,11 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd, int err; pgtable_t token; spinlock_t *uninitialized_var(ptl); + bool is_kernel_mm; - pte = (mm == &init_mm) ? + is_kernel_mm = (mm == &init_mm || core_kernel_data((unsigned long)mm)); + + pte = is_kernel_mm ? pte_alloc_kernel(pmd, addr) : pte_alloc_map_lock(mm, pmd, addr, &ptl);