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 X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C46AC4338F for ; Tue, 24 Aug 2021 15:36:56 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id BCBA561357 for ; Tue, 24 Aug 2021 15:36:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BCBA561357 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 411AC4B13C; Tue, 24 Aug 2021 11:36:55 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1hnF407yic5s; Tue, 24 Aug 2021 11:36:50 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F11D64B15E; Tue, 24 Aug 2021 11:36:49 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3F71E4B15E for ; Tue, 24 Aug 2021 11:36:48 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28iCJRx38wts for ; Tue, 24 Aug 2021 11:36:46 -0400 (EDT) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E53C44B13C for ; Tue, 24 Aug 2021 11:36:46 -0400 (EDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5CBC631B; Tue, 24 Aug 2021 08:36:46 -0700 (PDT) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4B10A3F766; Tue, 24 Aug 2021 08:36:45 -0700 (PDT) Subject: Re: [PATCH] arm64: Do not trap PMSNEVFR_EL1 To: Mark Brown References: <20210824132459.562923-1-alexandru.elisei@arm.com> <20210824151015.GB4393@sirena.org.uk> From: Alexandru Elisei Message-ID: <95ae126a-8fc2-1db1-a1fd-d6811644f507@arm.com> Date: Tue, 24 Aug 2021 16:30:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210824151015.GB4393@sirena.org.uk> Content-Language: en-US Cc: maz@kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Mark, On 8/24/21 4:10 PM, Mark Brown wrote: > On Tue, Aug 24, 2021 at 02:24:59PM +0100, Alexandru Elisei wrote: > >> Commit 31c00d2aeaa2 ("arm64: Disable fine grained traps on boot") zeroed >> the fine grained trap registers to prevent unwanted register traps from >> occuring. However, for the PMSNEVFR_EL1 register, the corresponding >> HDFGRTR_EL2.nPMSNEVFR_EL1 field must be 1 to disable trapping. Set the >> field to 1 if FEAT_SPEv1p2 is detected. > Oh, that's a shame :/ I wonder why this feature is different to the > others, I just had a quick check and didn't see any other issues but... > >> Based on v5.14-rc7. Also, we could write 1 << 62 to HDFGRTR_EL2 uncondit= ionally >> since the field is RAZ/WI if !FEAT_SPEv1p2. I don't have a strong prefer= ence for >> either approaches, but I chose this implementation because it's clearer = (even >> though it's more verbose and it's one extra trap on NV). > Yes, the explicit feature check is both clearer and more conservative - > it's unlikely to have a practical impact but = > >> At this point, I am inclined to think it's a model bug because reading w= orks, >> but writing causes a hang and that looks very suspicious to me. I'm goin= g to >> open a model bug internally and see what comes of it. > ...are you sure this isn't that the same issue also exists with the > equivalent field HDFGWTR_EL2 - glancing at the XML it appears to have > the same issue? One of the fine grained aspects of fine grained traps > is that there's separate read and write traps! Yes, you are right, when I read the MSR PMSNEVFR_EL1, pseudocode I mis= sed the fact that for writes the trap is controlled by HDFG*W*TR_EL1, not by HDFG*R*TR_EL1. I set=A0 the nPMSNEVFR_EL1 bit in HDFGWRTR_EL1, and Linux do= esn't hang anymore when I try to write to the register. Will send v2 shortly. Thanks, Alex _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 855A0C4338F for ; Tue, 24 Aug 2021 15:38:51 +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 53BCA61151 for ; Tue, 24 Aug 2021 15:38:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 53BCA61151 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=y36UxyY4MzYxtOFCsO9JUzxAp5RKwyKnrPe6oEQPXvE=; b=D7HLPlZibTnc/ZoaO17QddKyZS buLAQhw817gJWepAAl75qy+2Ym/7VNjfdFivqrqGS3ZCiXU9YHyVvbJZP9U3yFDg7v0X55AREAgPN QUkjz/54K0tJctpOFjXQipw5SxQVP/7P6rg/RFHN/C0v/R+Z1qF5dgSDlMqhU8D4MycrF6/EA8v8k WyeyvWvrgjyZkI4BqyS4x/2zVSxNdaUzmEqYXar3cB71m8E5H+KpdIpf+Ko+KnwycE3qOXDZKdyE6 K8I6vDEX+FkK3ZkcYeLJUL+ofUm2KfXCf23IdJQqaOHft8tPttxOi3HV6MQA/V02NxTfe1TNbc/6k Nip+LPxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIYTt-003ky8-3t; Tue, 24 Aug 2021 15:36:53 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIYTo-003kxA-W5 for linux-arm-kernel@lists.infradead.org; Tue, 24 Aug 2021 15:36:50 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5CBC631B; Tue, 24 Aug 2021 08:36:46 -0700 (PDT) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4B10A3F766; Tue, 24 Aug 2021 08:36:45 -0700 (PDT) Subject: Re: [PATCH] arm64: Do not trap PMSNEVFR_EL1 To: Mark Brown Cc: maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu References: <20210824132459.562923-1-alexandru.elisei@arm.com> <20210824151015.GB4393@sirena.org.uk> From: Alexandru Elisei Message-ID: <95ae126a-8fc2-1db1-a1fd-d6811644f507@arm.com> Date: Tue, 24 Aug 2021 16:30:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210824151015.GB4393@sirena.org.uk> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210824_083649_121245_D1F021E1 X-CRM114-Status: GOOD ( 23.16 ) 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: , Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Mark, On 8/24/21 4:10 PM, Mark Brown wrote: > On Tue, Aug 24, 2021 at 02:24:59PM +0100, Alexandru Elisei wrote: > >> Commit 31c00d2aeaa2 ("arm64: Disable fine grained traps on boot") zeroed >> the fine grained trap registers to prevent unwanted register traps from >> occuring. However, for the PMSNEVFR_EL1 register, the corresponding >> HDFGRTR_EL2.nPMSNEVFR_EL1 field must be 1 to disable trapping. Set the >> field to 1 if FEAT_SPEv1p2 is detected. > Oh, that's a shame :/ I wonder why this feature is different to the > others, I just had a quick check and didn't see any other issues but... > >> Based on v5.14-rc7. Also, we could write 1 << 62 to HDFGRTR_EL2 uncondit= ionally >> since the field is RAZ/WI if !FEAT_SPEv1p2. I don't have a strong prefer= ence for >> either approaches, but I chose this implementation because it's clearer = (even >> though it's more verbose and it's one extra trap on NV). > Yes, the explicit feature check is both clearer and more conservative - > it's unlikely to have a practical impact but = > >> At this point, I am inclined to think it's a model bug because reading w= orks, >> but writing causes a hang and that looks very suspicious to me. I'm goin= g to >> open a model bug internally and see what comes of it. > ...are you sure this isn't that the same issue also exists with the > equivalent field HDFGWTR_EL2 - glancing at the XML it appears to have > the same issue? One of the fine grained aspects of fine grained traps > is that there's separate read and write traps! Yes, you are right, when I read the MSR PMSNEVFR_EL1, pseudocode I mis= sed the fact that for writes the trap is controlled by HDFG*W*TR_EL1, not by HDFG*R*TR_EL1. I set=A0 the nPMSNEVFR_EL1 bit in HDFGWRTR_EL1, and Linux do= esn't hang anymore when I try to write to the register. Will send v2 shortly. Thanks, Alex _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel