Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1104033lqe; Sun, 7 Apr 2024 20:16:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/Saq+oqONWYwzgpZVzc/k6wXcfx+UYz1dJCAopJGuzKrF4eHFB4x1L+7gYnbmQ7Euimdj5EdKSyOvUDArY/xurGyYfBUCVTjBQHL7AQ== X-Google-Smtp-Source: AGHT+IG7mgIkTSdxDR40eJ2cBO+w1q3mNoUaHo/vsGQDBWIX2cfFcuEj8WHuWNX+PqeY+hbDXqHF X-Received: by 2002:ad4:5d49:0:b0:699:2db7:f5de with SMTP id jk9-20020ad45d49000000b006992db7f5demr8446816qvb.2.1712546201956; Sun, 07 Apr 2024 20:16:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712546201; cv=pass; d=google.com; s=arc-20160816; b=NywRETcK4ThvIaNeGF4g1s+KWl1kcO2iHH5de6mkatw+B11MPtgusl8nnvGk0EA3bC cB5Afq65eAegE4ZUmANYdm+jF49iscew/nyUR/fMxOD5VhTBvOccDelyeTx/SoysnL3x D7cVyE1X/POMPuMPry7RwOCGi7ZO547CoINQIpqR+KABD4WGSk0tThCMdjKU+9Ehf4K7 9YYY2wKL+8hn31nS70iL5Be53773ebduLdikqdTM3ThRGioO1eutsCZdy+sdKK5MW4z0 Q32pytFlZpvjXHKWTp2Lkk005FFGkuPbHxTsg0DIF3DejGW68u7qfO1TOGTkv+hn11l2 3GCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=g6qEzLCQMTbql5pZiT30Fj3PkeIgvPEsiDXsvPXShT8=; fh=hPr9UsQ01gPKCz4S2m0Yg48dRlZVm0Ad7UDt7Xyxfv8=; b=iNU7VDwoE7g6T5QiUE92l2swIDb2YK1aphh4AKhY2AE4yEDz5/yaR+o99kq2FP4zIk HhE2AtKIfKBy8T8xwj7axAc7WArRom8fnUG9XWV1DkQSxwauGDIVYJe4cB8qolaXoKZn 6juNTnUfK1VSZi1C3Krxr1CXUk3A7M9qXz3cpuGDxxOi5IXe1VCOLgjf4o78AtsCHXDs YYEZpfB8g35qSbpST41iLJ003t5YHv625GEiG2s9dU8ziGAZgB6t732vKbImf2JgiU3X mqWVvkfvNwcb5RI1BiAvwuxllZd0bU8DRDB5TCk8OyBkSTjGM7EV3cR7J0+UUYdHxthY /FCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cQ9hOfcy; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-134747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z6-20020ad44146000000b0069945e96325si6097180qvp.181.2024.04.07.20.16.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 20:16:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cQ9hOfcy; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-134747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AB3A01C21481 for ; Mon, 8 Apr 2024 03:16:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E1BD4685; Mon, 8 Apr 2024 03:16:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cQ9hOfcy" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 005A237B; Mon, 8 Apr 2024 03:16:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712546191; cv=none; b=TyAxaot64nO1m3zdZVpzz0JADzfJbbJS/Ymmj7zFQ26oVmRVDqki4ycuZXiDkZq2Ne3RhrynhBYyA8uoOStBZk3OIZv4fnTv8HINYGY5sz3pf1zjFa2O2l6sSQOhtqnhDGm0Cb9XLKkK2QwyMEJo+dJ0seht+m3da//bo49FrOk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712546191; c=relaxed/simple; bh=gPHQQQMPxHptTu1K4ZlwET/yYNwq3B7jXdJBFJYGjtU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WfRe7R5SKXgaBy0XZG6q/A/k/oaHLI1NFGOH92LwGzlrVXYxBOqAWxUNIg6HvhtTb/kW6FPpbqyZay/67nSBJrnxI1WSGiKxFeshsSjvfMBsnxTeGg+eVrjlqY9jF59ocVNmggk1pTil1uyP0mzhQLQIhnavSIekhmWylaZdGeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=cQ9hOfcy; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712546190; x=1744082190; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=gPHQQQMPxHptTu1K4ZlwET/yYNwq3B7jXdJBFJYGjtU=; b=cQ9hOfcyiwsnuLHA0tkdZnykZT7r5B/tBxXeH8r3y4p5m/99tZYc3+zv FUarvCaIBv50ya7Bd56MVDE7tcXU3bofjrFiWWt87FezlIdjSVPBgpFzx JARv5isfG6rEPSFepXuMPzY0NJepDnx1Y98bUHDvet0WgHcfcLWtTGtRB Bs+OAvCT3TIlSR+l1LOOez0qbJLmd3gkPfLxSnCY1sanCNmeUK/bKdUW1 mp9H17AWI52JC0kGdxDI5I+5ydY1MipyxS88+zZBB9Tcka8QxYCtLICtC fJZbTfojorUBGZxqszjJGVYDRCcQeVIZ90MgTurFbg//+zw+MTSGuSTAR A==; X-CSE-ConnectionGUID: WIaNLzz6SGO5ZaRfUoRy5Q== X-CSE-MsgGUID: Zl1GEcwyTpCpi3DE3rznvQ== X-IronPort-AV: E=McAfee;i="6600,9927,11037"; a="7989736" X-IronPort-AV: E=Sophos;i="6.07,186,1708416000"; d="scan'208";a="7989736" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2024 20:16:29 -0700 X-CSE-ConnectionGUID: y2RrYL31RVuogTOHoUndWg== X-CSE-MsgGUID: kogALiFCTNS0AM6kUXXPow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,186,1708416000"; d="scan'208";a="19830316" Received: from binbinwu-mobl.ccr.corp.intel.com (HELO [10.238.9.252]) ([10.238.9.252]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2024 20:16:26 -0700 Message-ID: Date: Mon, 8 Apr 2024 11:16:24 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v19 091/130] KVM: TDX: remove use of struct vcpu_vmx from posted_interrupt.c To: Isaku Yamahata , Chao Gao Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , Kai Huang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com, isaku.yamahata@linux.intel.com References: <6c7774a44515d6787c9512cb05c3b305e9b5855c.1708933498.git.isaku.yamahata@intel.com> <20240328211036.GS2444378@ls.amr.corp.intel.com> From: Binbin Wu In-Reply-To: <20240328211036.GS2444378@ls.amr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/29/2024 5:10 AM, Isaku Yamahata wrote: > On Thu, Mar 28, 2024 at 04:12:36PM +0800, > Chao Gao wrote: > >>> } >>> >>> void vmx_vcpu_pi_put(struct kvm_vcpu *vcpu) >>> @@ -200,7 +222,8 @@ void vmx_vcpu_pi_put(struct kvm_vcpu *vcpu) >>> if (!vmx_needs_pi_wakeup(vcpu)) >>> return; >>> >>> - if (kvm_vcpu_is_blocking(vcpu) && !vmx_interrupt_blocked(vcpu)) >>> + if (kvm_vcpu_is_blocking(vcpu) && >>> + (is_td_vcpu(vcpu) || !vmx_interrupt_blocked(vcpu))) >> Ditto. >> >> This looks incorrect to me. here we assume interrupt is always enabled for TD. >> But on TDVMCALL(HLT), the guest tells KVM if hlt is called with interrupt >> disabled. KVM can just check that interrupt status passed from the guest. > That's true. We can complicate this function and HLT emulation. But I don't > think it's worthwhile because HLT with interrupt masked is rare. Only for > CPU online. Then, it's better to add some comments?