Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp592938rdb; Tue, 31 Oct 2023 17:08:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYIWXaqljmJ5bay9oT/mHPtEZ3eHlhY1Z4SeMzEEGr95ZXVra3IvMMzFBXjU6kC2ThNgqX X-Received: by 2002:a17:902:f54f:b0:1cc:dda:9a1b with SMTP id h15-20020a170902f54f00b001cc0dda9a1bmr14362175plf.34.1698797314662; Tue, 31 Oct 2023 17:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698797314; cv=none; d=google.com; s=arc-20160816; b=oYph2gRZwn9nj8+r9PUgQNkkJ2ESX/GA5tNSulmJyk2MnGV/KKpSIOipNrYb2s8Azz Uyo8HBG0bsKMbTAHmpgVLEum2Dr5HPga21xPEV20GX/BT2TSNpKMeoS5KioM7ajMRskr M20s32AFZY+KlUq01AdO8Dm8JceEpj67/KDnSivk3MkGEUGXNJvz3PbW4BgA5WZKPUF0 HDk9hHBVMsD30U2EHw81zD2fVSmR6DcJ8wGrFthGrwWBRl7qXV7AyHGtkOjvCFZs05Kp /gzAS15GzgWYtw+NgZo6X8IZJ75L7fEZA24vCAORnCSZQhkr1Irglk6j7u5iPz2aWFZX z6Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=DER9XlP40YQ0FsYod3Po1oWh8SS7tTZc2Zrt7CkTsL8=; fh=WnlVi/Q/6zv0fZ6Ey9Krvq5QWByVvi9tb1A26EVXDkE=; b=SHHAJtlQl8FQoP4oe+8kHVNZ1j1zXSmFwpW89tzlWOBRBeEuZoGZNRTl9pcOlqgt7b HmPkKbuXkr/tLWdHVJP9yhniLXuq3nGhWjGag4sxjJZDV9D6vsgZtlAmz28uYkuPZ9sM B7BLoqz54/nnBMXkNFs/cqFRsiT7gH7gAKU/01nuovdRF4A1r1rJxV0TsZsmmBRpxL+q RiFifXxx/9NEhlp5RbAoA5bU8eeWcXZ/hc8DqjOURGma4vK8bdlMICokmedhB91A0kPz 8zULG91xy12ggMDgh2JT1W+1wzbt9AGcgWv6Y8ADT5W4LY5CKLQr0y83OTrsYi5HkSr0 853g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Edpiwt6S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id i3-20020a170902c94300b001ca5a337339si1843265pla.627.2023.10.31.17.08.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 17:08:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Edpiwt6S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DD6AD80BA7EC; Tue, 31 Oct 2023 17:08:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344135AbjKAAI1 (ORCPT + 99 others); Tue, 31 Oct 2023 20:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231129AbjKAAIZ (ORCPT ); Tue, 31 Oct 2023 20:08:25 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E0AF3 for ; Tue, 31 Oct 2023 17:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698797303; x=1730333303; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0fAlQDu6TcG0IgowxLHEv4hAohadL2zveXEyNa++vZs=; b=Edpiwt6SJ3sJip7PAByyfJ+z3e1S97kW0v5eIT1IP9yvRz8i8ZxMZeXc XrzIqyidiAt5Dt2Wwx/GaBU4p0jL2GFBMc0/SCJFmueskmXQuN9r8Wpp1 q98C5TaXgKo57GRstfdcbWVxuH3cDaSsUWqNUBORFUtHZ2NpK6m/jGpSx fGfI1Gs9kcUHy1gNKhMbMrgSkykSY1IwUicbsojJZv5mFjWMUYl6zBydl NxrihoyPnhLbpHMjnhkj3NzXzOMvWhEr3MNTET+V6Qz1dgnBbCAu8sSA0 v62WaDGiiuqz8V0qsqVMU7kARnEJT5BWe8EEiS+Gocr+dePf5RiCU0Vtz w==; X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="9933860" X-IronPort-AV: E=Sophos;i="6.03,266,1694761200"; d="scan'208";a="9933860" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 17:08:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="754298707" X-IronPort-AV: E=Sophos;i="6.03,266,1694761200"; d="scan'208";a="754298707" Received: from viggo.jf.intel.com (HELO ray2.sr71.net) ([10.54.77.144]) by orsmga007.jf.intel.com with ESMTP; 31 Oct 2023 17:08:22 -0700 From: Dave Hansen To: torvalds@linux-foundation.org Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Dave Hansen Subject: [GIT PULL] x86/tdx for 6.7 Date: Tue, 31 Oct 2023 17:07:55 -0700 Message-Id: <20231101000755.4183137-1-dave.hansen@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 31 Oct 2023 17:08:32 -0700 (PDT) Hi Linus, Please pull some x86/tdx changes for 6.7. The majority of this is a rework of the assembly and C wrappers that are used to talk to the TDX module and VMM. This is a nice cleanup in general but is also clearing the way for using this code when Linux is the TDX VMM. There are also some tidbits to make TDX guests play nicer with Hyper-V and to take advantage the hardware TSC. -- The following changes since commit 0bb80ecc33a8fb5a682236443c1e740d5c917d1d: Linux 6.6-rc1 (2023-09-10 16:28:41 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git tags/x86_tdx_for_6.7 for you to fetch changes up to 9ee4318c157b9802589b746cc340bae3142d984c: x86/tdx: Mark TSC reliable (2023-10-06 10:00:04 -0700) ---------------------------------------------------------------- * Refactor and clean up TDX hypercall/module call infrastructure * Handle retrying/resuming page conversion hypercalls * Make sure to use the (shockingly) reliable TSC in TDX guests ---------------------------------------------------------------- Dexuan Cui (1): x86/tdx: Retry partially-completed page conversion hypercalls Kai Huang (12): x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro x86/tdx: Skip saving output regs when SEAMCALL fails with VMFailInvalid x86/tdx: Make macros of TDCALLs consistent with the spec x86/tdx: Rename __tdx_module_call() to __tdcall() x86/tdx: Pass TDCALL/SEAMCALL input/output registers via a structure x86/tdx: Extend TDX_MODULE_CALL to support more TDCALL/SEAMCALL leafs x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL x86/tdx: Reimplement __tdx_hypercall() using TDX_MODULE_CALL asm x86/tdx: Remove 'struct tdx_hypercall_args' x86/virt/tdx: Wire up basic SEAMCALL functions x86/virt/tdx: Make TDX_MODULE_CALL handle SEAMCALL #UD and #GP x86/tdx: Fix __noreturn build warning around __tdx_hypercall_failed() Kirill A. Shutemov (1): x86/tdx: Mark TSC reliable arch/x86/Kconfig | 12 ++ arch/x86/Makefile | 2 + arch/x86/boot/compressed/tdx.c | 6 +- arch/x86/coco/tdx/tdcall.S | 234 +++++--------------------------------- arch/x86/coco/tdx/tdx-shared.c | 28 ++++- arch/x86/coco/tdx/tdx.c | 138 +++++++++++++++------- arch/x86/hyperv/ivm.c | 10 +- arch/x86/include/asm/shared/tdx.h | 89 +++++++++------ arch/x86/include/asm/tdx.h | 11 ++ arch/x86/kernel/asm-offsets.c | 33 +++--- arch/x86/virt/Makefile | 2 + arch/x86/virt/vmx/Makefile | 2 + arch/x86/virt/vmx/tdx/Makefile | 2 + arch/x86/virt/vmx/tdx/seamcall.S | 61 ++++++++++ arch/x86/virt/vmx/tdx/tdxcall.S | 226 +++++++++++++++++++++++++++--------- tools/objtool/noreturns.h | 1 + 16 files changed, 491 insertions(+), 366 deletions(-) create mode 100644 arch/x86/virt/Makefile create mode 100644 arch/x86/virt/vmx/Makefile create mode 100644 arch/x86/virt/vmx/tdx/Makefile create mode 100644 arch/x86/virt/vmx/tdx/seamcall.S