Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3026414ybb; Mon, 30 Mar 2020 18:49:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvZNro3+7JrnItpUrEUBh06OkseSz2q05eNUVzEdX6GqZDTkLyhKJFfZ5Ca8WHxwG6ps5tt X-Received: by 2002:a9d:a22:: with SMTP id 31mr10892625otg.349.1585619342118; Mon, 30 Mar 2020 18:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585619342; cv=none; d=google.com; s=arc-20160816; b=Er/KeApe+etD4y6cw0ugOJpdEebZSeQaioScP4UXEPiaYez7X+RNnFSWKVHLSzbfrN RaJUcokKkOe9mTjZb5pf3l1olQAAYaQBNAC/J9IS1m++VYNh5LVbLQ/MExoU1aCmFxQv i9w28CU0QRfodZBy5e13oqF0HpPRIeyAtPFM+G0ceY3bzXCpm2NA0U3Q5d6W59i1PIB2 zESKMKx6mTRGv2Y3psWk5B1VJ8CPxbCa5yaSpJ7ECtYGU5NEhoGC3BcY7pTMXFQteJDf ++dzX3LPpQv2EBwTJ9FI4+//KacHrbwnrtq5VruSKccBOP7AlhRY6Rs6jcwGZfIjimvO y32Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Uo+1bM5jLbPf26TN6zEnjUeeLZzs+2jX0NNWi8ZBweA=; b=wJaJTGB39LopS7bn6j+cmlSdk0eZ8ofC+nD8kuPXVtrNe29bvlXNtRTEVh7HkTCUw2 PFsT56DAt4HmprpCmhjbHdcBavMUQc4eIBkvibFaiSQjbHQcRcOdGNNyc+9MMLjAmcmo pPwbQO7hj/0rAgLZpGAnSVMZZF7+l2qf6Zechc/VM7Df5rJnLOinUKw7qp1UR/Dj2okq gg1hxGyQ3g3xPm2IpePDpZfBJwQ+D4lmzYfV6rmGrXkNR8lElMOE7MnMM3qR+UM0YwZb KRRCnZRiPGh1i14kXRhPihoddZ5pUm8/mLjZEarSIQP4X2laK+8jT3BpDQFltWFWj4p9 N4yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="U5/hhm6+"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si5692605otp.41.2020.03.30.18.48.49; Mon, 30 Mar 2020 18:49:02 -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=@redhat.com header.s=mimecast20190719 header.b="U5/hhm6+"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729589AbgCaBq5 (ORCPT + 99 others); Mon, 30 Mar 2020 21:46:57 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:40900 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729557AbgCaBq5 (ORCPT ); Mon, 30 Mar 2020 21:46:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585619215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Uo+1bM5jLbPf26TN6zEnjUeeLZzs+2jX0NNWi8ZBweA=; b=U5/hhm6+07Um63PyTZohHQEwa5e+Y1Z1SMnDGFVfS/i+5cyQSaEEOWJG/ItRcoS83lWcml s2XXT2bB4iW3Juqr7JJWhDpRvwfMzcRczmv4ZXKAfcErp5KdqXO1k88ykUmBxQOGgIATqv rFAwRz+2xTPV3w8athFRcqE9Z44/WW0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-219-ByELsUk1MmGYaIeZ40WgHg-1; Mon, 30 Mar 2020 21:46:50 -0400 X-MC-Unique: ByELsUk1MmGYaIeZ40WgHg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C48291005509; Tue, 31 Mar 2020 01:46:46 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-247.pek2.redhat.com [10.72.12.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20332100EBB3; Tue, 31 Mar 2020 01:46:36 +0000 (UTC) Date: Tue, 31 Mar 2020 09:46:32 +0800 From: Dave Young To: Konrad Rzeszutek Wilk Cc: Kairui Song , anthony.yznaga@oracle.com, Jan Setje-Eilers , Alexander Graf , iommu@lists.linux-foundation.org, the arch/x86 maintainers , Christoph Hellwig , Marek Szyprowski , Robin Murphy , linux-doc@vger.kernel.org, Linux Kernel Mailing List , Mark Rutland , dwmw@amazon.com, benh@amazon.com, Jan Kiszka , alcioa@amazon.com, aggh@amazon.com, aagch@amazon.com, dhr@amazon.com, Laszlo Ersek , Baoquan He , Lianbo Jiang , brijesh.singh@amd.com, "Lendacky, Thomas" , kexec@lists.infradead.org Subject: Re: [PATCH] swiotlb: Allow swiotlb to live at pre-defined address Message-ID: <20200331014632.GA81569@dhcp-128-65.nay.redhat.com> References: <20200326162922.27085-1-graf@amazon.com> <20200328115733.GA67084@dhcp-128-65.nay.redhat.com> <20200330134004.GA31026@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200330134004.GA31026@char.us.oracle.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/30/20 at 09:40am, Konrad Rzeszutek Wilk wrote: > On Mon, Mar 30, 2020 at 02:06:01PM +0800, Kairui Song wrote: > > On Sat, Mar 28, 2020 at 7:57 PM Dave Young wrote: > > > > > > On 03/26/20 at 05:29pm, 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 into > > > > 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 Device > > > > Tree or ACPI, but neither of the two mechanisms is standardized yet. Also, > > > > 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. > > > > > > Hmm, we have a use case for kdump, this maybe useful. For example > > > swiotlb is enabled by default if AMD SME/SEV is active, and in kdump > > > kernel we have to increase the crashkernel reserved size for the extra > > > swiotlb requirement. I wonder if we can just reuse the old kernel's > > > swiotlb region and pass the addr to kdump kernel. > > > > > > > Yes, definitely helpful for kdump kernel. This can help reduce the > > crashkernel value. > > > > Previously I was thinking about something similar, play around the > > e820 entry passed to kdump and let it place swiotlb in wanted region. > > Simply remap it like in this patch looks much cleaner. > > > > If this patch is acceptable, one more patch is needed to expose the > > swiotlb in iomem, so kexec-tools can pass the right kernel cmdline to > > second kernel. > > We seem to be passsing a lot of data to kexec.. Perhaps something > of a unified way since we seem to have a lot of things to pass - disabling > IOMMU, ACPI RSDT address, and then this. acpi_rsdp kernel cmdline is not useful anymore. The initial purpose is for kexec-rebooting in efi system. But now we have supported efi boot across kexec reboot thus that is useless now. Thanks Dave