From patchwork Thu Feb 23 22:03:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shanker Donthineni X-Patchwork-Id: 9589059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 09897601AE for ; Thu, 23 Feb 2017 22:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8D5828928 for ; Thu, 23 Feb 2017 22:04:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB16A2892E; Thu, 23 Feb 2017 22:04:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 65DA628928 for ; Thu, 23 Feb 2017 22:04:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=LrXBPPgKRFhs0EBj9aIb1RqZrkibM604v53p3LT7qsA=; b=G1e N6tf09g2YkFtEi4g4UYqg8XV5Eu3h65RDVukV5tCtkzWhFdnnBgxQLPRXeaFd4LsJjKIxzXu4iviK dEJ/sa86g3sMpV5+vkSXWGX1qj4nG87KLIHwVvgaiUkHNLImtMI6VDLaJi4lrWq87rvZ799s0fUKI 9T6FbwcvWNZ+Z7tZ8trvFlwRDvJVgTpoVGqTVEIKv++jR9BlmC3m71MlFkbtu9R1Wst2ET7sbeVTd 8HLdWtc8GH/g2g423a76+cY44pEAZbdH58RXCjs6O1wljMENGBEVl57MT9PrD/IWVFSbRdViA7P1C at7Xq6ub+khvh897qHvE60gVsxN+hnA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ch1V0-0000Ct-L9; Thu, 23 Feb 2017 22:04:30 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ch1UZ-00008R-Ve for linux-arm-kernel@lists.infradead.org; Thu, 23 Feb 2017 22:04:07 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id F35D960D34; Thu, 23 Feb 2017 22:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1487887423; bh=9MYv7MbkOdlH/p4kzwum1dVpcWk92KXCTguLV1mnm8s=; h=From:To:Cc:Subject:Date:From; b=VQox/pJ0oOK0Q10i6hOQlKIgStHQTaVL98wetjMgyPPwgWrbtXmplM6YCBq8rifTN scQOD/lvKQvr2l5KHV2MM2nYx4MZyUuBq9A8yeD1a9En/7A87jBfnvhLXjwc+U/+DD 13fDT8deDQTEIin8tb5u6QWEvNaa1iQ+cc+C/rD0= Received: from shankerd-ubuntu.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: shankerd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8249960A1B; Thu, 23 Feb 2017 22:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1487887422; bh=9MYv7MbkOdlH/p4kzwum1dVpcWk92KXCTguLV1mnm8s=; h=From:To:Cc:Subject:Date:From; b=dNeybHhkjOjCShPpzpKKNHUtHyyqcpZD52Cw7ESkO7+8B1Spqx5Kie+uMuwCy8FY+ aD51pgpoYqiZ+JGYLc1p+COIhKfSo4XKwYVpdW4T4VVIumqYaj7W3IEKFCEwy6C3Gv Pot30cN228v2iFeeGFCC1CKZT9glvt1E8IvXoI20= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8249960A1B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=shankerd@codeaurora.org From: Shanker Donthineni To: Catalin Marinas Subject: [PATCH v3] arm64: Fix kernel panic() in cpu_do_switch_mm() on QDF2400 Date: Thu, 23 Feb 2017 16:03:38 -0600 Message-Id: <1487887418-20195-1-git-send-email-shankerd@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170223_140404_125831_4B271609 X-CRM114-Status: GOOD ( 12.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Vikram Sethi , Timur Tabi , Will Deacon , linux-kernel , James Morse , Shanker Donthineni , linux-arm-kernel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The commit 38fd94b0275c 'arm64: Work around Falkor erratum 1003' has been added to fix the hardware bug but causes a system crash. The value of the register x1 which contains 'struct mm_struct *' should be preserved inside macro pre_ttbr0_update_workaround. Macro pre_ttbr0_update_workaround expects 2nd and 3rd arguments are temporary registers. Don't clobber register x1, Otherwise the next load operation 'mmid x1 x1' access the invalid address. [] cpu_do_switch_mm+0x20/0x40 [] efi_virtmap_load+0x34/0x40 [] virt_efi_get_next_variable+0x64/0xc8 [] efivar_init+0x8c/0x348 [] efisubsys_init+0xd4/0x270 [] do_one_initcall+0x80/0x110 [] kernel_init_freeable+0x19c/0x240 [] kernel_init+0x10/0x100 [] ret_from_fork+0x10/0x50 Code: d5033fdf b340bc01 d5182001 d5033fdf (f9416821) ---[ end trace 15247ca922eb6bb7 ]--- note: swapper/0[1] exited with preempt_count 2 Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b SMP: stopping secondary CPUs ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b Signed-off-by: Shanker Donthineni Tested-by: Manoj Iyer --- v2: include 12 digit commit-id in commit description. v3: modified the commit subject to more descriptive. arch/arm64/mm/proc.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index cd4d53d..877d42f 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -138,7 +138,7 @@ ENDPROC(cpu_do_resume) * - pgd_phys - physical address of new TTB */ ENTRY(cpu_do_switch_mm) - pre_ttbr0_update_workaround x0, x1, x2 + pre_ttbr0_update_workaround x0, x2, x3 mmid x1, x1 // get mm->context.id bfi x0, x1, #48, #16 // set the ASID msr ttbr0_el1, x0 // set TTBR0