From patchwork Wed Mar 17 11:03:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Pau Monne X-Patchwork-Id: 12145497 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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 1B665C433E0 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 C729564F41 for ; Wed, 17 Mar 2021 11:06:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C729564F41 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.98626.187129 (Exim 4.92) (envelope-from ) id 1lMTzZ-0008S9-4g; Wed, 17 Mar 2021 11:05:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 98626.187129; Wed, 17 Mar 2021 11:05:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lMTzZ-0008S2-1b; Wed, 17 Mar 2021 11:05:33 +0000 Received: by outflank-mailman (input) for mailman id 98626; Wed, 17 Mar 2021 11:05:30 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lMTzW-0008Rx-MR for xen-devel@lists.xenproject.org; Wed, 17 Mar 2021 11:05:30 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a161885d-e66b-4252-8d7d-b1cff585775a; Wed, 17 Mar 2021 11:05:29 +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: a161885d-e66b-4252-8d7d-b1cff585775a DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1615979129; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=Dj3WEWtfLuyd0K8fjqjOFWZBygM37snkgOFZ1PuAd7s=; b=GGVGEuN815hiHpM/o1KQWY/fR+veuDiwnvjoLEFi5I1RLjvqRIUVnrjh k1ni9XkxriiUKGLwVM9O/h+PmnCJP7VLBl2159R22XWeQrn25rit2oszA 71jSFpYjp6giT/nlwLEKnf9KAEnWgoGHA9CONi2I61axgFqQhRapHJDSm c=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: cEkfH64iLi94QlrgEQDnTmEqp9mnN89fAMmSKpnsRwZU5VZawiSRO5OqCPXNET415hgrIfacO6 DN8h9ScFg/MOZOOrU9u+GgnE76l1zy+LB5jZ2ZQKSYRaHXVW/M246xb7HQnxLmlgSTfXofTKIF 33x3mQpwH08+KR/QoDJvjhf/C/xcCdRe4OdRFQQYKHy2KnSpRJDorNIu5EVWm6+obqqwKmgvXN SGQeNtBGNHCVDCqORiSy/s6SjsIbLO1U3NYwgOCDJOfUztst9onCro+6SXxL88Tge5Y4umhnvG mc0= X-SBRS: 5.2 X-MesageID: 39488637 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:v7NBpalG7l9Tth1wK7wlojCMgvfpDfNMjWdD5ilNYBxZY6Wkvu iUtrAyyQL0hDENWHsphNCHP+26TWnB8INuiLNxAZ6LZyOjnGezNolt4c/ZwzPmEzDj7eI178 ldWoBEIpnLAVB+5PyU3CCRGdwt2cTC1aiui/vXwXsFd3AaV4hLxW5Ce2GmO2dxQxRLAod8MZ Ka6NZOqTbIQwVmUu2QAH4ZU+/f4+DajZ6OW29HOzcLyimryQmp5rnzDgSC0n4lMw9n7L8+/Q H+4nHEz4q5tfXT8G6460by641Rg8bozdFObfb88fQ9CjKpsQqwYZQkZrvqhkFKnMiKyHIH1O bBuA0hOcMb0QKTQkiQrQH20wftlBYCgkWStWOwunforcznSD9SMaMo7+80A3ipiXYIh91y3L lG2GiUrfNsfGz9tR/w+sTSUFVSnle0yEBIrccok3ddXYECAYUhy7A3wUJPHJ8MWAL85Yw3ed MedP302fdMfVuWK03ep2lkqebcJ0gbIxHueDlnhuWllxRmtlVQ7281/4g6szMr0rUTa7cs3Z WZDo1Y0JV1CuMGZ6N0A+kMBeGtDHbWfB7KOGWOZXz6CaAuIRv22tzKyYRwwNvvVI0DzZM0lp iEekhfr3QOd0XnDtDL9IFX8yrKXH62UV3Wu4Rjzqk8noe5aKvgMCWFRlxrudCnue8jDsrSXO v2H55KHfn5Ly/LFZxS1wPzH7leQENuFPE9i5IeYRajs8jLIorluqjwa/DIPofgFj4iRyfxGX 0GUD/vJNhR70yiV3Pi6SKhHU/FSwjax9ZdAaLa9+8cxMwmLYtXqDUYjly/+4WKJFR5w/ULVX o7BImivrKwpGGw82qNxX5uIABhAkFc56ilV3tLoAQNIl7laLprgaTGRUlimF+8YjNvRcLfFw BS435t/7isEpCWzSc+T9S9MmybiHMXrGm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V5Zv5KIGoNL3KsLn3/698NZwONfM0kzwmmn3cFGLOHNa ynah+MFZVlxt1mB4X8B4qFwdrU3gdX93sOv5v2hHyMkvVt996aLGdHwJsAWrksPByr8id+2s aSWgyKP5F/2lCgk1Dc X-IronPort-AV: E=Sophos;i="5.81,256,1610427600"; d="scan'208";a="39488637" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VG12hFFH2uopaIwkpXWtTX6wSn7bqfVG//lZy9sbnqJixv9bgqu/KBd3HNxyoX2HDbhU6s+xUf1/3gPXJrCG58qL8sHIkPLBoEAlIAv/4tq1Tq7PJmplS4yIFXp6oedh2UU7uDShel7Oh/cXGWt4YLuU7SApFpdIbu66VlTu7QM6DXakTSg4TR6p3Mu69qxb8RsC5kCYSgPnLzNeOQC1jWt0qntDiaeEV/evIBPILU55AbqowpBL94Gt02vKuy4L+qiJ0ORTjn6KD/EXyxkDBsSGJhsLmerd2iB2xLtckshKrPoKE4tUJ14VfkS3Tig9yIK5uO71AJkCCVX79TSqwA== 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=xAYosD/NdQQbVF91epopKWbQaq49dZ/bZFcLDV5M054=; b=FNm2Jg0Z7l/OUZGjh7MenDsXP14VJWkY4b46oPVTLV4D8wkGmiOoSh2qekelqQ/wNp7gfuqRC+GYmRUboCWM92eO87MgjliJz1uPLz3cRAj1ZAMcurVnCIc9wF/tkzz1MdBEm9c3oC6Zu2XDHc9Srrya+yt/Vp62wvSqknwzKQqzrEYmX+AE+UmvSu7knizyV8jqtpT2TGqc9jriYs+iF+Ua98AJ0ciZdAS2u0yt9If+w9ZeloTjoI/yTo2RDhGIFQvoSf5T5Q/Mmo2vtskHvvHUa8H2zruDNbtwk8bBx4X2ReWvFgNl1MOrhxvI3rn0aSm4Oj7Ay2e6z105w1/lpA== 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=xAYosD/NdQQbVF91epopKWbQaq49dZ/bZFcLDV5M054=; b=Fh+bn77WJl22UpYmiH2mJB6lW2t5F88T7XbaMNZxB9YronCBB6NdYWZec3/TXcnuuEzIjE4Cc5v/VBGUjbu0dgmewbqWP7fIsKFr9e5njoYudh63/ayhMmC9vIig4OpeLXd4PF86YrZtNyY0kb5qHSPbVP9GgVH7yG5toWwbTuE= From: Roger Pau Monne To: CC: Roger Pau Monne , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Jan Beulich , Subject: [PATCH 0/2] xen/x86: alternative fix for XSA-369 Date: Wed, 17 Mar 2021 12:03:59 +0100 Message-ID: <20210317110401.46322-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.30.1 X-ClientProxiedBy: MR2P264CA0168.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:1::31) 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: e3ca4c43-bfca-4fae-3c44-08d8e9349111 X-MS-TrafficTypeDiagnostic: DM6PR03MB4137: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SUAEzJh1WvLYv5aq90gF9un93IdwAJLBC4XhB0tpLshASB1aeHnT66WGxZK5gSLtfnWG/azgR5RgU/rcT6y83rA5yXUmyfFeLAvZf+VYRA0JlLR+h4M8rWmlEJQ+dtT4+gsRFw52HIs/B7WCVafQNmRCY+FsRG0Pew/cY2i6VsMQqAbxN+alSV1o/U0oGWCH680S8E58AZKLPeRc1JRpm4ImmTctU3dzf/qEKNQZLvObbRg6Izp7Zmph8quP56W2rn05v5R1a+qXo2dIXJseM6T75o44Pc4RNZ1t3jGqFnH5QeYquD2iPKt6pc8DKGyqz4HyX3fpTtxEDCJ/qishHYX9FAvKSuBf3qGuul1stJRv+CZYxpJpWFSS5eLrkz9v5IzX2JQ6naoUyVU+WdgwbSmiV04Qe0xuk+ToT1+5rqHFh0ZibDHqdNCqmBSGCa/CcvDCdFZraL/n8zq3VVUWYJqtQVgwyNNfUIaoQpQMZf+lAFrDZVHtSwKDeKxoxxGzWVGZC8edpKiQJ2fUMStOsETW0XVeELgpa2eHxsRAJDq5nXqlOPf0DLXQg3mGvnPy 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?7dXA+zlRcqEgriluRmD0kN+WO1/Ebs?= =?utf-8?q?xav6Q3/bt9/NOKnpFWnV1H4IgVcOK8ZHT8Lt6HSIjgfs497HJaVUCbkzbCHvN4RQP?= =?utf-8?q?bkZJnEN0qLamuE6aFK7+hyeBZTJDQcIJBljqjFFLCrWMxocomLC91oTZN/STpV3gc?= =?utf-8?q?Om8ifveRbIZfjqfJwBWIa/+42sKzcc+rFTn3e8OGu3xrJD/JsKmkT6/w37s+HF6ve?= =?utf-8?q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?zTAlbYjmv1UYnEg+kG8Reu/tSPhrOA9wBq56ZDRj5X6WXE5QK+gj2bimMgBd49vwV?= =?utf-8?q?h5SK5+tYEPUHwKCoFR/jmP+ycRw7CAgOpARr0tIYNXD2QvzkmK5JWGEHLA/DMJ0xb?= =?utf-8?q?QdG1NUtfFzuGq65pt6hm6KC0Gs4doULtObwMwXSGQDmDwVM1I5ZYUl/eacjm4FGiV?= =?utf-8?q?Ur8ERZCz4w4lg/?= X-MS-Exchange-CrossTenant-Network-Message-Id: e3ca4c43-bfca-4fae-3c44-08d8e9349111 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:25.6492 (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: Nc3av+x7AojimneYJ2kgThdWBB14nBDW1n5zUCShw20IylZx1Bc+W5vwwUtHeHkcIXWEKFuJLLYqFlkcCCr4fA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4137 X-OriginatorOrg: citrix.com Hello, This is a proposal for an alternative fix for XSA-369 that instead of special casing XEN_UNPOPULATED_ALLOC to size the p2m relies on making XEN_BALLOON_MEMORY_HOTPLUG_LIMIT depend on the generic MEMORY_HOTPLUG option rather than XEN_BALLOON_MEMORY_HOTPLUG. I think this is safer, as we don't want to be special casing any option that pulls in generic MEMORY_HOTPLUG without XEN_BALLOON_MEMORY_HOTPLUG. Without this we would also need to at least special case ZONE_DEVICE which also relies on MEMORY_HOTPLUG, and is what pulls the generic MEMORY_HOTPLUG option even when XEN_BALLOON_MEMORY_HOTPLUG is disabled with XEN_UNPOPULATED_ALLOC. Thanks, Roger. Roger Pau Monne (2): xen/x86: make XEN_BALLOON_MEMORY_HOTPLUG_LIMIT depend on MEMORY_HOTPLUG Revert "xen: fix p2m size in dom0 for disabled memory hotplug case" arch/x86/include/asm/xen/page.h | 12 ------------ arch/x86/xen/p2m.c | 7 ++----- arch/x86/xen/setup.c | 25 ++++++++++++++++++++++--- drivers/xen/Kconfig | 4 ++-- 4 files changed, 26 insertions(+), 22 deletions(-)