From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4BF9C433ED for ; Tue, 11 May 2021 02:19:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92DD46162C for ; Tue, 11 May 2021 02:19:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230487AbhEKCU0 (ORCPT ); Mon, 10 May 2021 22:20:26 -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