From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5668C433ED for ; Thu, 13 May 2021 15:16:03 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 57E7361406 for ; Thu, 13 May 2021 15:16:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57E7361406 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=R4dauKvKFpjTn1ndq1z7fPmxJ+1XnS3MSI0uUWX7L7o=; b=P4Tos+btaAnrVJmDDDPHpJNZD f+2tYNfUZRo2Rd6pC+S1T5iyhASvjjEOdjaYEYWrX/hpo56RAu7jDg3EmHp2MNSZWMfkY22/5DYil lc2bDzarwIeXRlI5RC96kMcyLpkBgkeglYTzkDBLIDzJzy2v7I0DNuW+xNYWTWkaLrlXB1WGWkWXA yYq8rQXaL5k6AiVg4mZPcLxdGpYeYM/+KZr965iWVx4EVvf5C0P6kf6wMPGha8heKPTywNtZegCpB 1vv4lLm3wfq1A5dZjpjC5WQnikwmCwfuQfO/3QBuw5AU61lbIfHWaDghR9duI+ws9xhyzInqUy3j8 xvklgxr2g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhD25-005q7F-EW; Thu, 13 May 2021 15:13:49 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhD22-005q6u-UD for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 15:13:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=N0c5RJ43/6eXtMgXe2FRn+gUWZwOzsKwDK9QOxnFniE=; b=ObyMfk562C83r0bnIrmlypmFs7 XP9boTXCQLr+D8Sh7obJmvb7M8KwsX4i91HpctMd7NFPMw+5vvKxZ/DSG6xMhCvx9Nn7lGzTfif0m 1U6oHGMxxfmwOCi0kkIqL9igZZCdG79TKHv3TVde4uQFTxnQGPzqS+64MiyxogrA9UyKo1p72k8+2 6+ncXgfUfqQJ1sZJU5atjh6iHs3o93T2WUG3z64bwJC+l9l+0wx1pvOZ2ih4nczK4voArLUWXbYqK xpRzYXlt3G6e/00GLXP0ktKR9qCCWnVIcZWGsdUD8WfDuRW4L/9O7+M8u5lI3TqHKO4FNFzy5u5em M6jdbuKA==; Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhD20-00BLZ2-9a for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 15:13:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=N0c5RJ43/6eXtMgXe2FRn+gUWZwOzsKwDK9QOxnFniE=; b=BWjciQ4EjJPJ5vU6IB92XJcJo wTeDVlqRV/CivbzrjUN66GzMg2O9b2VQ2CjdlmRAmDPaS7NZSsRACCZb/c/Bdn/LAYLtI6yI0qUlB N93HoSt/iIvd3czG9pCHsC3iasLITDM3B23MC9c1Rs4C0eXmw5JPQAZst7J+ohbbRpW1o9Ox1rgFT SUl7YqPujjmWU9TrMUqNBgYQiYcljS+faDv74Z5AssAtTOYa9Xm1bL4NTPts2AzCWeafhX9dUCuzI QAjd2UVUByGgxleKwvuz2qWMN2za4CUtu8ZWSC0CtWmdVtdkNjQbyZkbqHgvLL03w/ymSbn7Bn4/y KbhOhcUtg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:43934) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lhD1x-0006NQ-Mz; Thu, 13 May 2021 16:13:41 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lhD1x-00036S-9k; Thu, 13 May 2021 16:13:41 +0100 Date: Thu, 13 May 2021 16:13:41 +0100 From: Russell King - ARM Linux admin To: Arnd Bergmann Cc: Bjorn Helgaas , Linux ARM , linux-pci Subject: Re: [PATCH] PCI: dynamically map ECAM regions Message-ID: <20210513151341.GZ1336@shell.armlinux.org.uk> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_081344_354083_7D378F9F X-CRM114-Status: GOOD ( 22.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 13, 2021 at 05:02:32PM +0200, Arnd Bergmann wrote: > On Thu, May 13, 2021 at 4:18 PM Russell King wrote: > > > > Attempting to boot 32-bit ARM kernels under QEMU's 3.x virt models > > fails when we have more than 512M of RAM in the model as we run out > > of vmalloc space for the PCI ECAM regions. This failure will be > > silent when running libvirt, as the console in that situation is a > > PCI device. > > > > In this configuration, the kernel maps the whole ECAM, which QEMU > > sets up for 256 buses, even when maybe only seven buses are in use. > > Each bus uses 1M of ECAM space, and ioremap() adds an additional > > guard page between allocations. The kernel vmap allocator will > > align these regions to 512K, resulting in each mapping eating 1.5M > > of vmalloc space. This means we need 384M of vmalloc space just to > > map all of these, which is very wasteful of resources. > > > > Fix this by only mapping the ECAM for buses we are going to be using. > > In my setups, this is around seven buses in most guests, which is > > 10.5M of vmalloc space - way smaller than the 384M that would > > otherwise be required. This also means that the kernel can boot > > without forcing extra RAM into highmem with the vmalloc= argument, > > or decreasing the virtual RAM available to the guest. > > > > Suggested-by: Arnd Bergmann > > Signed-off-by: Russell King > > Looks good to me. I wonder if we should actually mark this for stable > backports. It is a somewhat invasive change, so there is a regression > risk, but it's also likely that others will run into this problem on distro > kernels. Maybe merge it first, wait a release cycle, and then request it for stable if we think it's of benefit? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel