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=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,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 E9E65C4338F for ; Tue, 3 Aug 2021 15:34:01 +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 ACB7160EC0 for ; Tue, 3 Aug 2021 15:34:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ACB7160EC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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: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=z5GhwyKpTXkoZEi6lvFl22zjBHNbWGumIDphYCZubnw=; b=ycpTcWOMl6Ynq6 UvdGI4KDZr6QG3pAja1E6al7SpmLKIpJ8UgfWLpUcxRA11KZQqTCVm//bThIQEr25noNCguZ6mFu1 4IOV6XUF8s7qH6nuxauus4L03SOxaJqgHgeeVQ9GZW6pxzuNdXYMWFHMC4Hob2VwZ7bRpGe4Ap2ka UdVyEe5qHpkvmg4TcNCMt5GHGqG9M5sbHkptrLvdZtV4zRo2CVGw5T0fe0subBPJGhqdOhJMjev1E +308wvyzEs0UwBWc0Ume9Axd0vP1Ci2882OcYjcZJfstTY9Pwt1YPo7FolklbRE3T6LiUGhk8qosO 2Og/KJkhbwg4bR3PWsVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAwPA-003Pwc-Qx; Tue, 03 Aug 2021 15:32:33 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAwP7-003PvN-0Q for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 15:32:30 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D53C60EC0; Tue, 3 Aug 2021 15:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628004748; bh=NFlhqOplTZXAI0Dyb+KjHTbgLHGA5lnFEt+p2z6v+iM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oMjfeRMxIT3SvO+bti5OjoKO6PpmEsNLCtlzo44iZnfZsZofDvb7xoPDD4mkX4OJ+ Vn1gECcUm5dFIKbOty+raoD0bQ2mGIpg0mn2LhKlxihBKhFQHpf/Wa+04Lhcun2RV9 +jLyYBAEyDfgAZcWaCKrrOB5xsYz/SLLNIhSI2PZqCefhYdhJIPa43GLPh6pd9Fpcl lvrLTNw2bXyyb4O3A4EgZi+Ca9VP56F2sajgBUbOlye7o/a7IwSNtvu4yxNafAnO81 32FjyCa5SeOQJFqM1E8kSYM4HddZQ6G4LUIiTEVCwLS4gYLq3hh8bKATjTG26qsYPO IvChdLdqlxrtw== Date: Tue, 3 Aug 2021 16:32:22 +0100 From: Will Deacon To: Fuad Tabba Cc: kvmarm@lists.cs.columbia.edu, maz@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, mark.rutland@arm.com, christoffer.dall@arm.com, pbonzini@redhat.com, drjones@redhat.com, qperret@google.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com Subject: Re: [PATCH v3 10/15] KVM: arm64: Guest exit handlers for nVHE hyp Message-ID: <20210803153222.GB31125@willie-the-truck> References: <20210719160346.609914-1-tabba@google.com> <20210719160346.609914-11-tabba@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210719160346.609914-11-tabba@google.com> 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-20210803_083229_123461_02A541C2 X-CRM114-Status: GOOD ( 15.26 ) 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, Jul 19, 2021 at 05:03:41PM +0100, Fuad Tabba wrote: > Add an array of pointers to handlers for various trap reasons in > nVHE code. > > The current code selects how to fixup a guest on exit based on a > series of if/else statements. Future patches will also require > different handling for guest exists. Create an array of handlers > to consolidate them. > > No functional change intended as the array isn't populated yet. > > Acked-by: Will Deacon > Signed-off-by: Fuad Tabba > --- > arch/arm64/kvm/hyp/include/hyp/switch.h | 43 +++++++++++++++++++++++++ > arch/arm64/kvm/hyp/nvhe/switch.c | 35 ++++++++++++++++++++ > 2 files changed, 78 insertions(+) Definitely keep my Ack on this, but Clang just chucked out a warning due to: > diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h > index a0e78a6027be..5a2b89b96c67 100644 > --- a/arch/arm64/kvm/hyp/include/hyp/switch.h > +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h > @@ -409,6 +409,46 @@ static inline bool __hyp_handle_ptrauth(struct kvm_vcpu *vcpu) > return true; > } > > +typedef int (*exit_handle_fn)(struct kvm_vcpu *); > + > +exit_handle_fn kvm_get_nvhe_exit_handler(struct kvm_vcpu *vcpu); and: > diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c > index 86f3d6482935..36da423006bd 100644 > --- a/arch/arm64/kvm/hyp/nvhe/switch.c > +++ b/arch/arm64/kvm/hyp/nvhe/switch.c > @@ -158,6 +158,41 @@ static void __pmu_switch_to_host(struct kvm_cpu_context *host_ctxt) > write_sysreg(pmu->events_host, pmcntenset_el0); > } > > +typedef int (*exit_handle_fn)(struct kvm_vcpu *); Which leads to: arch/arm64/kvm/hyp/nvhe/switch.c:189:15: warning: redefinition of typedef 'exit_handle_fn' is a C11 feature [-Wtypedef-redefinition] typedef int (*exit_handle_fn)(struct kvm_vcpu *); ^ ./arch/arm64/kvm/hyp/include/hyp/switch.h:416:15: note: previous definition is here typedef int (*exit_handle_fn)(struct kvm_vcpu *); ^ 1 warning generated. So I guess just pick your favourite? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel