Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp53187pxh; Thu, 7 Apr 2022 13:44:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQj0QriNgNoRmzV7ERJEKReaLxaf0yorRwREiqtwmQRUb1iMMMTXwMe4dSwj1ZTQRbjgXN X-Received: by 2002:a17:90a:9f0b:b0:1ca:4647:a447 with SMTP id n11-20020a17090a9f0b00b001ca4647a447mr17896701pjp.11.1649364291966; Thu, 07 Apr 2022 13:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649364291; cv=none; d=google.com; s=arc-20160816; b=btruThKRoCWab4O/RzDU2JPjyDLlH02m0XYLyvH8C4Tjiz2mbpqiuCOPzvp/f+3HoF IozJxdYIy7uCIJ96TB52NgeWYdgWB9mG4zLSS5X+yOlans40BdZaikLZirbP+0EoBZH+ kECAZPlUmH8soCfk1pgG7hnlt12qqh/myCp5bGwYwqc9HB/cAq9GEWMZQBNTE+qDZPTx O6+fFAQ+bkzQjOvtCzaquhP1GiC4xic0yzk0C4G6MlZS0MoeHnKiY7h9RTDix0+RaSF8 13P/bvu/YoPXGftAT55isaLVsvlz9pdD8sOAMMXBqRxl3S/Yox641dEqJ+Aa0h5+GA/9 1ZjA== 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=+saCSnArnxO2TUlvbHmXQoFiDXGA5TGiskFrczuz73Y=; b=E5z7aUVMIKD1W2dCAybTXvgCbD02KibvgqwAQWoxI/49ObCf6d3jjoei5rCkp8L10m AtlQBtgYWITqSgBG1AkZaur7IK8RscyFd6/pmJWeu0xWfQZfZMTexVmueOJpqUS+ZJnm qWdsk0UlftXCp7A4uXI3XfK0rI2Coxzazueyqvv4nlx1clxdxXlEDKiaUKe6uKGGv+jb X6F1sNG4nWyqgaDs3rvsoLPKtMTDo7uGMlcHG4rMSaOaJ8YqKbwOAK+wwDbxmzQLUqAE v7e2Z8Ux1Riqy4vmgxugVPlgk1HshBOjWHVpCovwuYU9SJCsmyRIJRlh91TgjrUhLPfP /teg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=gHTdAdlG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e19-20020a63ee13000000b0039a14df586asi7254304pgi.784.2022.04.07.13.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:44:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=gHTdAdlG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2FFE43D519E; Thu, 7 Apr 2022 12:54:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344293AbiDGOx0 (ORCPT + 99 others); Thu, 7 Apr 2022 10:53:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241089AbiDGOxY (ORCPT ); Thu, 7 Apr 2022 10:53:24 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D9BBC054F for ; Thu, 7 Apr 2022 07:51:19 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id j20-20020a17090ae61400b001ca9553d073so6450348pjy.5 for ; Thu, 07 Apr 2022 07:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+saCSnArnxO2TUlvbHmXQoFiDXGA5TGiskFrczuz73Y=; b=gHTdAdlGBmpoT+iYDeLwfYqrMCSYrMcJVsXDPpLHU3NBKwlohuLKsUBjowQ1O2LiOJ KZffRjcfwLSL6o96OsbDefjoXwv1mvenp7oEbdCKjdurcoUI7auXyhHB5WHqQ4OWkQlw IFDwCExv6ewWhlpPReqoL5OwUVapAHbqScbIH5uXL4fiqZrs4ymU0+44GkINgNYx8Ovr cEql/OO9nI49LTrPCuPEfNQp1GkO39m0yw8Si97vRBbODsWIWbo8Gys0dZ6AZQKoYAa+ SDzbUpIdz3zViyGPYpdbQz594K4IeR/Do0h2paWmrHYt5Xyer4S+73NFgjXB759C1SEl yi8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+saCSnArnxO2TUlvbHmXQoFiDXGA5TGiskFrczuz73Y=; b=3oRz+FrRhFN4VIpMg75crvx4lH7W4g+Cm5FWJBJWyDZ6n3VaKOZMaXm0lH9ZWvShQo KubNNwqTaXWEaZ6MySPrNszDiWNZG1ynCkjVPbiOuGLrwFNPQMqgEEagv9yN82B9tnQW yRyGwVzUuu1vsnFcQbVNErT6Te6DcLTIDhcQD4aL4idnSxaeWbY0j4ONKzWzljnlawFE mweE0abGEKxxOvj18DCAFp93MpqEiOVRRWrK+lrGMJ0ZLBTrtvhFKfZPVI39K/AwosxG 6wVKPjeO35y0hCA4wSn6CY45Vr4giJLncoRgN/qxJtHLUkzeXzYo2X282I+uk6ddCWG0 ak3w== X-Gm-Message-State: AOAM531tc9gfYZmdFNJdoJl7NJSZCtVS8IBrmLwBtZXtSx1a0TS8U1fY ecUtY4V2IsObuGROs5fLnTNFaQ== X-Received: by 2002:a17:90a:4417:b0:1ca:a861:3fbf with SMTP id s23-20020a17090a441700b001caa8613fbfmr16611866pjg.80.1649343077600; Thu, 07 Apr 2022 07:51:17 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id rm5-20020a17090b3ec500b001c7559762e9sm9173481pjb.20.2022.04.07.07.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 07:51:16 -0700 (PDT) Date: Thu, 7 Apr 2022 14:51:13 +0000 From: Sean Christopherson To: isaku.yamahata@intel.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , Jim Mattson , erdemaktas@google.com, Connor Kuehl Subject: Re: [RFC PATCH v5 092/104] KVM: TDX: Handle TDX PV HLT hypercall Message-ID: References: <6da55adb2ddb6f287ebd46aad02cfaaac2088415.1646422845.git.isaku.yamahata@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6da55adb2ddb6f287ebd46aad02cfaaac2088415.1646422845.git.isaku.yamahata@intel.com> X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Fri, Mar 04, 2022, isaku.yamahata@intel.com wrote: > From: Isaku Yamahata > > Wire up TDX PV HLT hypercall to the KVM backend function. > > When the guest issues HLT, the hypercall instruction can be the right after > CLI instruction. Atomically unmask virtual interrupt and issue HLT > hypercall. The virtual interrupts can arrive right after CLI instruction > before switching back to VMM. In such a case, the VMM should return to the > guest without losing the interrupt. Check if interrupts arrived before the > TDX module switching to VMM. And return to the guest in such cases. Pretty sure you mean STI, not CLI.