From patchwork Thu Jan 25 03:23:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 13529915 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 1A0DA13AD1 for ; Thu, 25 Jan 2024 03:31:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706153488; cv=none; b=TDbRDnK6gyK2gqjwZ3Y8HoJAFI1wYQthwyslyvHaeaFdHrPKGa2LQmOkmqPSFGrWxsSeAeGlFu8+Xh7hKmQT+nAIBnqukg7vkC3sWUnJq0oK4bojRjUXkAJUiwiA6M+AJLHucV01ztVWl6a6yBjwW8EnFlAv3KpBoI1tmNREuh8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706153488; c=relaxed/simple; bh=maYjgz/h/ZZjwQV0B3brw6jcZafKzTlp30cuMRoIjBA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=G6citFWgR8JvCqMSaBZmag3TFI1vawsZ8S6b5FSlgyAVJAy12EL7qmMCVTzxRgxm8GXmqZV4+RxDDyaI0Vou/6hUy7PvOCQ2L+yHxo63HxjVdfnZRtDIA9pBawKEKgB49wpr56XQGnA9JSQPtuG/fXgs/FcPVZ+JmNNH5SgaEIA= 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=UXH8ex4k; arc=none smtp.client-ip=192.198.163.10 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UXH8ex4k" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706153487; x=1737689487; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=maYjgz/h/ZZjwQV0B3brw6jcZafKzTlp30cuMRoIjBA=; b=UXH8ex4kEKGT1b6BrcGzOMWNubq1YY+U5JGbyFVhXsCuwVeq+avu1mRl UzyvAGB9ecExpBQgdjhm/XcxOGzxlTFRxa/akcURNsjVUkC/iUBXu8z7H JW5LgssET5b4rCSp2k/CS77WpZRofHuJv/mOW3HM0G18ExRlzzpthjMHL LuTLkB/c754YagRaFgxeL/Q10t9qKrN2HMfcKGWgMQOXwNlkrbvB56QKC 0l3+rddS+vOjB/NtfBrYWKWsqoWuytS3/SQGP148hx81ZEqLxF7AzrJlY kQnHxIzyPNiZJvqlymxhBcGLTQI4Svoy00SUUEf3a97K4eYYe8MgTSNco Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="9430553" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="9430553" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2024 19:29:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="2086706" Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by orviesa005.jf.intel.com with ESMTP; 24 Jan 2024 19:29:21 -0800 From: Xiaoyao Li To: Paolo Bonzini , David Hildenbrand , Igor Mammedov , "Michael S . Tsirkin" , Marcel Apfelbaum , Richard Henderson , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cornelia Huck , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Eric Blake , Markus Armbruster , Marcelo Tosatti Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, xiaoyao.li@intel.com, Michael Roth , Sean Christopherson , Claudio Fontana , Gerd Hoffmann , Isaku Yamahata , Chenyi Qiang Subject: [PATCH v4 64/66] i386/tdx: Skip kvm_put_apicbase() for TDs Date: Wed, 24 Jan 2024 22:23:26 -0500 Message-Id: <20240125032328.2522472-65-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240125032328.2522472-1-xiaoyao.li@intel.com> References: <20240125032328.2522472-1-xiaoyao.li@intel.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 KVM doesn't allow wirting to MSR_IA32_APICBASE for TDs. Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann --- target/i386/kvm/kvm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 128cce929ed3..109f778ba14d 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -3065,6 +3065,11 @@ void kvm_put_apicbase(X86CPU *cpu, uint64_t value) { int ret; + /* TODO: Allow accessing guest state for debug TDs. */ + if (is_tdx_vm()) { + return; + } + ret = kvm_put_one_msr(cpu, MSR_IA32_APICBASE, value); assert(ret == 1); }