From patchwork Tue Jun 19 16:29:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10475033 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 61DF8601D7 for ; Tue, 19 Jun 2018 16:29:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EE0A28E85 for ; Tue, 19 Jun 2018 16:29:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41E7228E97; Tue, 19 Jun 2018 16:29:54 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 DF4CF28E85 for ; Tue, 19 Jun 2018 16:29:53 +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=EAEyua1dlw1BA5C8tIjUxFfzmxF9HZ2/wzT+92a9kIU=; b=F+A fRzovY25oAo7okl8g8fx+gU7SiEf7fkkoiLsU4bg3qML8MZ3XhtXfWUv1LxyVuKN0gvLMD0uvpbrN 5a9HbmkDtE1ILXekUfycHZbEmbdXrZ7/82gbQLMWrwY5XtxKOa9w5U5o5vorykNT4huD+QiogMcZ/ LtF+iKC5CQO6VnOsQzR4Bs8nVG4Hzj4biqI7M/H2+IRyHrJB34a3HhKYHb09zz/+C3KIt51wz+N3v 87RR5HM6Y907X0cu+GCNd4BAG9WIL0W0d1lp8Jmn0YdTAZlMbS/m2MxN4+YG3ToQu/2v07syUcXWK G63X5cUwnIqKf3omATXg92CpoVNkxZg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVJVp-0001Xr-Hc; Tue, 19 Jun 2018 16:29:45 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVJVm-0001Wk-GI for linux-arm-kernel@lists.infradead.org; Tue, 19 Jun 2018 16:29:44 +0000 Received: by mail-wr0-x244.google.com with SMTP id a12-v6so318875wro.1 for ; Tue, 19 Jun 2018 09:29:30 -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=5iOBoHcL1XYX7a5uFs/nMlNI4rrtsNUgt0WGKu7/IUk=; b=E2oyS/hD/Gafz8DwxDXL+oNldjYjiWF+hXw4Xi7f8+LU9RckUcZoZ7uOC9IhyPgUpO KsiqCB/YQvOx+wRDCcnwmnpvc8QLZhpjgrWFfed8bc8RqWub8lwrCVxdg00AVca3bHRR L6fhqzLJhJ0Cf2hEMkChiA+DDe9Ag3ZE8f0TI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5iOBoHcL1XYX7a5uFs/nMlNI4rrtsNUgt0WGKu7/IUk=; b=lzWUTEDIbGxAnqYCOgwywEfBdQqL1iWniRHwz/g6lEefVFXOTsldlj+YgnpMGPLEl+ 3uQ0Jt7XU0doDd906L3DU+nvVpeAtL3pyIon67/VIeDhehS3FIcz55psW/k2oMWAV5M9 ReYHngTVK4HckEsWwKktz4t883oXGNAWXILtssbAYtJBpp7Wu6yMD0nWRxKcgw9j26S7 m4W4+/5VijS70PV98RKkkBJyCu6UMA7Ru+5k1C8VbBqINgReWav5CiIbafgm6HizUNia FEGoL47v9NQP5M4UsXmHP3AEupLryGs1aflTAb52NtbGSrAqFUpLW1sQfSa+fawfry+C tAJA== X-Gm-Message-State: APt69E3XM99NWh3izUucoolnbUsRY80okXa5FsoUwZ4hFSC5Vmk57p3L +4HL4Rf1DCDiSzfrbeU1Hfl5702Co44= X-Google-Smtp-Source: ADUXVKKZupIjlDN+4ZfmRocmtpVLFhhvfZVYD4BQbY3wf9/PQYlObplxwtiKlRRZaVtgsHsdjuwAPw== X-Received: by 2002:adf:b0da:: with SMTP id j26-v6mr13827999wra.3.1529425769373; Tue, 19 Jun 2018 09:29:29 -0700 (PDT) Received: from dogfood.home ([2a01:cb1d:112:6f00:a06d:5653:4fd5:13a]) by smtp.gmail.com with ESMTPSA id j13-v6sm141514wre.38.2018.06.19.09.29.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 09:29:28 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: proc-v7: fix Thumb annotation of cpu_v7_hvc_switch_mm Date: Tue, 19 Jun 2018 18:29:19 +0200 Message-Id: <20180619162919.25190-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180619_092942_546186_27FC9C89 X-CRM114-Status: GOOD ( 14.97 ) 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: linux@armlinux.org.uk, Ard Biesheuvel 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 Due to what appears to be a copy/paste error, the opening ENTRY() of cpu_v7_hvc_switch_mm() lacks a matching ENDPROC(), and instead, the one for cpu_v7_smc_switch_mm() is duplicated. Given that it is ENDPROC() that emits the Thumb annotation, the cpu_v7_hvc_switch_mm() routine will be called in ARM mode on a Thumb2 kernel, resulting in the following splat: Internal error: Oops - undefined instruction: 0 [#1] SMP THUMB2 Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-rc1-00030-g4d28ad89189d-dirty #488 Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 PC is at cpu_v7_hvc_switch_mm+0x12/0x18 LR is at flush_old_exec+0x31b/0x570 pc : [] lr : [] psr: 00000013 sp : ee899e50 ip : 00000000 fp : 00000001 r10: eda28f34 r9 : eda31800 r8 : c12470e0 r7 : eda1fc00 r6 : eda53000 r5 : 00000000 r4 : ee88c000 r3 : c0316eec r2 : 00000001 r1 : eda53000 r0 : 6da6c000 Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Note the 'ISA ARM' in the last line. Fix this by using the correct name in ENDPROC(). Signed-off-by: Ard Biesheuvel Reviewed-by: Dave Martin --- arch/arm/mm/proc-v7.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 6fe52819e014..339eb17c9808 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -112,7 +112,7 @@ ENTRY(cpu_v7_hvc_switch_mm) hvc #0 ldmfd sp!, {r0 - r3} b cpu_v7_switch_mm -ENDPROC(cpu_v7_smc_switch_mm) +ENDPROC(cpu_v7_hvc_switch_mm) #endif ENTRY(cpu_v7_iciallu_switch_mm) mov r3, #0