Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2436776lqt; Mon, 22 Apr 2024 10:34:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTj0q2ngZaaIGd7R67OYFJjtvglSzODGnN0i5eH2FNCY6qkim/sdTMP2RqYalnnsjQ458axuZIhTAVYd99WlGXAX+4Z3hkBWqXIhQoXA== X-Google-Smtp-Source: AGHT+IF9Xgm13Ssez/LkUtajwtvIre6uLrJd5xlxfR8RGPtNE6khCQdJbU0Dq3RilhoYd3NOWWno X-Received: by 2002:ac8:5f46:0:b0:439:b3bb:4b6e with SMTP id y6-20020ac85f46000000b00439b3bb4b6emr3740355qta.13.1713807268688; Mon, 22 Apr 2024 10:34:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713807268; cv=pass; d=google.com; s=arc-20160816; b=QKJFN0e4WtofeQUOoguw7wKB/JoX8ef60+KeaQbgIp+x2Dz0iB8OxBs/VPydwuEXNj vCayIbzZRU13fc5xgbvMxtaUFbZD+0OJYzMhVz66IJLRRs0M4NrxovYo4KQYou5KhkQ+ Eo5WgWSxkQqGG7HrdzHFk9GqnQgC9BpKjgttM571SR1YqSBbYd6HWX3tgfI0vxCxDyPO ENxyTuFe536Gi2X715bQ8216PYltPgxkPwtQ+mmtEgPw1eqGQezcjdVnUZJ68yDNYFNf JKTPaDJqvKivcjHonvrE9qKindsj2pNbXvr4Z2DBZ9wTIFTFTUAvZtWwycS2EWrLSgOu Q2ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DbQ6cMyPO0N3V5TwPwZ9djAF8RQGBU1xCdpZGxaoL7I=; fh=P/quV/w7uXmndbL78FtEpLTNkJRPx4LJS51PzREvtL8=; b=MxOtxyCo/MvWB2677OdiHV6Ul5zYkQ0FSp+hKKYVj09FQ2TwGMNpEmVj391GUBVL4l xs3h/HimEeHkJZojPH4g9y7IKNqn2fJ0LLHhJB09q5UDfD/5sH2IfcM/W7irLFobVqZA gLE1JA7MwEapT8AjRp4KeTDFv7wrKbGyHG5flXu46wYTxj4Qqs6D3CTocf8PKvHyOKMc pWca0xFJ1WNgVjxiPB/1Msj8ilY2UF6gDcoWkMoul6j0ognMfGKSOvwikPFQlqdIS500 7pBaSFCVTCPpRPiCz4F9akGa1cX/k28hfYkj65330sVLVYeyHLaw351dLRd1RpzGG3eH c2Mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="gNx/9Y6w"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-153799-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153799-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 g2-20020ac85d42000000b004364bdb0364si7643266qtx.515.2024.04.22.10.34.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 10:34:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153799-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="gNx/9Y6w"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-153799-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153799-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 6712B1C21842 for ; Mon, 22 Apr 2024 17:34:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBF73153BF4; Mon, 22 Apr 2024 17:34:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gNx/9Y6w" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 5D354146A6A; Mon, 22 Apr 2024 17:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713807259; cv=none; b=O7475xpMNMib79axnx42znY6Xi1kOoOSXYINaq+ZKIZVtj0YmLsBStg5fBE9Xdhs5nu70QM9Cdxb/76wkUUVggeFTKsKcPEWzb7srXAkwqfE1r28V2h30TnZ19G805BLi/E/QWW4g8oBYUb8et5e6Rt2Rg8ntkidjKnFFfeY8e8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713807259; c=relaxed/simple; bh=CtkdzXdAdH5gbzYeGAqYpxDqL2frKUxXG+eSiaqEq0Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uXljtWTgY02hgk07iQRmh0TGag8WlGg3ZpjoB/YdubgxDRTCUAKTxalhechPSIZYeBd7nm1ePh21PzfSzaUy2cEaBK2/wXcniLaO+x6xJMpitaoBShCWAzf0pcHf3A2fPXm/CPRCV0x3+B2Rc+dc4UWL4uvfB/VDknwY8u70IzE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gNx/9Y6w; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713807258; x=1745343258; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=CtkdzXdAdH5gbzYeGAqYpxDqL2frKUxXG+eSiaqEq0Y=; b=gNx/9Y6wXT6VI62sAu4ehpCtj1zss+8AIAaEqAqs197hI+8qzJTzKZDf VxOEVtgGebhQ3OsJ13KDi3CCtuBkyHE/sql6sNcBLaj05uPL85iXX2uoC 6CW5YzHoUBJxlmy7h9mZT/zFBvMLlTPyY9QkDQX7XHBqEUIXFp5q/vgaR 4k0pLvFie3i2rue/GiUcmjjvUAHqCHM4QAQspcgI6kEyt9oMHMMq7/8HZ ApnUHCmtxUJMlfeEC3z6bYNRHne1iN0rxMsyFj1N/4LJAMVQl9zXTDjJb OJ4jDwvJYsWsVkL6ACBaZajY9lXZL4QHaV/6BlzxPkCQFChP5WEcz4IF6 Q==; X-CSE-ConnectionGUID: ToG5ZEPiSHiM67+vxm0Ctg== X-CSE-MsgGUID: giGBvsBKQmeT4wZIC/WXVA== X-IronPort-AV: E=McAfee;i="6600,9927,11052"; a="13193756" X-IronPort-AV: E=Sophos;i="6.07,221,1708416000"; d="scan'208";a="13193756" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2024 10:34:18 -0700 X-CSE-ConnectionGUID: 0Kr9rkLySKmCW5Evqz0lKQ== X-CSE-MsgGUID: piQOTgyTQmCywsB4u+mvfA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,221,1708416000"; d="scan'208";a="55019332" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2024 10:34:16 -0700 Date: Mon, 22 Apr 2024 10:34:15 -0700 From: Isaku Yamahata To: Binbin Wu Cc: isaku.yamahata@intel.com, 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 Subject: Re: [PATCH v19 125/130] KVM: TDX: Add methods to ignore virtual apic related operation Message-ID: <20240422173415.GK3596705@ls.amr.corp.intel.com> References: <52300c655b1e7d6cc0a13727d977f1f02729a4bb.1708933498.git.isaku.yamahata@intel.com> <1a3f4283-0dfd-4b7d-ae1b-f22c13a8c4e1@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1a3f4283-0dfd-4b7d-ae1b-f22c13a8c4e1@linux.intel.com> On Mon, Apr 22, 2024 at 09:56:05AM +0800, Binbin Wu wrote: > > > On 2/26/2024 4:27 PM, isaku.yamahata@intel.com wrote: > > From: Isaku Yamahata > > > > TDX protects TDX guest APIC state from VMM. Implement access methods of > > TDX guest vAPIC state to ignore them or return zero. > > > > Signed-off-by: Isaku Yamahata > > --- > > arch/x86/kvm/vmx/main.c | 61 ++++++++++++++++++++++++++++++++++---- > > arch/x86/kvm/vmx/tdx.c | 6 ++++ > > arch/x86/kvm/vmx/x86_ops.h | 3 ++ > > 3 files changed, 64 insertions(+), 6 deletions(-) > > > > diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c > > index fae5a3668361..c46c860be0f2 100644 > > --- a/arch/x86/kvm/vmx/main.c > > +++ b/arch/x86/kvm/vmx/main.c > > @@ -352,6 +352,14 @@ static bool vt_apic_init_signal_blocked(struct kvm_vcpu *vcpu) > > return vmx_apic_init_signal_blocked(vcpu); > > } > > +static void vt_set_virtual_apic_mode(struct kvm_vcpu *vcpu) > > +{ > > + if (is_td_vcpu(vcpu)) > > + return tdx_set_virtual_apic_mode(vcpu); > Can open code this function... Yes, the function is empty currently. -- Isaku Yamahata