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=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 8DD21C433E0 for ; Mon, 15 Mar 2021 17:05:00 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 1DA6C64DE0 for ; Mon, 15 Mar 2021 17:05:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DA6C64DE0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p3e3MjXEHLZJUBBnTWbkHd7CtQc8ZFYS2QuHmjTFvhc=; b=KJufFRwCMlDzjQebdbn+R+BLR Knxn/SFLs0E6e0zm1NgHXS18r8YL20Vp2NzrB0SznrkYYOUR/GGmCa9/Uyj+Pes4ms5/lFN2bOeqj d+1caAO0gB3Rii+cagoEKNwTre/gMYKwTKLVwVRFsyFZEPIs1W8iF8n8nCzPC6keYz0EhVjbzDhpI w3+KjKv30m0YYLM6E+HIb6dy9nExrimixb9uJexBnYIUH9B6v3KcW/Oc5pOG1FgdDhYkKpr+BVjgq 0/IEP5TaQS0cxuw+bMalpYPEKwxsBEmp0mOGstU0Xbw8kboRu7pH8t/hUHKpZbOncRnyDqwM2Kr9C iS5m9Vp0Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLqck-00GRP9-JH; Mon, 15 Mar 2021 17:03:22 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLqcg-00GRNT-1Y for linux-arm-kernel@lists.infradead.org; Mon, 15 Mar 2021 17:03:19 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8F83764D9A; Mon, 15 Mar 2021 17:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615827796; bh=mQMzN2WAIpvMXAy9wRcyfDHn8betfQjTx6sPWE5hfOY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OauwNRykO0ltPWn1LrX9v3BP/5+tkjyQSzPhZ5T4OCEZvlIqijFKy/3lKoBsmOF2U rl0izM5DcoKA893WVk1Iu9srMke7oltRYGYKPo/dzCewyArFSbMlT5rtxXUfoBvEgK 1cu83oCMRijYcrO3tEv50MnKxkwfJDIzQQZ2D1K+vQoIQWujzpFcCbfoQl94BLW3/V Zewyd9EV+odYwtSeUOaqiWSO3WSe8qYjnajRMlPwxTAzT+iHmAIqccNDNLtulypqZ9 wbzy/dqMJvcG/f1pcie66L/IV8n+sGowT4+xQbk6fwHRs1zPVlF1fvjtXSr+xBwD7y NAfPddGD3+6Dg== Date: Mon, 15 Mar 2021 17:03:10 +0000 From: Will Deacon To: Quentin Perret Cc: catalin.marinas@arm.com, maz@kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, android-kvm@google.com, seanjc@google.com, mate.toth-pal@arm.com, linux-kernel@vger.kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, kvmarm@lists.cs.columbia.edu, tabba@google.com, ardb@kernel.org, mark.rutland@arm.com, dbrazdil@google.com Subject: Re: [PATCH v5 14/36] KVM: arm64: Provide __flush_dcache_area at EL2 Message-ID: <20210315170310.GI3430@willie-the-truck> References: <20210315143536.214621-1-qperret@google.com> <20210315143536.214621-15-qperret@google.com> <20210315163322.GE3430@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210315_170318_258565_094F1309 X-CRM114-Status: GOOD ( 28.64 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 15, 2021 at 04:56:21PM +0000, Quentin Perret wrote: > On Monday 15 Mar 2021 at 16:33:23 (+0000), Will Deacon wrote: > > On Mon, Mar 15, 2021 at 02:35:14PM +0000, Quentin Perret wrote: > > > We will need to do cache maintenance at EL2 soon, so compile a copy of > > > __flush_dcache_area at EL2, and provide a copy of arm64_ftr_reg_ctrel0 > > > as it is needed by the read_ctr macro. > > > > > > Signed-off-by: Quentin Perret > > > --- > > > arch/arm64/include/asm/kvm_cpufeature.h | 2 ++ > > > arch/arm64/kvm/hyp/nvhe/Makefile | 3 ++- > > > arch/arm64/kvm/hyp/nvhe/cache.S | 13 +++++++++++++ > > > arch/arm64/kvm/sys_regs.c | 1 + > > > 4 files changed, 18 insertions(+), 1 deletion(-) > > > create mode 100644 arch/arm64/kvm/hyp/nvhe/cache.S > > > > > > diff --git a/arch/arm64/include/asm/kvm_cpufeature.h b/arch/arm64/include/asm/kvm_cpufeature.h > > > index 3fd9f60d2180..efba1b89b8a4 100644 > > > --- a/arch/arm64/include/asm/kvm_cpufeature.h > > > +++ b/arch/arm64/include/asm/kvm_cpufeature.h > > > @@ -13,3 +13,5 @@ > > > #define KVM_HYP_CPU_FTR_REG(name) extern struct arm64_ftr_reg kvm_nvhe_sym(name) > > > #endif > > > #endif > > > + > > > +KVM_HYP_CPU_FTR_REG(arm64_ftr_reg_ctrel0); > > > > I still think this is a bit weird. If you really want to macro-ise stuff, > > then why not follow the sort of thing we do for e.g. per-cpu variables and > > have separate DECLARE_HYP_CPU_FTR_REG and DEFINE_HYP_CPU_FTR_REG macros. > > > > That way kvm_cpufeature.h can have header guards like a normal header and > > we can drop the '#ifndef KVM_HYP_CPU_FTR_REG' altogether. I don't think > > the duplication of the symbol name really matters -- it should fail at > > build time if something is missing. > > I just tend to hate unnecessary boilerplate, but if you feel strongly > about it, happy to change :) I don't like it either, but I prefer it to overriding macros like this! I think having the "boilerplate" is a better starting point should we decide to consolidate the definitions somehow. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel