Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2058806pxb; Thu, 7 Oct 2021 23:09:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx39dku+wA+GlqX3R2PrdIemJeYrDvjSwykWMQ+BxZISmG5/3BEZ/HkfNaD1Vf9l3LE/ZWb X-Received: by 2002:a62:2c51:0:b029:329:932b:9484 with SMTP id s78-20020a622c510000b0290329932b9484mr8227571pfs.13.1633673347385; Thu, 07 Oct 2021 23:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633673347; cv=none; d=google.com; s=arc-20160816; b=RVz0mvzoKb2ytDXhnOFOPnZ/gZkJXzgt6jS53fYsF1v1I5hr6mqzhKSUZve5iOO0Gz T/gJ0PWH4dj60l25CWPuXI1bD56S4iOppD9XNjlyqIAPnvagZ253sVVIQdhfS5J79ZXl SeM9vSBg3uoL3uRD9oKr51RerMRev62mSEPks6PJA2dliLi2ZmholleFIcZ18d5iqBbs 1U0YfGB/uSr1cBRKVLlsxJfcEiWfaRKDlFZuJTUPoQjvKrK9urHATK1mQS+EZAy0cJIP BlTyYA8iE2+sDKwaAqVtSWP3wZ6XccbQ9q6ytzHCa2PMpCEdFD4ognPux7iMImw+4jFP kfXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from:dkim-signature; bh=HtNb7Tgg0FX/qljbg4W3bUMaXu11sKsG1sEi11NjGME=; b=yYOk8pvNWKg57WD8fucARDcirnL1h+OaOysvIsT8fnlVIWS+neC96dLsK81BuRF+Vu 3LD5veIbzhKl6zh+EUUPCCO6FGaDg9g7qRpSr9a+zSJ0mDv+GqLKQNtVgTErf8K8cupo kEiXNkmnC+mjmP4HYdg4q0Uul4g5mezyoSrylbY0lOM3OQ0k7bGjGMIrQBnll3uIvT26 RjzYMQbUSoZYmJA7F7dMXvQMz3R1qTlKt9NiyulEpkSQ+c/AeWJVla/BzMjfvtpZZtMT upYMwm4X+8HRsno5Y1cjJIKamJhqyO9gPPGdO8bM1jpv7ZVFeZz5QwsFNq61CmswMJL5 f/9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="o/8tZZV1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p11si1736664pls.365.2021.10.07.23.08.54; Thu, 07 Oct 2021 23:09:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="o/8tZZV1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229664AbhJHGKH (ORCPT + 99 others); Fri, 8 Oct 2021 02:10:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbhJHGKF (ORCPT ); Fri, 8 Oct 2021 02:10:05 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D651C061570 for ; Thu, 7 Oct 2021 23:08:10 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id s75so2112084pgs.5 for ; Thu, 07 Oct 2021 23:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id; bh=HtNb7Tgg0FX/qljbg4W3bUMaXu11sKsG1sEi11NjGME=; b=o/8tZZV19jXhzpFd9tEL7D7fkf1vyjW/yB5Dt7N8fLIVyceFJ/yMvT7IGDOgEhQRxX IcwoIYrIPzSIGfhdbM2oHhZh/dNVyQyrLPP6qBB53R61AFkn4zvMp7+nHTg9pnWo3Yfy RSdKxJv8TPSSqBI2JLowqewTEyOQcVCIqBomFNLsi9PGEJjEuZq0iJcuA3sKJ1kahumU 7tIx3tRZp1RXOGXWEm7yDlol9saM1HhMXhJth3ibbH+WLR11HCORkISE9KSAzpCW/Z1E SQRKfhQZ3UuqyCD0/ApNOT+YpHngsfxaKuio8XuoYrwOPIYkleECaNEZYyhzFS5tizWH +IfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id; bh=HtNb7Tgg0FX/qljbg4W3bUMaXu11sKsG1sEi11NjGME=; b=xMrK3QgOSiOY1VUJtJdRXS6tm+/hhfGSEH8nUE8PcxuIdqN8Qe6Sn6Fk3vBY48ectI VqzYPyvgQofeHfnV9dV77oDf2G8CcuPRUzfPEBMW2WjEgVH7FiiTO3Uj5caeY3/F7eJ7 kcoJ2R2iOm6SDRDrbbwCv5w6EDfwd+nr2MWJdJGfc2VxiKSyS5D/BR1HzMqYBzhAHGOr BGow1V3OvXUOQ+Dqp67hfFQf3WQstBwLbMsU9S31F6lX1N772Req6E9oSWSiGXeb6r90 6CJhTTq8YyzHYOU0nWCyX4OSrlUCTXmnHaMEYpffxag8Q7UdgXECK9uCJEzBv0G6Hwvv gOZQ== X-Gm-Message-State: AOAM533Q/GvzkS3/8B9s22Hnhp+fcqgjxxPmpa3s5h/Yu65D+peOOWzN 6/qkHwOUKljGW89zo1qucXSIvD310qk= X-Received: by 2002:aa7:9a1d:0:b0:44c:af89:e24 with SMTP id w29-20020aa79a1d000000b0044caf890e24mr8543328pfj.12.1633673290082; Thu, 07 Oct 2021 23:08:10 -0700 (PDT) Received: from bj03382pcu.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e20sm1291145pfc.11.2021.10.07.23.08.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Oct 2021 23:08:09 -0700 (PDT) From: Huangzhaoyang To: Catalin Marinas , Will Deacon , Mark Rutland , Suzuki K Poulose , Ionela Voinescu , Quentin Perret , Vladimir Murzin , linux-arm-kernel@lists.infradead.org, Zhaoyang Huang , linux-kernel@vger.kernel.org, ke.wang@unisoc.com Subject: [RFC PATCH] arch: ARM64: add isb before enable pan Date: Fri, 8 Oct 2021 14:07:49 +0800 Message-Id: <1633673269-15048-1-git-send-email-huangzhaoyang@gmail.com> X-Mailer: git-send-email 1.7.9.5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhaoyang Huang set_pstate_pan failure is observed in an ARM64 system occasionaly on a reboot test, which can be work around by a msleep on the sw context. We assume suspicious on disorder of previous instr of disabling SW_PAN and add an isb here. PS: The bootup test failed with a invalid TTBR1_EL1 that equals 0x34000000, which is alike racing between on chip PAN and SW_PAN. Signed-off-by: Zhaoyang Huang --- arch/arm64/kernel/cpufeature.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index efed283..3c0de0d 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1663,6 +1663,7 @@ static void cpu_enable_pan(const struct arm64_cpu_capabilities *__unused) WARN_ON_ONCE(in_interrupt()); sysreg_clear_set(sctlr_el1, SCTLR_EL1_SPAN, 0); + isb(); set_pstate_pan(1); } #endif /* CONFIG_ARM64_PAN */ -- 1.9.1