Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp171704rdb; Thu, 19 Oct 2023 00:16:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfL5WWtVOtwHlQl0Z1ab3e+3pK1dLJfJkVblymKgldWkOKNspRms41wvEp1amsCE8sK+w8 X-Received: by 2002:a05:6358:ed7:b0:166:f618:cf6a with SMTP id 23-20020a0563580ed700b00166f618cf6amr1144693rwh.27.1697699763650; Thu, 19 Oct 2023 00:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697699763; cv=none; d=google.com; s=arc-20160816; b=Lq4L+/vLp+HkyZmMkIPFr3eQ4CrALA/mGorneglgL8/VSrz7VrN9a6NyeZB+3NV92D bECVdMswqfMkxwPjrwPQ9cvz7qStGd4pAYElH2DCROLoPrlCuzkqOtBR0Qcnpyzu7t/s LBTRCJxuJB8/roa8vIid0kzrrbnoTMW3YZPUAIG8k4GMKBwLCKbcnt1sAF+Bii7mjX1+ ZRTS/CoJ9Yvf/KkFUWkrY7dLWeMYzk3uVlHsP3HCq+TPsnN/mEABaZ61ugFELxls4+z+ FN2oIBPGpo7amKZo8kcS55jlfE9XlTgvwLlt1Btq6/9zOa0/lFafb1ySJCJrRDN98Qat UQ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=jOBtVrmSFvSA6qZ6FmxppWwl2FoqDUB7gUcTEHhwo3k=; fh=H5M+SUWapC/3S02a2TqU9z8XKoVdwzR1WfxqBeup3U8=; b=JWT7qRgVnv8Ks8i1lL5gJ/Ou1+ITA/4tg42Og4/zibEJX7uR6BeMgt8yB4qtrfOgF7 BvBiLYJZHxXoZIJgWLhZ3fGfHmbQ8kBK0XBtecTETEjyhfufLfZMfPqYKPgt1Ti+D2f/ n83L14j/RK3hFgCgiWA04KZDLhwT/H+ialq/ucM9XGQajXznMTlhohjslDmMVFzUMu9c 2Ophhvbwy018U31HVidfW8f+pkVQWcMT/Obhwx2Wq2JLmIaGQ5UJDwPHzjTcDZgKHsnr 6RP3vyXESMIaK940iT2yLEH1K6+PvgjG83lqa1qCLFp29eLVSRt6cjeumkY8kCTUIws+ ln5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WF2pwdCD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id i75-20020a639d4e000000b005a1d8815ec0si3773841pgd.37.2023.10.19.00.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 00:16:03 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WF2pwdCD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D4A2380756D9; Thu, 19 Oct 2023 00:15:23 -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 S232800AbjJSHPP (ORCPT + 99 others); Thu, 19 Oct 2023 03:15:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232788AbjJSHPO (ORCPT ); Thu, 19 Oct 2023 03:15:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54707123 for ; Thu, 19 Oct 2023 00:15:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFD80C433C8; Thu, 19 Oct 2023 07:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697699710; bh=PP+R+qu15Zi7YrcYi4QBuD0RQDJPomxczNjindxBJl0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WF2pwdCDgI3gvtTSRP8HuWN9guaMoGi7Izl/UdFp2Bee6hL+IlQ2qVl9J7cm7AgRP SJlYSSQY0ArpznUWCxPEUXbTXpdls8pXdGAMIRHFgUwbDsPLndahZyNIYnVce1FuQa CXkivjrwhYsqvp0a8A6bB0b4Xa/V4/dqq1aAX+XuN66bkic/0qgFx4mofa9HQv1acp kByR6B84yzrWjrG+RwMLWUPBxRyMkdBGEYpSDK4Q9LbTYNW9TiodIQZvKBNqrMUcjL FzIcPD4/5iV9MVB7DE4dRUds9oq8QpW+picabntLxigwYVmBKpJ8g2oBiKnUo7CnCU 6qWDFEfYhmq1A== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qtNFM-005eAG-1Y; Thu, 19 Oct 2023 08:15:08 +0100 Date: Thu, 19 Oct 2023 08:15:03 +0100 Message-ID: <8734y76q2w.wl-maz@kernel.org> From: Marc Zyngier To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Oliver Upton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: Independently update HDFGRTR_EL2 and HDFGWTR_EL2 In-Reply-To: References: <20231018030007.1968317-1-anshuman.khandual@arm.com> <86r0lsm7cq.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 00:15:24 -0700 (PDT) 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. Thanks, M. -- Without deviation from the norm, progress is not possible.