Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3068552pxj; Mon, 10 May 2021 17:59:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIxpr9Kh0br7Ff8GXVkvBhMcEkGe3R1LJPHvU8P2o4MYOviZiHjqBzbv1nvgo3nBc9pb+c X-Received: by 2002:a92:4b06:: with SMTP id m6mr6416735ilg.54.1620694752319; Mon, 10 May 2021 17:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620694752; cv=none; d=google.com; s=arc-20160816; b=P1JkY+pS4/YfH2ZNtKN39V2fI6J1NNrvl0QwMHdRGVtz+iszyLQEmEW/u63Nz/w90e oK5G+ihbYqaiNucmDcku7b9Q2N0tz4wLgOB85gm79f17Nsc+QtNOxYq08dblWTFggZEB BeAvKNE0/Ssy/f/JlTM1IXX2rp7FMk8fUE6G/J+LDn/5ExFthWQmrLboCsU/mpU+GBnS y1zezIJmQaBLOgLnOsxnBwcpmdCQ2N+oXhpgedw4GH4EONBgPX2LEsAsl4hCKe70MEFz fzjQIUNCKv35UYAeXAk16qGd+F//D5QuoW8YfpEDlqGhgVvcaDJUjWV6XclFXolCWSG2 XQFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=rx/8VDoTfFGFfvUPE6Qf7ti6KQFOTjy+d7p4YFKU6Tc=; b=gjNea9XLf+Vq7is3brGgbf1/eYRaRix9jFy/A15881x1cvlfWmYTIuukUj9UiuoNVQ RUTMM/+a8cisWaDQ5vs57k3N/BqdJanu6ZT+4EFHDnWVR9uNxVSRHud1LmqZdsGMgHt1 BaZsY7X3Jlfj8kZMQ9JWKFl/D96B2G7j5JgLDENtorbF3elyHymZs58zTDbgMXckaRVq X9PyY66WwE+lPK14DSNRz3pUk6c9mLolvucLx4MHYKZrqczqwYtICVPJ+gdAlofIxlEg uNwh4RJ9OXYr2qudl/dGvDfgmPyFSVenvtdZzdKgI1U0PJnZuHAJV7+/2hgXNMUYW2dr xdBQ== 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 w9si7555288ilv.15.2021.05.10.17.58.58; Mon, 10 May 2021 17:59:12 -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 S229996AbhEKA6G (ORCPT + 99 others); Mon, 10 May 2021 20:58:06 -0400 Received: from mga12.intel.com ([192.55.52.136]:41091 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbhEKA6F (ORCPT ); Mon, 10 May 2021 20:58:05 -0400 IronPort-SDR: lqu/X6UteCN/t1XqVWaCN3x8EGa1HBXem+blhnWQ/o9GGkwDjOsJeTrqErGiQJrBcC6Etshjil dAfNmdXrtcbQ== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="178914936" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="178914936" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 17:57:00 -0700 IronPort-SDR: WUv2E4eXYfwDyhrA/lvKTldiswLPuB87I6iCKNz96u+SrTOd2+mtfQJaca3kHBuYv6U3/iyKw2 Ey5mSQRLZDow== X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="609297151" Received: from kcmorris-mobl1.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.213.165.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 17:56:59 -0700 Subject: Re: [RFC v2 14/32] x86/tdx: Handle port I/O To: Dan Williams , Andi Kleen Cc: Peter Zijlstra , Andy Lutomirski , Dave Hansen , Tony Luck , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , Linux Kernel Mailing List References: <0e7e94d1ee4bae49dfd0dd441dc4f2ab6df76668.1619458733.git.sathyanarayanan.kuppuswamy@linux.intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <648fe68f-c521-dbba-4495-9a4d0498a3be@linux.intel.com> Date: Mon, 10 May 2021 17:56:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/10/21 4:34 PM, Dan Williams wrote: >>> Surely there's an existing macro for this pattern? Would >>> PUSH_AND_CLEAR_REGS + POP_REGS be suitable? Besides code sharing it >>> would eliminate clearing of %r8. >> >> There used to be SAVE_ALL/SAVE_REGS, but they have been all removed in >> some past refactorings. > Not a huge deal, but at a minimum it seems a generic construct that > deserves to be declared centrally rather than tdx-guest-port-io local. I can define SAVE_ALL_REGS/RESTORE_ALL_REGS. Do you want to move it outside TDX code? I don't know if there will be other users for it? -- Sathyanarayanan Kuppuswamy Linux Kernel Developer