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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D70BCC433EF for ; Thu, 24 Feb 2022 14:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235274AbiBXOHk (ORCPT ); Thu, 24 Feb 2022 09:07:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232103AbiBXOHj (ORCPT ); Thu, 24 Feb 2022 09:07:39 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CD553EBA8 for ; Thu, 24 Feb 2022 06:07:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id A580ACE1DE4 for ; Thu, 24 Feb 2022 14:07:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEABCC340E9; Thu, 24 Feb 2022 14:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645711624; bh=iNe/Xdsad40FDFPmtJ5EvAYSNSCE4WkT2G91LScinbE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MIaJLRU/t2DRlFeFSN4T8OiDHq/ETmj9y6wEIwqHQt35cbB/x0O1j2qlYo6MXtjBn kQTSK4jTvvayN4DJO6LedOTu8WIdj1dGXQr9kdfkCpc6EDkYZ0U6h/VRLVIfvE6yAh UTSbBre4ua+06XcgkgA2j8Ath2SaP2dLYm7XvZJYDqvn73+ziyZdlrJ1YokRkXFuR+ qyx0K8iJOLffGUap8qyjEsIvJQOmuyTYb7ky41mPBEq9ndJ17tne849MX4Z6I0j+Pk fx0Mkjq9jGhRwzqgHCJ7B5jVlNK+JEzA42LUYotRvaYy8R2TC2RDjld5XF87Y3ONdO id4u124syG25g== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nNElq-00ACSB-HZ; Thu, 24 Feb 2022 14:07:02 +0000 Date: Thu, 24 Feb 2022 14:07:02 +0000 Message-ID: <87v8x42wah.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.cs.columbia.edu, Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Anup Patel , Atish Patra , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Peter Shier , Reiji Watanabe , Ricardo Koller , Raghavendra Rao Ananta , Jing Zhang Subject: Re: [PATCH v3 10/19] KVM: Create helper for setting a system event exit In-Reply-To: <20220223041844.3984439-11-oupton@google.com> References: <20220223041844.3984439-1-oupton@google.com> <20220223041844.3984439-11-oupton@google.com> 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/27.1 (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.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, kvmarm@lists.cs.columbia.edu, pbonzini@redhat.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, anup@brainfault.org, atishp@atishpatra.org, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, pshier@google.com, reijiw@google.com, ricarkol@google.com, rananta@google.com, jingzhangos@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, 23 Feb 2022 04:18:35 +0000, Oliver Upton wrote: > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index f11039944c08..9085a1b1569a 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -2202,6 +2202,13 @@ static inline void kvm_handle_signal_exit(struct kvm_vcpu *vcpu) > } > #endif /* CONFIG_KVM_XFER_TO_GUEST_WORK */ > > +static inline void kvm_vcpu_set_system_event_exit(struct kvm_vcpu *vcpu, u32 type) > +{ > + memset(&vcpu->run->system_event, 0, sizeof(vcpu->run->system_event)); > + vcpu->run->system_event.type = type; > + vcpu->run->exit_reason = KVM_EXIT_SYSTEM_EVENT; > +} > + nit: does this really deserve an inline function? I'd stick that in kvm_main.c, really. Or is that getting in the way of building KVM as a module on 'the other architecture'? M. -- Without deviation from the norm, progress is not possible.