From nobody Mon Feb 9 14:02:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1587738036; cv=none; d=zohomail.com; s=zohoarc; b=H5rxNe/yNxHnjbHGsnqtwSFmAJbtlYBc6fZPL8gKOjfjsI4Vvz/m5xXFwE0SXXAQvHiBvVGQ+ZIJgC9U85gfikoDuzx4JTXNT5mrebaMWe7yE3E9Uh1y+6FNkm99qAhTOH/HfUd6j0UyojnP5MMKVksmoxBS99R+gm3SIwLv7fI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587738036; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=beV1du9ph6uMZY01rLgboEpxeFyXrD+9xnH+UQh67O0=; b=iPMfqCR4Vdnbp2HzXLidSalJTfcyYvnwoUXZX3xUZv3Gnh3TXElnP9XDhY1vQBZ0e0aVpYjS3v0A6B8TNzAkICpgvZ8JTKzONSdHbiRuQAoxvU3Fs8wCV0Qo/nxY5PwMu14bazHCUyj9eIGPlD6VjTxFolWfe8NMgv9eTeRMJS4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 158773803687391.76483066937976; Fri, 24 Apr 2020 07:20:36 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jRzBi-0005DY-7h; Fri, 24 Apr 2020 14:20:18 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jRzBg-0005Ci-P8 for xen-devel@lists.xenproject.org; Fri, 24 Apr 2020 14:20:16 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b48f0996-8636-11ea-94b3-12813bfff9fa; Fri, 24 Apr 2020 14:20:10 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jRzBa-0001x9-7D; Fri, 24 Apr 2020 14:20:10 +0000 Received: from 54-240-197-226.amazon.com ([54.240.197.226] helo=u1bbd043a57dd5a.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jRz1P-0001fN-FM; Fri, 24 Apr 2020 14:09:39 +0000 X-Inumbo-ID: b48f0996-8636-11ea-94b3-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=beV1du9ph6uMZY01rLgboEpxeFyXrD+9xnH+UQh67O0=; b=1N2DbrFADG5vUIVnUYc+z8LPWW +4fwBJid6FLzmIz6h8SixZRB5AJVwC03aLdR+0c4uHNwO3fxAu5I0RKmTmAMphUVW/S3A4ciG323u fO09oUoELw3KZXx/2ZYI8/wdi4uzdc45nHtb0r6QiZR5pVR5FgIxDEyG2GngWAhVFAgM=; From: Hongyan Xia To: xen-devel@lists.xenproject.org Subject: [PATCH v6 14/15] x86: switch to use domheap page for page tables Date: Fri, 24 Apr 2020 15:09:05 +0100 Message-Id: <6cf43a3d1cd3d18c600515b1ead65f41c2996e92.1587735799.git.hongyxia@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , julien@xen.org, Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Hongyan Xia Signed-off-by: Wei Liu Signed-off-by: Hongyan Xia --- xen/arch/x86/mm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 749b6f23e5..7e212cc3e0 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -4923,10 +4923,11 @@ mfn_t alloc_xen_pagetable_new(void) { if ( system_state !=3D SYS_STATE_early_boot ) { - void *ptr =3D alloc_xenheap_page(); =20 - BUG_ON(!hardware_domain && !ptr); - return ptr ? virt_to_mfn(ptr) : INVALID_MFN; + struct page_info *pg =3D alloc_domheap_page(NULL, 0); + + BUG_ON(!hardware_domain && !pg); + return pg ? page_to_mfn(pg) : INVALID_MFN; } =20 return alloc_boot_pages(1, 1); @@ -4936,7 +4937,7 @@ mfn_t alloc_xen_pagetable_new(void) void free_xen_pagetable_new(mfn_t mfn) { if ( system_state !=3D SYS_STATE_early_boot && !mfn_eq(mfn, INVALID_MF= N) ) - free_xenheap_page(mfn_to_virt(mfn_x(mfn))); + free_domheap_page(mfn_to_page(mfn)); } =20 static DEFINE_SPINLOCK(map_pgdir_lock); --=20 2.24.1.AMZN