Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2136211pja; Thu, 26 Mar 2020 10:14:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsczWUG9ACq/R9Btv0yVwzs4rmmj7bnv8Wgb30SWm3tPPxGKOAn9m/lh7I3Wl+xLa7oMAns X-Received: by 2002:aca:b602:: with SMTP id g2mr860782oif.82.1585242854491; Thu, 26 Mar 2020 10:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585242854; cv=none; d=google.com; s=arc-20160816; b=fXDr6tP77iYeJeef3yGDDYJHm1FcYwsvsZQ0a/4VmsU4e4BiVHfnpKZXVpdX4u44p0 s3IIDmu1As/SQ0x2YpmAna12Wp4sXRjW1fbN57Y2WICC6fGqd1xNLcMKJJYo0jLbRL/K 1znI9zBhVGgGe63XgxyU9ac6TDK8w1T6m4OHLUXekpWrJVdiJR0vy4riq3nl63Yjoe32 LOn9qpGos5pCD8wYM9rR+oDPfg2hPiV+QKqbqBrAQuMy5qB3tiwmQShs+/QIEcc+9PCO tY4LbcB3xmh3rF0bYDxAAB3TbDItUDnMfTzklcEk1gIDYgjcadi/Pxx9dvkKFa3DGjaq utVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr :dkim-signature; bh=7dKViaTkqgkOuleKzCaJ8koVRSroLTuB4+O9Hh8aggM=; b=sfdgpBpXRNBYan+O6vSxIjeXaORMuzexVm2eQXnjp7eOoxS3lTi46oy2xnwZCGlIQA sFaFEwW5843GF9BkXGjcZQ1NJIvcal/XXaLFyg9/derKCvU/A9YFboDxjfCUOhU1sYs8 sFVCrVApKh9OYqBZ5vtzfgZVNA3guzfjqs52GApLfrUe8Ohr6fRURXwgqDTssEhjs6RK KELUv9Apg1fBDLrGu3Bk8i4I74va6qK7l8eu6HenkZ7ZLpAt17GVaxN1A828eS9TOQDn aUnFv4t54iRf6LXIHr9WBI3Z0YCa6XBcK7zj7erODWVtOXN+pqZhmFBF5e2E9GCsZ8n0 ZbNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ESl69Xjo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si1329408otk.128.2020.03.26.10.13.58; Thu, 26 Mar 2020 10:14:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ESl69Xjo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727805AbgCZRLy (ORCPT + 99 others); Thu, 26 Mar 2020 13:11:54 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:16207 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbgCZRLy (ORCPT ); Thu, 26 Mar 2020 13:11:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1585242713; x=1616778713; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=7dKViaTkqgkOuleKzCaJ8koVRSroLTuB4+O9Hh8aggM=; b=ESl69Xjo8HJb0mcrmO8q/uKsDwwFYjWckhJDaireykIMpyt7eTlp37qN 78uEP7kgjVZAbI8fIMDZilKBeajLr9xgsEgTtw7ISRDSassWjjQOZwKKN brpTKJCSKiWOUruMvcq549sbK0nq22ZycvJK2bn7BYuf1aE2OGX0qWISu 8=; IronPort-SDR: VLVG9KdHa9SYDLOS5XHvQwlSi5CKx1/HQVCocDXLl0fRLLxFzUUQLhJik/SBPYR9NgJKGCXbkw vTgHetDIaOrA== X-IronPort-AV: E=Sophos;i="5.72,309,1580774400"; d="scan'208";a="23030054" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-69849ee2.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 26 Mar 2020 17:11:39 +0000 Received: from EX13MTAUWC001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-69849ee2.us-west-2.amazon.com (Postfix) with ESMTPS id 15434A2102; Thu, 26 Mar 2020 17:11:39 +0000 (UTC) Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 26 Mar 2020 17:11:38 +0000 Received: from 38f9d3867b82.ant.amazon.com (10.43.162.39) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 26 Mar 2020 17:11:34 +0000 Subject: Re: [PATCH] swiotlb: Allow swiotlb to live at pre-defined address To: Christoph Hellwig CC: , Konrad Rzeszutek Wilk , , Marek Szyprowski , Robin Murphy , , , Mark Rutland , , , Jan Kiszka , , , , References: <20200326162922.27085-1-graf@amazon.com> <20200326170516.GB6387@lst.de> From: Alexander Graf Message-ID: Date: Thu, 26 Mar 2020 18:11:31 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200326170516.GB6387@lst.de> Content-Language: en-US X-Originating-IP: [10.43.162.39] X-ClientProxiedBy: EX13D36UWA004.ant.amazon.com (10.43.160.175) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Content-Type: text/plain; charset="windows-1252"; format="flowed" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.03.20 18:05, Christoph Hellwig wrote: > = > On Thu, Mar 26, 2020 at 05:29:22PM +0100, Alexander Graf wrote: >> The swiotlb is a very convenient fallback mechanism for bounce buffering= of >> DMAable data. It is usually used for the compatibility case where devices >> can only DMA to a "low region". >> >> However, in some scenarios this "low region" may be bound even more >> heavily. For example, there are embedded system where only an SRAM region >> is shared between device and CPU. There are also heterogeneous computing >> scenarios where only a subset of RAM is cache coherent between the >> components of the system. There are partitioning hypervisors, where >> a "control VM" that implements device emulation has limited view into a >> partition's memory for DMA capabilities due to safety concerns. >> >> This patch adds a command line driven mechanism to move all DMA memory i= nto >> a predefined shared memory region which may or may not be part of the >> physical address layout of the Operating System. >> >> Ideally, the typical path to set this configuration would be through Dev= ice >> Tree or ACPI, but neither of the two mechanisms is standardized yet. Als= o, >> in the x86 MicroVM use case, we have neither ACPI nor Device Tree, but >> instead configure the system purely through kernel command line options. >> >> I'm sure other people will find the functionality useful going forward >> though and extend it to be triggered by DT/ACPI in the future. > = > I'm totally against hacking in a kernel parameter for this. We'll need > a proper documented DT or ACPI way. = I'm with you on that sentiment, but in the environment I'm currently = looking at, we have neither DT nor ACPI: The kernel gets purely = configured via kernel command line. For other unenumerable artifacts on = the system, such as virtio-mmio platform devices, that works well enough = and also basically "hacks a kernel parameter" to specify the system layout. > We also need to feed this information > into the actual DMA bounce buffering decisions and not just the swiotlb > placement. Care to elaborate a bit here? I was under the impression that = "swiotlb=3Dforce" basically allows you to steer the DMA bounce buffering = decisions already. Thanks! Alex Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879