From patchwork Thu Aug 1 08:16:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 170342 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp5086809ile; Thu, 1 Aug 2019 01:21:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyygypdpTXp2IzzQG5q2UgRAmvjwu97ZY7/IsZ4gaC75DLRZNJx7YTU82OuybQDf2AOjLe/ X-Received: by 2002:a63:2c8:: with SMTP id 191mr115981734pgc.139.1564647673923; Thu, 01 Aug 2019 01:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564647673; cv=none; d=google.com; s=arc-20160816; b=eAOqIy7De47UZ8wwqIY0SopKLjm1Bra6Q220CTywWtGd/zzFrUk2l19rX66KCr0oRm FDgJK8Tfp0CitEcatvZCiF3hT7XPKVo2Wbs3xEWnI1LjEi9NXH99JTcyrK572wGs9sxO IwwoBTRnEg/grN+nmeOHmG7tsJgL/SkFSFj7nfKqoCzWSi1bpW2NMuppu7pzjF2GHIvV HsIocZt8lygcUij/kU8TQ3fPYLEebEZrPnz8kKxMAJZLxKnIdBnp3dXslGeaPLDhO/Kt UJxEuSmve5nd1IP7K7gDBcngbsJ3eZI/mkcuQsrpG3ic/oGazNYDjO5mA0NLEIa+xvl2 /3Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jbpvQKJEQu6FughKaepmre4Ek2Fg9qHsXyEHlW2kC7A=; b=H6124k/Z5ifIkzRHZUVhc69PazEblvjhb7h0EiMkZrMxds+DJAdZmIY18pmhsTiLnD YU7FIvzvMfwdEZEUQLk1AQE4Y9WTwktFfKk7y007x5lM+LQJd17Gedydj6OmR7Yu40TP HBzljHk8+vyoR44OuPfPHIu30wEligdQfbnE0ZhEmI+OulVqwlhPmudcgD3WCAyNESYq euvyGd4XmjhhR3G1ipR3iTSnnrHHIlW2LRpFfPy8HQuikgCapSfJnsQKDDobPmKE/Q6A 3kyO1N+uqfVGrcPrk/sDUHf98g3x10mk7G8sWhtFkJ7u635sQU+K+coPe4N1PlqzvGGv DPxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nuPAxY96; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13si4013236pgj.476.2019.08.01.01.21.13; Thu, 01 Aug 2019 01:21:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nuPAxY96; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730681AbfHAIVN (ORCPT + 14 others); Thu, 1 Aug 2019 04:21:13 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34431 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731106AbfHAIVM (ORCPT ); Thu, 1 Aug 2019 04:21:12 -0400 Received: by mail-pg1-f196.google.com with SMTP id n9so27510213pgc.1 for ; Thu, 01 Aug 2019 01:21:11 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=jbpvQKJEQu6FughKaepmre4Ek2Fg9qHsXyEHlW2kC7A=; b=nuPAxY96iM+XwKlBy8anITOo/610vyvWeiY88oH4WhEaRNHJ+4FpcKfNUOq6sORC1n bognKJBIWgQngLwGMhYvzwuGBzT4WIu2MfMf8wZwWkZari+WuthCl6e/xY85XPk1O9WS W4HJ2d3jp408eScQ9rXt/Og1AIxEp3+gEHIQ+m0RWksDj+hoyuWm7cqTTOVQdSMaDRnh QQbblfammaCkWIWdwB9jSxF/XD7zfcPy8fmeA0b3nXznGmJW8355BJcQ4Yb3fU+RSBtP xyQgP/CWI3bq3rP9YfrrackmXpNijHi+BWViX2RDCKnE+QVy/UZBD8wV3GkSzbEsMW+v EPUg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jbpvQKJEQu6FughKaepmre4Ek2Fg9qHsXyEHlW2kC7A=; b=hayDZnpHeeLxNZBQE4sTtVBfV4m7/glLrqxDlKzHTHSMvNiw21mlGNUtcJ9xfl2XSp sV1TDmMujtfO8TKeD88ehfbhk5Rr/8+opzsMQupZaSZeYsjeA9S5OvMjqZAx7zFDazMr InjFk2ED47PuytU5aSO4RWFI9fdEgZTGRUMJwjQD96lmhkhUN4XM+iN4kGkb1Tm5b8ni lK7p269Ly+dR3hWz5e5OQJiKC1kYiNRNDEQM+uHDejlW3VjSTAFQTLMPcOU+ZBikZU34 81PrA5vKgmC9qRGNfoI63AA6Zch9svofltDf6RSppT2GoaMZXnk9642vI8FRRJ3JU2X0 L60w== X-Gm-Message-State: APjAAAVyKpe9g9+yM6RCHKLnvO29RqnnnOxp2EUM/1sy7/6i7Q7GlamC OJOc0KYZWKPG928i6aEadI8GPrNxhQA= X-Received: by 2002:a65:53cb:: with SMTP id z11mr1365272pgr.200.1564647670832; Thu, 01 Aug 2019 01:21:10 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id w4sm90742508pfn.144.2019.08.01.01.21.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 01:21:10 -0700 (PDT) From: Viresh Kumar To: stable@vger.kernel.org Cc: Viresh Kumar , Julien Thierry , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Marc Zyngier , Mark Rutland , Will Deacon , Russell King , Vincent Guittot , mark.brown@arm.com, guohanjun@huawei.com Subject: [PATCH ARM32 v4.4 V2 37/47] ARM: 8809/1: proc-v7: fix Thumb annotation of cpu_v7_hvc_switch_mm Date: Thu, 1 Aug 2019 13:46:21 +0530 Message-Id: <41ffeadd36b1640c285d4d7b633696cd5ae4f03c.1564646727.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ard Biesheuvel Commit 6282e916f774e37845c65d1eae9f8c649004f033 upstream. 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(). Cc: Fixes: 10115105cb3a ("ARM: spectre-v2: add firmware based hardening") Reviewed-by: Dave Martin Acked-by: Marc Zyngier Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King Signed-off-by: Viresh Kumar --- arch/arm/mm/proc-v7.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.21.0.rc0.269.g1a574e7a288b diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index b6359ce39fa7..90cddff176f6 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -106,7 +106,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