Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp906974pxj; Tue, 18 May 2021 17:21:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynWRXyNYW2ITjR489LlvuZQOTRViXYdZelIJqXe5FwHawBK6H6HdJGwjY5nMfdtdkU9egP X-Received: by 2002:aa7:cfcd:: with SMTP id r13mr10178169edy.177.1621383704858; Tue, 18 May 2021 17:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621383704; cv=none; d=google.com; s=arc-20160816; b=r68rwilA2hOjiRXEpSfBd/Ncj/lQOQ7EQtRdOjNOR87Dv18TAK0RaDZIzgMD+tV97A bLX2gZTMp7I0vrLUPyzq3u8yEbN0A8vFFaUP5s/YAHMTu4uMlP20/JfhL/QEa2QqFgw+ Ydc94vgnmHu8S6qx4c7M8kwsOvTFXI54gcQzNcm1l2Tb8QOHDopJtbrSFFAlko8xBdD2 JBgCfv5wBy1pJEm6QeFCDADrzRHn3pO75KPa4LvzisYyWqoTQoCbZZp83qCS7Sk9EwZd OgGWYob1acJnX/YE5EExfTqi7aLPHrnPZHMUBnUlGtORZ05bmTdbxbXR6ORcZD0tmTRy mpHQ== 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=2wf1OgAeI+9s8rpl2vGE4rKQY3OmX6BsLljNVCStlIE=; b=ta2zGZKnBRH7d0iCznADYizdfm55/BeLh6mYNLYHlRHqMmP9kxv4Z0/sAkcDWK0ULL XMiW06TZl5XISW4bwxJGv38rCO+0wN+gGmWCnAerHvAzgdf/6OciYr/J9Q2Fz0tFLGBb jOon+ct2qU1EgqsFoDJsSc79iGSQGYus+terrgYdgGXAnM0Y6fP320aobmUv1qHg3h+O BMzwmwzsb5cHl4p29WbGj7czVzClgyDHsK2W+BB7BNM2nzU03CL19TaT1xIzh7zDtlG9 ogleALHxomjlx+glSpfXuypbITL2VVOqb3wZJf6Frhwd04+VQ6jwqdQL77mmG9YNrErN 2AIA== 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 g6si2563122edb.247.2021.05.18.17.21.08; Tue, 18 May 2021 17:21:44 -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 S234608AbhEQS25 (ORCPT + 99 others); Mon, 17 May 2021 14:28:57 -0400 Received: from mga17.intel.com ([192.55.52.151]:17147 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233592AbhEQS2z (ORCPT ); Mon, 17 May 2021 14:28:55 -0400 IronPort-SDR: YjMTZCGkoQQhWyf2PNgqEJZtPuHOILB7a5+vP/cxJOOimoLOwVQYRY1UAEJ4YAfss3U+feT/4P HQ0L7870ming== X-IronPort-AV: E=McAfee;i="6200,9189,9987"; a="180812523" X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="180812523" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 11:27:37 -0700 IronPort-SDR: 3g4wahcMquEIn9pC7wPTvUqmPsuxEsWz+PdKJfmj7EJmI6N6zOBV03b3r+ixWosiRLhSetr7pq ICUV4CvXG3Ig== X-IronPort-AV: E=Sophos;i="5.82,307,1613462400"; d="scan'208";a="393625340" Received: from jtshade-mobl.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.212.100.65]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 11:27:35 -0700 Subject: Re: [RFC v2 26/32] x86/mm: Move force_dma_unencrypted() to common code To: Sean Christopherson , Andi Kleen Cc: Dave Hansen , "Kirill A. Shutemov" , Peter Zijlstra , Andy Lutomirski , Dan Williams , Tony Luck , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , 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> <943645b7-3974-bf05-073c-03ef4f889379@intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: Date: Mon, 17 May 2021 11:27:31 -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/17/21 11:16 AM, Sean Christopherson wrote: > What generic code needs access to SEV vs. TDX? force_dma_unencrypted() is called > from generic code, but its implementation is x86 specific. When the hardening the drivers for TDX usage, we will have requirement to check for is_protected_guest() to add code specific to protected guests. Since this will be outside arch/x86, we need common framework for it. Few examples are, * ACPI sleep driver uses WBINVD (when doing cache flushes). We want to skip it for TDX. * Forcing virtio to use dma API when running with untrusted host. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer