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 140C4C38142 for ; Thu, 19 Jan 2023 09:50:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230114AbjASJuF (ORCPT ); Thu, 19 Jan 2023 04:50:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbjASJt4 (ORCPT ); Thu, 19 Jan 2023 04:49:56 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D09846B991; Thu, 19 Jan 2023 01:49:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=n9ShCI5SqUuw0LHZza+w96OHBa8sMt5AxJi4PRDnQTo=; b=UXGyFKtdG5wDiGqOEE2A15YN/u rQhls/O6cIT0l6SE1oxkPh8IIcSwEyek1x73YYOM2NGkZeM8SpYoTC7NeHx9uwjAtuAj19B99iURg vED0oMbdfcojGVrp5cJ8MKfP2AGlkMTkoU83btDPXkK39S50qh1k6tPONoGQ1OfcnMNqrVbuN4qvD 3NaWIFI5eMWx6+P/WLpcc7gRVO7rdTKMIFxyiBmvED7L1fF6LoSTChZEgGroH/S5oCunqDXVdzV9t ftzltF/Hw+/g2tGnwCRvFjofls8ABatbfllzUIxYDVS8l0SjlLypQgChKWsHUvemenQPewSfZeBBW ZP2FHVrA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIRY6-000qn4-6p; Thu, 19 Jan 2023 09:49:34 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9065F30012F; Thu, 19 Jan 2023 10:49:32 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5286B2011B922; Thu, 19 Jan 2023 10:49:32 +0100 (CET) Date: Thu, 19 Jan 2023 10:49:32 +0100 From: Peter Zijlstra To: Sean Christopherson Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Thomas Gleixner Subject: Re: [PATCH 7/7] KVM: VMX: Handle NMI VM-Exits in noinstr region Message-ID: References: <20221213060912.654668-1-seanjc@google.com> <20221213060912.654668-8-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221213060912.654668-8-seanjc@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 13, 2022 at 06:09:12AM +0000, Sean Christopherson wrote: > @@ -7119,6 +7118,18 @@ static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu, > > vmx_enable_fb_clear(vmx); > > + if (unlikely(vmx->fail)) > + vmx->exit_reason.full = 0xdead; > + else > + vmx->exit_reason.full = vmcs_read32(VM_EXIT_REASON); > + > + if ((u16)vmx->exit_reason.basic == EXIT_REASON_EXCEPTION_NMI && > + is_nmi(vmx_get_intr_info(vcpu))) { > + kvm_before_interrupt(vcpu, KVM_HANDLING_NMI); > + vmx_do_nmi_irqoff(); > + kvm_after_interrupt(vcpu); > + } > + > guest_state_exit_irqoff(); > } I think we're going to have to sprinkle __always_inline on the kvm_{before,after}_interrupt() things (or I missed the earlier patches doing this already), sometimes compilers are just weird.