Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp199992rdb; Thu, 19 Oct 2023 01:31:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGH+SQGDUpuBJDvoV2eX6FUpCk0Y/7LgtEC5CK95o3NMXGEhIt1DF48+lGXBywF6fvosWhK X-Received: by 2002:a05:6870:11d7:b0:1e9:c28f:45ba with SMTP id 23-20020a05687011d700b001e9c28f45bamr1674252oav.16.1697704311332; Thu, 19 Oct 2023 01:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697704311; cv=none; d=google.com; s=arc-20160816; b=BTo/X1iy5vmg3bk37M5NaRlDu8zBAWtqidmz+NMCGu7WYfVfc3H8RmBKKO//gNtyeL GNCMLvFHuZKk74j160r4HO+2f3dsh7w94cQhtITZaLLfa995CM2qyBHiyJltUUwPZ8mZ M8K5ColYf1TnyIFn/pPyYNwsCXwmXkjrBYrckNZTnZUDFT2PkHRRLXaWYOXA3u0ILAEj MoOMIdg58B8vHm44ZnQwVhw3OwEY5WLoUmSkmN2/bLyRTCgP5vg26Emx1qSptrSbnQ2V U9sQMV0k/cyMG0MjSPYRmIpkilI1ORqamxKqOE3734lFkRY4vrrK5GdwPeqRjl05vRZc +Svg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=k6JcDHJp545eY8IVREhkPZ3E+LMhsiXqfTVn7TRU424=; fh=POw2JMHpEj10GmITKbApXtlA5QsI9X0B+vj+VrlicvY=; b=bl+kZevFm4CFTz5FzeNKdJr9yN2xg7xovyICMLw0ouZ5ettvT7CCh/ndxHT2l8AGT+ c8qe95Fmw6xlCM9rN5gxrLdpjuTOYjmiKs2kq2IxhO+CT6U2bgjM8WoJCy1riTppxtYE wRjoRFD5LXfUPEb2l+fg9iFcCvPLBApdCqiEqIAlbQn2uoEwrpBMyUjB+Ec+Jyo8Wkan 4gSbKWn4MDkj2IsXuhOOn0AMa3WZLTu7ytgT/ErPYKaobXCu+ftijkM5aIe/BvI3XhqF xT/6ETstMZ+MR7VB+jdTJfAwqHzbUSKXdQRTFjj4Yw0hNEdQMkLZPOLc7d6HjvZ+mYUS NKKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ck3-20020a056a02090300b00588fdd9504bsi4232021pgb.858.2023.10.19.01.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 01:31:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 004968225C8F; Thu, 19 Oct 2023 01:31:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344904AbjJSIbk (ORCPT + 99 others); Thu, 19 Oct 2023 04:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232383AbjJSIbj (ORCPT ); Thu, 19 Oct 2023 04:31:39 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 29FB711F for ; Thu, 19 Oct 2023 01:31:37 -0700 (PDT) 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 CCFD82F4; Thu, 19 Oct 2023 01:32:17 -0700 (PDT) Received: from [10.163.36.185] (unknown [10.163.36.185]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C4F8F3F762; Thu, 19 Oct 2023 01:31:34 -0700 (PDT) Message-ID: <96e31c6a-8de6-43dd-842e-ca56146d91d0@arm.com> Date: Thu, 19 Oct 2023 14:01:31 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm64: Independently update HDFGRTR_EL2 and HDFGWTR_EL2 To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Oliver Upton , linux-kernel@vger.kernel.org References: <20231018030007.1968317-1-anshuman.khandual@arm.com> <86r0lsm7cq.wl-maz@kernel.org> <8734y76q2w.wl-maz@kernel.org> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <8734y76q2w.wl-maz@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 19 Oct 2023 01:31:48 -0700 (PDT) On 10/19/23 12:45, Marc Zyngier wrote: > On Thu, 19 Oct 2023 04:36:15 +0100, > Anshuman Khandual wrote: >> >> >> >> On 10/18/23 18:10, Marc Zyngier wrote: >>> On Wed, 18 Oct 2023 04:00:07 +0100, >>> Anshuman Khandual wrote: >>>> >>>> Currently PMSNEVFR_EL1 system register read, and write access EL2 traps are >>>> disabled, via setting the same bit (i.e 62) in HDFGRTR_EL2, and HDFGWTR_EL2 >>>> respectively. Although very similar, bit fields are not exact same in these >>>> two EL2 trap configure registers particularly when it comes to read-only or >>>> write-only accesses such as ready-only 'HDFGRTR_EL2.nBRBIDR' which needs to >>>> be set while enabling BRBE on NVHE platforms. Using the exact same bit mask >>>> fields for both these trap register risk writing into their RESERVED areas, >>>> which is undesirable. >>> >>> Sorry, I don't understand at all what you are describing. You seem to >>> imply that the read and write effects of the FGT doesn't apply the >>> same way. But my reading of the ARM ARM is that behave completely >>> symmetrically. >>> >>> Also, what is nBRBIDR doing here? It is still set to 0. What >>> 'RESERVED' state are you talking about? >> >> Let's observe the following example which includes the nBRBIDR problem, >> mentioned earlier. >> >> Read access trap configure >> >> HDFGRTR_EL2[59] - nBRBIDR >> HDFGRTR_EL2[58] - PMCEIDn_EL0 >> >> Write access trap configure >> >> HDFGWTR_EL2[59:58] - RES0 >> >> Because BRBIDR_EL1 and PMCEID_EL0 are read only registers they don't >> have corresponding entries in HDFGWTR_EL2 for write trap configuration. >> >> Using the exact same value contained in 'x0' both for HDFGRTR_EL2, and >> HDFGWTR_EL2 will be problematic in case it contains bit fields that are >> available only in one of the registers but not in the other. >> >> If 'x0' contains nBRBIDR being set, it will be okay for HDFGRTR_EL2 but >> might not be okay for HDFGWTR_EL2 where it will get into RESERVED areas. > > None of which matters for this patch. You keep arguing about something > that does not exist in the change you're proposing. > > [...] > >> I should have given more details in the commit message but hope >> you have some context now, but please do let me know if there >> is something still missing. > > What is missing is a useful patch. This one just obfuscates things for > no particular purpose. If you have a useful change to contribute, > please send that instead (your BRBE change). We don't need an extra, > standalone and pointless patch such as this one. I will fold this patch with other BRBE changes as mentioned earlier but thought that - separating out updates for HDFGRTR_EL2, and HDFGWTR_EL2 should be done as stand alone change in a preparatory patch. Seems like that was an incorrect assumption.