From patchwork Mon Jul 11 17:08:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 71747 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp56490qga; Mon, 11 Jul 2016 10:09:53 -0700 (PDT) X-Received: by 10.98.101.198 with SMTP id z189mr36597776pfb.53.1468256993257; Mon, 11 Jul 2016 10:09:53 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id sy1si4554024pac.262.2016.07.11.10.09.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jul 2016 10:09:53 -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 1bMehK-0001Xq-PZ; Mon, 11 Jul 2016 17:08:46 +0000 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bMehF-0001VJ-5U for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2016 17:08:45 +0000 Received: by mail-lf0-x22d.google.com with SMTP id f93so27227891lfi.2 for ; Mon, 11 Jul 2016 10:08:20 -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=mi3wTvG9/7PgkolLwlxMX1RpvC2hzqNxU8ddrmQV6EA=; b=COna/RSLqQh5IWLc1PEcIQ7qwDMY0utpLW9pXw//vMkF+mRL+1SvG/9fJEd1yKIyw5 A3lJNs+Mpd4+ztLSj8p6xOc1GPfKkoZTY95BbyiU6PRPpn2r6T+xjJPqmRl/Q1E/A/5P /0WcaSQDDOrThYkFyERY+ZcI1jEACG4MAlO6c= 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=mi3wTvG9/7PgkolLwlxMX1RpvC2hzqNxU8ddrmQV6EA=; b=L5qUlEFx3tNQuHICKpq/Tx9SY5bpGujSUbT2A6miNnJDaqTphrNeEBNKbbol5Icrni 7cR04A/ZF698z744CBAsfey4dFK/9whzeZ14Yg+aGbtx+SYlLgxz2j+dczqeIYWHmZ+1 UmntMJUaRCYJ2ZZHmCNQShtA1aqRGy+LW/jMDpQNtDHbVhaGrs8Cf4S6SW0QkW3iMwCu 63TtstZERXiNeXtZTj0aEeoE/yH+e+HmZMBnezhV46zoQpS6WBTaxGGi0PhphVhho3Lf 00q3ztFDAHemwM39F43kyp49Z1ZA98LDSv/e9GfTpVf6zmH7S2HHqp3PI6YREQeKv083 8BBQ== X-Gm-Message-State: ALyK8tKIXnfMMEVgtIy3GeVkb0tSFNHYSbVwYnMPFCKt7cUzKtymkYiFS9Qgw3o4N4U8fDb+ X-Received: by 10.46.33.147 with SMTP id h19mr2732293lji.29.1468256898875; Mon, 11 Jul 2016 10:08:18 -0700 (PDT) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 83sm2789941ljj.14.2016.07.11.10.08.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jul 2016 10:08:17 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Neil Armstrong , Russell King Subject: [PATCH] RFC: ARM: fix the uaccess crash on PB11MPCore Date: Mon, 11 Jul 2016 19:08:13 +0200 Message-Id: <1468256893-12811-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-20160711_100844_091215_AC598D5C X-CRM114-Status: GOOD ( 13.87 ) 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:22d 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 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. I also know that Oxnas has actual, mass-deployed NAS (PogoPlug Pro variants) using PB11MPCore, and that they may or may not be seeing the same issue so I want their feedback on this: do you or do you not see this with mainline, or have you not even tested? Cc: Russell King Cc: Will Deacon Cc: Neil Armstrong Fixes: a5e090acbf54 ("ARM: software-based priviledged-no-access support") 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 Tested-by: Neil Armstrong diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index 2e72be4f623e..7cb079e74010 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)