From patchwork Sun Apr 28 16:52:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_Bene=C5=A1?= X-Patchwork-Id: 13646079 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 5D5EEC25B73 for ; Sun, 28 Apr 2024 16:53:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.713709.1114637 (Exim 4.92) (envelope-from ) id 1s17lq-0007IC-Tf; Sun, 28 Apr 2024 16:52:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 713709.1114637; Sun, 28 Apr 2024 16:52:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s17lq-0007GD-NT; Sun, 28 Apr 2024 16:52:58 +0000 Received: by outflank-mailman (input) for mailman id 713709; Sun, 28 Apr 2024 16:52:56 +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 1s17lo-0006DB-Gl for xen-devel@lists.xenproject.org; Sun, 28 Apr 2024 16:52:56 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c296f8e1-057f-11ef-909a-e314d9c70b13; Sun, 28 Apr 2024 18:52:55 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-41adf3580dbso20948005e9.0 for ; Sun, 28 Apr 2024 09:52:55 -0700 (PDT) Received: from lab.home (dynamic-2a00-1028-83a4-4bca-c0bb-96ff-feed-9d50.ipv6.o2.cz. [2a00:1028:83a4:4bca:c0bb:96ff:feed:9d50]) by smtp.gmail.com with ESMTPSA id a12-20020a056000188c00b00347eb354b30sm27850921wri.84.2024.04.28.09.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 09:52:54 -0700 (PDT) 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: c296f8e1-057f-11ef-909a-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714323175; x=1714927975; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uRmhbnTJStHi1KkjxYIGvbfG3WE3teBkCarxEGq+EPc=; b=VGV8AeblDbsOxKIJldsP4cjmhqio9yRaTagX0M4HuCDRLPXDWYIgUdiBu6RcrykjuL 2f4yc5aCR8eW7T0gqymLRrlUp38n8SkNkrXGl5e2bF8nwU3QQ8QdTYuY8V2usSX8sg+1 mIVwkVBTu79ZGis+g75zPXrcxgAexw6yNLXtgHX3/613b//K0cDcPUpRS+wS3scN1boq Omu9vn8658SpMYuklk4gEQyx9dDO7CEKCWLjUGFaIGrRrnA+SfHacjOl4bCMOHDxeuzl RRpETV8+D6THJbOav5fn7faBZ3RQnn5It9GeCBJGRgH/TvxeK3f73RO9+sT8+D8WsOlD S7dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714323175; x=1714927975; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uRmhbnTJStHi1KkjxYIGvbfG3WE3teBkCarxEGq+EPc=; b=EIrYdJFgCE3XHB9MjYLHhe7GHLn81QBvLC04Ue2wAQpPPcMpn/dleEgUO672ED9w93 /Xik+McYlDFyfVguadqc8yxSfgmrRo7E781e9EujxP8nDFHs3bnva9HIfsfLjWQZFn4P /jt1vI3iopbDDyWUPNggqK9QK+7Yn9skrHzhWr+Rs1aQQ1dyr07SN5MDdJ2+FBBNCCD0 30WbMH/sTJpqxHn3GvstVAZB28vdUdSua9Qv3YJu1LWE7jPZwBy0r6HA1sVE/O6WjEzE LAYI1tZA3ESyi4grSjvA8noV/Tmf3gstItc5bUJVVO+atxVuQcCyaZ7C04irAVjkYq0h /ydQ== X-Gm-Message-State: AOJu0YxsZqrYIi7MjT9LMct34ZxM1fXJyqwHUMYQiR0AMdYZrPB08lOQ 5NHF74ELoWxov9vEpx74EWtu4g4y31wbqzraWtpASpl2mc8tRpzrY8NWP687 X-Google-Smtp-Source: AGHT+IE/5HJoBtmMIjJcoejHquMqcOjnqeFgg34BEa/OWG1DnI5wPeGzp6pPW3gpJoK8tHMRC0MmBA== X-Received: by 2002:a05:600c:1d16:b0:418:5ef3:4a04 with SMTP id l22-20020a05600c1d1600b004185ef34a04mr7707461wms.18.1714323175061; Sun, 28 Apr 2024 09:52:55 -0700 (PDT) From: " =?utf-8?q?Petr_Bene=C5=A1?= " X-Google-Original-From: =?utf-8?q?Petr_Bene=C5=A1?= To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Petr_Bene=C5=A1?= , Anthony PERARD , Jan Beulich , Andrew Cooper , George Dunlap , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [PATCH v2 7/7] x86/hap: Increase the number of initial mempool_size to 1024 pages Date: Sun, 28 Apr 2024 16:52:42 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 From: Petr Beneš This change anticipates scenarios where `max_altp2m` is set to its maximum supported value (i.e., 512), ensuring sufficient memory is allocated upfront to accommodate all altp2m tables without initialization failure. The necessity for this increase arises from the current mechanism where altp2m tables are allocated at initialization, requiring one page from the mempool for each altp2m view. Signed-off-by: Petr Beneš --- tools/tests/paging-mempool/test-paging-mempool.c | 2 +- xen/arch/x86/mm/hap/hap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests/paging-mempool/test-paging-mempool.c index 1ebc13455a..91b06fa0cf 100644 --- a/tools/tests/paging-mempool/test-paging-mempool.c +++ b/tools/tests/paging-mempool/test-paging-mempool.c @@ -35,7 +35,7 @@ static struct xen_domctl_createdomain create = { static uint64_t default_mempool_size_bytes = #if defined(__x86_64__) || defined(__i386__) - 256 << 12; /* Only x86 HAP for now. x86 Shadow needs more work. */ + 1024 << 12; /* Only x86 HAP for now. x86 Shadow needs more work. */ #elif defined (__arm__) || defined(__aarch64__) 16 << 12; #endif diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index 7aff5fa664..fab7e256a4 100644 --- a/xen/arch/x86/mm/hap/hap.c +++ b/xen/arch/x86/mm/hap/hap.c @@ -468,7 +468,7 @@ int hap_enable(struct domain *d, u32 mode) if ( old_pages == 0 ) { paging_lock(d); - rv = hap_set_allocation(d, 256, NULL); + rv = hap_set_allocation(d, 1024, NULL); if ( rv != 0 ) { hap_set_allocation(d, 0, NULL);