Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3033260ybb; Mon, 30 Mar 2020 19:01:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuUoFxKKTzSte17RaEynjrLKniUfYwaoEeFADonB0u+kDvHT4fRkcWHPQEiQ4dINR8kypmT X-Received: by 2002:aca:484c:: with SMTP id v73mr616854oia.138.1585620087652; Mon, 30 Mar 2020 19:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585620087; cv=none; d=google.com; s=arc-20160816; b=gthieyh9GhU6kMWdJd0hNFkHzHGiqpZQPPDh81lUaHB6aIrNbqSrc36I1EGnxEv3qn iGHXMgeYQK28PBjr/q1tvutde5DOyDgOpbpOZZ6bVTGIRed9rVuCk0P/A8k2o2badxVc Fp/4IdagFPQjIawqyPnhw/l7tBFIb9vOS72z2W9BPb4/NxT5Nr2i/5KtZ0bGr7AtfLe6 KF//yQRS2yhPlq1I6NSeaP5/HkqPrYWFVkqgcU8kH6OylqfQO9j4iOlIkp9RLk1D8v3Q Y5mejHE3fHErneuRZpHi9Ufd7dWj1K5fmkr3pq5w5otli07X25ZjtyNwyfBNFS/RLr2I mKxQ== 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=J7J/WvCRzFDPjN13KVOAH7X96x+em5mLjdDYjxy7JL4=; b=o3dnPmXps29Ticv1qNf0lK4STgLY7zeZsNjEgqa82cG544GIEzKJiQAH5rBbGkFc1s b7Hcz4nX673HBc/9oftgc60/xE7C47bVmGqAXjbK9rDVO3k+W7qkvOJBqGjTIPFDRmCT ItC6TWvZ6ocI1BjmLrXJVqZzwGNT5QMgUqE9g7eR/f1s9fav3uFJIbkpnkQWmjmtV1ER 1BRRV0OsMjAJKzQTTrC/dHWi6omYK0zINd1bjzuRlDg7a49F6/FVeL/N4UosEPagXiPH naEEb2841RTDo44VeA0HX8JHwCe0ZTRVk2t5qr7MZoh1RSBCGb3YQfOoMWPshTTgGTm/ fkZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fCtLxoLn; 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 f1si6804029otq.90.2020.03.30.19.01.02; Mon, 30 Mar 2020 19:01:27 -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=fCtLxoLn; 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 S1729358AbgCaCAN (ORCPT + 99 others); Mon, 30 Mar 2020 22:00:13 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:47177 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729035AbgCaCAM (ORCPT ); Mon, 30 Mar 2020 22:00:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585620011; 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=J7J/WvCRzFDPjN13KVOAH7X96x+em5mLjdDYjxy7JL4=; b=fCtLxoLnOPo/SoS4R7pRoLXAJRwpPrNCzJzCzCaCRRmqLNeX1UIYU3wAIy6wkjJ/Y7HxoB lTUpj3atXnffF9niOvtlpahhnVfOjq3kdq1x6kWJoJk2XswYLNXFkODQM/hDHScGdqgS6w TK0KtMw005Z6Iij8E6LLwnEpunlKm98= 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-487-EpzUZZB8O_GoilF-gs7kdA-1; Mon, 30 Mar 2020 22:00:09 -0400 X-MC-Unique: EpzUZZB8O_GoilF-gs7kdA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 179D58017DF; Tue, 31 Mar 2020 02:00:06 +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 40CA15DA60; Tue, 31 Mar 2020 01:59:52 +0000 (UTC) Date: Tue, 31 Mar 2020 09:59:49 +0800 From: Dave Young To: Alexander Graf Cc: Konrad Rzeszutek Wilk , Kairui Song , anthony.yznaga@oracle.com, Jan Setje-Eilers , 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, "Schoenherr, Jan H." Subject: Re: [PATCH] swiotlb: Allow swiotlb to live at pre-defined address Message-ID: <20200331015949.GB81569@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> <51432837-8804-0600-c7a3-8849506f999e@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51432837-8804-0600-c7a3-8849506f999e@amazon.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, [snip] > 2) Reuse the SWIOTLB from the previous boot on kexec/kdump We should only care about kdump > > I see little direct relation to SEV here. The only reason SEV makes it more > relevant, is that you need to have an SWIOTLB region available with SEV > while without you could live with a disabled IOMMU. Here is some comment in arch/x86/kernel/pci-swiotlb.c, it is enforced for some reason. /* * If SME is active then swiotlb will be set to 1 so that bounce * buffers are allocated and used for devices that do not support * the addressing range required for the encryption mask. */ if (sme_active()) swiotlb = 1; > > However, I can definitely understand how you would want to have a way to > tell the new kexec'ed kernel where the old SWIOTLB was, so it can reuse its > memory for its own SWIOTLB. That way, you don't have to reserve another 64MB > of RAM for kdump. > > What I'm curious on is whether we need to be as elaborate. Can't we just > pass the old SWIOTLB as free memory to the new kexec'ed kernel and > everything else will fall into place? All that would take is a bit of > shuffling on the e820 table pass-through to the kexec'ed kernel, no? Maybe either of the two is fine. But we may need ensure these swiotlb area to be reused explictly in some way. Say about the crashkernel=X,high case, major part is in above 4G region, and a small piece in low memory. Then when kernel booting, kernel/driver initialization could use out of the low memory, and the remain part for swiotlb could be not big enough and finally swiotlb allocation fails. Thanks Dave