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 00630C4707F for ; Thu, 27 May 2021 04:46:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDCC5611C9 for ; Thu, 27 May 2021 04:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbhE0Erq (ORCPT ); Thu, 27 May 2021 00:47:46 -0400 Received: from mga02.intel.com ([134.134.136.20]:20290 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbhE0Ero (ORCPT ); Thu, 27 May 2021 00:47:44 -0400 IronPort-SDR: VoEjo+DQdxW37IWnPDFQ+FepY/c1+MepCeJ8vafskodxW+DxTnkD65+0bWRpmVev57c+O90CVV b2yDGE7PKvjQ== X-IronPort-AV: E=McAfee;i="6200,9189,9996"; a="189768101" X-IronPort-AV: E=Sophos;i="5.82,333,1613462400"; d="scan'208";a="189768101" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2021 21:46:11 -0700 IronPort-SDR: 62Tm5zi7TGbqjS64796oOtrEvTUtHN8hacdWLq7e1MlkexgR4oePMmqUiPom0tT3hAuH0+ENCu w/acnlkA2Jng== X-IronPort-AV: E=Sophos;i="5.82,333,1613462400"; d="scan'208";a="547534955" Received: from skgiroua-mobl2.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.251.151.24]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2021 21:46:10 -0700 Subject: Re: [RFC v2 26/32] x86/mm: Move force_dma_unencrypted() to common code From: "Kuppuswamy, Sathyanarayanan" To: Dave Hansen , "Kirill A. Shutemov" Cc: Peter Zijlstra , Andy Lutomirski , Dan Williams , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , linux-kernel@vger.kernel.org References: <7c5adf75d69ea327b22b404b7c37b29712d73640.1619458733.git.sathyanarayanan.kuppuswamy@linux.intel.com> <5536639a-918d-de8d-ff32-934a13902a03@intel.com> <20210512130821.7r2rtzcyjltecun7@box.shutemov.name> <3ad7a35d-45f2-9c62-23cd-3b7a167c5d83@linux.intel.com> Message-ID: <8ae486b9-6e03-52fd-ee4d-b106e087ef8d@linux.intel.com> Date: Wed, 26 May 2021 21:46:08 -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: <3ad7a35d-45f2-9c62-23cd-3b7a167c5d83@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/17/21 6:28 PM, Kuppuswamy, Sathyanarayanan wrote: >> Because the code is already separate.  You're actually going to some >> trouble to move the SEV-specific code and then combine it with the >> TDX-specific code. >> >> Anyway, please just give it a shot.  Should take all of ten minutes.  If >> it doesn't work out in practice, fine.  You'll have a good paragraph for >> the changelog. > > After reviewing the code again, I have noticed that we don't really have > much common code between AMD and TDX. So I don't see any justification for > creating this common layer. So, I have decided to drop this patch and move > Intel TDX specific memory encryption init code to patch titled "[RFC v2 30/32] > x86/tdx: Make DMA pages shared". This model is similar to how AMD-SEV > does the initialization. > > I have sent the modified patch as reply to patch titled "[RFC v2 30/32] > x86/tdx: Make DMA pages shared". Please check and let me know your comment My method of using separate initialization file for Intel only code will not work if we want to support both AMD SEV and TDX guest support in same binary. So please ignore my previous reply. I will address the issue as per your original comments and send you an updated patch. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer