Message ID | 20211021134530.206216-3-leo.yan@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=6Q0g=PJ=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AB7CC433EF for <linux-arm-kernel@archiver.kernel.org>; Thu, 21 Oct 2021 13:47:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF4A560F59 for <linux-arm-kernel@archiver.kernel.org>; Thu, 21 Oct 2021 13:47:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BF4A560F59 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LwAU3e81Tdm7JwNPlUG7s5v0aemH255wQovxugGPnAM=; b=4MeTZoBN0wsH0z gAYIWzU6a8oGUsLwsEotfYFevCRhvodmwMHNUIfCQkyOTHOUuVi1S82p04O5nnJ3WqjOsni2JlLp4 dWPuuTcFXOi5OJcBkR7HI7Y/pqszf+Vriir92vJZgHKMt2+rp/3eqfn8D8A2dTdHsYRvagI1fxyM7 cCl80ErgnycIolYdItzfOOw5FfqZYFUonrp4gYFbcPAUMpXVub/5/s4it0aOs5c0OMidqyd9wDyTT IQSbzxqM1nPORQgviG5h7XoVSP2QWMF/xTSD4suScEWT61K5hwGconwg4XV7dBy9X920yLAbPgsKy itxQHOk6VHLDgNbUG5sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdYOZ-007geZ-5t; Thu, 21 Oct 2021 13:46:11 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdYOC-007gXW-Ky for linux-arm-kernel@lists.infradead.org; Thu, 21 Oct 2021 13:45:50 +0000 Received: by mail-pl1-x630.google.com with SMTP id i5so445171pla.5 for <linux-arm-kernel@lists.infradead.org>; Thu, 21 Oct 2021 06:45:48 -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=C4YhQIiG/VVRYQyoXQKHZiWpfOu0OLjbGvCY/d59nFU=; b=HlmJX7TRx4UG0ncPN6Qe3EXnk2ZF9DqLFJphH7uq5N7ZIMVDkvlFe3OwfVkzv+jOUX nEDYcNKn4FiMGpSyH9MwVHOjHjmj/xJwjp42QY85oyBxzOp3Lfi+oyWc4CCwbsr/h1VR ZZ5f7OSp4EysK8w2Ca20O+4hNrZOXf2w4wqak+Z1N/vLht/egXfxz5WzI9ZalH/lUvC+ nTVD9dOb5T+i2eO4DGb3yPVbHOT2JcUv4xEZ/LSjuG+2BUNPjSk4+GZK6l+QMLfHUw7D agQLiL+7qyQzFutls43OjUocmcdw64gKS0AWCnKD47K7Pp7YDIOW73Lxd6Kl0f+KTK+C UJ/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C4YhQIiG/VVRYQyoXQKHZiWpfOu0OLjbGvCY/d59nFU=; b=qDZZkyt12IW2umw+JvyWtp3Qn7HSG12ohjW37M1w/CyLFd7ovm026BeCEjI950DZ+l 9JzzhQLbmckx9bJVhzZ6emOneE1tzFWOEJIlrguGGUvnMAJ+jU/vSlwtROp9jOalN6MB ekH7qS9vigCdHUfcF+q4Zb937biGCmQDF/aAmYVc1+vfdRMbtG307OV0hf1bNb8ZrMmy ZovmIybdNZLhDS8SauW1fmDtrkmRUUxWlJDOPjUlboDJ+0EW6OkVPHsKyKyRpKf3HNdi stSYtOyA3qrViMbt9aSR0XGeX/wMcXluC6UEowdI5mX9dTxS7Xvv3LzJRT5sVG5k9Lv+ +aKw== X-Gm-Message-State: AOAM532pMM3x2gHHF7qaN5nBKhjK413zpAmK7dhUc0mJeAqCYCZhhDiX C7jnnP/gx1vUxW812aYLE6Ok8w== X-Google-Smtp-Source: ABdhPJwvwIGLuEN95nh+Hdt3OX1LVT7d/V/k3x5/tuTpUkDCBpOM1BJzR/hzpYqZkA7GOoyte5YkgA== X-Received: by 2002:a17:902:b213:b0:13e:cd44:b4b5 with SMTP id t19-20020a170902b21300b0013ecd44b4b5mr5250651plr.18.1634823948002; Thu, 21 Oct 2021 06:45:48 -0700 (PDT) Received: from localhost ([103.127.241.129]) by smtp.gmail.com with ESMTPSA id g16sm1370633pfv.192.2021.10.21.06.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 06:45:47 -0700 (PDT) From: Leo Yan <leo.yan@linaro.org> To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Kees Cook <keescook@chromium.org>, Ard Biesheuvel <ardb@kernel.org>, Sami Tolvanen <samitolvanen@google.com>, Nicholas Piggin <npiggin@gmail.com>, James Morse <james.morse@arm.com>, Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Peter Collingbourne <pcc@google.com>, Vincenzo Frascino <vincenzo.frascino@arm.com>, "Peter Zijlstra (Intel)" <peterz@infradead.org>, Stephane Eranian <eranian@google.com>, James Clark <james.clark@arm.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Leo Yan <leo.yan@linaro.org> Subject: [RFCv1 2/4] arm64: entry: Always apply workaround for contextidr_el1 Date: Thu, 21 Oct 2021 21:45:28 +0800 Message-Id: <20211021134530.206216-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021134530.206216-1-leo.yan@linaro.org> References: <20211021134530.206216-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211021_064548_751173_659CE77E X-CRM114-Status: GOOD ( 12.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
arm64: Use static key for PID in CONTEXTIDR
|
expand
|
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index bc6d5a970a13..c41a4cfff527 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -356,12 +356,8 @@ alternative_else_nop_endif #ifdef CONFIG_ARM64_ERRATUM_845719 alternative_if ARM64_WORKAROUND_845719 -#ifdef CONFIG_PID_IN_CONTEXTIDR mrs x29, contextidr_el1 msr contextidr_el1, x29 -#else - msr contextidr_el1, xzr -#endif alternative_else_nop_endif #endif 3:
After introducing static key as the switch for tracing PID into contextidr_el1, the kernel can dynamically turn on the static key to use PID tracing to contextidr_el1. This means even the config CONFIG_PID_IN_CONTEXTIDR is not selected, the kernel still can use contextidr_el1. When erratum 84571 is detected, the workaround should be always applied on contextidr_el1, particularly if the static key is enabled dynamically. This patch would introduce minor overload by one extra instruction for accessing system register contextidr_el1 and it only impacts platform which erratum 84571. So it's expected to not cause any significant regression. Signed-off-by: Leo Yan <leo.yan@linaro.org> --- arch/arm64/kernel/entry.S | 4 ---- 1 file changed, 4 deletions(-)