Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp286644pxj; Wed, 26 May 2021 23:26:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxqf3XdpUSdEdzntxXvf+ETV+6q8GOeOwR9EFwkiBqG7T58xopi3MBSnTME8e4iPJQ1NNz X-Received: by 2002:a17:907:2148:: with SMTP id rk8mr2166626ejb.270.1622096816964; Wed, 26 May 2021 23:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622096816; cv=none; d=google.com; s=arc-20160816; b=JiUZ/kgAHxfnhdwAnR95EkgFuQTUESnjAVD46SUb54gKYEZwrQzbUBPxEq90Wkx0W1 9NZJs+kSuqqbVuwqFtaArWgCgc1+YyL9hBd9nKPMxK12IRkArMEKX7XUvuozQzWhZcvC As8005wEk5dFj2mAuzGnDLLWvZRsGLnMikcURhwssHcmWyHV862VZoeOuqE+Nxe1a4XW xyLjqSvGtE8/WhFPWLsAVcBLGTCPrn52rIIpvdM0Hlse69rIy7nt39QDO+AWPjys/BpL 6H4usLQnhqO46TNmSQr68BCIuoNa8ob9P2uSoq9YeXKxVC3mY6pOAC3LOI6ofSW98m+E 8QAQ== 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:references:cc :to:from:subject:ironport-sdr:ironport-sdr; bh=h0h797Qna8T9JFJVChbuh/CMZAnoNfebQbs+tVb8aKM=; b=k8fsnLZo+eNzQpAQqf+DuC6DFFhU7vyBcm6n2gj7kXNKvuy4Jc8G/Rjtcsi3KY8DV/ YOr5TOol+J2aKu9YEQ9gwgp1hECfB77YzycBfDwqSDQr3znmBRE74xq5XhHGIoWAYP9R MN+acHExQwBOFFaxcLysPWeRBF8HHMAAOP6FM0WCABXW3GIPb9szdQsYeyPE6uIqRhZL xO6g6VvcGA+z176hCvr7W1h4NuxYndqToPv5FaBJKKnSZaafruloTf/nKRkUwHMk7sFT G+c2BKqs7Hpo3juI6Z8eeKUSQQYfd+efeT46g9Uy6Wpetc9CVmKBgEXhD8zD/CDlVeyd oItg== 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 y18si535071edr.418.2021.05.26.23.26.30; Wed, 26 May 2021 23:26:56 -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 S229833AbhE0Erp (ORCPT + 99 others); Thu, 27 May 2021 00:47:45 -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