Received: by 10.223.185.116 with SMTP id b49csp7391865wrg; Thu, 1 Mar 2018 04:57:40 -0800 (PST) X-Google-Smtp-Source: AG47ELssDtxQzj5Xw1ajVt7Ikd7SDPm0kge8aYb/rNzgv8bsOUO0PWdKvdWkR/phW4KaAJYjE0jw X-Received: by 2002:a17:902:9898:: with SMTP id s24-v6mr1845686plp.382.1519909060158; Thu, 01 Mar 2018 04:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519909060; cv=none; d=google.com; s=arc-20160816; b=rH8QBqHxIOuzfWrm6PxhocP1/ybHN7ZP5lpfr1fIG3aGDJtWa7JBaslACdXMfFsC3Q 2F5ZYoqVqfnI0MopBD/OokxTemARg0zj/dU5v0dYzEVp6oZdZgxKuNWiwIQPgbRCkVmP IKkcnc4HB2dwA01EY69rPKN8DdWDbQVIJ4LYzhsmFJCxdgiEKUZ6dRkBLb7EAZLyw/UP EiNM710RFXPkToGHp9ZoNRhqdNK9M7babu9iiM5D6jlF2tKPxDmSPTdBkyfeWiGsiG6x DZewn8g3RlDYv0nXAA9pGthRm3WzNlxw45lmlOriYHY+dcBcX07fFgXO86RCuGRCjL/C ZCrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=1Y8BanaJo1dWq0GIhEtFd/7ONzz9WFIJLPbGyXUfe10=; b=UQNdQlwQnuN07IWkGHfmuoXA792OsiDxxN9eYWJI2NC5VN5J730nBKZLegSF+ACUEs ozVBnF2I0tS+KUD93kC3nVxnDfJZWZLPt5dxsKKOteDOImBgqHea+BpLT4Eu+iRSg33C Vfk3y01qkWdVMe1/IxqjZ+b4CeCCuCkCpicnIpxfZyk5YQxWi1A9RWXG+3I2kYKO0wZq JIXBf09vokHIZBlux4MoCh2kPYB9O5cdDuKgxPkfpEdmznNugX01CDLyk7l+2ZQ+c0c7 ID3Srg0Joul1yTgsNEdxwN/ilCoIceSyzYBGvC8hFinXgRtTVKZiPoTObRqstpOSZaw2 CN2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iJNPwsm5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 t8si2966391pfi.168.2018.03.01.04.57.25; Thu, 01 Mar 2018 04:57:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=iJNPwsm5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1030691AbeCAM4J (ORCPT + 99 others); Thu, 1 Mar 2018 07:56:09 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:36076 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030568AbeCAM4G (ORCPT ); Thu, 1 Mar 2018 07:56:06 -0500 Received: by mail-pl0-f66.google.com with SMTP id 61-v6so3593445plf.3 for ; Thu, 01 Mar 2018 04:56:06 -0800 (PST) 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; bh=1Y8BanaJo1dWq0GIhEtFd/7ONzz9WFIJLPbGyXUfe10=; b=iJNPwsm5RYUN+7lvaEDqUyfARuBi++8KzenaenRDM7kaPMoFj481PAc6dhCteFwK1L LU561UBY1VHvfo3+VaVqVaKXGlrVVw8WVdDaVa2Gx4aCyiKQRq2yBmzA61CLX53af0Kv I5SiiqUZ+PUsF05KOXZQtAvslfxP4UGh7o+lM= 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; bh=1Y8BanaJo1dWq0GIhEtFd/7ONzz9WFIJLPbGyXUfe10=; b=OP/mbRQkjideO+3QjirgoIBpRy1sEeS8dcbGgjAMb5P30HATMV4C8ein3UaKREetcs uplQoWrFfThn1Ci3vPlpyg72ocAU470P5AyNPFoOxCLpvOGOI5LywXb1EdgtlU/rcUMa suOko61TkftDjK8B/HZ/MP4TVLu7ACft7w9JJl20GjIZZ5IMsfdalEVdn5UqikWoUL/k 6+VkTYT3QI9+PtYdU79lx5FWfho2UCeVYtd77Vhtnk+bl0yl6Wv8TQlGpdJG5+Wb4iHu 7MScsaWPd6NFgXG6ikdO+GHrv5ymx4LVdwN/8lP27y0Hl0Vt4MYnsAqsmgVYf0dwt++w GWpg== X-Gm-Message-State: APf1xPAfdeaqUOJp3fvkWXhLua3Uu/nXoU8TInGmW95tEljuxk650swU yTYFkrMYpVZJg6RT6eMcDjWBew== X-Received: by 2002:a17:902:b690:: with SMTP id c16-v6mr1888625pls.264.1519908966243; Thu, 01 Mar 2018 04:56:06 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id x4sm2289655pfb.46.2018.03.01.04.55.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 04:56:05 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: James Morse , Kees Cook , Alex Shi Subject: [PATCH 07/45] arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro Date: Thu, 1 Mar 2018 20:53:44 +0800 Message-Id: <1519908862-11425-8-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> References: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Catalin Marinas commit f33bcf03e6 upstream This patch takes the errata workaround code out of cpu_do_switch_mm into a dedicated post_ttbr0_update_workaround macro which will be reused in a subsequent patch. Cc: Will Deacon Cc: James Morse Cc: Kees Cook Reviewed-by: Mark Rutland Signed-off-by: Catalin Marinas Signed-off-by: Alex Shi --- arch/arm64/include/asm/assembler.h | 13 +++++++++++++ arch/arm64/mm/proc.S | 6 +----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 8760300..ab3a179 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -420,4 +420,17 @@ alternative_endif movk \reg, :abs_g0_nc:\val .endm +/* + * Errata workaround post TTBR0_EL1 update. + */ + .macro post_ttbr0_update_workaround +#ifdef CONFIG_CAVIUM_ERRATUM_27456 +alternative_if ARM64_WORKAROUND_CAVIUM_27456 + ic iallu + dsb nsh + isb +alternative_else_nop_endif +#endif + .endm + #endif /* __ASM_ASSEMBLER_H */ diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 352c73b..c2adb0c 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -136,11 +136,7 @@ ENTRY(cpu_do_switch_mm) bfi x0, x1, #48, #16 // set the ASID msr ttbr0_el1, x0 // set TTBR0 isb -alternative_if ARM64_WORKAROUND_CAVIUM_27456 - ic iallu - dsb nsh - isb -alternative_else_nop_endif + post_ttbr0_update_workaround ret ENDPROC(cpu_do_switch_mm) -- 2.7.4