From patchwork Wed Apr 27 09:27:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Penny Zheng X-Patchwork-Id: 12828509 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C5850C433F5 for ; Wed, 27 Apr 2022 09:29:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.314611.532763 (Exim 4.92) (envelope-from ) id 1njdyc-00016a-KM; Wed, 27 Apr 2022 09:28:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 314611.532763; Wed, 27 Apr 2022 09:28:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdyc-00016O-GT; Wed, 27 Apr 2022 09:28:50 +0000 Received: by outflank-mailman (input) for mailman id 314611; Wed, 27 Apr 2022 09:28:49 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdyb-00015W-8G for xen-devel@lists.xenproject.org; Wed, 27 Apr 2022 09:28:49 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02on0601.outbound.protection.outlook.com [2a01:111:f400:fe06::601]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 70d3dad0-c60c-11ec-a405-831a346695d4; Wed, 27 Apr 2022 11:28:48 +0200 (CEST) Received: from DB3PR08CA0005.eurprd08.prod.outlook.com (2603:10a6:8::18) by DB9PR08MB6537.eurprd08.prod.outlook.com (2603:10a6:10:250::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Wed, 27 Apr 2022 09:28:38 +0000 Received: from DB5EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::76) by DB3PR08CA0005.outlook.office365.com (2603:10a6:8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14 via Frontend Transport; Wed, 27 Apr 2022 09:28:38 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT055.mail.protection.outlook.com (10.152.21.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:28:38 +0000 Received: ("Tessian outbound ab7864ef57f2:v118"); Wed, 27 Apr 2022 09:28:38 +0000 Received: from f7af931dfd82.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B8337183-C9E2-4605-9B2C-0756620C920D.1; Wed, 27 Apr 2022 09:28:32 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f7af931dfd82.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Apr 2022 09:28:32 +0000 Received: from AS9PR06CA0126.eurprd06.prod.outlook.com (2603:10a6:20b:467::25) by PA4PR08MB6255.eurprd08.prod.outlook.com (2603:10a6:102:f1::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Wed, 27 Apr 2022 09:28:30 +0000 Received: from VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:467:cafe::17) by AS9PR06CA0126.outlook.office365.com (2603:10a6:20b:467::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13 via Frontend Transport; Wed, 27 Apr 2022 09:28:30 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT040.mail.protection.outlook.com (10.152.18.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:28:29 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 27 Apr 2022 09:28:29 +0000 Received: from a011292.shanghai.arm.com (10.169.190.94) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Wed, 27 Apr 2022 09:28:20 +0000 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: 70d3dad0-c60c-11ec-a405-831a346695d4 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ipdc3e1RnMQb/YeZhjG0nay+i9AURQsGfGhypTtQTZBqjqeA9i1hApU0hUe9Wr3wPIucwiG1kkHWS1MsjeBCr7HDQiKOtwpcLkiDM3smNsap0Y8Lz3FbQ5u9Pvkd8muWFg2HT8M6Ro3RL8Qn890P9j0+1DiVkZcbzh1DUyjLvw2MaCOT11mLNZCJxpNRKUKJsRpuJWsisboguWkhyIajD2eO35+y2VeI1lodA1oTfiTHGh0EgBp3jAdNxNnUIo//x0LJ+aVBYk2ZP3xWcojfzYDPM0r026re0cG+0hSJull+TSY5/IhUxGsNFJHxQ8klTPCb4rab4qDFuBVUUKiiQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0qA9JxuQq7jj4LbeGwyi4Yeymfcd0bnxAGCmwirOLIs=; b=UnGIenCDFTFWpHO9cAVCJmo83LymqJR/v3K80WDoRgcyFxDxBCp0lsblpqoyW0AzMz983963X7BfShy250GpM6w9j52N7/UGLWkTDV3cy6LAbm5a/ok/BB8xXlJ2FrPAoOAJ2EQTVQnuAae9sLT4TtMRVxgFYj1B24YSvI8n4pXiUNXQJoqXXQZ1NPIv9qg6UN/ZCtVruyorbzLgFGltGdUDulYwrrnXdau8xYDJcKFcB52c7gZZ+zTvp/f3QvikryY8ewUvLiOXh/7yZyVT3bkEOvXIAWj1dihIoXm6yWHBw7XduA7eyOB+kkBdog2LxTzJbZQ/UDHQqOrKvd8YNQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0qA9JxuQq7jj4LbeGwyi4Yeymfcd0bnxAGCmwirOLIs=; b=JZyVFCDJR6FeRXHZ3xmBdZYzD0/AjkKfeu91czzeGKit2Y5lZWkyCS1EWLxhvdhtEuyb35XASBV23ldIXbm+6IWuqh6OpK+fe4bgRX+WpyIJIO+lHNnB4RinTqQD+aWp9k7B7G1rU+wcF1DaUzSpRj4/tPMwYwm/Sxf5Y0KsuRc= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: e3ddfc275cec7f16 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bMXZ6FPmUhRUIoKeaT3JrAo8nAdFFV9SBwmfJP3MEhKo5LqfY7j/C1Jr0fQFO+K0frNx5ScqEL9QkS50SCTUMbktq7oSQGSHFtC3SI/ENmZHwWbVNNsn8jjEI92fSwTbYRXbAkGozf0nz0v4ihMSIvRzI0IqREswNB0hd5//mLq/iiktZ2CSztWATJ80F9YyoK532EAaDFuQ1a4jk1l89gmUdkZeQWIQ4cG2bDIUdjn8Z562eLfkyzl7kRldcRqP+F05pggqYp3HIWUzMakQUUMlNCRpmaQndVgcWemNaCGcNCt19Gp7vFjRNegBdVHsWwZR/pAph5hCjjlL8If2pA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0qA9JxuQq7jj4LbeGwyi4Yeymfcd0bnxAGCmwirOLIs=; b=AGCRo13vVysLgQ6zELxmR1cV2W+kcH1WTsGqo+iCVRX+ef9bU5Dtnuae/zTT8BIHFBGfcSUivV1IIkSGKUkpDXC7adCruk76l78OQG2gnBmPFUSd6OywHR+JcMWRDHoNtk8XpognIlFFhkXBEH4BnsWau8ptyBpVFqVv9Ludv7INS/xoXXRD7jHDJkaJtY1Fq6fKpHoycxD09lkcW6CuuohgUXyG3BsJpwORvXQnAqaREGuvBEenlXtHIoA8zKFq36p6fOv6WSDy0aIncI1DkgGldgTFapsVo8iorr9gN7bBaFaZvTeNjKjgWRwbvKBsUKENxd1uHd8RF4S+z0OLNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0qA9JxuQq7jj4LbeGwyi4Yeymfcd0bnxAGCmwirOLIs=; b=JZyVFCDJR6FeRXHZ3xmBdZYzD0/AjkKfeu91czzeGKit2Y5lZWkyCS1EWLxhvdhtEuyb35XASBV23ldIXbm+6IWuqh6OpK+fe4bgRX+WpyIJIO+lHNnB4RinTqQD+aWp9k7B7G1rU+wcF1DaUzSpRj4/tPMwYwm/Sxf5Y0KsuRc= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Penny Zheng To: CC: , , Penny Zheng , Andrew Cooper , "George Dunlap" , Jan Beulich , "Julien Grall" , Stefano Stabellini , Wei Liu , Penny Zheng Subject: [PATCH v3 2/6] xen: do not merge reserved pages in free_heap_pages() Date: Wed, 27 Apr 2022 17:27:39 +0800 Message-ID: <20220427092743.925563-3-Penny.Zheng@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427092743.925563-1-Penny.Zheng@arm.com> References: <20220427092743.925563-1-Penny.Zheng@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 36b494a7-3363-4682-2fb8-08da28304f97 X-MS-TrafficTypeDiagnostic: PA4PR08MB6255:EE_|DB5EUR03FT055:EE_|DB9PR08MB6537:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: AWx/5t2DB2QmJrYK1Or6f3Y5sa0SXa6EFCN5YLjEx5KHn9BJdpQv38GHQlCMwbPVymr1F/ARdUQ+dm6aKyGntpSNm0x8YGSGc4XInMKb30T2kSUyZcx+d9uz8e3W/ab7hesVTDhiC+eveRzHPR+VFunHucfr0KdVryGqWmVzoB4Sc91AHSf74QcZDDCASXgXbZaOFl53LIFXygRhU/SKMWl+Q7ao6RQ1wDXs6lct1QJ/t3Yi0WFY7jbpA0PJY8ymDjKEPEtDL+yjDy1bX+BgzCAZM6BQ9cohni3qWdZ67EoB1BZ71pG5v/zr8oWZMnsvgSAF2ZdwTfldrLzBnYCJJFuzxrUhPaWAQvXZH7Z/iuQzr1rlsJ+C6tNIZqyXdWmc51nhk/9aV8TCz2aKM0ex1rWmbjbqjieQ+3GvzYNW2lcgjxqeauprjPCyvpJ3bORMF/I57VPQFrMiq+fe95HcGliDpMzZPH2nAMHXuLO8lV6gu61cHLxZJcZc8FzZbX2mCvQgMsYbzue+AW5MTm3z4zRzoc3zvsuya64UwXWyCXA3lqleaunvlHpeFUR8fXejnG77V8DrmvMvwe9oY5OaHmfd/O2G7CqUartwVEbHyAGAVhLtI9s7dva+QDTCDGzv/gjLqLCRAYxpp1zwj/AamuEPPY9aT30L3O85VXuBUM2rfOIJRlftYwk6+U2jmP+861xG3wgH91NilCfQiW2wDg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(8676002)(4326008)(70586007)(356005)(83380400001)(70206006)(7696005)(2616005)(86362001)(54906003)(6916009)(316002)(47076005)(186003)(1076003)(336012)(426003)(81166007)(6666004)(508600001)(40460700003)(26005)(36860700001)(8936002)(2906002)(5660300002)(36756003)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6255 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 663a81de-99b2-440f-259f-08da28304a57 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HTwKq9JaZ7EHMetoVjuvKD/tQyU5DNbsuAvE3bSa6SjQqR9lCMIpttuUAKwyxZ5lBy36ZBCc3qxQuk4gNsSp+wnVq/udnYXLAHUP9I074S0RgFEXFkx5jBX1hFLUoHPE+aC1Y5EK0glRLPFdeNBDKSUpGKDzjSKTQfM28o+0XDJKi2gpzU4JfAhd2oO5GEzXjJJDejnYojUZm3uQx703f/a3SiEsSSXHJUwXBwJlfvcoBPw+P7dI5kTKgPjedF/YUUKca2vtZ6uYZnILMAihqFzrUQxQvxOU5OnRKqqNPgN6zoA/CPFJrCYt01pU1lb2x2L+WmleS7z0pVbgpijIkBqxFLAYQCTw8VtX2fAeLkOYdP+r3VZViq0NnIjoJh03PCRay3/pa7qMPdwrE6TdUBDxg/u9raVacGVh0BNXpd1RfCPugMdNbRa82taB2Njq2p7A7eawTYIPNzKFFO0zYwQ1xH8AdeaDkkIOEz2nLYNHY78PYGWDQkvWrwgfR+t3azZhinx/yzE6gXCKfutBEO/YH8LqesomMZplzWxE7frqmtpkPKl4fhIMcJ4t+7XHt8rq9TToKZcuZ7nbX4vBec69IkQc1BUjAnN505wEB99bqvhpDeRX/ogXJDQR/35C0ZvH0yzhzEG86JuisjruhN1qPpUkfhk5RI+GVkuglisiXRopNwu1PiYhtY0Fkhl5 X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(70206006)(8676002)(70586007)(36860700001)(2906002)(4326008)(40460700003)(6666004)(86362001)(5660300002)(8936002)(508600001)(26005)(83380400001)(7696005)(2616005)(47076005)(6916009)(54906003)(316002)(1076003)(36756003)(336012)(426003)(81166007)(186003)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2022 09:28:38.5195 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36b494a7-3363-4682-2fb8-08da28304f97 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6537 There is a slim chance that free_heap_pages() may decide to merge a chunk from the static region(PGC_reserved) with the about-to-be-free chunk. So in order to avoid the above scenario, this commit updates free_heap_pages() to check whether the predecessor and/or successor has PGC_reserved set, when trying to merge the about-to-be-freed chunk with the predecessor and/or successor. Signed-off-by: Penny Zheng Reviewed-by: Jan Beulich --- v3 changes: - no changes --- v2 changes: - new commit --- xen/common/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index be501582a3..1f3ad4bd28 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1483,6 +1483,7 @@ static void free_heap_pages( /* Merge with predecessor block? */ if ( !mfn_valid(page_to_mfn(predecessor)) || !page_state_is(predecessor, free) || + (predecessor->count_info & PGC_reserved) || (PFN_ORDER(predecessor) != order) || (phys_to_nid(page_to_maddr(predecessor)) != node) ) break; @@ -1506,6 +1507,7 @@ static void free_heap_pages( /* Merge with successor block? */ if ( !mfn_valid(page_to_mfn(successor)) || !page_state_is(successor, free) || + (successor->count_info & PGC_reserved) || (PFN_ORDER(successor) != order) || (phys_to_nid(page_to_maddr(successor)) != node) ) break; From patchwork Wed Apr 27 09:27:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Penny Zheng X-Patchwork-Id: 12828510 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 15CDAC433EF for ; Wed, 27 Apr 2022 09:29:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.314616.532774 (Exim 4.92) (envelope-from ) id 1njdyr-0001bD-Ub; Wed, 27 Apr 2022 09:29:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 314616.532774; Wed, 27 Apr 2022 09:29:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdyr-0001b6-R3; Wed, 27 Apr 2022 09:29:05 +0000 Received: by outflank-mailman (input) for mailman id 314616; Wed, 27 Apr 2022 09:29:04 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdyq-0000n9-8I for xen-devel@lists.xenproject.org; Wed, 27 Apr 2022 09:29:04 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on060d.outbound.protection.outlook.com [2a01:111:f400:fe02::60d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7953a565-c60c-11ec-8fc2-03012f2f19d4; Wed, 27 Apr 2022 11:29:02 +0200 (CEST) Received: from FR3P281CA0026.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::17) by DB9PR08MB7116.eurprd08.prod.outlook.com (2603:10a6:10:2c9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Wed, 27 Apr 2022 09:29:00 +0000 Received: from VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:1c:cafe::ab) by FR3P281CA0026.outlook.office365.com (2603:10a6:d10:1c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.6 via Frontend Transport; Wed, 27 Apr 2022 09:29:00 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT057.mail.protection.outlook.com (10.152.19.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:28:59 +0000 Received: ("Tessian outbound 62985e3c34b6:v118"); Wed, 27 Apr 2022 09:28:59 +0000 Received: from eae4235bb0d5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 77FF16C7-2200-46AB-9358-7ABC31E92AE4.1; Wed, 27 Apr 2022 09:28:52 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eae4235bb0d5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Apr 2022 09:28:52 +0000 Received: from AM6P192CA0086.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::27) by VI1PR08MB5453.eurprd08.prod.outlook.com (2603:10a6:803:132::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Wed, 27 Apr 2022 09:28:49 +0000 Received: from VE1EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8d:cafe::bc) by AM6P192CA0086.outlook.office365.com (2603:10a6:209:8d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14 via Frontend Transport; Wed, 27 Apr 2022 09:28:49 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT021.mail.protection.outlook.com (10.152.18.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:28:48 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 27 Apr 2022 09:28:39 +0000 Received: from a011292.shanghai.arm.com (10.169.190.94) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Wed, 27 Apr 2022 09:28:30 +0000 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: 7953a565-c60c-11ec-8fc2-03012f2f19d4 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ca957iFd3GwcadLwUBIDY2Xk61wjByJebQxyw/mmKDb2q7Lh7ol7sDSmTmR+2Nwcy+Bvy/gez8fYIiZyrGpXL7M4llq5SrqjBJg6ofioBE9OIUE1LMalh7b1CSrh4L039WY0wtqfSAw/rmPVWG1KwWWW+0ci7BkmsfdKmC8zI2/TMcsSnR55zcLzAm9E445ecNlybVKsurELMx8Rz9zkZhjraIvjit3beCjljzJMUisgnH/O5QmZAlpU5DNxHofDV5zsQGgVebT8x1kKUCi6dA4pcN1/3fQF4UYkPN6Pm8rI6mpwsTLrI8X/gUSCW/yhtoFvc0sEkk3smr4h6huzLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gKV5xiCmhipxoNF2c34Y3bk6wQOs8dxWyNC/VQODx1s=; b=iyTOPSfCeh1M3ZF4i1u6E685Nd0i9+Z7Gk+YOSKwh/uUcXYKvA5b2FAvrcSpgfs41GFE8aF89XShXRQbWDERhGtpQElMvzPW3Ki8IVGx6Gnb3JMqTHGc4vcPkS4JgfLS+SuIQ0Tn8Sv5nxJ7o9/nP6wP6qZ9d8h0ASyp2G0TAqprEFR6M16nGK4Ba5dxMO+b4R8SYORo6Efzq1eKkXC5eeUTFdKlmcQPO7rXVREz0oIR9GyRPnYKTXCVgbur+fz5SRgkEGHDwbj1wKBVj1EIvsSrLjcDG4+2saV+TsUUXIRjV+gmAyuuqe7s95LVzhTeV0l/axZLvhYLwOApTWyoNA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gKV5xiCmhipxoNF2c34Y3bk6wQOs8dxWyNC/VQODx1s=; b=k83bgoeH6Jm7PC8uN4PicxtmnmTachNYARFHrkVtBnRB8GUpcdzh81NOQiO7vxnHx+Fosgep6kT+96mgbb07DHsczyTxyhOSRV5Dg3q17mGiyvYBvE37aNkinQvRU9BH3DwK6mL8HJAy2KiXvb+ctC6d70jDk6TfdeeaFghqx4M= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: b0351bf2feed9c09 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iSLOTXDgBsOyagF0KTsSY8SYlON3Zr/TSjLE/RM73no0g98EKxpShw9hVHGsSm6w4IV41y0FvlBefX6wgllPHlkNMYgUXps+/gQj9uFxcSaIJhq0yHFtPHHKo6mPbExs5l8DGS8BdNo79MUVxbHGbtmNAU418R5JkCmYu35OwJauJGjXIYOgjKYBP0tNMhHapZtRiZyCgS4I/pC+bT8cZemSafM+UX7RiY+EKwRxkIMD2E4bil2AmuaEkKKEQ45W64DbGCuptsDjyo+as/biqdH+vMqSu917KJTCtlGSC4zd1XRCuWhgoGJs7dPUbuTntqwo6DzCaxV2sRfj8WZUzg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gKV5xiCmhipxoNF2c34Y3bk6wQOs8dxWyNC/VQODx1s=; b=NAQEzoOpN30dQe3a5WB1YHDHkrcOVZ5h4X7W+2dFKuAPZPsJ6rIKtiAhfiNrs7bpvhWJZL65912LxhJ+T6YqkIKnqSkFYFDHCmx4GZo+rqVljPCoKdlGG8iI+Dy4PAaIVeLdDTllIyl40ckau6iyRO3otr95ATrYXRUEUZFnTAtI+PVFatnzt2dkR/Cp/1dHeYSQsRc55hAo6Y9H9JrG4Eb5nz5G2jxz+ljrIB24i9YC1npziFyHoIvZVeCE4BR0SDAEaUrr6pIcOtcoiiEj1uuQqmoYe/kBuAI4Ts213nc0k7m/mN+aE4eeLqoVm7pxxoyBQ2YOc8AbkfHdXbe6tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gKV5xiCmhipxoNF2c34Y3bk6wQOs8dxWyNC/VQODx1s=; b=k83bgoeH6Jm7PC8uN4PicxtmnmTachNYARFHrkVtBnRB8GUpcdzh81NOQiO7vxnHx+Fosgep6kT+96mgbb07DHsczyTxyhOSRV5Dg3q17mGiyvYBvE37aNkinQvRU9BH3DwK6mL8HJAy2KiXvb+ctC6d70jDk6TfdeeaFghqx4M= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Penny Zheng To: CC: , , Penny Zheng , Stefano Stabellini , "Julien Grall" , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , "Jan Beulich" , Wei Liu , Penny Zheng Subject: [PATCH v3 3/6] xen: add field "flags" to cover all internal CDF_XXX Date: Wed, 27 Apr 2022 17:27:40 +0800 Message-ID: <20220427092743.925563-4-Penny.Zheng@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427092743.925563-1-Penny.Zheng@arm.com> References: <20220427092743.925563-1-Penny.Zheng@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: cc2d2d35-9304-4bf6-c4d2-08da28305c34 X-MS-TrafficTypeDiagnostic: VI1PR08MB5453:EE_|VE1EUR03FT057:EE_|DB9PR08MB7116:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: LPrdKLX2hlNxyN93t931MKCbSZb/Fau2N51CeW6V9aPu9cTp1mH0/QIG4d1JkB9I4KxCWPROI0hEk+Df4x1L0JWtRFq3ZbWEL8Fzo6HVDlIQIwexvvBjEwf1a6xAnXCJf51/BZ2eu1dBydGp7n6ER0cUiv33BRyi1QWlcnyEYlCdGr3j1KHs0aUL7OlkPvkmiNKw5Ci8qQBcW1haindCBmEm2EohDTNsTGbokPUSy2o88cN7jcDv0t++nHo4bHPb25jYkm7BbONbV5gDhxxwtOBfXdu9+jpmle2MzxOdHyGLYyKzmkP2xlJaRftY5/0Z0DtIi8jbKJkylmDVrs9933v7sX5lmyoa+QHIfy3150SFBQFjCj/JGTKYf4SC+G/+FPcXv4UvVnoEbe5Mu10oMefCFKQp09Kxi4pMU4KhR7EfNZoqUBtiQR4PteUvnsnFZdVcNatMZc0LmADgxgYTk2d2pPJMco+O6OsWK+fetZ9R4lTLqkEu7pWFu0n6Y0OHTj8v+ej6sOP1F3Y5yqWjH0qHx25MvPQHWyaWwQottYCo4wVduxByjAlpxIeoCY7FvkQRJL4Qxreg8KF78Pw9rgME6p34HNJZgPZScw4pZwrqmXIrty/OHKloNayHd4ndsy+nWEv2AsnIJX3ppKH2/hdLg0z6/KZUw+In5GaQQ4EUUH48DXXIJHzqqoaBq+W6oQDHmmnjSbcCOLXokh8k8xuq+fGANlcFtAaukGLhbDk= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(426003)(336012)(508600001)(82310400005)(2616005)(47076005)(86362001)(40460700003)(1076003)(26005)(356005)(81166007)(6666004)(7696005)(186003)(2906002)(316002)(36860700001)(70206006)(36756003)(5660300002)(8936002)(70586007)(54906003)(4326008)(83380400001)(6916009)(8676002)(21314003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5453 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: fcf7d022-2bed-4ff2-1992-08da283055b7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wJa8vUXa5eCEqu7ecyfTe8VMJbdBIBjxpTRdrxEnh83UBVsA7CQ8kC4UyRpZ2UaNsT7U1R2cOyP5M14p7cB6B0ekwbsIQ/WNbVj6XybJR98k+vpOVpoOPOyFJzSM6HGm446HEmwdNObx42wkUO/ETsmMeF6d991rvWDbeQK7f5+JaO/g+LR4MBpLsVn4T/tnt3XJ5aBbxA566Sh4vA1dxQbOygXvXN5aSKa6ZLGF1CF0NETocCMiCYXXw8shaFebDrBiPfHbG6lsxB+TFlwsg2vt8WoOS57Ftv6brOb9P1kOpOw9wltq6mJMuDffObOfA3i3rz1Cfi+aUZcyuiWDg9isIE/ECeVpb2owNbJ1JqIP7+gDq3T7d/j5k2wnSV2WmgAf89+An6cyujhTH8LuTj0kz2r20tRbobz14oDaGMmCSjOVxqYEK9UY8u6Qyk5myy+jnD+hTwkTqG7CHHuqN16iXctqNcHOie2wIiW+nfrWXbnTYNTAnwlOpPZ0YiQ3MXV3lNl0Kz6q3UZFm187rCGOlOO4lslHKdcczbJ+XZGGEYl8QOOtC2vBKkzFA5xiMOI0pAEbvlpsQJqOsZOxhwmwXBcQAUoEeg/QboIKRFflf50M/vxlQEaWt4EKLiecnC3lSwHSa9QXKrSnFgDdsCsqO+eFw5OBcEYXnEgA+Uz3dxzePuFMft9VsSqLMZLC5x4Ehgb/Vba0ffzVv7lJRA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(36860700001)(26005)(7696005)(6666004)(54906003)(83380400001)(86362001)(47076005)(336012)(2616005)(186003)(426003)(1076003)(8936002)(4326008)(40460700003)(8676002)(2906002)(5660300002)(82310400005)(36756003)(81166007)(508600001)(70586007)(6916009)(316002)(70206006)(21314003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2022 09:28:59.5443 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc2d2d35-9304-4bf6-c4d2-08da28305c34 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7116 With more and more CDF_xxx internal flags in and to save the space, this commit introduces a new field "flags" in struct domain to store CDF_* internal flags directly. Another new CDF_xxx will be introduced in the next patch. Signed-off-by: Penny Zheng Acked-by: Julien Grall --- v3 changes: - change fixed width type uint32_t to unsigned int - change "flags" to a more descriptive name "cdf" --- v2 changes: - let "flags" live in the struct domain. So other arch can take advantage of it in the future - fix coding style --- xen/arch/arm/domain.c | 2 -- xen/arch/arm/include/asm/domain.h | 3 +-- xen/common/domain.c | 3 +++ xen/include/xen/sched.h | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 8110c1df86..74189d9878 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -709,8 +709,6 @@ int arch_domain_create(struct domain *d, ioreq_domain_init(d); #endif - d->arch.directmap = flags & CDF_directmap; - /* p2m_init relies on some value initialized by the IOMMU subsystem */ if ( (rc = iommu_domain_init(d, config->iommu_opts)) != 0 ) goto fail; diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h index ed63c2b6f9..fe7a029ebf 100644 --- a/xen/arch/arm/include/asm/domain.h +++ b/xen/arch/arm/include/asm/domain.h @@ -29,7 +29,7 @@ enum domain_type { #define is_64bit_domain(d) (0) #endif -#define is_domain_direct_mapped(d) (d)->arch.directmap +#define is_domain_direct_mapped(d) ((d)->cdf & CDF_directmap) /* * Is the domain using the host memory layout? @@ -103,7 +103,6 @@ struct arch_domain void *tee; #endif - bool directmap; } __cacheline_aligned; struct arch_vcpu diff --git a/xen/common/domain.c b/xen/common/domain.c index 8d2c2a9897..6373407047 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -567,6 +567,9 @@ struct domain *domain_create(domid_t domid, /* Sort out our idea of is_system_domain(). */ d->domain_id = domid; + /* Holding CDF_* internal flags. */ + d->cdf = flags; + /* Debug sanity. */ ASSERT(is_system_domain(d) ? config == NULL : config != NULL); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index ed8539f6d2..49415a113a 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -591,6 +591,9 @@ struct domain struct ioreq_server *server[MAX_NR_IOREQ_SERVERS]; } ioreq_server; #endif + + /* Holding CDF_* constant. Internal flags for domain creation. */ + unsigned int cdf; }; static inline struct page_list_head *page_to_list( From patchwork Wed Apr 27 09:27:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Penny Zheng X-Patchwork-Id: 12828511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E9C33C433F5 for ; Wed, 27 Apr 2022 09:29:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.314618.532785 (Exim 4.92) (envelope-from ) id 1njdyw-0001yM-9x; Wed, 27 Apr 2022 09:29:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 314618.532785; Wed, 27 Apr 2022 09:29:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdyw-0001yC-6A; Wed, 27 Apr 2022 09:29:10 +0000 Received: by outflank-mailman (input) for mailman id 314618; Wed, 27 Apr 2022 09:29:09 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdyu-00015W-SB for xen-devel@lists.xenproject.org; Wed, 27 Apr 2022 09:29:09 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20610.outbound.protection.outlook.com [2a01:111:f400:7e1b::610]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7ce389f7-c60c-11ec-a405-831a346695d4; Wed, 27 Apr 2022 11:29:08 +0200 (CEST) Received: from AM7PR03CA0014.eurprd03.prod.outlook.com (2603:10a6:20b:130::24) by AM0PR08MB5347.eurprd08.prod.outlook.com (2603:10a6:208:17f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Wed, 27 Apr 2022 09:29:06 +0000 Received: from VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:130:cafe::72) by AM7PR03CA0014.outlook.office365.com (2603:10a6:20b:130::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13 via Frontend Transport; Wed, 27 Apr 2022 09:29:06 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT031.mail.protection.outlook.com (10.152.18.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:29:06 +0000 Received: ("Tessian outbound ac9bb5dd84f6:v118"); Wed, 27 Apr 2022 09:29:05 +0000 Received: from 561f0d3f7380.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7981905B-B85C-4EA6-9582-316B10F5BBC5.1; Wed, 27 Apr 2022 09:28:59 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 561f0d3f7380.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Apr 2022 09:28:59 +0000 Received: from AM6P192CA0107.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::48) by DB6PR0802MB2503.eurprd08.prod.outlook.com (2603:10a6:4:97::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Wed, 27 Apr 2022 09:28:56 +0000 Received: from VE1EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8d:cafe::49) by AM6P192CA0107.outlook.office365.com (2603:10a6:209:8d::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13 via Frontend Transport; Wed, 27 Apr 2022 09:28:56 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT021.mail.protection.outlook.com (10.152.18.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:28:56 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 27 Apr 2022 09:28:49 +0000 Received: from a011292.shanghai.arm.com (10.169.190.94) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Wed, 27 Apr 2022 09:28:40 +0000 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: 7ce389f7-c60c-11ec-a405-831a346695d4 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=HfhCtJnwBt2pArU8TSVp6ZpUqeJ6J/UwQmD085e9c1UPnLTKkn0WCBwxeKajleyCO3qw+QGQ0EAv2ZYNJI8Ii7qen6wLncCZoJKfW02uh6DHPXCzs7ksmq/GYTuOfKPCjcvZHzXXCXHs1/0eMsuM2m7rzNZs1q3hsfpi/2gXylR2ZsGScnuZNxzDbyQfMJ4heY9P78hNtUtS8+vYpCNozbVuEW9XgB4eby4+i0yfvbj9hoeRVOyK3UAgvBBNSCYMLK1mxqxd03w5Zv0kRFSvzJETCXe8RNMGB7IxbQRkUKZhhlaBn3+Xtbrhlq5Fi2fV6S6dsAvas6xbLq6cNcmyZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Tc8bIziiDz6ap/XVy6bFd+Wj+r4OC2m3pmrld4YMMWs=; b=c6MavAhP3pQhqZTHg/lHz0VNXg2URbwNGXkoOK/v9gUt8sjVCmmrkJSPu78Cv4MmIZrxvPAb/r1E8n1eA7AFrEkepLxrldL70BDv7ujptA48EYB1iLA9sc+whXs+awzhWUezsfT4OtaJ1UwSBn3emtc5BcGys6Gz376EOLp1HAoB7+JHUAntHC73RpLsSow9UQbpLVERwPbMe5UTrGqqifP6F/2eVTJOUE/wsIi0NO1swP1gX96dHmel79U3LCi73v6w/gWDhIGDPxffh3/0Dd0onB3D+j+8ifKTKtqlLWGpGFBy/sIYjB5jqRfsvcOdoKTQkpd+cgm/XX0Yyg15Qg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tc8bIziiDz6ap/XVy6bFd+Wj+r4OC2m3pmrld4YMMWs=; b=7RG4tWEsQW3NIPjwW4pcs/oC2d8R1dWDgACz9tTHTnFiTmB/CBoxapq02dHGxR5V+z2fcW6DFyxHf6oG+uP2ns2hDlrCTwLOIiiYwrmwViHlC0jqoRy2WT4/6uNf3R/ip4vEwsy7XRyPVjbxexkPDFe4KcaQqxiAnvG6zPFmmL8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 10335ee396b426b7 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aH//NYMbAvLuGgJ/sm1XUff/yS1pY3tckyIsUDdmF8xKdo835V3dAfU87+8T7yoEeLX5XadkcnpufcatcX2jjpxtTuDe7G5IMJtqMMfUV/gxwrdC6KM3IVOStiYlEshI5joKKHGZEcEHFOs8IB5melE3GLssooOi3yDOnKUnezfWDDWG1wF5fj2176pR/XlQkODIJ6blyF76rcMs7+O/ebySeYAFNThwi0vdoChXuJKU1ewkPsOyEoTZiF9KhPmgYqbd9XRTi5tZ+Oxmlgl6dhTFebMtQ/H1AA9T5yo9ZPST26p0SDpeU4KBfIzUserAz+0retsW9s0RVEdfTUNVTA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Tc8bIziiDz6ap/XVy6bFd+Wj+r4OC2m3pmrld4YMMWs=; b=LpTS85ObVdYtRSONaujt9ujFWoDXizGd7S0gIe4A4ynK4pVQ+MPT7MDG1BwYV8cRcn+onbHoYQBWx+N17uNK3r683qqImPRC57CMqjLxwa1N8hv/Jz4nfx8tNtjeSumPdD5KZxPq52IQv1lm9sqjeeuBWyoSwhlbugdQTeVeG4umLLD/UF++uP0yRoIxQq0Y/0DK0Yo+QRPUPA5hHLwAIw/Ty4/lEsRy1SJq8cKj6EvlUel4mPeTo+KBCsPalAvIEQzNEaHEV4k7vR5t38IHYXOeXODxHqUpIT4S0wKXCWoVq6NDq5vPAReLrUtzBedGyxYbWkqeZV945K64JvANBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tc8bIziiDz6ap/XVy6bFd+Wj+r4OC2m3pmrld4YMMWs=; b=7RG4tWEsQW3NIPjwW4pcs/oC2d8R1dWDgACz9tTHTnFiTmB/CBoxapq02dHGxR5V+z2fcW6DFyxHf6oG+uP2ns2hDlrCTwLOIiiYwrmwViHlC0jqoRy2WT4/6uNf3R/ip4vEwsy7XRyPVjbxexkPDFe4KcaQqxiAnvG6zPFmmL8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Penny Zheng To: CC: , , Penny Zheng , Stefano Stabellini , "Julien Grall" , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , "Jan Beulich" , Wei Liu , Penny Zheng Subject: [PATCH v3 4/6] xen/arm: introduce CDF_staticmem Date: Wed, 27 Apr 2022 17:27:41 +0800 Message-ID: <20220427092743.925563-5-Penny.Zheng@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427092743.925563-1-Penny.Zheng@arm.com> References: <20220427092743.925563-1-Penny.Zheng@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 50ef8318-7abc-4890-77da-08da2830601a X-MS-TrafficTypeDiagnostic: DB6PR0802MB2503:EE_|VE1EUR03FT031:EE_|AM0PR08MB5347:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: hvLdJQuIGXtdgN1+lpJUggGxQq09Vc9J7Y10f+zhmSJVU3k61A9mj/FCBmJwceM4dI54kVJoG/AtGRPoFDp+Tp0+zk77WGGzHbxuuVJN7l5DZyorbSregzNQGOz4aF1qdWfwy82jjMAEH/SnHg2xyvRAOwYehTJyPdrJsiQs68WxZbUZtnDSnpxmb2uWZd4sVXhBQYqZa9KVeoyjjlBM5/lQdtbxggGljoG6g0dlGiUBOyTU8iII4w/4HM5bY/ctcqZlhOacPsQZtKGjBi6Wvl8cev75zajHyhBLv7HyLwHC4PBTofwMl1IU7KZC8Gzk8umGPpOgQ4Wwrq7RIAeNukD4Ay97VcDKDwJJ1OoxT49olc8wwRuw3dYivq3kXaTAwLhLaLMK/mhJuyMZ5N1N/phqNcOKWvV0JrldetK0AQ9RHvNna95ReWY2WT6yHBQ+Ty5YBzepTnU6EJlrRDfMskmI+ZKFGUd7lpAUsZvtv13f3rBjm+NxUMG2cbbOyQm4IlnZ2hTANeN3nSK5ccMeLaPZPhOwTK0Mk2itmyIgK5iP3T8RiJrkUUSZeOV2Hnz/C9o9MRXB+iIswF9DV98K+r+mD79tTIlxqmBqzQTHxyrh0ICiKwdIdPbhwoMie3VXv24ZEQz4e9GfEapnS8So23mfa/EHHeZps7jPX+g52b43sFqPxLiPF43BiYrojwYFDWPHlTg2VR9RWfsVZQBtbQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(86362001)(26005)(82310400005)(36860700001)(70206006)(70586007)(8936002)(36756003)(54906003)(356005)(316002)(81166007)(6916009)(40460700003)(4326008)(508600001)(8676002)(5660300002)(2906002)(186003)(336012)(426003)(47076005)(1076003)(83380400001)(2616005)(7696005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2503 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: df0ac107-1037-4f61-bc3d-08da28305a1e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gkdHmxSDSsLUbrY1LLxOo5/uoGWtPiu8gowBhQhZO69roIGNhaQySzLSmBYzB/7QiNJDY0Aj9I5FicfE2VHZW+gR5xVPIiob6QdcYhRdxj9iOYU7Id6m5pmceByAaVPt/PlMae1OGHb7q9fjMWpS2kFSo/Juhwp/nN4bFTj8xY3ob9GuUiNefEyu5SOqASJMvA4aqfmO+2ULb0Z3jz5XJXmEbwjU3Tfw0B73WljlkVsXVa+isEHikDJlV1D+rU/Jg/obExJROyVhr+CNhedT5gX4l1a7mEbtTwmNRkVXg9zOlz5LStnyMyCKQaFqQ7axfavF0EJEfEGTbh5ujFX7moUqhyQbCu2911LgzjcrMMojsrA+xzvIPfwaR9jUHpz2EyBxDqE/AM0ga2do68JHsh5TB3UPPFI4D2j1Vmks1+KoLSzDmon59VQUxbh+UvcUaB9dSvWRpdNGUPB852a2p87xZ+zOjTKuA+BJGdUuIyVJL+wqT7nzFI3EL6vKh8TzH3EiT6Fg9yaZxezkoKZTZw5/pXEk4CsFbfftHGkiP7hHrhOH8uu3G0y4RgrAHzgTcUJx2t1qVH/WTwTxamkCV8QI9I9Wg1m2MN4a0Rg5sd36gw8OXeu/krmVY24EJfwCCSVzPChaRQyUkKKDvan1vflrdqGCcguovtDptJriTOcppXqQsOF+Dk3/QrUvw+/a X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(508600001)(26005)(40460700003)(81166007)(2906002)(5660300002)(82310400005)(36756003)(36860700001)(8936002)(7696005)(70206006)(2616005)(8676002)(4326008)(70586007)(83380400001)(1076003)(47076005)(186003)(336012)(426003)(54906003)(6916009)(86362001)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2022 09:29:06.1297 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 50ef8318-7abc-4890-77da-08da2830601a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5347 In order to have an easy and quick way to find out whether this domain memory is statically configured, this commit introduces a new flag CDF_staticmem and a new helper is_domain_using_staticmem() to tell. Reviewed-by: Stefano Stabellini Signed-off-by: Penny Zheng --- v3 changes: - change name from "is_domain_static()" to "is_domain_using_staticmem" --- v2 changes: - change name from "is_domain_on_static_allocation" to "is_domain_static()" --- xen/arch/arm/domain_build.c | 5 ++++- xen/arch/arm/include/asm/domain.h | 2 ++ xen/include/xen/domain.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 1472ca4972..6830a282a0 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -3190,9 +3190,12 @@ void __init create_domUs(void) if ( !dt_device_is_compatible(node, "xen,domain") ) continue; + if ( dt_find_property(node, "xen,static-mem", NULL) ) + flags |= CDF_staticmem; + if ( dt_property_read_bool(node, "direct-map") ) { - if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) || !dt_find_property(node, "xen,static-mem", NULL) ) + if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) || !(flags & CDF_staticmem) ) panic("direct-map is not valid for domain %s without static allocation.\n", dt_node_name(node)); diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h index fe7a029ebf..110c672589 100644 --- a/xen/arch/arm/include/asm/domain.h +++ b/xen/arch/arm/include/asm/domain.h @@ -31,6 +31,8 @@ enum domain_type { #define is_domain_direct_mapped(d) ((d)->cdf & CDF_directmap) +#define is_domain_using_staticmem(d) ((d)->cdf & CDF_staticmem) + /* * Is the domain using the host memory layout? * diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 1c3c88a14d..35dc7143a4 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -34,6 +34,8 @@ void arch_get_domain_info(const struct domain *d, #ifdef CONFIG_ARM /* Should domain memory be directly mapped? */ #define CDF_directmap (1U << 1) +/* Is domain memory on static allocation? */ +#define CDF_staticmem (1U << 2) #endif /* From patchwork Wed Apr 27 09:27:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Penny Zheng X-Patchwork-Id: 12828512 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 09338C433EF for ; Wed, 27 Apr 2022 09:29:35 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.314623.532796 (Exim 4.92) (envelope-from ) id 1njdz8-0002YE-I7; Wed, 27 Apr 2022 09:29:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 314623.532796; Wed, 27 Apr 2022 09:29:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdz8-0002Y3-EU; Wed, 27 Apr 2022 09:29:22 +0000 Received: by outflank-mailman (input) for mailman id 314623; Wed, 27 Apr 2022 09:29:20 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdz6-0000n9-J9 for xen-devel@lists.xenproject.org; Wed, 27 Apr 2022 09:29:20 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on060c.outbound.protection.outlook.com [2a01:111:f400:fe1f::60c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 83515e1a-c60c-11ec-8fc2-03012f2f19d4; Wed, 27 Apr 2022 11:29:19 +0200 (CEST) Received: from DB6PR0402CA0002.eurprd04.prod.outlook.com (2603:10a6:4:91::12) by DB7PR08MB3913.eurprd08.prod.outlook.com (2603:10a6:10:7c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Wed, 27 Apr 2022 09:29:17 +0000 Received: from DB5EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:91:cafe::c2) by DB6PR0402CA0002.outlook.office365.com (2603:10a6:4:91::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:29:17 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT063.mail.protection.outlook.com (10.152.20.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14 via Frontend Transport; Wed, 27 Apr 2022 09:29:17 +0000 Received: ("Tessian outbound 78191104f1b7:v118"); Wed, 27 Apr 2022 09:29:17 +0000 Received: from 9e0162dee0fb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 88035E24-03D7-4FEC-8848-972454D7FA5F.1; Wed, 27 Apr 2022 09:29:10 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9e0162dee0fb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Apr 2022 09:29:10 +0000 Received: from AS9PR04CA0105.eurprd04.prod.outlook.com (2603:10a6:20b:50e::27) by AS4PR08MB8096.eurprd08.prod.outlook.com (2603:10a6:20b:58b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.21; Wed, 27 Apr 2022 09:29:08 +0000 Received: from VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:50e:cafe::e1) by AS9PR04CA0105.outlook.office365.com (2603:10a6:20b:50e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13 via Frontend Transport; Wed, 27 Apr 2022 09:29:08 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT054.mail.protection.outlook.com (10.152.19.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:29:08 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 27 Apr 2022 09:28:59 +0000 Received: from a011292.shanghai.arm.com (10.169.190.94) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Wed, 27 Apr 2022 09:28:50 +0000 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: 83515e1a-c60c-11ec-8fc2-03012f2f19d4 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Lp14PJgJSL8DfRY/vNVSTgnaJP2+SXMtOOaxSIdSN0G4aM5/fBYLJIYOAFjptaxa+83YZhxJED9CAGp+7zwj0E6fc0Qlfr9XBRJP+HDrXXEwd4Ow1xEiEMDKbnJ7J/lJednUxQsCAF02YPLXXpfaapzeuSYqvg7+RZ7RW4ZylLhZY/72Xkgp8AkvrpnQFr0iU+dLU40fgzOvBoBtIRlpg2qVviFOVl5Rv78ey7WWnNbIOqduYP8ZxAAxmXTGMv7Y0YYVT9SOsQz6xRROZUUw/yP/vleGtXsZ+DHJTxDCSFoJoZNHH2A1DxRF8SFld7T7EQ74K7FFjW8KvRrukTVJOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rCND5tjX5cKrs7fmmCD71EclFIECccAGVb3ArYFdizM=; b=RBR5KkIyVp5gpUt7Eu4MJi3NvQluON6G3W3eywgyhW9bNwt1g4NZWmt+Ru31RFbvfYUP+cOPVrxUQzhhYIbfeMhuiMtCHxWidRRPsiCQOTKZTr9aRJWsN4QdXQp70SP2IX5J0n5I+F871AyI0ZYgG/7gLkjvdzIj+rQjYQk2hD+4oemlveXIL0XueuMvZuuprBHo7P6Qo+KoVopsWdw/NiHlxQd8me98rk05A5E0S5vzW712fPpDAqOBupprT9Dp1TgAAjboFl2n3C4R0ritHDUgNE+1ubPapzaadJDGYkTF34O8k4JVpq3oRS9S6EBPm5+7bZIbM8nYTjNhnmagPw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rCND5tjX5cKrs7fmmCD71EclFIECccAGVb3ArYFdizM=; b=wkowdLebUts6R/rCfiZDkpGh6/X2YaY/K24k60FdILdg972WFRUaytQ1xDsAxyL86ms3pw2bSuuCPC0KKlCHw4oxLKQSnZCM7iZr3wqQFYaNDUJcJGON7L2t+PmYNa3ZUN8+9gyw7dVIl8Grp8gZL9Ed63tmK5ceo4u9F2WuH+c= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: aafece6b67b8cb1f X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DW8tuW/3PO3wj6ibJeBkmJxfFZgNLMjZ7tiByBHf0tda8nRNSZ3rplcFJROl57zqMDK5i9Zb/EPy8DzeA1ItH60aptA44Ok7GNKXGPSkuIpQPvBQQwZT/HvsAH5UXUEWd+DlpE+n3Oo0iaKwiFrrlnKY3k6isataHH7eQG6QNnsWKYG4p7tQPAYWFy9qhyCU0fGHnTimmMZYYhkxhyva1Q9CQMCzpcD0Vdj/o/EjOqdwb4g6lWjmzBNME9V6VKHFAo73/qhYRwLfVLqaqHi3SQnCHxetujQUsFNm17oZu7A56smfPc49t2Pjo0PO3nBakb+1PV9TgTscui6Rej1DIw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rCND5tjX5cKrs7fmmCD71EclFIECccAGVb3ArYFdizM=; b=mYTkotw3LsfsobX6sYZ/FfNfEwK2wW2W/6vpMvVudajP5GD65FAepkRcYH8f1b5CMBt8ORrtDJRvAxAYmblIm5bzQlQwfFbTZly71kA/muxJfGcC2uMFTKEkPAbn4cjNRwxVvKMuLou7rLSAIQmIE4VeRGrHSYCFNji7xZzLSBYY3NanwpPQmkf9BCR2vpix/JSxXgumoypDs8p1EOL6ncOSOTqXmhHZAu/xPSufOCJhV5tLsbCiEeELTIjqI5FIXzszeFRmYrz3Rj0O1WN+NF0Vxx7YayIvopDEHuhg03mWbut+GrAeZiudxFFyfLYbU3yZeZPt3TJ1teQ3/kJMVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rCND5tjX5cKrs7fmmCD71EclFIECccAGVb3ArYFdizM=; b=wkowdLebUts6R/rCfiZDkpGh6/X2YaY/K24k60FdILdg972WFRUaytQ1xDsAxyL86ms3pw2bSuuCPC0KKlCHw4oxLKQSnZCM7iZr3wqQFYaNDUJcJGON7L2t+PmYNa3ZUN8+9gyw7dVIl8Grp8gZL9Ed63tmK5ceo4u9F2WuH+c= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Penny Zheng To: CC: , , Penny Zheng , Stefano Stabellini , "Julien Grall" , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , "Jan Beulich" , Wei Liu , Penny Zheng Subject: [PATCH v3 5/6] xen/arm: unpopulate memory when domain is static Date: Wed, 27 Apr 2022 17:27:42 +0800 Message-ID: <20220427092743.925563-6-Penny.Zheng@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427092743.925563-1-Penny.Zheng@arm.com> References: <20220427092743.925563-1-Penny.Zheng@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: f4131831-1799-4b14-1aad-08da283066d5 X-MS-TrafficTypeDiagnostic: AS4PR08MB8096:EE_|DB5EUR03FT063:EE_|DB7PR08MB3913:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: DqS6UQL8zbObI10JODmPFKntvpE/EsMonDE2eqCLZxVxP8Abuf5MJrkGyL4EjwW+Y/w2tI+0XnzgFiTyGLhzvF6XIr2DG24yt8jT9bJqqlumkMeg2NBDmG2St3PUH1SuDJGw+nMxvbW5awgeAYbXBX2L0PPsHmz1Yw3DGmLJ1UWQBDv9oS9bECIXkPU+uKtx6jcJsEDygybn0Qs/Xahx4E13BVv+U5u7UH0sWF9XAN/E/iX9H7Q1jlosi+MzkowgOzQvMkKzheyN997mTVJlyy/44HUdKs1P8y9ZL3N2Tn/2IpOZm6AvBRjOPBJiAxoUz5XZcTD/5zTmu3lFP3XZxCj3QeBdoYKeEDSAexLoUPNUlanPSRvMVKi49dzvJFNstMOCQQ7pVXBbjVa6dl39TDwcGh7BmNcw4k7BA2uKeAo5ZSut3e1pl4QrcyTEaRMIDbGQqzptuEY4n5NvNlQ7m25rJQS1KApTUtLFfamvjOWLVuJCSH8hxe++7i6pCRUo82lFBC0ibfnaui2Zx5esk9Ya3ZVj/3DSp1XQCoihb+ddZbqUTxWZt+LJClcz5Hjx9jo2JDPGBevWlqh5Nc2+eTFFc4wOGDM94reWbkUPDIdbhyJ0rd0UzKiWVnN1ZGYI4GUWjOld4tZ7pmfhmYbYXhJo1TP+juQtmxH35OLPIbgMD7JNmY21Q9UBAinODzYQichS5nDfU95Cuy0dJXBTWw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(40460700003)(81166007)(70206006)(70586007)(47076005)(4326008)(8676002)(2906002)(356005)(54906003)(6666004)(316002)(36756003)(6916009)(7696005)(508600001)(83380400001)(5660300002)(336012)(82310400005)(2616005)(426003)(1076003)(86362001)(186003)(26005)(8936002)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8096 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0b5be69e-92ff-44d8-95d7-08da2830616e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zRNPADpIKlJhypvZvuOdckqGNnMcN6kYoOSHTuQXffMVNngTfSRABTypNlW/1OkspLYmjqCAu8G+Iyqyt1wTHru2yYM5mdrwCR5fEvLnBv1SUFrKoJEr8wrU29QTjFo9vVMOLu6/ntAR0F3S2kNbscmEwi+ve3az2RIeS2kAReLYEYwiUiPa9dqX8k1bGQ+9qrk1qAlb7dEFoYcKKzqnk1HiXkk1HFg7m8faexs39MGvYxyOkXiwbGghdcqNXaEa4zauGlNsBfo0gDn21rLQ6dMWnznvJPnAGEk2pYX5idSj2JrylOi+1ZeRvqwR6hPLQ+YuM3F/5sgLPd8ld9B58a9sm/XJqs8EIKTmZP9PSQGMl/euzNDVnRxPBspcEf2x4nQ4Yj5f0ikwjdThYx1hFoR0vTkdr9S1zlbQtrwfXt+pXcRxfQcNbey1qEbdOFik9HC7MT/VZ8OSsmsZl0slEwg3ZWWXioUjI4tAwO1WDQppo131sijS1zWH2QRw7juEzlWn/SBJ0aO3mSVY8rjeSMJ3zZz8tq43fqPMMJeNoBARAbbeVwLjbeT7fCnDUlY48Gtaswf2Ce7oRiSlNp9UC0rCGzqgOPfjFuk+eUIaINrxMf4FGA4YBYUhL5y8q1aFRV5qEKVKOdAIjfdfaX4HNxk4bwCpf4S0v4xqKjoao2Yu8jxxoLCnr2AiAotWhe6M X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(2906002)(316002)(86362001)(81166007)(5660300002)(8936002)(70206006)(70586007)(4326008)(8676002)(6666004)(83380400001)(47076005)(40460700003)(1076003)(7696005)(336012)(26005)(186003)(426003)(54906003)(6916009)(2616005)(508600001)(36860700001)(82310400005)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2022 09:29:17.4973 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4131831-1799-4b14-1aad-08da283066d5 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3913 Today when a domain unpopulates the memory on runtime, they will always hand the memory back to the heap allocator. And it will be a problem if domain is static. Pages as guest RAM for static domain shall be reserved to only this domain and not be used for any other purposes, so they shall never go back to heap allocator. This commit puts reserved pages on the new list resv_page_list only after having taken them off the "normal" list, when the last ref dropped. Signed-off-by: Penny Zheng --- v3 changes: - have page_list_del() just once out of the if() - remove resv_pages counter - make arch_free_heap_page be an expression, not a compound statement. --- v2 changes: - put reserved pages on resv_page_list after having taken them off the "normal" list --- xen/arch/arm/include/asm/mm.h | 12 ++++++++++++ xen/common/domain.c | 4 ++++ xen/include/xen/sched.h | 3 +++ 3 files changed, 19 insertions(+) diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h index 424aaf2823..c6426c1705 100644 --- a/xen/arch/arm/include/asm/mm.h +++ b/xen/arch/arm/include/asm/mm.h @@ -358,6 +358,18 @@ void clear_and_clean_page(struct page_info *page); unsigned int arch_get_dma_bitsize(void); +/* + * Put free pages on the resv page list after having taken them + * off the "normal" page list, when pages from static memory + */ +#ifdef CONFIG_STATIC_MEMORY +#define arch_free_heap_page(d, pg) ({ \ + page_list_del(pg, page_to_list(d, pg)); \ + if ( (pg)->count_info & PGC_reserved ) \ + page_list_add_tail(pg, &(d)->resv_page_list); \ +}) +#endif + #endif /* __ARCH_ARM_MM__ */ /* * Local variables: diff --git a/xen/common/domain.c b/xen/common/domain.c index 6373407047..13fe7cecff 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -604,6 +604,10 @@ struct domain *domain_create(domid_t domid, INIT_PAGE_LIST_HEAD(&d->page_list); INIT_PAGE_LIST_HEAD(&d->extra_page_list); INIT_PAGE_LIST_HEAD(&d->xenpage_list); +#ifdef CONFIG_STATIC_MEMORY + INIT_PAGE_LIST_HEAD(&d->resv_page_list); +#endif + spin_lock_init(&d->node_affinity_lock); d->node_affinity = NODE_MASK_ALL; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 49415a113a..368e5c1c53 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -376,6 +376,9 @@ struct domain struct page_list_head page_list; /* linked list */ struct page_list_head extra_page_list; /* linked list (size extra_pages) */ struct page_list_head xenpage_list; /* linked list (size xenheap_pages) */ +#ifdef CONFIG_STATIC_MEMORY + struct page_list_head resv_page_list; /* linked list (size resv_pages) */ +#endif /* * This field should only be directly accessed by domain_adjust_tot_pages() From patchwork Wed Apr 27 09:27:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Penny Zheng X-Patchwork-Id: 12828513 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 87DA9C433F5 for ; Wed, 27 Apr 2022 09:29:39 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.314624.532806 (Exim 4.92) (envelope-from ) id 1njdzD-000308-0J; Wed, 27 Apr 2022 09:29:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 314624.532806; Wed, 27 Apr 2022 09:29:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdzC-000301-TH; Wed, 27 Apr 2022 09:29:26 +0000 Received: by outflank-mailman (input) for mailman id 314624; Wed, 27 Apr 2022 09:29:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1njdzC-00015W-5x for xen-devel@lists.xenproject.org; Wed, 27 Apr 2022 09:29:26 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02on0630.outbound.protection.outlook.com [2a01:111:f400:fe06::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 86fdbeb6-c60c-11ec-a405-831a346695d4; Wed, 27 Apr 2022 11:29:25 +0200 (CEST) Received: from AM6PR05CA0017.eurprd05.prod.outlook.com (2603:10a6:20b:2e::30) by HE1PR0802MB2363.eurprd08.prod.outlook.com (2603:10a6:3:c8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Wed, 27 Apr 2022 09:29:22 +0000 Received: from AM5EUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2e:cafe::c6) by AM6PR05CA0017.outlook.office365.com (2603:10a6:20b:2e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.21 via Frontend Transport; Wed, 27 Apr 2022 09:29:22 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT052.mail.protection.outlook.com (10.152.17.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:29:22 +0000 Received: ("Tessian outbound 9613c00560a5:v118"); Wed, 27 Apr 2022 09:29:22 +0000 Received: from ef1b70aa2845.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 19911613-40BF-4E00-8FCF-3EEB1596DE4F.1; Wed, 27 Apr 2022 09:29:15 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ef1b70aa2845.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Apr 2022 09:29:15 +0000 Received: from AS9PR04CA0096.eurprd04.prod.outlook.com (2603:10a6:20b:50e::26) by GV2PR08MB8052.eurprd08.prod.outlook.com (2603:10a6:150:75::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.25; Wed, 27 Apr 2022 09:29:13 +0000 Received: from VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:50e:cafe::19) by AS9PR04CA0096.outlook.office365.com (2603:10a6:20b:50e::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:29:12 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT054.mail.protection.outlook.com (10.152.19.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Wed, 27 Apr 2022 09:29:12 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.27; Wed, 27 Apr 2022 09:29:09 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.27; Wed, 27 Apr 2022 09:29:06 +0000 Received: from a011292.shanghai.arm.com (10.169.190.94) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Wed, 27 Apr 2022 09:29:00 +0000 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: 86fdbeb6-c60c-11ec-a405-831a346695d4 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=lx3muvo1NlYjIRnnCg1kt3OFOpKsUqq0PYoEogUasjlIPigg1ZmUPEWmGE8MPto+mhdGkXhvUEMqgN2DIsuUw3SITjghayxLbPY1iRZ615rwJoVHKZT0ECKEodfPDYpvPyqNBg+STctti5BCCHWS3OE2t+vMvWWt7Tprwt0RSjfFvD4xt871CdAdYpaNlWa/7UuvMcccvfSYnj7WXzNPocpdlQ+ki6PLkDgxLjz1kANfJpC+40TY8ma1mt7R/aLjd7E9/NzIh1KLSIT3qCKYYDVd1eCPs9olwbKrKRqNcDPbq413PVsT9RXJRbkJao8mEJmccJ62vmWgWVcogrYvuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nqcTO4An0BbV9XfJHUHLhj5Zal3nPygOYB8CUZJHxi4=; b=jIRWwNoqH63Jm5Ju9lr39dEPu1WB4gYILPphBCrzKJXIvMDlVbv2K7rHjARfbMQs/hFp36hYxbBKZu25x/wWRGshnyb6y/4naQIdiVw6eZwpRb5Q/qo98d2MIKSkwLTKnIEeSyfwNMMa5s9UKvoSR1jGA9UonP7TEa/6SzhZj9myrvng+9yWDdsIUbH1HVPeEf5f8ewsaNrYxxav6Ub5U2lBUX76SN9QlCmGGyoyt2Lc1fgN1FYy49LsabucmL6zjAF47NbkzI3BG0N4id4RGYqWtMmjUkRNcAFvEoIkwm4xIGYHJkjsRj5Bdt9OrEGcRBP8F1Kg3/hVZ155Pw/CZw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nqcTO4An0BbV9XfJHUHLhj5Zal3nPygOYB8CUZJHxi4=; b=3abGuENAl1r7u00mChf+Xh6QW0FI1QdciX/j9njLNLntUMdBeVQ+Rby01mdCyfAEUrGgi2EslaG9EJapZapwyMEJWNr5WogyjpzjX9PGyRNZsDO4KV6iK2piB3UINbrWRQK86vFmNIx1dbLNHtIx1GP2ZVJ4ayzGiLPzIWFthNU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: b06a487819eedf4d X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NHWeu1xM4N6IL9tfKciKbagCXC/TR8susY2uFAgeyrPFuoSt7c3VJ9FOu55myfqqrC3yd0FpMAX2uIOgIpc/lWh2Cszj5KyAd+gX5LylJUr59KeY0Qrx1kgpB0j13h9i1kOLCHUXZex7yuP5yWCMfFGx8RP7feakMJQ3gBHDSH9+DqywR9HAOODAv5VwPqc0PDx1xLwRI91+Yq8eo3EvXRs5DO9czhMWnWagEDUbpYiZ7L48ViH1IPeY4pXkfCU5oKvNeohT81SFx67G0dfsjzLeAmlEeiR7H8mbXHxhvFeuZmQBi6v2d9vGuxM9X+cFzwO/1ybJF1eAHXShsL6/fg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nqcTO4An0BbV9XfJHUHLhj5Zal3nPygOYB8CUZJHxi4=; b=U1eEY0dqSIK+Ysny16f3TO96ijWbwrS1A/NYGj6Dp9jQNLQCr2LfiRVp2Dxob/3WtcjU/bZ67D+N708WyvxOcfC0zeVCXMjGTKbkUfhHIcD6EoQYfA35RgAFHMj+LVDVyPUo/oiNdEF8gD0Fibtd0fxopNXJmQQP20m/dB5b+W52mLsaqkKM4BLW+Jqyet1gzP9G9vQuRNy2hgysgFViDvfiTEkkESmHcHygWfBJ8tynGl4LLyPoQvmPuzzJZOni/LFAVWfIpHCdBvSRo3kApZM8cQ3CYZ/8K7nK2breLxKFjZjN1wE+oK3ESoweMU4Q0xY3Dtr1Xs5N/DrchT+CAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nqcTO4An0BbV9XfJHUHLhj5Zal3nPygOYB8CUZJHxi4=; b=3abGuENAl1r7u00mChf+Xh6QW0FI1QdciX/j9njLNLntUMdBeVQ+Rby01mdCyfAEUrGgi2EslaG9EJapZapwyMEJWNr5WogyjpzjX9PGyRNZsDO4KV6iK2piB3UINbrWRQK86vFmNIx1dbLNHtIx1GP2ZVJ4ayzGiLPzIWFthNU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Penny Zheng To: CC: , , Penny Zheng , Andrew Cooper , "George Dunlap" , Jan Beulich , "Julien Grall" , Stefano Stabellini , Wei Liu , Penny Zheng Subject: [PATCH v3 6/6] xen: retrieve reserved pages on populate_physmap Date: Wed, 27 Apr 2022 17:27:43 +0800 Message-ID: <20220427092743.925563-7-Penny.Zheng@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427092743.925563-1-Penny.Zheng@arm.com> References: <20220427092743.925563-1-Penny.Zheng@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 2508ef9c-4a05-4230-4942-08da283069c4 X-MS-TrafficTypeDiagnostic: GV2PR08MB8052:EE_|AM5EUR03FT052:EE_|HE1PR0802MB2363:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: gdoBoYK/OIMyiV9XnuWnT9a4L/tOa2B7LKMnWSi9Vf2nobRNq3qs63KqyhChWntCK2glnDqwqIBE9BdOELgXzIqi8sq4ewMhnkwR5buLsvvAeQyu8+JpQm1JWi9g74wYBlB/3BOgaVmhZUCgdo+o2m/4XQCyq5uqt08VMM4vGRvFXTkr5VtdXW1qsFfljHfFSGjhUkKeaTox+10crtHtlPu65/g4xdvKY6u5NoskMx7XFf/tkTx6p1e0Nnj5JI1EqFR0pGKJxwEWddEHqYRvmZieDfTEKhiTR1Kar4+pJTSfPxDn8eTj46bhIzZnP5s3JKhyACQW2FVHMoUbyTaUKdbGMPb0BKcSYgsk7Isvfmhl0lA8wqhmNIh5grLEaaSraqBPJHL8T8Cx1hOOV+xShTybNbF7I9NgKyoHFVdJ2HljvumXajrMIX7d80WcKjFc5sOpsZpVuVUTFlKB+EzxUkWEqL7dFyIIGeARldnzyupBeiYgE6t0rv9PCJUVH29mYB9CH7PkX+mQf/3FlBG4h8VhbxORxcpZ5wXkRtpTsoRcnfUuMaa9HpQFmL0jB/vyA9ckx8GfqgBg6bhS28S7IdWnD6thKZZjLy2bbxGpwnZB8k8fhmS9zO/FLj06JYbw8uB2Iu9wCyQzita4F2NVJHrPNFpvE6W1vN8ZpY8M4dSPmBc4x31UrvpnimtHN+q3YuLtfwWTRtqwJfj/pT7DhA== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(47076005)(2906002)(6916009)(7696005)(70206006)(6666004)(83380400001)(70586007)(356005)(186003)(86362001)(36860700001)(4326008)(40460700003)(8936002)(54906003)(8676002)(508600001)(426003)(26005)(36756003)(336012)(81166007)(82310400005)(5660300002)(2616005)(316002)(1076003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8052 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a46b7fa6-f55f-4a58-3f5a-08da28306406 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N6c1Ihfe0cmjtFPH2PJbQqLz+tAeMGs3Fi3nrezTzXJjUV0RMnHbV6rVTIrR3+6AcZp1j/TT22y3cvLI57krMU4nUJYdYldfxD4GtWtvPoQn0ngZkhsZpISYiIfpNDSvWIXjPPYwjS/t/AI4ibayAAKAuez51FMJINcqJlYBEOEn6FN+pJxKS7teoFF32cDTXgl937MgkCR2Ztc61JspYSj2I2p/6j+vGP1mvgq5S3xr8JRsKVLKoKJ0wWPzC0gOoFp1agUfVfqb/CZgd0F0tBVF3NoCMbRJZ+UnOJ7udXj6ew4uwIJf8Eihrr/3OpJIavraki6T06CiQIBLmIFhxHJ87RsGnLj1dYXaFHeHOXW0Um6t/dYd+HhzsVAJHtvlk9Ns3L+jw/qaW9VTorug3t+GnizC6QJBKImNYBa39RjTWRt/lGO6zByiMA0s1VFvyWYMlr/wZrDRqtiTPO3YezqVkW0BzBAIvlNUOr0LAXYyx2Wi2ei8L1MgzEuKz2ld9mwmx61XwvAl5oUbODw2gBymcS2SzF68UfvLFWybyhu5bImF4loWPuwOF8/n3QjX26rSNJCBn+D7T/bJ5K0IQLr0WF/nPNDNraBKGKu4YLYczFp2huNoZ6EXDKyLkGDsSzUgzjCKQ2Z7g2EBi/2YlwXkoOgLvOgxdnnmQUFqTXzcx66gC8/Z+JvMunjDb8Xh X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(36860700001)(26005)(6666004)(7696005)(54906003)(83380400001)(86362001)(47076005)(336012)(2616005)(186003)(426003)(1076003)(8936002)(4326008)(40460700003)(8676002)(2906002)(5660300002)(82310400005)(81166007)(36756003)(508600001)(70586007)(6916009)(316002)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2022 09:29:22.3734 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2508ef9c-4a05-4230-4942-08da283069c4 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2363 When static domain populates memory through populate_physmap on runtime, other than allocating from heap, it shall retrieve reserved pages from resv_page_list to make sure that guest RAM is still restricted in statically configured memory regions. And this commit introduces a new helper acquire_reserved_page to make it work. Signed-off-by: Penny Zheng --- v3 changes - move #ifndef is_domain_using_staticmem to the common header file - remove #ifdef CONFIG_STATIC_MEMORY-ary - remove meaningless page_to_mfn(page) in error log --- v2 changes: - introduce acquire_reserved_page to retrieve reserved pages from resv_page_list - forbid non-zero-order requests in populate_physmap - let is_domain_static return ((void)(d), false) on x86 --- xen/common/memory.c | 23 +++++++++++++++++++++++ xen/common/page_alloc.c | 38 ++++++++++++++++++++++++++++++++++++++ xen/include/xen/domain.h | 4 ++++ xen/include/xen/mm.h | 3 +-- 4 files changed, 66 insertions(+), 2 deletions(-) diff --git a/xen/common/memory.c b/xen/common/memory.c index 69b0cd1e50..6cee51f0e3 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -245,6 +245,29 @@ static void populate_physmap(struct memop_args *a) mfn = _mfn(gpfn); } + else if ( is_domain_using_staticmem(d) ) + { + /* + * No easy way to guarantee the retreived pages are contiguous, + * so forbid non-zero-order requests here. + */ + if ( a->extent_order != 0 ) + { + gdprintk(XENLOG_INFO, + "Could not allocate non-zero-order pages for static %pd.\n.", + d); + goto out; + } + + mfn = acquire_reserved_page(d, a->memflags); + if ( mfn_eq(mfn, INVALID_MFN) ) + { + gdprintk(XENLOG_INFO, + "%pd: failed to retrieve a reserved page.\n.", + d); + goto out; + } + } else { page = alloc_domheap_pages(d, a->extent_order, a->memflags); diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 1f3ad4bd28..78cc52986c 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -2769,12 +2769,50 @@ int __init acquire_domstatic_pages(struct domain *d, mfn_t smfn, return 0; } + +/* + * Acquire a page from reserved page list(resv_page_list), when populating + * memory for static domain on runtime. + */ +mfn_t acquire_reserved_page(struct domain *d, unsigned int memflags) +{ + struct page_info *page; + mfn_t smfn; + + /* Acquire a page from reserved page list(resv_page_list). */ + page = page_list_remove_head(&d->resv_page_list); + if ( unlikely(!page) ) + { + printk(XENLOG_ERR + "%pd: failed to acquire a reserved page from resv_page_list.\n", + d); + return INVALID_MFN; + } + + smfn = page_to_mfn(page); + + if ( acquire_domstatic_pages(d, smfn, 1, memflags) ) + return INVALID_MFN; + + return smfn; +} #else void free_staticmem_pages(struct page_info *pg, unsigned long nr_mfns, bool need_scrub) { ASSERT_UNREACHABLE(); } + +int __init acquire_domstatic_pages(struct domain *d, mfn_t smfn, + unsigned int nr_mfns, unsigned int memflags) +{ + ASSERT_UNREACHABLE(); +} + +mfn_t acquire_reserved_page(struct domain *d, unsigned int memflags) +{ + ASSERT_UNREACHABLE(); +} #endif /* diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 35dc7143a4..c613afa57e 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -38,6 +38,10 @@ void arch_get_domain_info(const struct domain *d, #define CDF_staticmem (1U << 2) #endif +#ifndef is_domain_using_staticmem +#define is_domain_using_staticmem(d) ((void)(d), false) +#endif + /* * Arch-specifics. */ diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 9fd95deaec..32b0837fa0 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -88,10 +88,9 @@ bool scrub_free_pages(void); /* These functions are for static memory */ void free_staticmem_pages(struct page_info *pg, unsigned long nr_mfns, bool need_scrub); -#ifdef CONFIG_STATIC_MEMORY int acquire_domstatic_pages(struct domain *d, mfn_t smfn, unsigned int nr_mfns, unsigned int memflags); -#endif +mfn_t acquire_reserved_page(struct domain *d, unsigned int memflags); /* Map machine page range in Xen virtual address space. */ int map_pages_to_xen(