Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4201002pxj; Tue, 8 Jun 2021 08:43:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4jyG0lKnoflfdMrD08NCFX/tcZFeG0I+2Jz6Y4yQWnSB5ylNPjiTdx7c6AFT6SId+knnb X-Received: by 2002:a17:906:76d2:: with SMTP id q18mr23796484ejn.294.1623166998836; Tue, 08 Jun 2021 08:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623166998; cv=none; d=google.com; s=arc-20160816; b=UHglCMKaPExtILT3HMwYzxPxtlPGKGNqy+ZxfbdombbsZZgmuEB4eVA+ea50BMO1RO cqyCZwku7X3Zm67AATRQzDDOCvHcXTrXMus9hW40SfQDFrTBHntaKUh8id0+2FJJ/bW8 lwnCI3TRt2mhzL0yPy3Ype458RdqJMK/ie/ELMgAtWNTr+Ng5FTMg+Nbr1JVYUcqVful IQuCIxzwq26gc5sEUg30kCkCOq/2cbqXf3datsPtswdnitPf0hv2JnvDIZ9dXFWG2BF6 2iAHmSC3ypvWb+VApL9QoD/PdAUN+CBi9wsV+FYdOX1HBHIvlcU81Z5APyFcYXbg+eDy ERWg== 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=SP9i47KLgMiIuK/sIGcD9V9ECMQaw+HcNId5O6+oZ5s=; b=UQ7TIkiRnsz7Q6OnXOM4Mnw0d8c0JiYItuOTL9euVVWUp3klLY4ToN+4CMdBy4zUOT is/+3Tf1xFRVuScJNMppsdN+E1X6N9eO4fmESY8Kd/vQjGqXX/zDAXS9neYrwjklEO5T aB6gzkEI7NQ/4R52xSEIfBF4DuIKDI6MqWHIw7BnvSvkJmp1PjDp7TPi0Pz7Phru8Qzo F3Le64qhU/o4567w9iDSmsF8JF1PHvgHVJtCFjptM/yskLCxEA1nJDr/znEPA+gasdda MIbA0H1b/GOqjZnOiej7ZRA3T8+qeEouS/q3F60ORZhFvaM+pHaWbSRTTxixTSOS3i/T /Z7A== 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 ba10si398edb.344.2021.06.08.08.42.49; Tue, 08 Jun 2021 08:43:18 -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 S231961AbhFHPmm (ORCPT + 99 others); Tue, 8 Jun 2021 11:42:42 -0400 Received: from mga11.intel.com ([192.55.52.93]:7767 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231996AbhFHPme (ORCPT ); Tue, 8 Jun 2021 11:42:34 -0400 IronPort-SDR: d3aRzP+3S6sFUd5uQDtuxTRPDKd45Qo7IAdy7Qfgvv5KlGNLiaDvfmlRYioVbc4q2GxrhmneaK AUq+MzirG/iA== X-IronPort-AV: E=McAfee;i="6200,9189,10009"; a="201849037" X-IronPort-AV: E=Sophos;i="5.83,258,1616482800"; d="scan'208";a="201849037" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 08:40:30 -0700 IronPort-SDR: YpOV4FO2hhJwyS1M3ho7/A8lj2Od4mrDRlaSd8geubsNCZjd9LS6TXZXsQbMDjnEqSKd/D3T3y ynWY9o6OXWzw== X-IronPort-AV: E=Sophos;i="5.83,258,1616482800"; d="scan'208";a="552314839" Received: from ticela-az-103.amr.corp.intel.com (HELO skuppusw-desk1.amr.corp.intel.com) ([10.254.36.77]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 08:40:29 -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 , linux-kernel@vger.kernel.org, Kuppuswamy Sathyanarayanan Subject: [RFC v2-fix-v2 0/3] x86/tdx: Handle port I/O Date: Tue, 8 Jun 2021 08:40:20 -0700 Message-Id: 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-fix-v1: * Splitted TDX decompression IO support into a seperate patch. * Implemented tdg_handle_io() and tdx_early_io() in the similar way as per review suggestion. * Added VE_IS_IO_OUT() macro as per review suggestion. * Added VE_IS_IO_STRING() to check the string I/O case in tdx_early_io() * Removed helper function tdg_in() and tdg_out() and directly called IO hypercall to make the implementation uniform in decompression code, early IO code and normal IO handler code. 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): x86/tdx: Handle port I/O in decompression code arch/x86/boot/compressed/Makefile | 1 + arch/x86/boot/compressed/tdcall.S | 3 ++ arch/x86/include/asm/io.h | 15 +++--- arch/x86/include/asm/tdx.h | 54 ++++++++++++++++++++ arch/x86/kernel/head64.c | 3 ++ arch/x86/kernel/tdx.c | 84 +++++++++++++++++++++++++++++++ 6 files changed, 154 insertions(+), 6 deletions(-) create mode 100644 arch/x86/boot/compressed/tdcall.S -- 2.25.1