Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3115568pxj; Mon, 10 May 2021 19:21:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1Hnz9wVuFZQzm4zrjSlm5nB/+oN7tuSbeWautW8c6f90sdTvSATrLNHxiZ9gwBuqHWzZS X-Received: by 2002:a05:6402:4383:: with SMTP id o3mr33057904edc.333.1620699661359; Mon, 10 May 2021 19:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620699661; cv=none; d=google.com; s=arc-20160816; b=wvw5872Ot3TDxZI+oLSj/tywL4jan7+o0MwxH62sG9XmWqnz2PlBiF80F80M0fCnqF xkOqstZjha7T8jSMfFxK8CvjbFmanC3JE0ag/36dmGomHBxQ1C7yfbqHk4CyjoG36wtH ScSncypdq7jzUxRA02mUydh5/NT4xRho5y834JsL2lfGIhVJHqqBflkaLBQ7H/8ZCp8/ DGI8SCLAu9e+wMM0avA2FBkwkljt727fCnbHqg2lphtvbZm+6lwK0ObWwa0eN1wV99zs sR1xTjzHpkHgwRTmgy5X6lq++fkC9X5tzpnqJaldrZQwMIN6DwhlrIFA3JGMpkv5UWWw McMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=LgFeAPg3Q2h11lZPhw9slC7Q3mVzyj3D3puD3waKP24=; b=rsjuwM6bxJor+HZ5nvPEVThPZsZwy8ak2CcVeVGL6oGmfqVDcv1cUGlI/qcB4Ujmed DO+Od5Lr9pgBoiAAuHwy0f6m3mU7LOQli3/kjq/wPklAzM+AS4NKMaoEj/hpdu98vd2U YtqwKoWGTAlyu1Evxmb2x/rOCcvM8ezN+JESaRY1CzTOq6KTlZpyXnxNRxzQlXF4Cf7j HnkL0FVHJ6j4ZXVElfaW67yoPaIJNr9M8tm+Z2A5jYbbZYd18yam7hqt1b4kpS3ntIpY Z3gNp2p7Ja6ZDNs57cfAsYD3NYzxzfXIiQPdCo0wWxDEaQDr4dOxNvF8ozJwbSiaU0lh xRVg== 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 w24si17484249ejb.528.2021.05.10.19.20.37; Mon, 10 May 2021 19:21:01 -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 S230477AbhEKCUZ (ORCPT + 99 others); Mon, 10 May 2021 22:20:25 -0400 Received: from mga01.intel.com ([192.55.52.88]:13354 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230417AbhEKCUZ (ORCPT ); Mon, 10 May 2021 22:20:25 -0400 IronPort-SDR: 8RWUe7W8jqX16NB4wgz9Y8Qz8fAFpgVjhOEKri6h/N/RAR4P3WcnXMMtYWQuEfM5W0LWhLND67 juV8Q/L/150g== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="220288820" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="220288820" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 19:19:19 -0700 IronPort-SDR: FLN5JysCA+Gp5Oc3E4ZlMPbIVXuZ078nnQ1dj4cmnyZTtO81lkHOAFUSkrV7NLxaP+StjhuAQN Sjjvf87FUNnQ== X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="434075669" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.209.32.217]) ([10.209.32.217]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 19:19:18 -0700 Subject: Re: [RFC v2 14/32] x86/tdx: Handle port I/O To: "Kuppuswamy, Sathyanarayanan" , Dan Williams 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> <648fe68f-c521-dbba-4495-9a4d0498a3be@linux.intel.com> From: Andi Kleen Message-ID: <96ffe033-9f60-b56e-d159-c1d0e8ae532b@linux.intel.com> Date: Mon, 10 May 2021 19:19:18 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <648fe68f-c521-dbba-4495-9a4d0498a3be@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/10/2021 5:56 PM, Kuppuswamy, Sathyanarayanan wrote: > > > 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? The old name was SAVE_ALL / SAVE_REGS. Yes please put it outside tdx code into some include file. -Andi