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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham 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 24A77C433F5 for ; Mon, 20 Sep 2021 14:09:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F21F8610A3 for ; Mon, 20 Sep 2021 14:09:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230175AbhITOK7 (ORCPT ); Mon, 20 Sep 2021 10:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhITOK6 (ORCPT ); Mon, 20 Sep 2021 10:10:58 -0400 Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C2E2C061574 for ; Mon, 20 Sep 2021 07:09:32 -0700 (PDT) Received: by mail-oo1-xc35.google.com with SMTP id y47-20020a4a9832000000b00290fb9f6d3fso5918429ooi.3 for ; Mon, 20 Sep 2021 07:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qzAdTsGqrarKrbZiLgQ+yqd08O5g2KPS2fQJ1adRAbE=; b=Lc5yTDdu4Z3ESLWgSn8P+Yyo1JXoXNnAwo7xIH57GWzVa7TVzjcFv4yNw2009ZQ5Zi qPA1ibsjJp5bIhAVuwjxCm+Io/CPD9HVF9biAgL65DiCGnM2XTe164wB+IYCSfsDWDMk DcyLd1ntMHf4fpszz2py6D2mpdB1vdmF37E/L3X8eMeFn/pBrbTbOe1RIETYK3xbIFzX ghTEMZjdySpQv9CTWdSzOTNizZM8UNm5hpPfuLRX0Wz6WSkFn4Mm2smHwmgdc90PHDvv j/GV4JfTTPPhj2rff2ZLrbFlVqSC4hudG78SAJBcHQvskuD3oP2bzCfDPf76nCRDOp+I W1cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qzAdTsGqrarKrbZiLgQ+yqd08O5g2KPS2fQJ1adRAbE=; b=c9TV4oJ6tjORfssV9HhgdbQwrb0hLi5JgqSnSYAArmyxQxcdIEy/huVAMiaRKeW16N yJ5kA5vWwCcZpKJZuO+X9oaaulsDFL82pyk7QQvPmj7w68m1lC1PDOHogrFjtwkLWAxZ kUIwI4s/Ab1m/zwlSN+P7WndJvJiUrWNpKpWmKryx3R7WaP04hDCj5ANWmHsdko9+TF7 tZvMhpLFZXhIuIHUDVQROsK18sxuOxfKPbVnvSCp2gtbwAk7zU+kc7mWPyAOP4osGibb IOvZU02gewwOEUpKhlch7OY1/+p4fnw09bYdtQBNe5EFpXWrTUQFiYZVGG7rlP/2Wj3s mJQQ== X-Gm-Message-State: AOAM533o6BY143VMw5jzmaA/lmjIPuOSXwWa2QcC0q06ZhUMXjMEW56m DyKcDRqz2K5EFPbsMjlJ3yTAhWLttECkkWKt8D7OVg== X-Google-Smtp-Source: ABdhPJzcGkhhRgG63cEAKiVJaDA4QJ+7e3xmIVMV1M65aTlgH1dCw2yj+iWheoNkqPW9cH7sK0KJqPYXfV3EypeyiR4= X-Received: by 2002:a4a:b6c2:: with SMTP id w2mr17432044ooo.59.1632146971367; Mon, 20 Sep 2021 07:09:31 -0700 (PDT) MIME-Version: 1.0 References: <20210827101609.2808181-1-tabba@google.com> <20210827101609.2808181-2-tabba@google.com> <87pmt3v15x.wl-maz@kernel.org> In-Reply-To: <87pmt3v15x.wl-maz@kernel.org> From: Fuad Tabba Date: Mon, 20 Sep 2021 15:08:54 +0100 Message-ID: Subject: Re: [PATCH v5 1/8] KVM: arm64: Pass struct kvm to per-EC handlers To: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu, will@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, oupton@google.com, qperret@google.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Marc, > > diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h > > index 0397606c0951..7cbff0ee59a5 100644 > > --- a/arch/arm64/kvm/hyp/include/hyp/switch.h > > +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h > > @@ -163,7 +163,7 @@ static inline void __hyp_sve_restore_guest(struct kvm_vcpu *vcpu) > > * If FP/SIMD is not implemented, handle the trap and inject an undefined > > * instruction exception to the guest. Similarly for trapped SVE accesses. > > */ > > -static bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_code) > > +static inline bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_code) > > No, please don't do that. We already have function pointers for each > of these, so by doing that you are forcing the compiler to emit the > code *twice*. > > Instead, call into the relevant EC handler by using the base array > that already does the non-protected handling. > ... > > -static const exit_handler_fn *kvm_get_exit_handler_array(void); > > +const exit_handler_fn *kvm_get_exit_handler_array(struct kvm *kvm); > > Why? What breaks if when this is static? There really shouldn't be > anything else referencing this array. For the two points above, the reason I did that is because later patches call these functions from the newly added arch/arm64/kvm/hyp/nvhe/sys_regs.c. That said, I think that the code that calls them more naturally belongs in arch/arm64/kvm/hyp/nvhe/switch.c instead. I'll fix that, rebase on 5.15-rc2, and respin. Thanks, /fuad > Thanks, > > M. > > -- > Without deviation from the norm, progress is not possible. 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=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 4A5FDC433FE for ; Mon, 20 Sep 2021 14:09:36 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id BFE606109E for ; Mon, 20 Sep 2021 14:09:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BFE606109E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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 49DFA40413; Mon, 20 Sep 2021 10:09:35 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com 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 ZtjGFdE5tMpE; Mon, 20 Sep 2021 10:09:34 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 357F84B0B8; Mon, 20 Sep 2021 10:09:34 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 14FC340413 for ; Mon, 20 Sep 2021 10:09:33 -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 fg3Ccsdf6Jnl for ; Mon, 20 Sep 2021 10:09:32 -0400 (EDT) Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 20D90402C0 for ; Mon, 20 Sep 2021 10:09:32 -0400 (EDT) Received: by mail-oo1-f48.google.com with SMTP id u15-20020a4a970f000000b0029aed4b0e4eso3920537ooi.9 for ; Mon, 20 Sep 2021 07:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qzAdTsGqrarKrbZiLgQ+yqd08O5g2KPS2fQJ1adRAbE=; b=Lc5yTDdu4Z3ESLWgSn8P+Yyo1JXoXNnAwo7xIH57GWzVa7TVzjcFv4yNw2009ZQ5Zi qPA1ibsjJp5bIhAVuwjxCm+Io/CPD9HVF9biAgL65DiCGnM2XTe164wB+IYCSfsDWDMk DcyLd1ntMHf4fpszz2py6D2mpdB1vdmF37E/L3X8eMeFn/pBrbTbOe1RIETYK3xbIFzX ghTEMZjdySpQv9CTWdSzOTNizZM8UNm5hpPfuLRX0Wz6WSkFn4Mm2smHwmgdc90PHDvv j/GV4JfTTPPhj2rff2ZLrbFlVqSC4hudG78SAJBcHQvskuD3oP2bzCfDPf76nCRDOp+I W1cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qzAdTsGqrarKrbZiLgQ+yqd08O5g2KPS2fQJ1adRAbE=; b=7PWKQ2+01kDbRCztso2UfIvHioFMJyNhSjDce2cO8b1wZlMiBRLT4RpQSXNTw82bUu TKEoJeL8NXJrBhGjJO1LlwsBjekKq81Mdhi7NBWzFd5B2hW2ru6vSEynbgS6SzLCULif iDnyakBc3yPn40PlomhvVlyog1hMASA/eamwXwDqDAwA8AA3VbxZKAp7RksW6mEQS8nu w9bdEQB89TAcK8WOAq1wwliAVCYCcaNnNwYsQ+k5rZPTcil0ijVyWM0EpXggG2u9jMJX /+jrM3OZ0mwMa7ypV6jSdOjL+L6UdGVTYI55ieDB7hl1vJm/krMChjIc5PKdJq8lmdRk dS5g== X-Gm-Message-State: AOAM533v3iURAcHMQ1fqB20FlRc8Sl69ORVEjOgIhHA30WE9ow59CTR5 CLK8wXofLJhx66vMFB22FlIMkVSvI1vXBFbo481HJw== X-Google-Smtp-Source: ABdhPJzcGkhhRgG63cEAKiVJaDA4QJ+7e3xmIVMV1M65aTlgH1dCw2yj+iWheoNkqPW9cH7sK0KJqPYXfV3EypeyiR4= X-Received: by 2002:a4a:b6c2:: with SMTP id w2mr17432044ooo.59.1632146971367; Mon, 20 Sep 2021 07:09:31 -0700 (PDT) MIME-Version: 1.0 References: <20210827101609.2808181-1-tabba@google.com> <20210827101609.2808181-2-tabba@google.com> <87pmt3v15x.wl-maz@kernel.org> In-Reply-To: <87pmt3v15x.wl-maz@kernel.org> From: Fuad Tabba Date: Mon, 20 Sep 2021 15:08:54 +0100 Message-ID: Subject: Re: [PATCH v5 1/8] KVM: arm64: Pass struct kvm to per-EC handlers To: Marc Zyngier Cc: kernel-team@android.com, kvm@vger.kernel.org, pbonzini@redhat.com, will@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="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Marc, > > diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h > > index 0397606c0951..7cbff0ee59a5 100644 > > --- a/arch/arm64/kvm/hyp/include/hyp/switch.h > > +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h > > @@ -163,7 +163,7 @@ static inline void __hyp_sve_restore_guest(struct kvm_vcpu *vcpu) > > * If FP/SIMD is not implemented, handle the trap and inject an undefined > > * instruction exception to the guest. Similarly for trapped SVE accesses. > > */ > > -static bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_code) > > +static inline bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_code) > > No, please don't do that. We already have function pointers for each > of these, so by doing that you are forcing the compiler to emit the > code *twice*. > > Instead, call into the relevant EC handler by using the base array > that already does the non-protected handling. > ... > > -static const exit_handler_fn *kvm_get_exit_handler_array(void); > > +const exit_handler_fn *kvm_get_exit_handler_array(struct kvm *kvm); > > Why? What breaks if when this is static? There really shouldn't be > anything else referencing this array. For the two points above, the reason I did that is because later patches call these functions from the newly added arch/arm64/kvm/hyp/nvhe/sys_regs.c. That said, I think that the code that calls them more naturally belongs in arch/arm64/kvm/hyp/nvhe/switch.c instead. I'll fix that, rebase on 5.15-rc2, and respin. Thanks, /fuad > Thanks, > > M. > > -- > Without deviation from the norm, progress is not possible. _______________________________________________ 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=-10.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 8C49AC433F5 for ; Mon, 20 Sep 2021 14:11:57 +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 5B5F4610CE for ; Mon, 20 Sep 2021 14:11:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5B5F4610CE Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8s1reVYm6Q4Mxi00XG8gkeB4F1KZkLpN065OgwadLL8=; b=nepyIh2yawsuuJ E7mRMxpeywK+hGYW8J8EKLuMsXOrGSgLTOSjD04UlwPlZxzW1i2gH2T46OrWF/S8r3GvugUSkjxuv 9I8ec9ntCPG4SrQy50csGcDu7BszNnz8f0kibYW9Nx2MkB10TP2ojaq2UeExgBRgyNKlaD/7e35hf WZFKCxwCnvi6RomrH7bgtvmCLnFntQF8+rG300K4beylkk8WCKldL+RZZ67/P+IK/5nvd2i4H1x5C RM8SFUp1ZWwW3O5wSkZyJqVPuNlAItKzjKPdKFUGZkIWeSJLHgxymIuR8NnqFID/o++r34yJQgkYm hicK5QDj/M7GIGpAxRdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSJzF-001s11-Bz; Mon, 20 Sep 2021 14:09:37 +0000 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSJzB-001s0Z-Ds for linux-arm-kernel@lists.infradead.org; Mon, 20 Sep 2021 14:09:34 +0000 Received: by mail-oo1-xc34.google.com with SMTP id y3-20020a4ab403000000b00290e2a52c71so5903752oon.2 for ; Mon, 20 Sep 2021 07:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qzAdTsGqrarKrbZiLgQ+yqd08O5g2KPS2fQJ1adRAbE=; b=Lc5yTDdu4Z3ESLWgSn8P+Yyo1JXoXNnAwo7xIH57GWzVa7TVzjcFv4yNw2009ZQ5Zi qPA1ibsjJp5bIhAVuwjxCm+Io/CPD9HVF9biAgL65DiCGnM2XTe164wB+IYCSfsDWDMk DcyLd1ntMHf4fpszz2py6D2mpdB1vdmF37E/L3X8eMeFn/pBrbTbOe1RIETYK3xbIFzX ghTEMZjdySpQv9CTWdSzOTNizZM8UNm5hpPfuLRX0Wz6WSkFn4Mm2smHwmgdc90PHDvv j/GV4JfTTPPhj2rff2ZLrbFlVqSC4hudG78SAJBcHQvskuD3oP2bzCfDPf76nCRDOp+I W1cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qzAdTsGqrarKrbZiLgQ+yqd08O5g2KPS2fQJ1adRAbE=; b=lfr6rk9ksQtQAzwRN7jNGvyajEE80F++iA3P9RKbYk67aj2HD3IuCMcSwbvhsc29bJ 9Q7TRM8qp5C7KQGnWb2KJYiMg49uoYtwI06+RVG86+50qpikGhwUeGYom9oye/Clbfw1 KuHYJQ0XLU2yKqTr/rcQ/j8SEeRRae+9YNYBeU4Ws1US9zkCfPr087DggcGQa+7jb1lw 1j77l8iL7Y0O49YLkbsqRm/FZ0kcAf5r8UF4R0ETetIfofNbgavy41Mi/LOgKKdYhNxF AgFgVoONCEv5XUL6RqfS23gzNDVxe85PXIsJ074W6HeVVYo8Gm4hhCOvFmHTifUxOzPj hzkA== X-Gm-Message-State: AOAM531VliB4Lve6k79mNv4JEC0DBtYivWra9Mkm8sftmaOeOcPGC93h qLfXWHmn2QYlrptie4fJA2qf4tbCO7kHodACupL/PQ== X-Google-Smtp-Source: ABdhPJzcGkhhRgG63cEAKiVJaDA4QJ+7e3xmIVMV1M65aTlgH1dCw2yj+iWheoNkqPW9cH7sK0KJqPYXfV3EypeyiR4= X-Received: by 2002:a4a:b6c2:: with SMTP id w2mr17432044ooo.59.1632146971367; Mon, 20 Sep 2021 07:09:31 -0700 (PDT) MIME-Version: 1.0 References: <20210827101609.2808181-1-tabba@google.com> <20210827101609.2808181-2-tabba@google.com> <87pmt3v15x.wl-maz@kernel.org> In-Reply-To: <87pmt3v15x.wl-maz@kernel.org> From: Fuad Tabba Date: Mon, 20 Sep 2021 15:08:54 +0100 Message-ID: Subject: Re: [PATCH v5 1/8] KVM: arm64: Pass struct kvm to per-EC handlers To: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu, will@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, oupton@google.com, qperret@google.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210920_070933_529365_24CFFA97 X-CRM114-Status: GOOD ( 18.74 ) 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 Hi Marc, > > diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h > > index 0397606c0951..7cbff0ee59a5 100644 > > --- a/arch/arm64/kvm/hyp/include/hyp/switch.h > > +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h > > @@ -163,7 +163,7 @@ static inline void __hyp_sve_restore_guest(struct kvm_vcpu *vcpu) > > * If FP/SIMD is not implemented, handle the trap and inject an undefined > > * instruction exception to the guest. Similarly for trapped SVE accesses. > > */ > > -static bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_code) > > +static inline bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_code) > > No, please don't do that. We already have function pointers for each > of these, so by doing that you are forcing the compiler to emit the > code *twice*. > > Instead, call into the relevant EC handler by using the base array > that already does the non-protected handling. > ... > > -static const exit_handler_fn *kvm_get_exit_handler_array(void); > > +const exit_handler_fn *kvm_get_exit_handler_array(struct kvm *kvm); > > Why? What breaks if when this is static? There really shouldn't be > anything else referencing this array. For the two points above, the reason I did that is because later patches call these functions from the newly added arch/arm64/kvm/hyp/nvhe/sys_regs.c. That said, I think that the code that calls them more naturally belongs in arch/arm64/kvm/hyp/nvhe/switch.c instead. I'll fix that, rebase on 5.15-rc2, and respin. Thanks, /fuad > Thanks, > > M. > > -- > Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel