Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15296962rwb; Mon, 28 Nov 2022 09:58:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf78bp27XY8UOYb+urUeoHfDeLtXhxy8iTr0V8316jtXxbdiF7JmgEbebrI4s8R8rGEvIlXS X-Received: by 2002:a17:90a:fb50:b0:219:5e9:f260 with SMTP id iq16-20020a17090afb5000b0021905e9f260mr19939387pjb.16.1669658286181; Mon, 28 Nov 2022 09:58:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669658286; cv=none; d=google.com; s=arc-20160816; b=VPHYiMqkInEAyEBctThqB3f6uNv7vTTg6KNIPnwl3DgCDLTsxZZygZTwG1DX3wWC4A HjxHLD85pXPc3+k8ofIdgz3nxP0csHsdLu4K0Y3Geox7ENZX7bAhF7rchTNLNxRk/1Z5 FfimsWKzwzZL6qfePkJeULohZuB1KN/Z+ts6auq2l8AzsseqbJtHRxwvS6IRTeviRaUN t2dD2wdiBoi99YiSDMIhLqD8jx9PQhuCVnJGTLtAUKuxPN/qxqkCyCBF6cIAfImiJjPZ 28qpWbWaOPhWR+ObSYP1uQk+hhO6hUJYOyb74ERXO1meEGfNcG798N8zINa8baUjWAam 1NHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Z490q3+4OBgGpP4ghV2GyQxr+yapVjAEH0weCGz/rew=; b=HmL0LcXz74fEVuoYELi6e6nRvFbV8Z3KMmKnb7dJd2YPQS9A9jspkdA0EBJhmi+D/e 8Dm6LOIY0eujD3rcu6HYVmn73TIipVD4HXK7ZEtHqpwcOwRNVU+afteeV4K32KFyn62k +x6X33+7gU2Cuo71PR/9+R+HQLC5TQCF5s/Yop2/5OfOS6fEdmBvpsOhcIeMy31XMHd1 io5VYFwLg6IOJJlTInO+0k6j6wNT01RJnhV+2HZiJRhQwZMogflbEOgTpgWDLwq3A//H ADnANJJ0KQU5SOZNsH31owu8VByIps8I6y1NnHtca2+yJnKyefFykAA7fhqpZT6zY3Wi ATqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="g4/JV+5A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id om17-20020a17090b3a9100b002136ad22b32si13952925pjb.39.2022.11.28.09.57.51; Mon, 28 Nov 2022 09:58:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="g4/JV+5A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232397AbiK1Q2T (ORCPT + 84 others); Mon, 28 Nov 2022 11:28:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232427AbiK1Q2N (ORCPT ); Mon, 28 Nov 2022 11:28:13 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B481C220F7 for ; Mon, 28 Nov 2022 08:28:12 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id t17so10000616pjo.3 for ; Mon, 28 Nov 2022 08:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Z490q3+4OBgGpP4ghV2GyQxr+yapVjAEH0weCGz/rew=; b=g4/JV+5AWieJycDXis2BS4N3wmKNQsJ/KNpv5tNUJ7bYf7rIi5c6ZaaBKkHz/bt2ds NVz1nDCNfg0Gvfj59pCRuZnyo34rIXD5ZSqLXCEY3KRO6/0+gAckzIMtyN+jGGEHc1LZ fc8V8VVQPLEKTbb0k2l/Y0nzsa1NvtgKYzNydgnY35ub6CZbpuUKfzyDWtzTNa8u2S43 Rc6+U9WQb1R1XNDtXj2X0abf3a3VLUTgErJgNOb0NQ1HdQE+GVbcZntRU5XLuQL7Nyr3 En9IRHHNEXJ5km/umpqJRqRfuuhN8VUXjEz6i9JeMmMlZtCvtN8lVb4xVk2+abtzmgCe +FYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Z490q3+4OBgGpP4ghV2GyQxr+yapVjAEH0weCGz/rew=; b=2YYK3/3shEqi3l3AzZD33GlRZN/0QpMTfg3ruN0YZdRhLeCvxPGdslYcTJppegPSYF dmtAJWZrA8PGN3doYzE94cdQtGEm2iqCmiyIc+d4OPpGZ3EI0armdTFXG1DTeVRBhDuT sfSRM83EY/ekPeUQr58wSw8V1IyMVFnYxK0ck+cNNI0eOZMar2A1fxPHPUY+1GDhjTro 7wSyXApNbeJPgFybPc9sva5TjmAjCkO31b77P/T3oqJZlwnAOR27v1uQVw/FRJ7XbDSG NwiFnU8wDGahTddpXc9hRH1v8O5ZacsenQHgyVxTq7uJDXw015pfSKGHp4sQ7s8mfWfU oNVA== X-Gm-Message-State: ANoB5pn4NULJyIayvdE1NUfG/TAJIAz3FvOIuUSgilNnJEsgzR8/n3nz FhXeQKR1FbgInZxY29LjDPU1KA== X-Received: by 2002:a17:902:7793:b0:189:24b3:c86 with SMTP id o19-20020a170902779300b0018924b30c86mr33048176pll.84.1669652765355; Mon, 28 Nov 2022 08:26:05 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id a14-20020a170902ecce00b00186b1bfbe79sm8546264plh.66.2022.11.28.08.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 08:26:04 -0800 (PST) Date: Mon, 28 Nov 2022 16:26:01 +0000 From: Sean Christopherson To: "Li, Xin3" Cc: Peter Zijlstra , Paolo Bonzini , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "kvm@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "hpa@zytor.com" , "Tian, Kevin" Subject: Re: [RESEND PATCH 5/6] KVM: x86/VMX: add kvm_vmx_reinject_nmi_irq() for NMI/IRQ reinjection Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 24, 2022, Li, Xin3 wrote: > > > > thouh we'd like want a fair bit of refactoring so that all of > > > > vmx_vcpu_run() and > > > > svm_vcpu_run() don't need to be noinstr. > > > > For the record, svm_vcpu_run() is fine, at least as far as NMIs are concerned. > > > > > This sounds reasonable to me, however from > > > Documentation/core-api/entry.rst, we do need it. > > > > Why do you say that? > > > > Copy/Paste from Documentation/core-api/entry.rst: I'm very confused. What do you mean by "we do need it". What is "it"? And what does "it" have to do with the below documentation? The documentation does nothing more than explain how KVM handles task work. > KVM > --- > > Entering or exiting guest mode is very similar to syscalls. From the host > kernel point of view the CPU goes off into user space when entering the > guest and returns to the kernel on exit. > > kvm_guest_enter_irqoff() is a KVM-specific variant of exit_to_user_mode() > and kvm_guest_exit_irqoff() is the KVM variant of enter_from_user_mode(). > The state operations have the same ordering. > > Task work handling is done separately for guest at the boundary of the > vcpu_run() loop via xfer_to_guest_mode_handle_work() which is a subset of > the work handled on return to user space. > > Do not nest KVM entry/exit transitions because doing so is nonsensical.