Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp285882pxj; Wed, 26 May 2021 23:25:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8RO3ZzRn20qlpHdiDm62U55oswmMVRuiTYC9gUvE2b+MqJH+rHEqzm6lqTw+Sfm9GI+4b X-Received: by 2002:a17:906:d0d4:: with SMTP id bq20mr2154167ejb.541.1622096725630; Wed, 26 May 2021 23:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622096725; cv=none; d=google.com; s=arc-20160816; b=J1awMNgbySiXbs0AeQ/XEalEgT+8uDkIqSQ8fMSr45KOMIF6fZzXhJbFWcq2mHMigY a2o7VTzzYt98+jWeO1mZ4dXsumPvtXevnhKSvwU8Hc2Rs3DJtZH3Eqg3U+gar8hgJZeS XvyOZCPXGVOHZdUxqSTRkZkGSBXP4dqsSXenX+j1l2tnSkoQXqNNQZkLrvqJGqCjhRQc /+y0h87Aay1z/FD1dsvjC41chRIz3FYOLol9yuVIaAxazIqmdFDHyQm4SzHgvUqZ36DD EQ+/NC+G/I8rejWn0bvajEpIzOGWswmfNWrRmKr1lEEf6AvAZ4vKwfmrsvNyZwwdsQHj LH/g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=krP2huzmX2IxX0+c6Te1Y1RGzq3QpefNSMXASuTOaPg=; b=XT7jjQbOJbPM+fpUBlnVqRHM42KdnHAUhlh3Cwlwb/+V5pzsdNjifyPfuc/uW5D6Cs Mb8eX/QKqpXyUYc3vjEOQNcglEqt7FHAfJ9tH7k7Jh9eJhNfyOLcjKY5hulceeT4ye7p hGXFNgnueak0iFItxCXjWRih8visGtuZHP5j7ZeWetgVRYmfM/5sckul5VUGIlmb9QV5 Joa4YTiaHgezRRBwynTW3fjXXKUJlYtIdkICz2a08fWXr4j9HM34KjO33cScvux/Bcnn 2HKmcnOzUyRYrGsZ2s++/V4Bxd7Tkqx03iY4aHmx70GsXimy/ZgF9oaeT6SxSrdogpe/ kdgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz5si1272864edb.303.2021.05.26.23.25.00; Wed, 26 May 2021 23:25:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbhE0EZq (ORCPT + 99 others); Thu, 27 May 2021 00:25:46 -0400 Received: from mga17.intel.com ([192.55.52.151]:56123 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbhE0EZp (ORCPT ); Thu, 27 May 2021 00:25:45 -0400 IronPort-SDR: lcOFcnNHPCxk2/uvZUR2stcHLGvQFc5G/LTLFKSs9spX6rnIVkhbNH/39EKowiXscIn2TKKdrg 9z1gxPWiBXnA== X-IronPort-AV: E=McAfee;i="6200,9189,9996"; a="182979643" X-IronPort-AV: E=Sophos;i="5.82,333,1613462400"; d="scan'208";a="182979643" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2021 21:24:12 -0700 IronPort-SDR: vTsaw6QNaM/5cgvOZHBHc/jzqVYYdLz1srgA4CeZJ31uwN1Yn8rbWDsNebYiorPAs3KYb8QZkS QlN/fpwTAjwQ== X-IronPort-AV: E=Sophos;i="5.82,333,1613462400"; d="scan'208";a="480391407" Received: from skgangad-mobl.amr.corp.intel.com (HELO skuppusw-desk1.amr.corp.intel.com) ([10.254.33.45]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2021 21:24:12 -0700 From: Kuppuswamy Sathyanarayanan To: Peter Zijlstra , Andy Lutomirski , Dave Hansen , Tony Luck , Dan Williams Cc: Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org Subject: [RFC v2-fix-v1 0/3] x86/tdx: Handle port I/O Date: Wed, 26 May 2021 21:23:53 -0700 Message-Id: <20210527042356.3983284-1-sathyanarayanan.kuppuswamy@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset addresses the review comments in the patch titled "[RFC v2 14/32] x86/tdx: Handle port I/O". Since it requires patch split, sending these together. Changes since RFC v2:  * Removed assembly implementation of port IO emulation code    and modified __in/__out IO helpers to directly call C function    for in/out instruction emulation in decompression code.  * Added helper function tdx_get_iosize() to make it easier for    calling tdg_out/tdg_int() C functions from decompression code.  * Added support for early exception handler to support IO    instruction emulation in early boot kernel code.  * Removed alternative_ usage and made kernel only use #VE based    IO instruction emulation support outside the decompression module.  * Added support for protection_guest_has() API to generalize    AMD SEV/TDX specific initialization code in common drivers.  * Fixed commit log and comments as per review comments. Andi Kleen (1): x86/tdx: Handle early IO operations Kirill A. Shutemov (1): x86/tdx: Handle port I/O Kuppuswamy Sathyanarayanan (1): tdx: Introduce generic protected_guest abstraction arch/Kconfig | 3 + arch/x86/Kconfig | 1 + arch/x86/boot/compressed/Makefile | 1 + arch/x86/boot/compressed/tdcall.S | 3 + arch/x86/boot/compressed/tdx.c | 28 ++++++ arch/x86/include/asm/io.h | 7 +- arch/x86/include/asm/protected_guest.h | 24 +++++ arch/x86/include/asm/tdx.h | 60 ++++++++++++- arch/x86/kernel/head64.c | 4 + arch/x86/kernel/tdx.c | 116 +++++++++++++++++++++++++ include/linux/protected_guest.h | 23 +++++ 11 files changed, 267 insertions(+), 3 deletions(-) create mode 100644 arch/x86/boot/compressed/tdcall.S create mode 100644 arch/x86/include/asm/protected_guest.h create mode 100644 include/linux/protected_guest.h -- 2.25.1