From patchwork Mon Sep 12 13:38:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 76002 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp856521qgf; Mon, 12 Sep 2016 06:40:21 -0700 (PDT) X-Received: by 10.66.180.111 with SMTP id dn15mr2630626pac.125.1473687621894; Mon, 12 Sep 2016 06:40:21 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id t184si17245454pfd.66.2016.09.12.06.40.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 06:40:21 -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 1bjRS7-00070d-Ii; Mon, 12 Sep 2016 13:39:15 +0000 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bjRS1-0006pb-0B for linux-arm-kernel@lists.infradead.org; Mon, 12 Sep 2016 13:39:10 +0000 Received: by mail-lf0-x22c.google.com with SMTP id g62so86902407lfe.3 for ; Mon, 12 Sep 2016 06:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=+5dSQNvihJC0mNF7Fl3z/cu2oSQJPRLLb7SwCQ7vRnM=; b=RAZevqlRpFpBl3TglR7xIg7ah2bRhfQOR7RA5C0oLob40nxunQaF9u0kWh+7Nds4YR 1KzNzHUYUFjRhty0O9L+gLxo+mF5vRD/H+jVXxj2cZm4TLFhYXbPHOAIHymaZpjjDGV+ zGvQUKgjyiOLn3v7yx/TNjbZXKNtk9wiM8aOs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+5dSQNvihJC0mNF7Fl3z/cu2oSQJPRLLb7SwCQ7vRnM=; b=YMbv9Zcvk5CBbJ0RC5BXxc1/ILj7misWTRgW5+gFG1Qwif5WHuDnwSwGjJQxyRlsLj iRIVrueKvjRtWeeaU89VNea21Ra/1Wdmzo732Q5Lhq9fH8bSvxQZgtVDARDI1hA9hHLM zcgYU8NWJhblEJjE2laa9LJTDj09xpArMVJaRu7HrJMpc6fQulSviET4eS36HwsHNV/M +3/WgUl3fQydRLqHgId7k8EAsNvnBG4G4a0IuZxUza/59Ikq3tJy3R5n19iHjr5hYlmV kEh9FAC0JDSYApNSW6n8J9CGvRjaX8iC2nKFAhNduJMWOzVAimCSy0EGXrHjkV5fVG7c v7Jg== X-Gm-Message-State: AE9vXwMC/UvrcKdCr5L8Z7OP9gVyRprH7wAJIIXMBiZi+d6gPCezbRIw+ORbDqyokPQH8hQH X-Received: by 10.25.203.74 with SMTP id b71mr3298281lfg.101.1473687526347; Mon, 12 Sep 2016 06:38:46 -0700 (PDT) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o10sm2957491lfo.47.2016.09.12.06.38.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 06:38:45 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: fix the uaccess crash on PB11MPCore Date: Mon, 12 Sep 2016 15:38:41 +0200 Message-Id: <1473687521-779-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160912_063909_339307_7C4F1D3B X-CRM114-Status: GOOD ( 13.55 ) 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 [2a00:1450:4010:c07:0:0:0:22c 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , Will Deacon , Russell King MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The following patch was sketched by Russell in response to my crashes on the PB11MPCore after the patch for software-based priviledged no access support for ARMv8.1. See this thread: http://marc.info/?l=linux-arm-kernel&m=144051749807214&w=2 I am unsure what is going on, I suspect everyone involved in the discussion is. I just want to repost this to get the discussion restarted, as I still have to apply this patch with every kernel iteration to get my PB11MPCore Realview running. Testing by Neil Armstrong on the Oxnas NAS has revealed that this bug exist also on that widely deployed hardware, so we are probably currently regressing all ARM11MPCore systems. Cc: Russell King Cc: Will Deacon Fixes: a5e090acbf54 ("ARM: software-based priviledged-no-access support") Tested-by: Neil Armstrong Signed-off-by: Linus Walleij --- arch/arm/kernel/smp_tlb.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index 22313cb53362..9af0701f7094 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c @@ -9,6 +9,7 @@ */ #include #include +#include #include #include @@ -40,8 +41,11 @@ static inline void ipi_flush_tlb_mm(void *arg) static inline void ipi_flush_tlb_page(void *arg) { struct tlb_args *ta = (struct tlb_args *)arg; + unsigned int __ua_flags = uaccess_save_and_enable(); local_flush_tlb_page(ta->ta_vma, ta->ta_start); + + uaccess_restore(__ua_flags); } static inline void ipi_flush_tlb_kernel_page(void *arg) @@ -54,8 +58,11 @@ static inline void ipi_flush_tlb_kernel_page(void *arg) static inline void ipi_flush_tlb_range(void *arg) { struct tlb_args *ta = (struct tlb_args *)arg; + unsigned int __ua_flags = uaccess_save_and_enable(); local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end); + + uaccess_restore(__ua_flags); } static inline void ipi_flush_tlb_kernel_range(void *arg)