From patchwork Wed Mar 17 11:04:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roger Pau Monne X-Patchwork-Id: 12145499 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 6113FC433E6 for ; Wed, 17 Mar 2021 11:06:05 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 1C30D64F4F for ; Wed, 17 Mar 2021 11:06:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C30D64F4F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.98627.187142 (Exim 4.92) (envelope-from ) id 1lMTzc-0008TO-Ix; Wed, 17 Mar 2021 11:05:36 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 98627.187142; Wed, 17 Mar 2021 11:05:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lMTzc-0008TH-El; Wed, 17 Mar 2021 11:05:36 +0000 Received: by outflank-mailman (input) for mailman id 98627; Wed, 17 Mar 2021 11:05:35 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lMTzb-0008Rx-IQ for xen-devel@lists.xenproject.org; Wed, 17 Mar 2021 11:05:35 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b583e291-a162-4caa-9f71-64d8892872b2; Wed, 17 Mar 2021 11:05:33 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b583e291-a162-4caa-9f71-64d8892872b2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1615979133; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=wp0RccVI1tCqlieLeZR40m+vQPb4oS3BJx8bkuHZwN0=; b=XklvQePTUfA8fzYAEY23VNWeDIFALw/Oo54gWIvwANdKxfwdz/oPZk+U +X9zKEwTiEEyT6u0yCDNMQsyxoxmEXiv/OyImy/vhjJfYuB+58VChaKxn ur/KYc9HaaPrwJTDOcl6GmGH+LEfqzLU1pSyB1no2rqIYp8CASP89bxyd w=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: hoRtLp/ly252ADuLwJafpUylXwz4p4ZiwRc5U6scuqSgiki0SkUt7B0C2n88f8x2BDVlM26gDS URlQmWOOswm/gDLbd+UG94itg7FJZifMGkW5L4zLwojf1+rXQlE0yp2wxMg07AWJwTSoqrWRD2 B40Lmfm5j7RBlx5P+tMg17quQ4/tTdsgjnDClMj7dqDJV4j8EjL/oRC0JxiE0Ya1L6jX7zzbI1 G+MngiXMEdO7Y/UW0jlLWv7ND/OjI43EEuJuIRyLpdNDqzmQssmNBD9+2aL2DKQfVu+cW28n3T Cks= X-SBRS: 5.2 X-MesageID: 39488646 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:HKNhB6kcXwf/Yrolt1Uu+ZaU3ArpDfP2imdD5ilNYBxZY6Wkvu izgfUW0gL1gj4NWHcm3euNIrWEXGm0z/NIyKMWOqqvWxSjhXuwIOhZnO7f6hDDOwm7zO5S0q 98b7NzYeebMXFWhdv3iTPWL/8O29+CmZrHuc7771NACT5ncLth6QARMHf4LmRTSBNdDZQ0UL qwj/AmmxOadX4abtu2CxA+NoCum/TxmI/7ehlDPhY76WC15g+A0qLwEBSTw34lIlBy6IolmF KlryXJop+Nntv+4R/a2m/V4f1t6aHc4+oGPuOgoIw4Lj3tjyyheYhuXaaT1QpF3d2H2RIRv/ Tn5zsmIsRv+1PdF1vF3SfF6k3b/xsFr1/k1FOCjnPoraXCNU0HIvsEv611WF/9ySMbzbVB+Z MO5U21nd5rKCmFuyLH693BR3hR5zKJiEtnq8E/pThiS4cEAYUhyrA3zQduP7orOjn104wjGP kGNrCm2N9mNWmXaH3UpQBUsbqRd0V2Gh+HR34LsdCO3w5Xm2hkz1AZyNZ3pAZ4yK4A X-IronPort-AV: E=Sophos;i="5.81,256,1610427600"; d="scan'208";a="39488646" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJpMJF05/FZw3BFa1guhmg91XypIA7XIg07QNSAWFG34jxaNVL3gezDeji69GhLJUlBizfzItd8pKzx0lPkOzTThBbhrga2lwhPpBnWWvFB8zV4+EIE/apjL9SzSTXDKbpazom+vzsClpOjv3Bs6NbahcNCm/34pK63u66SqBf6PaPZElWmDUF5b1a5PzMmi87CIzDnQITi4ISK9vayBaSeNSkIE+/NFB0UrfK8kbQR09PPqytOovuXWJeEHHnm2J+qM7LoynQI9c/Fat+PNt/Jq8lFYdMmujWz2by3CKRuC5aNgh53nnWsCsn7kybNaU+J5kkghBLGnrwrR/rBgzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sdo8EeuM+xU2F1GMX+fxj8Mg5M4tPEbvnO/5QsPd9n8=; b=DK1LMh3RYXcHu1wjCIupI8WWwcRMxusZNcmYEX0Zw2ATMNzs9pddkEoPtWHj2KvS24SodlEBFVyGjJKsJazHl6XtJkGXsHw8waSWWnnW54cCNzrUIxJMegO446YhkXEqMD8gNkixGALLP3WipiA+eJJL6WKYT/f4HDxJilVZblHJsz75HhZmf99HwbAn2jBn1ugua/r9jReMV7LZH94e/4BeSCJkE6TxcA4WSUX5/DCrDLCciYfPuCL7xthfpmFAvzgdzamdFvnMkSceHmeVWh2f2W5NGxPSV5jfQQAgRoz80ZiIDo4DxG6A6UN5KocEip+mifLbQrXrDD8JGenpFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sdo8EeuM+xU2F1GMX+fxj8Mg5M4tPEbvnO/5QsPd9n8=; b=xljdE8q/Cvv6vda3O5BEPtD3EnC3eh0OomAeMevvBgS2THxJg8iPQTETFpLhpzUpmdT7e0fz/rXfxhGjIavuZvpAmEnONPguO/lN2YEBqoDWoSg/vKH/NItKwdLfrhHe7HEzWL8/kq3vZaKkomWIx3Yi+ftMlmaldrFWJl8kdDE= From: Roger Pau Monne To: CC: Roger Pau Monne , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Jan Beulich , Subject: [PATCH 1/2] xen/x86: make XEN_BALLOON_MEMORY_HOTPLUG_LIMIT depend on MEMORY_HOTPLUG Date: Wed, 17 Mar 2021 12:04:00 +0100 Message-ID: <20210317110401.46322-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210317110401.46322-1-roger.pau@citrix.com> References: <20210317110401.46322-1-roger.pau@citrix.com> X-ClientProxiedBy: MR2P264CA0161.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:1::24) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 171b86a0-9674-4c4c-cf25-08d8e9349471 X-MS-TrafficTypeDiagnostic: DM6PR03MB4137: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J+9A5LLVZaOp20IHx3zrh37q0KdRAFLYT1Q6iAJ1KnB+Naxi4udSAuXmKuj6gUxF5qwR/udgkMsbbYeeQdEv8oibcKoXVbLJf4CnIQ4sqX+71k6f+Mv0co53uS6d6D+uPmixqjaB3UjX/H4uYdFWNt9Gsv7Nt0JUC1MrdGj4zS7q2v4R+chi8F8YOPNOmeo282MYB3JwL0I1/Ga9QedWfsBpNHrr0rKbBPfeOsPMXqR0c6BX6ELjN124Csg1QzcjDa/IwLU/E11FsV4TUtP6e5Ajhn8hRdGixQsH6ZYr4UAkTUgmom8ahMSoBlW0kWyUtMK4nObunweZ7DTiqW1lJyKHx0aSvALP0Wrxshv45YskX6LqZhPLoISWoNsB718aPyJtPt8mSYTm7U310uMpNolA6I7B6+wTwOGzk4EAHx46ebZMuVVAwy+zmoAWDgz+Ge2QRqg2WrnYlL41ru7YiClDZYiKK4pOD8PI7qoOidwinIYUtDoxRofRdlSWGIbh6fGrDKp5i5RnnGJsoYQTX5t+R+mog3FAwZvVH3+DtH7pyzJ041EpXVLPHyM/ZN2H X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(346002)(136003)(396003)(376002)(366004)(36756003)(4326008)(2616005)(956004)(83380400001)(8676002)(8936002)(86362001)(5660300002)(66946007)(6486002)(66476007)(6496006)(478600001)(26005)(16526019)(186003)(66556008)(1076003)(6916009)(2906002)(6666004)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?9iQZLxFIng5grUAcKce6ChqVLBiDCl?= =?utf-8?q?5SsTmlbsc18APVfwBa6E+u/jZ8jdGnbmRYkDKfQtOxdu4kfrcO1vzp4SpqdSSLYbg?= =?utf-8?q?cNJTIOOPcJDq58/4khJbLQSmF+682sqg7vnTg5ISOAmpAndZNHRURze7xcgIYx26g?= =?utf-8?q?3nNrOoUQIZvW0g5s8h7+efg7UsoPo3ye6LcNxS8cR3j2OQ7MfdnUIzUO/K5YMsb3G?= =?utf-8?q?WvNzT1mq1S3RrCjSzbxdXTryuckk9th8nBIUbo6l2DmX+pk73BXJ9het11mLwPiOg?= =?utf-8?q?aqMIPq95ZqST+kw9AVkl7xjjyomvFK3eVD2fkpT+DMRgMHUW11tot2fHhSEZnNVRG?= =?utf-8?q?r7Qd7P/yitIWvpadvsNAjsdHl+PZkSJdwwbvPOndv3iPHqpMXyFaug6NpB4dLA8G0?= =?utf-8?q?TgsH+Vuc/UFi2qaZh4J65kvWfy8a39U+bu09tY6R81emARXJDInZggR3G0lxyHO9m?= =?utf-8?q?nXp/eRx+8d4/W/4CMcMIm8RPdYankCPGT6vUxjYk5AL5ipZg+mWa9VloGumQor+FI?= =?utf-8?q?kPuIcJM/LiZLexfBpQce8RbJxmR7WIr/Vmys7gYtCv6hE70qzqCDPRVXtpIjWI3k1?= =?utf-8?q?beFWFJzv8kM7KiQkKWbmEpz56sy0OHw8635o9ai2AFceqvuInVfTpomPXok6DMusM?= =?utf-8?q?aUmCJyM8rn3by32Z9eCx6Q1guzIUm9JelIsJ8Kslx9ZV2nlno/Lh93077fkGMlV8V?= =?utf-8?q?xv9R4YFpch5NPJjJNstv1eGi4ZwAwD3XkcJORZfMLoUeA0q6i6AnNnmUvrHrQmiov?= =?utf-8?q?e43MM7GPZEpujB3rzMfv7NLasUqgA4KMHNrlJXKLbXxPh4UjKy9eyinee5FojKSNf?= =?utf-8?q?wl8JNP+TnNQXckGpuJVSEfLFs9WCvIxJB/ZOm8YSzsViJJ0PfOm0GU4Wa7LB+jEoR?= =?utf-8?q?0wrgqkENMcuzIoIKywDiEYePlP8EAFyPgC67Za+JOFuJm4qus9Ph97KwA1wJvykBF?= =?utf-8?q?AXhXtBSXmPUOb40Dq0BuzhDeXiMdOsNxp807MjkZxo82PKabkFGUC7bzREuOVtDmP?= =?utf-8?q?VUbX1QkZAiT02ZBjkarjG1iuqUocRRxYOhzAwVOupRCoP/ZkLvBKpdJnxDJN/VVKw?= =?utf-8?q?eWbvg8yc4fVe6PrvpqKAFqHvrpkiy6DtJlSCxHt/waIZpxlz5qDol3H7o++Ht4NSL?= =?utf-8?q?TIrbuNwlqXohA08IYs7f9CnKY4kyBuwVv/aB5faXc7l9OKaVh/Qihs7CzQMmR+1Vp?= =?utf-8?q?1A18dvXztHfbqGfC1KeaFfx/cmQIWW+0wOB6BAFIVOSS21qhCKzPVdCe9/hKXRfj7?= =?utf-8?q?YbpGl6miuccKhd?= X-MS-Exchange-CrossTenant-Network-Message-Id: 171b86a0-9674-4c4c-cf25-08d8e9349471 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2021 11:05:31.3133 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EbYWaCZfLzd0baby1vWRHqeu+h7e3oJ82QAEm4XoAZG9HVkmnUWEM0i+KJkmeugMzVPJ3uw+IlCtaK5JQy6W5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4137 X-OriginatorOrg: citrix.com The Xen memory hotplug limit should depend on the memory hotplug generic option, rather than the Xen balloon configuration. It's possible to have a kernel with generic memory hotplug enabled, but without Xen balloon enabled, at which point memory hotplug won't work correctly due to the size limitation of the p2m. Rename the option to XEN_MEMORY_HOTPLUG_LIMIT since it's no longer tied to ballooning. Fixes: 9e2369c06c8a18 ("xen: add helpers to allocate unpopulated memory") Signed-off-by: Roger Pau Monné --- Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Jan Beulich Cc: xen-devel@lists.xenproject.org --- arch/x86/xen/p2m.c | 4 ++-- drivers/xen/Kconfig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 17d80f751fcb..a33902d05e45 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -98,8 +98,8 @@ EXPORT_SYMBOL_GPL(xen_p2m_size); unsigned long xen_max_p2m_pfn __read_mostly; EXPORT_SYMBOL_GPL(xen_max_p2m_pfn); -#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG_LIMIT -#define P2M_LIMIT CONFIG_XEN_BALLOON_MEMORY_HOTPLUG_LIMIT +#ifdef CONFIG_XEN_MEMORY_HOTPLUG_LIMIT +#define P2M_LIMIT CONFIG_XEN_MEMORY_HOTPLUG_LIMIT #else #define P2M_LIMIT 0 #endif diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 41645fe6ad48..ea0efd290c37 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig @@ -50,11 +50,11 @@ config XEN_BALLOON_MEMORY_HOTPLUG SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'" -config XEN_BALLOON_MEMORY_HOTPLUG_LIMIT +config XEN_MEMORY_HOTPLUG_LIMIT int "Hotplugged memory limit (in GiB) for a PV guest" default 512 depends on XEN_HAVE_PVMMU - depends on XEN_BALLOON_MEMORY_HOTPLUG + depends on MEMORY_HOTPLUG help Maxmium amount of memory (in GiB) that a PV guest can be expanded to when using memory hotplug. From patchwork Wed Mar 17 11:04:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roger Pau Monne X-Patchwork-Id: 12145501 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 44354C433DB for ; Wed, 17 Mar 2021 11:06:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 E958E64F4F for ; Wed, 17 Mar 2021 11:06:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E958E64F4F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.98628.187154 (Exim 4.92) (envelope-from ) id 1lMTzk-000068-QP; Wed, 17 Mar 2021 11:05:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 98628.187154; Wed, 17 Mar 2021 11:05:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lMTzk-00005z-N9; Wed, 17 Mar 2021 11:05:44 +0000 Received: by outflank-mailman (input) for mailman id 98628; Wed, 17 Mar 2021 11:05:43 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lMTzj-00005D-0w for xen-devel@lists.xenproject.org; Wed, 17 Mar 2021 11:05:43 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 129053de-0480-43bd-888d-03877a60ed45; Wed, 17 Mar 2021 11:05:41 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 129053de-0480-43bd-888d-03877a60ed45 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1615979141; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=JjifyQYBWEZf3votvo8D/SBs1EAoJKrZOarp5mqtzfc=; b=eJhQ9hv0d3kuBjJTMNt/bYj/dylP+5BFk8oHGp31s3i/ubvsB/EyCuYI MqAhu5gvvVL6nuSq/XmOZi2RURMc13wRuY+dN0cvYkmF13zP3kCOeXz46 0AZQpIehXLdlq6lEz5HFyTLQU+Ngtq8WNkgb9Ad0mevx5TbovlPsselvs A=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: q3PJ0H+xSkxicawBPLIxgUufCGJmCyQkQI3Q5pG2O/H4XcawlBv9/Ol0ZFj1fxDkGr0BA0ao6J mnaxyS1QbndzfnP30xIun/Jlkd9g+FJ/aVO1HPmKthnB3LWt3FnizXGBS9I8ovFTJNrMCGLB5s 4oM6DAyi18AHztOuTQLWNl6bEn4Fx2wPN7usb0S1JjxZTFyAGuDFe7RTHfE8Hbomz5a+Ukeaka 3zdzWPFlZvsHxIy0jaiLstbO67nbPLhhadFQjZJortff5qeRq9fNZE1GqrT9RYaIthDdhf55RT ieM= X-SBRS: 5.2 X-MesageID: 39376917 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:4qp65K7UEVhalkalSQPXwU+EI+orLtY04lQ7vn1ZYSd+NuSFis Gjm+ka3xfoiDAXHEotg8yEJbPoex3h3LZPy800Ma25VAfr/FGpIoZr8Jf4z1TbdBHW3tV2kZ 1te60WMrHNJHBnkMf35xS5Gd48wN+BtJuln/va0m0Fd2FXQotLhj0JbTqzOEtwWQVAGN4FD5 Ka/MVKvH6Nfn4QY8S9CBA+Lpf+jvfMk4/rZgNDOg4/5GC1/E+VwZPZMzzd5BcRVDtT3awvmF KlryXV7riu2svLsyP0+HTU6/1t6b7c4/tFQPeBk80Ebgjr4zzYHrhJf52nkHQLrPq06FAs+e O80CsIG8ho8XveciWUjHLWqnHd+Q0j4XPj1lOU6EGLyaeSKUNYeqgx8L5xSRfX51Etu9txys twrh+knqFaEA/am2DF78XIPisa5nacm2YokuIYkhVkIO0jQYJWxLZvmH99IdMrGSL3750fC+ 9+DM3Qz+Y+SyLqU1np+kZo29CiRXI1A1OvRVUDoNWc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CBKph9MG7I02Fhu+S2/GI5Q2HAQeTWgA/no 1KdUsZc8RFhH0DteQMo1aPY52yhFkknVtY6SxgjXj31OGdkT/mIX0= X-IronPort-AV: E=Sophos;i="5.81,256,1610427600"; d="scan'208";a="39376917" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gv+Uo4KTSQTAit3Y/Ara4j2Zln5sX5NvhPHSBe0a3rPi1bAeOusVgIeD5dn8JaZs0f2r6QKj64Y8IgRzg/bJ2IqVVURS6ik2RyMUssyN9G9MkCSZfwneQmWpROIdj41YZZ5bI1dF4Jkd7+GVXOYMk9kLK5w39GfjeQM5Bke3Lc3EplV9eZSvxqKP5yz1lyPhqJoNqEFj2FSwDWokqWJqkBcLg/gsergIpBKdCaWMqSpnHZUv2zgdiEIcy5Q1vF7Oe5Q3kg89OOMX/oLmEGTrEW8Z/lQwswBJUJqU/sWIqVCPnrQxkbJxbYvN7atyHjp+rQzMwCYb47mgbx1ar3gvyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a9NK4I28nJimLBCaFSNjZA+gzCPe3+u58agzQpiG2Co=; b=HNwwlyJMswgsdp+et6bRVWZRPehcc0WPIF2MU3tbdrifhdyBxr782ud0coUsr++6NDehK/eY4JOw4gXHkiig3PESP7+u60/7n47/aXd8wqt5O1gx56l9vl5SGCh9GlPP44Tk4VMn7fmBPlM1G0hvnjduxbhtQke5/Loh1VNT/CTlXvD74s+bnPFdqCuwJxjSrhvPPqgwTKlLUbbG3LPUW867KdWvXAPugY1kV/VsWGEAWd4pNE71p3ce2CmNyHEpG8SnEzRo2Nr3pJg/GukX6fI9W0wNt/gwkps+AIn0cg0jKMCVx/goVhyDKH5wxgS1NFknS5gdKgzxC6NVZhMpLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a9NK4I28nJimLBCaFSNjZA+gzCPe3+u58agzQpiG2Co=; b=JuvPjs1qGxl8+boEJ3ymqFmbXcsiNcsty+sS/sP0tRZMc4dAxo2upNxcxEAQZU7ijAl60JPzqtpYuavV2DuC6w0Dndcchr3mB4rkzs/0wdk0ir1DDhxvOAgFLjNJYeGv3zmYXAG5TPY/HCkHEPUOVPpfCjGmQf8DYjge2cSKIrw= From: Roger Pau Monne To: CC: Roger Pau Monne , Boris Ostrovsky , Juergen Gross , "Stefano Stabellini" , Jan Beulich , Subject: [PATCH 2/2] Revert "xen: fix p2m size in dom0 for disabled memory hotplug case" Date: Wed, 17 Mar 2021 12:04:01 +0100 Message-ID: <20210317110401.46322-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210317110401.46322-1-roger.pau@citrix.com> References: <20210317110401.46322-1-roger.pau@citrix.com> X-ClientProxiedBy: MR2P264CA0166.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:1::29) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 53f24b2b-06b5-4f3d-e6cf-08d8e9349889 X-MS-TrafficTypeDiagnostic: DM6PR03MB4137: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:972; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tJaaDoqe0+GXF/dWYvL9HSzoSYdxwiFtPmWSEb/RuugAPzPKEqb/AuqiH7qporA/tAmF2TschW5o1gL9MYMdlXLlgWyuT3ldM5YF5r3A6BKqgQcwiristG0Y+kcJvHuvCZlrumRbsGJe+wvalYgpjHAVWOsd8nOeLki6DyTvAFPsd91j5f8jAbWGaCtQEnmCfu1HiFu38tjZNP8H+k0ShjqH3OkZ4mzlyLhGyMD08wETbdhGqi3c06eaRJtjiS0KxqkIUrWT1+CnxAcW7dWjNG/nSK8P6jQPmb9hyAk+EjO6lPkFZ3pPC46fCslcYgaAzzbkqANX9EPjzab0JoDmgbWN6CUzPTlsXrC3sVNwAu0O8C2nx7IadraGxuzJB5hbQTfF8ueMBcWa/sqAYu8Pz0RhSuG+F8xkeM4bBhCqgFg5ibnZ3iMnwFnGCT5n0TQsMXPDPfd6p86fPwR9O+QmUNMpNVCHDGebb+5G1im7LeywBWuRALtqjkMt19d3m+fRZIN1ENvELIIOgbho1kMoYNzNuHvTvmuI9QvT3/Sk4eeUtcs507GsOv/Pzy4tLhoP X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(346002)(136003)(396003)(376002)(366004)(36756003)(4326008)(2616005)(956004)(83380400001)(8676002)(8936002)(86362001)(5660300002)(66946007)(6486002)(66476007)(6496006)(478600001)(26005)(16526019)(186003)(66556008)(1076003)(6916009)(2906002)(6666004)(54906003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?BqAa2/1PvlzCn5eh97H6U86t9Mkh8S?= =?utf-8?q?pk5derny3SzYvrrLnrBA1MDAvilFB5MZIod/N4pklx3cd/B5htIKBwU5Yk5GZVayI?= =?utf-8?q?jGt9pF8S6AaqwLuXBveJmqoQn3DK0XI8LweDxtaHE4DiePqTQzii3MNNdTCxlzQeV?= =?utf-8?q?+Re4lZdqxZ829gmcIwmqBvSHprzPpgyorO7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ui1n3mLHOjxdSq15rh/F34xPxI/?= =?utf-8?q?R946RKAwfNSBzngY5XBXK4b+Lk7v17yHum5Jaj2v1rcNthgHhr8BC5XiA5GF2N5Pi?= =?utf-8?q?DQOzsZ9q0keXxDdhuzKfYY+qvZVa+keUngKpcDqouOMD+LN0Z+0qNni8cftayngiG?= =?utf-8?q?3bgy6IL+EEZfF2sUbcAA2OfWxCDTYb3/r5c7adNgR5gB3gQBaIJvTW+GV6tzakGgi?= =?utf-8?q?pKPD4WoQmPFfRO?= X-MS-Exchange-CrossTenant-Network-Message-Id: 53f24b2b-06b5-4f3d-e6cf-08d8e9349889 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2021 11:05:38.1791 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 14FtMN1D3ZYvIY54wPQHWG7Pi1hKZ8fqLXK/+0K1WLCYVPXCay0OADwfDl7BdmLj+BWuMFyjzrAl3RTONVZ97Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4137 X-OriginatorOrg: citrix.com This partially reverts commit 882213990d32fd224340a4533f6318dd152be4b2. There's no need to special case XEN_UNPOPULATED_ALLOC anymore in order to correctly size the p2m. The generic memory hotplug option has already been tied together with the Xen hotplug limit, so enabling memory hotplug should already trigger a properly sized p2m on Xen PV. Leave the check added to __set_phys_to_machine. Signed-off-by: Roger Pau Monné --- Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Jan Beulich Cc: xen-devel@lists.xenproject.org --- arch/x86/include/asm/xen/page.h | 12 ------------ arch/x86/xen/p2m.c | 3 --- arch/x86/xen/setup.c | 25 ++++++++++++++++++++++--- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 7068e4bb057d..1a162e559753 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h @@ -86,18 +86,6 @@ clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, } #endif -/* - * The maximum amount of extra memory compared to the base size. The - * main scaling factor is the size of struct page. At extreme ratios - * of base:extra, all the base memory can be filled with page - * structures for the extra memory, leaving no space for anything - * else. - * - * 10x seems like a reasonable balance between scaling flexibility and - * leaving a practically usable system. - */ -#define XEN_EXTRA_MEM_RATIO (10) - /* * Helper functions to write or read unsigned long values to/from * memory, when the access may fault. diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index a33902d05e45..ac06ca32e9ef 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -416,9 +416,6 @@ void __init xen_vmalloc_p2m_tree(void) xen_p2m_last_pfn = xen_max_p2m_pfn; p2m_limit = (phys_addr_t)P2M_LIMIT * 1024 * 1024 * 1024 / PAGE_SIZE; - if (!p2m_limit && IS_ENABLED(CONFIG_XEN_UNPOPULATED_ALLOC)) - p2m_limit = xen_start_info->nr_pages * XEN_EXTRA_MEM_RATIO; - vm.flags = VM_ALLOC; vm.size = ALIGN(sizeof(unsigned long) * max(xen_max_p2m_pfn, p2m_limit), PMD_SIZE * PMDS_PER_MID_PAGE); diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 1a3b75652fa4..7eab14d56369 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -59,6 +59,18 @@ static struct { } xen_remap_buf __initdata __aligned(PAGE_SIZE); static unsigned long xen_remap_mfn __initdata = INVALID_P2M_ENTRY; +/* + * The maximum amount of extra memory compared to the base size. The + * main scaling factor is the size of struct page. At extreme ratios + * of base:extra, all the base memory can be filled with page + * structures for the extra memory, leaving no space for anything + * else. + * + * 10x seems like a reasonable balance between scaling flexibility and + * leaving a practically usable system. + */ +#define EXTRA_MEM_RATIO (10) + static bool xen_512gb_limit __initdata = IS_ENABLED(CONFIG_XEN_512GB); static void __init xen_parse_512gb(void) @@ -778,13 +790,20 @@ char * __init xen_memory_setup(void) extra_pages += max_pages - max_pfn; /* - * Clamp the amount of extra memory to a XEN_EXTRA_MEM_RATIO - * factor the base size. + * Clamp the amount of extra memory to a EXTRA_MEM_RATIO + * factor the base size. On non-highmem systems, the base + * size is the full initial memory allocation; on highmem it + * is limited to the max size of lowmem, so that it doesn't + * get completely filled. * * Make sure we have no memory above max_pages, as this area * isn't handled by the p2m management. + * + * In principle there could be a problem in lowmem systems if + * the initial memory is also very large with respect to + * lowmem, but we won't try to deal with that here. */ - extra_pages = min3(XEN_EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM)), + extra_pages = min3(EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM)), extra_pages, max_pages - max_pfn); i = 0; addr = xen_e820_table.entries[0].addr;