From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5FCFAEB64D7 for ; Tue, 20 Jun 2023 19:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:Reply-To:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gLM6TpoQ4N4IydBYpW1s3i+AR1B2PTA1j1G0jN6b2QU=; b=k9Z6J9IdKJSBYN 0QYX8hu0SeRZTHY1Kfp1ALqxUqT6z0Gn0/5KBp92CayB6xMn0FYVfswSuADTNug3I+9lfSHJcvpAc s3NqRwa3rsZhnuGxINwGLFBYO8StkHXZMHSYXVP4Ld8/TRuue2deo4xHXiP74hnA1eSMiHjKFv3nJ 1n32Y4Xi5J0snY/iTDpidh64MVH8BvKI4J9dLc2hhoNOYKnkUgNA8Q8D+uy5IkTtG+IlZdN/zoxCc 1gYFSZSz4vpsR0nCtqP2P6IbeTpawbrDrvIjvniZTkyAtzsPKQCpSfKR5j+AGux1EUQqbZmLIB+QS 6jp4BIWH8UIZLIEQMK3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBgpp-00C9tm-2l; Tue, 20 Jun 2023 19:16:13 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBgpm-00C9tD-17 for linux-arm-kernel@lists.infradead.org; Tue, 20 Jun 2023 19:16:12 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f9b4a715d9so17121645e9.0 for ; Tue, 20 Jun 2023 12:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687288567; x=1689880567; h=content-transfer-encoding:in-reply-to:organization:from:reply-to :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=1mD9I4nNUeLdpFMPXDPLZezt3lAmxRCFthasDSn18PM=; b=jQatyIPfnr/GickdR7M/CtBDgpq4n7sh4fxj3o6rLZC8wXSl2AZ+NVsLiurfcJLHZA 6R3OYfuzsABcvRqOCx95ad8ZP3zYE6IULkEuIz0vtbXOfZNi4i8C+hyEqnF5SRV0vpGh 6kOdq6bMnkRcvyf/I2fSIlh/deQwwzKyz6UibaBm3ZXfMNVk14JjfETuelBgbQnGuqIe fko71Fi3fRkdWn+GWHYzjD8mBAOE4jxV4JyFYaMQYvt9PVMMT/K0oKrtyuxqui+LuO9+ aro/E3Srf7h6StIyYzG6jj/EI3MwWIsYh1QyIl9kXtAzONDOScRDlSfOB9GpTaHs+23c gI9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687288567; x=1689880567; h=content-transfer-encoding:in-reply-to:organization:from:reply-to :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1mD9I4nNUeLdpFMPXDPLZezt3lAmxRCFthasDSn18PM=; b=CUrZUOIQCQz/N/hfyXVUZIkb9J1tTC73DSq58/deITLIYBK6YFgCmyArSLtJGlbfBw cH8CIuzZBZ9gvZ19iTaYYF6EjYl3WUiDofAoZRXB3FOnd6RpWWrF8ZwwOMu1wqnXsYLG 0ynZuzygleijiZYyzW26GpZPnW1+wLnp2/+7vV77PDJA0a+HXEQVp1KCSlVi+nzYW6Yc 4wto6QfdV7Re3RLY8oyjL25GKG9bB3fnCiJP2IEFj0APssxYoEoKjYVglSNLfHFgz9JT 7ioOHzgrpyKCcZhiq6DAvYBZhW+y/xxpFalnQceCu/qhWdluerLz41FhUT64FjCcpa++ 6yWw== X-Gm-Message-State: AC+VfDzmoDOP8oc+h74NYgu9yGmtegKcRbR2G4Pjjp0hI7kh+IukzJeH sBWnGatD6P8hwC2u92HOhj4wNA== X-Google-Smtp-Source: ACHHUZ7Wi8jQlrG/8Tz7cerVxiBskvE3mDHqDqzUD9L4DdnQLhDyZnlNN8q1ba1lOxGKAY/occt7pQ== X-Received: by 2002:a05:600c:3b97:b0:3f9:b535:381a with SMTP id n23-20020a05600c3b9700b003f9b535381amr3743255wms.10.1687288567444; Tue, 20 Jun 2023 12:16:07 -0700 (PDT) Received: from ?IPV6:2a01:e0a:982:cbb0:496f:4432:b5b2:1b3b? ([2a01:e0a:982:cbb0:496f:4432:b5b2:1b3b]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c231100b003f8ec58995fsm3063313wmo.6.2023.06.20.12.16.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Jun 2023 12:16:07 -0700 (PDT) Message-ID: Date: Tue, 20 Jun 2023 21:16:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v4 16/20] arm64: enable Permission Indirection Extension (PIE) Content-Language: en-US To: Joey Gouly , linux-arm-kernel@lists.infradead.org, Bjorn Andersson Cc: nd@arm.com, broonie@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, mark.rutland@arm.com, maz@kernel.org, oliver.upton@linux.dev, shuah@kernel.org, suzuki.poulose@arm.com, will@kernel.org, yuzenghui@huawei.com, linux-arm-msm References: <20230606145859.697944-1-joey.gouly@arm.com> <20230606145859.697944-17-joey.gouly@arm.com> From: Neil Armstrong Organization: Linaro Developer Services In-Reply-To: <20230606145859.697944-17-joey.gouly@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230620_121610_392030_0672209D X-CRM114-Status: GOOD ( 15.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: neil.armstrong@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Joey, On 06/06/2023 16:58, Joey Gouly wrote: > Now that the necessary changes have been made, set the Permission Indirection > registers and enable the Permission Indirection Extension. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Catalin Marinas This patch on linux-next causes a great amount of: X xxx.xxxxxx Emulated RAZ for ID register: ISS 0x36002f messages printed by the system firmware on the Qualcomm SM8550 SoC, and the platform is barely usable. Here is the SoC cpuinfo for reference: # cat /proc/cpuinfo processor : 0 BogoMIPS : 38.40 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x1 CPU part : 0xd46 CPU revision : 1 processor : 1 BogoMIPS : 38.40 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x1 CPU part : 0xd46 CPU revision : 1 processor : 2 BogoMIPS : 38.40 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x1 CPU part : 0xd46 CPU revision : 1 processor : 3 BogoMIPS : 38.40 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x1 CPU part : 0xd4d CPU revision : 0 processor : 4 BogoMIPS : 38.40 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x1 CPU part : 0xd4d CPU revision : 0 processor : 5 BogoMIPS : 38.40 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x2 CPU part : 0xd47 CPU revision : 0 processor : 6 BogoMIPS : 38.40 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x2 CPU part : 0xd47 CPU revision : 0 processor : 7 BogoMIPS : 38.40 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x1 CPU part : 0xd4e CPU revision : 0 The bisect log for reference: # bad: [925294c9aa184801cc0a451b69a18dd0fe7d847d] Add linux-next specific files for 20230615 # good: [858fd168a95c5b9669aac8db6c14a9aeab446375] Linux 6.4-rc6 git bisect start 'FETCH_HEAD' 'v6.4-rc6' # bad: [c20f7e5e521ee3f50b064cdb441f65075ca6eb17] Merge branch 'nand/next' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git git bisect bad c20f7e5e521ee3f50b064cdb441f65075ca6eb17 # bad: [9b3c3144b2d3b5022370883e2834887fc7f3d5d3] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git git bisect bad 9b3c3144b2d3b5022370883e2834887fc7f3d5d3 # bad: [8a2e6adeea094195f860f1f5dd799c9f0015dd92] Merge branch 'at91-next' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git git bisect bad 8a2e6adeea094195f860f1f5dd799c9f0015dd92 # good: [4f826d17f9de4d708f2c07bb40a104426a22b384] Merge branch 'mm-everything' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm git bisect good 4f826d17f9de4d708f2c07bb40a104426a22b384 # good: [62f97a067a7e77fd2016ce7d413fceaaf5882385] Merge branch 'for-next' of git://git.infradead.org/users/hch/dma-mapping.git git bisect good 62f97a067a7e77fd2016ce7d413fceaaf5882385 # good: [e5047345bb6c8ee1e5d319c989dc9e3442f891c7] soc: document merges git bisect good e5047345bb6c8ee1e5d319c989dc9e3442f891c7 # good: [cca5c2136d9ca679a9b0cdb51ce64c79cd7c092c] Merge branches 'for-next/kpti', 'for-next/missing-proto-warn', 'for-next/iss2-decode', 'for-next/kselftest', 'for-next/misc', 'for-next/feat_mops', 'for-next/module-alloc', 'for-next/sysreg', 'for-next/cpucap', 'for-next/acpi', 'for-next/kdump' and 'for-next/acpi-doc' into for-next/core git bisect good cca5c2136d9ca679a9b0cdb51ce64c79cd7c092c # bad: [b6719d317df3ab47dc86776c499fc1e2009e1b37] Merge branch 'for-next/core' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux git bisect bad b6719d317df3ab47dc86776c499fc1e2009e1b37 # bad: [ee053e03b08e1b287d9a43152e4623a04cb24fe6] KVM: selftests: get-reg-list: support ID register features git bisect bad ee053e03b08e1b287d9a43152e4623a04cb24fe6 # good: [86f9de9db1783b32e8812fe21c2c8cf02cf911ff] KVM: arm64: Save/restore PIE registers git bisect good 86f9de9db1783b32e8812fe21c2c8cf02cf911ff # good: [7df7170965a28c61f80a57b655b0cc10adb88ab9] arm64: disable EL2 traps for PIE git bisect good 7df7170965a28c61f80a57b655b0cc10adb88ab9 # bad: [9e9bb6ede00a84275b65bb8d00812c1e24b5fa7e] arm64: enable Permission Indirection Extension (PIE) git bisect bad 9e9bb6ede00a84275b65bb8d00812c1e24b5fa7e # good: [eeda243dfeb996fe236c624796630c16237a18d6] arm64: add encodings of PIRx_ELx registers git bisect good eeda243dfeb996fe236c624796630c16237a18d6 # first bad commit: [9e9bb6ede00a84275b65bb8d00812c1e24b5fa7e] arm64: enable Permission Indirection Extension (PIE) Thanks, Neil > --- > arch/arm64/mm/proc.S | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S > index 9513a8d2ce0e..2baeec419f62 100644 > --- a/arch/arm64/mm/proc.S > +++ b/arch/arm64/mm/proc.S > @@ -454,6 +454,21 @@ SYM_FUNC_START(__cpu_setup) > #endif /* CONFIG_ARM64_HW_AFDBM */ > msr mair_el1, mair > msr tcr_el1, tcr > + > + mrs_s x1, SYS_ID_AA64MMFR3_EL1 > + ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4 > + cbz x1, .Lskip_indirection > + > + mov_q x0, PIE_E0 > + msr REG_PIRE0_EL1, x0 > + mov_q x0, PIE_E1 > + msr REG_PIR_EL1, x0 > + > + mov x0, TCR2_EL1x_PIE > + msr REG_TCR2_EL1, x0 > + > +.Lskip_indirection: > + > /* > * Prepare SCTLR > */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel