From nobody Sun May 5 03:47:37 2024 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=1587117171; cv=none; d=zohomail.com; s=zohoarc; b=g02lo4P1Cc+NJYOlT2YWiJJ8n2Eax007oRaAuAbBXqmmUqORqWITaMNS1bMM20a3w5zCqDBDaM9cORP6WVYdxTfp6+M/Me6lbHq5pjZXHPasFALN58WfRvrwoUmIB7i6V7CeWmI3gXNIFMFYhWsrm/0QJO8jRLfqfyRU3bVT8LE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587117171; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=fgPHa6/lewyPUGLpvLuUr7Qnl8FXYus9SeBUggwCmRY=; b=Zxg3z7DiJZsq6orGnVOZRKQc+V5yZwvf/LpKowP2WAIgLlT3ILZPNc77gCzqzbl2RZge2P113ssGUNVm+R2accVtwsKrLYwk6c/oLWgvpnfD+RUJ5aIKzZC1D8AYx5JTaEhaVyzb/rFPYtBHJtkq3cpRnuqg9xJORPgf6F7S290= 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 1587117171346371.38112881759344; Fri, 17 Apr 2020 02:52:51 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfe-0000M6-Nm; Fri, 17 Apr 2020 09:52:26 +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.89) (envelope-from ) id 1jPNfd-0000Lc-0p for xen-devel@lists.xenproject.org; Fri, 17 Apr 2020 09:52:25 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2030b313-8091-11ea-8c9b-12813bfff9fa; Fri, 17 Apr 2020 09:52:20 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfX-0002fd-9o; Fri, 17 Apr 2020 09:52:19 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] 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 1jPNfW-000304-TS; Fri, 17 Apr 2020 09:52:19 +0000 X-Inumbo-ID: 2030b313-8091-11ea-8c9b-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=fgPHa6/lewyPUGLpvLuUr7Qnl8FXYus9SeBUggwCmRY=; b=fsoDzbLe09VaPA4VGTGG/T2hUA ng16FFZwNw0bU5Df2LGAgfBie/sIqtw/GHzip1fzwercdIajGh2lUi7UvIwZvPcWUSzbZpRQ+4sr2 JC12EYZYIOBOWUlpfl1yhEqZxMD+E54kgExpa6CVvZy3QCRiEiQ/dvIiOVgsZM4x9HFo=; From: Hongyan Xia To: xen-devel@lists.xenproject.org Subject: [PATCH 1/6] x86_64/mm: map and unmap page tables in cleanup_frame_table Date: Fri, 17 Apr 2020 10:52:03 +0100 Message-Id: <12c4fe0c0c05b9f76377c085d8a6558beae64003.1587116799.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.23 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: Wei Liu Also fix a weird indentation. Signed-off-by: Wei Liu Signed-off-by: Hongyan Xia Reviewed-by: Jan Beulich Reviewed-by: Julien Grall --- xen/arch/x86/x86_64/mm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index e85ef449f3..18210405f4 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -737,8 +737,8 @@ static void cleanup_frame_table(struct mem_hotadd_info = *info) =20 while (sva < eva) { - l3e =3D l4e_to_l3e(idle_pg_table[l4_table_offset(sva)])[ - l3_table_offset(sva)]; + l3e =3D l3e_from_l4e(idle_pg_table[l4_table_offset(sva)], + l3_table_offset(sva)); if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_flags(l3e) & _PAGE_PSE) ) { @@ -747,7 +747,7 @@ static void cleanup_frame_table(struct mem_hotadd_info = *info) continue; } =20 - l2e =3D l3e_to_l2e(l3e)[l2_table_offset(sva)]; + l2e =3D l2e_from_l3e(l3e, l2_table_offset(sva)); ASSERT(l2e_get_flags(l2e) & _PAGE_PRESENT); =20 if ( (l2e_get_flags(l2e) & (_PAGE_PRESENT | _PAGE_PSE)) =3D=3D @@ -763,10 +763,10 @@ static void cleanup_frame_table(struct mem_hotadd_inf= o *info) continue; } =20 - ASSERT(l1e_get_flags(l2e_to_l1e(l2e)[l1_table_offset(sva)]) & - _PAGE_PRESENT); - sva =3D (sva & ~((1UL << PAGE_SHIFT) - 1)) + - (1UL << PAGE_SHIFT); + ASSERT(l1e_get_flags(l1e_from_l2e(l2e, l1_table_offset(sva))) & + _PAGE_PRESENT); + + sva =3D (sva & ~((1UL << PAGE_SHIFT) - 1)) + (1UL << PAGE_SHIFT); } =20 /* Brute-Force flush all TLB */ --=20 2.24.1.AMZN From nobody Sun May 5 03:47:37 2024 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=1587117167; cv=none; d=zohomail.com; s=zohoarc; b=Kd1g+jiWZfOTsA3X6Bnno92ykcA1qxlx3hxi1ZZZD/qruJyN1S/KfVr17KTLBXh313n7aFj7V+ahqyLjbFqU70soSbKRTMSx5lmxuWxAeta/Ne/gZwOsReGjykAUcq4+6em+soDmj2C+tD8GVCdbdkfN1eB7fuyHRts1i7OEpbg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587117167; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=tEeVOsGMSDjBCM+osSPHmTi/618O72vOFb/JLOuqfjw=; b=h7kKaiFfDmW2Soal3JmqYz2hxR13yWejPPPuxDkdZhyjAd4sdHcYZrKVgt/NfZCMNzX4AFxg9OY2fetCRLMHHvN50PdmrxI6QBzL3Wo9P6K12BaXrFSP4hQiF4Hx04M7exNXOraMZiivRbRNoL2ogapBBR7QXvJ6AAyw4UC2UCc= 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 1587117167392295.7912569146654; Fri, 17 Apr 2020 02:52:47 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfj-0000Nv-An; Fri, 17 Apr 2020 09:52:31 +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.89) (envelope-from ) id 1jPNfi-0000NQ-0x for xen-devel@lists.xenproject.org; Fri, 17 Apr 2020 09:52:30 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 21d23984-8091-11ea-8c9b-12813bfff9fa; Fri, 17 Apr 2020 09:52:21 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfY-0002fk-Lb; Fri, 17 Apr 2020 09:52:20 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] 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 1jPNfY-000304-B3; Fri, 17 Apr 2020 09:52:20 +0000 X-Inumbo-ID: 21d23984-8091-11ea-8c9b-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=tEeVOsGMSDjBCM+osSPHmTi/618O72vOFb/JLOuqfjw=; b=FPk6Z1cKcufcm78XCUmuoAsxxg NB3bUWLYiTVSS/9IGOxLLksT8xkRnHri/hH9X25+ldy7DqY3dAxpaUOvJy/7srSgxcNkRUC8X6CIT qf0PaoDxzvVgRwDGesPf3H/FRcBDOLUa/0Pm4j8vLlNFK0NeMdi+zzvlyjh2PVzilojw=; From: Hongyan Xia To: xen-devel@lists.xenproject.org Subject: [PATCH 2/6] x86_64/mm: map and unmap page tables in subarch_init_memory Date: Fri, 17 Apr 2020 10:52:04 +0100 Message-Id: <0e14533f516ee5ce410e2cd8050f085aec4b4961.1587116799.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.23 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: Wei Liu Signed-off-by: Wei Liu Signed-off-by: Hongyan Xia Acked-by: Jan Beulich Reviewed-by: Julien Grall --- xen/arch/x86/x86_64/mm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index 18210405f4..5714e5ba62 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -852,14 +852,14 @@ void __init subarch_init_memory(void) v +=3D n << PAGE_SHIFT ) { n =3D L2_PAGETABLE_ENTRIES * L1_PAGETABLE_ENTRIES; - l3e =3D l4e_to_l3e(idle_pg_table[l4_table_offset(v)])[ - l3_table_offset(v)]; + l3e =3D l3e_from_l4e(idle_pg_table[l4_table_offset(v)], + l3_table_offset(v)); if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) ) continue; if ( !(l3e_get_flags(l3e) & _PAGE_PSE) ) { n =3D L1_PAGETABLE_ENTRIES; - l2e =3D l3e_to_l2e(l3e)[l2_table_offset(v)]; + l2e =3D l2e_from_l3e(l3e, l2_table_offset(v)); if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) ) continue; m2p_start_mfn =3D l2e_get_pfn(l2e); @@ -878,11 +878,11 @@ void __init subarch_init_memory(void) v !=3D RDWR_COMPAT_MPT_VIRT_END; v +=3D 1 << L2_PAGETABLE_SHIFT ) { - l3e =3D l4e_to_l3e(idle_pg_table[l4_table_offset(v)])[ - l3_table_offset(v)]; + l3e =3D l3e_from_l4e(idle_pg_table[l4_table_offset(v)], + l3_table_offset(v)); if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) ) continue; - l2e =3D l3e_to_l2e(l3e)[l2_table_offset(v)]; + l2e =3D l2e_from_l3e(l3e, l2_table_offset(v)); if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) ) continue; m2p_start_mfn =3D l2e_get_pfn(l2e); --=20 2.24.1.AMZN From nobody Sun May 5 03:47:37 2024 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=1587117163; cv=none; d=zohomail.com; s=zohoarc; b=NmQH12pU9gomF/bVODsnVfL9SqmsSTa4yK+QHN1UXZXnDbsS+h8ZVqS+n2X+RTRdxJ+Ukiwn52uwkIxRX3Lh/C4N8BHmh6wVKyo58eFMho9aWJt00oLut3lz4tmYFe7HFnc7ItTTp1fGjiIlZ/X+ejW0cpGmHGup+Zs1H4J2rd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587117163; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=7I49opomVxvB6V8PzhNVtuuo+Ifnpql27GLDjPB32Kw=; b=SS04s4Um65cbEsQv3g9bi1u6FoJij3GM/femI9oej0GLntnAcwrnJrpxoXuy1JjGfcjxLkKtauQSiawPHO4Jt5szor/OT5rB13J0wheQPU5bKorhybFRx8fRTPlZ5Mw+eABx1FSRBbIH9IpxZW4raglYm0avtg54cLh+hANcSAg= 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 1587117163581695.6935427141113; Fri, 17 Apr 2020 02:52:43 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfc-0000LT-Dh; Fri, 17 Apr 2020 09:52:24 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfb-0000LM-40 for xen-devel@lists.xenproject.org; Fri, 17 Apr 2020 09:52:23 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 226fb0b0-8091-11ea-b4f4-bc764e2007e4; Fri, 17 Apr 2020 09:52:22 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfa-0002fp-2R; Fri, 17 Apr 2020 09:52:22 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] 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 1jPNfZ-000304-Os; Fri, 17 Apr 2020 09:52:22 +0000 X-Inumbo-ID: 226fb0b0-8091-11ea-b4f4-bc764e2007e4 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=7I49opomVxvB6V8PzhNVtuuo+Ifnpql27GLDjPB32Kw=; b=U/vQRxFirIgOsjhpUeE1YKAn/1 ioly0B4M83S0EK0PELN1eGIbRSPaod2Z1wJwZzJvz4kK+YGbQGqQ/dmAUfaydE8dBlSU3HiS2UW7S nBlomGh2Ejn/9aVTANwypSQcq2bKlplr6hG/Vl6S8f1o7Wo/wazxJ0ri8nM7jf2wDYz4=; From: Hongyan Xia To: xen-devel@lists.xenproject.org Subject: [PATCH 3/6] x86_64/mm: map and unmap page tables in subarch_memory_op Date: Fri, 17 Apr 2020 10:52:05 +0100 Message-Id: <1c88c785eb9537983a1692cc379604233ff13025.1587116799.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.23 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: Wei Liu Signed-off-by: Wei Liu Signed-off-by: Hongyan Xia Acked-by: Jan Beulich Reviewed-by: Julien Grall --- xen/arch/x86/x86_64/mm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index 5714e5ba62..6d52183559 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -932,13 +932,13 @@ long subarch_memory_op(unsigned long cmd, XEN_GUEST_H= ANDLE_PARAM(void) arg) (v < (unsigned long)(machine_to_phys_mapping + max_page)); i++, v +=3D 1UL << L2_PAGETABLE_SHIFT ) { - l3e =3D l4e_to_l3e(idle_pg_table[l4_table_offset(v)])[ - l3_table_offset(v)]; + l3e =3D l3e_from_l4e(idle_pg_table[l4_table_offset(v)], + l3_table_offset(v)); if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) ) mfn =3D last_mfn; else if ( !(l3e_get_flags(l3e) & _PAGE_PSE) ) { - l2e =3D l3e_to_l2e(l3e)[l2_table_offset(v)]; + l2e =3D l2e_from_l3e(l3e, l2_table_offset(v)); if ( l2e_get_flags(l2e) & _PAGE_PRESENT ) mfn =3D l2e_get_pfn(l2e); else --=20 2.24.1.AMZN From nobody Sun May 5 03:47:37 2024 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=1587117170; cv=none; d=zohomail.com; s=zohoarc; b=ifeLVoWhxttECynnDzV74od9m3MmvDLlKq4zMCDvR443bmsrQrgbGruTVOWV4vcYEdpi9PBnRWg9hw6SzmF2QHeAA4zc5XKoIghzUGjEDIb2AeRQVQPQzXdWCEyuYVkEwffhELR/qusyLm+7xY1r5WHhtzum1CSuKwUD7YWYkf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587117170; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=TtfDNJhA8tjoCGd8nfl59DQgpyHwzck4uvav7srJyZM=; b=ENvWP7U1SGMerwd8N1gR8sbikB1MidgcGxm5GuKRZt0wkIrecipEDRqdnmudNTzpMS5XFdUMeaf8rJu6QHHunnwDr1rJH512TWrUpLTuGAKy8RTH89KO+mmo1n60YejiEAbQ9TxSnbyffdle1HCMuI9vB4JDrY+q+UfG25YDgi8= 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 1587117170064168.9619023309682; Fri, 17 Apr 2020 02:52:50 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfn-0000Qx-KK; Fri, 17 Apr 2020 09:52:35 +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.89) (envelope-from ) id 1jPNfn-0000Qc-18 for xen-devel@lists.xenproject.org; Fri, 17 Apr 2020 09:52:35 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 232cfa12-8091-11ea-8c9b-12813bfff9fa; Fri, 17 Apr 2020 09:52:23 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfb-0002fw-Fo; Fri, 17 Apr 2020 09:52:23 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] 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 1jPNfb-000304-6P; Fri, 17 Apr 2020 09:52:23 +0000 X-Inumbo-ID: 232cfa12-8091-11ea-8c9b-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=TtfDNJhA8tjoCGd8nfl59DQgpyHwzck4uvav7srJyZM=; b=g3HnPNSWrF201Ln96S0X0V/JcW wroUnjXehYGLMAV4J6FGf/LZz+Cb5M0eHPm7Uit2Ahbyyp080Cd7ak33v8QUeCSxka8THYJSgwbB7 hXKpv/5fMSRJbedRVuycqIxJJdh5+Ckl6+oU+foZDHO9fLzjdIRZ6B0GGPM0rRpGRNSk=; From: Hongyan Xia To: xen-devel@lists.xenproject.org Subject: [PATCH 4/6] x86/smpboot: map and unmap page tables in cleanup_cpu_root_pgt Date: Fri, 17 Apr 2020 10:52:06 +0100 Message-Id: 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.23 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: Wei Liu Signed-off-by: Wei Liu Signed-off-by: Hongyan Xia Acked-by: Jan Beulich Reviewed-by: Julien Grall --- xen/arch/x86/smpboot.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 09264b02d1..275ce7661d 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -858,23 +858,27 @@ static void cleanup_cpu_root_pgt(unsigned int cpu) r < root_table_offset(HYPERVISOR_VIRT_END); ++r ) { l3_pgentry_t *l3t; + mfn_t l3mfn; unsigned int i3; =20 if ( !(root_get_flags(rpt[r]) & _PAGE_PRESENT) ) continue; =20 - l3t =3D l4e_to_l3e(rpt[r]); + l3mfn =3D l4e_get_mfn(rpt[r]); + l3t =3D map_domain_page(l3mfn); =20 for ( i3 =3D 0; i3 < L3_PAGETABLE_ENTRIES; ++i3 ) { l2_pgentry_t *l2t; + mfn_t l2mfn; unsigned int i2; =20 if ( !(l3e_get_flags(l3t[i3]) & _PAGE_PRESENT) ) continue; =20 ASSERT(!(l3e_get_flags(l3t[i3]) & _PAGE_PSE)); - l2t =3D l3e_to_l2e(l3t[i3]); + l2mfn =3D l3e_get_mfn(l3t[i3]); + l2t =3D map_domain_page(l2mfn); =20 for ( i2 =3D 0; i2 < L2_PAGETABLE_ENTRIES; ++i2 ) { @@ -882,13 +886,15 @@ static void cleanup_cpu_root_pgt(unsigned int cpu) continue; =20 ASSERT(!(l2e_get_flags(l2t[i2]) & _PAGE_PSE)); - free_xen_pagetable(l2e_to_l1e(l2t[i2])); + free_xen_pagetable_new(l2e_get_mfn(l2t[i2])); } =20 - free_xen_pagetable(l2t); + unmap_domain_page(l2t); + free_xen_pagetable_new(l2mfn); } =20 - free_xen_pagetable(l3t); + unmap_domain_page(l3t); + free_xen_pagetable_new(l3mfn); } =20 free_xen_pagetable(rpt); @@ -896,11 +902,14 @@ static void cleanup_cpu_root_pgt(unsigned int cpu) /* Also zap the stub mapping for this CPU. */ if ( stub_linear ) { - l3_pgentry_t *l3t =3D l4e_to_l3e(common_pgt); - l2_pgentry_t *l2t =3D l3e_to_l2e(l3t[l3_table_offset(stub_linear)]= ); - l1_pgentry_t *l1t =3D l2e_to_l1e(l2t[l2_table_offset(stub_linear)]= ); + l3_pgentry_t l3e =3D l3e_from_l4e(common_pgt, + l3_table_offset(stub_linear)); + l2_pgentry_t l2e =3D l2e_from_l3e(l3e, l2_table_offset(stub_linear= )); + l1_pgentry_t *l1t =3D map_l1t_from_l2e(l2e); =20 l1t[l1_table_offset(stub_linear)] =3D l1e_empty(); + + unmap_domain_page(l1t); } } =20 --=20 2.24.1.AMZN From nobody Sun May 5 03:47:37 2024 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=1587117168; cv=none; d=zohomail.com; s=zohoarc; b=KTYGp2hPUe5k5rYJmq2kJmjrGSgbnN5JqxlOgLxflcEmGhZscCU7Fv46jLiDIpeCvyAbsNUBeNoT089o6/43EeeIEQE078arKk1YldLfU8bwx/ifyPSeBdYg+uYbhRLOUz7040uNX8mXWrWOCnIdvrntFy7R6Z1E+CwtFam8CMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587117168; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=3PKlc7n3xS/jV0u6XuY6+PkL5866S2noi39EkmZJHLk=; b=hxHpMrFdW+VmBr0m1Klm3exVsc58yFV4H667bT5/6k9i6tARKxihDbN8MsO01kxwCkhQvm77yULA+6m1RD0tBTW92af1Umy5a0SLELhDBAByQQwYRrTunsFsqW01ZpX01kZuwBSk5Nyumy/mUO6Qts3huWygEr3LjTg2kGu8C6c= 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 1587117168801247.07776229561648; Fri, 17 Apr 2020 02:52:48 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfh-0000Mq-18; Fri, 17 Apr 2020 09:52:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfg-0000Me-1B for xen-devel@lists.xenproject.org; Fri, 17 Apr 2020 09:52:28 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 241c2132-8091-11ea-b58d-bc764e2007e4; Fri, 17 Apr 2020 09:52:25 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfc-0002g2-TE; Fri, 17 Apr 2020 09:52:24 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] 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 1jPNfc-000304-Ju; Fri, 17 Apr 2020 09:52:24 +0000 X-Inumbo-ID: 241c2132-8091-11ea-b58d-bc764e2007e4 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=3PKlc7n3xS/jV0u6XuY6+PkL5866S2noi39EkmZJHLk=; b=6Wg/PSgPxch2MIXxZCIZTcAGU2 e+xUte2YS7ssUZFYv3wFEa/duhWo1Ggen13MRH11jSCORyfcUeRbyKWsDQDL6mNvXVJ1/HexFz1DW fygtm8y+pMpFDHAveHIAoqHwbPYOc4iAYVihpCinG71neeIk6++Dvyj3pRxvpxhj1a3U=; From: Hongyan Xia To: xen-devel@lists.xenproject.org Subject: [PATCH 5/6] x86/pv: map and unmap page tables in mark_pv_pt_pages_rdonly Date: Fri, 17 Apr 2020 10:52:07 +0100 Message-Id: <9287363e13924f4a633b47b53c23b3466e26e4a8.1587116799.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.23 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: Wei Liu Signed-off-by: Wei Liu Signed-off-by: Hongyan Xia Reviewed-by: Julien Grall --- xen/arch/x86/pv/dom0_build.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index 5678da782d..28a939b68a 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -50,17 +50,17 @@ static __init void mark_pv_pt_pages_rdonly(struct domai= n *d, unsigned long count; struct page_info *page; l4_pgentry_t *pl4e; - l3_pgentry_t *pl3e; - l2_pgentry_t *pl2e; - l1_pgentry_t *pl1e; + l3_pgentry_t *pl3e, *l3t; + l2_pgentry_t *pl2e, *l2t; + l1_pgentry_t *pl1e, *l1t; =20 pl4e =3D l4start + l4_table_offset(vpt_start); - pl3e =3D l4e_to_l3e(*pl4e); - pl3e +=3D l3_table_offset(vpt_start); - pl2e =3D l3e_to_l2e(*pl3e); - pl2e +=3D l2_table_offset(vpt_start); - pl1e =3D l2e_to_l1e(*pl2e); - pl1e +=3D l1_table_offset(vpt_start); + l3t =3D map_l3t_from_l4e(*pl4e); + pl3e =3D l3t + l3_table_offset(vpt_start); + l2t =3D map_l2t_from_l3e(*pl3e); + pl2e =3D l2t + l2_table_offset(vpt_start); + l1t =3D map_l1t_from_l2e(*pl2e); + pl1e =3D l1t + l1_table_offset(vpt_start); for ( count =3D 0; count < nr_pt_pages; count++ ) { l1e_remove_flags(*pl1e, _PAGE_RW); @@ -85,12 +85,20 @@ static __init void mark_pv_pt_pages_rdonly(struct domai= n *d, if ( !((unsigned long)++pl2e & (PAGE_SIZE - 1)) ) { if ( !((unsigned long)++pl3e & (PAGE_SIZE - 1)) ) - pl3e =3D l4e_to_l3e(*++pl4e); - pl2e =3D l3e_to_l2e(*pl3e); + { + unmap_domain_page(l3t); + pl3e =3D l3t =3D map_l3t_from_l4e(*++pl4e); + } + unmap_domain_page(l2t); + pl2e =3D l2t =3D map_l2t_from_l3e(*pl3e); } - pl1e =3D l2e_to_l1e(*pl2e); + unmap_domain_page(l1t); + pl1e =3D l1t =3D map_l1t_from_l2e(*pl2e); } } + unmap_domain_page(l1t); + unmap_domain_page(l2t); + unmap_domain_page(l3t); } =20 static __init void setup_pv_physmap(struct domain *d, unsigned long pgtbl_= pfn, --=20 2.24.1.AMZN From nobody Sun May 5 03:47:37 2024 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=1587117180; cv=none; d=zohomail.com; s=zohoarc; b=fZ+8ZVvJSKe3SZbq12oUrhPJNsIak/oYIXDE+8Q0NQUpDx+XHfgnNdZf7a8b1n9nbqhR2JNRTXFIPPiN6iA9rqjO8HLmP/QDwI03f9I4/oVlQ2zsYfJnl3kW10zDlz8pu4aVbLwd7GmevnSalaIVcDK2/Zj0dsvc6L2RSwxZywQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587117180; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Dfu+OgKnJzFWoXe/gPFe0obtWomHwJiB46S0uhovLc0=; b=j0FLh9oFayPB9wMZH2pGdio6c0n40YnO0CciHRzWFFTU9dosRq5icvG0sh3y9pb6w5FMJ823jocJxwUHGpTkJ7LYnVoX6EW7QkY62bKc7lZ1YTCGHWnTxJc60YeS8a1K+VnCAWOf5PwXEwS7vWlRkmzce7ZkSZq53bCD2IIYUZ0= 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 1587117180100429.4371195725199; Fri, 17 Apr 2020 02:53:00 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNft-0000UJ-3c; Fri, 17 Apr 2020 09:52:41 +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.89) (envelope-from ) id 1jPNfs-0000Tf-1F for xen-devel@lists.xenproject.org; Fri, 17 Apr 2020 09:52:40 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 24f1209e-8091-11ea-8c9b-12813bfff9fa; Fri, 17 Apr 2020 09:52:26 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jPNfe-0002g8-Aj; Fri, 17 Apr 2020 09:52:26 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] 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 1jPNfe-000304-15; Fri, 17 Apr 2020 09:52:26 +0000 X-Inumbo-ID: 24f1209e-8091-11ea-8c9b-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=Dfu+OgKnJzFWoXe/gPFe0obtWomHwJiB46S0uhovLc0=; b=D3+GJWuLGIwR19dKVk0QfvNpEP cq5z41eQ+J/4T7c2UgY0l1mUsBfDgyPYxRoCHvFEVty/RdmTdnBAeHoDv2QLHpo989tqmXDP8/zq8 aqAaX/Nm3UKdNTMnSmr4X/cLjNmWJY6ox7HCtSFN9clvlm85ITsPGB8cccDyzXW+xf+w=; From: Hongyan Xia To: xen-devel@lists.xenproject.org Subject: [PATCH 6/6] x86/pv: map and unmap page table in dom0_construct_pv Date: Fri, 17 Apr 2020 10:52:08 +0100 Message-Id: <18fda6bdeb4f20bf2272503e45c7c420e51673ac.1587116799.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.23 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: Wei Liu Signed-off-by: Wei Liu Signed-off-by: Hongyan Xia Acked-by: Jan Beulich Reviewed-by: Julien Grall --- xen/arch/x86/pv/dom0_build.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index 28a939b68a..a03f0501ab 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -677,6 +677,8 @@ int __init dom0_construct_pv(struct domain *d, =20 if ( is_pv_32bit_domain(d) ) { + l2_pgentry_t *l2t; + /* Ensure the first four L3 entries are all populated. */ for ( i =3D 0, l3tab =3D l3start; i < 4; ++i, ++l3tab ) { @@ -691,7 +693,9 @@ int __init dom0_construct_pv(struct domain *d, l3e_get_page(*l3tab)->u.inuse.type_info |=3D PGT_pae_xen_l= 2; } =20 - init_xen_pae_l2_slots(l3e_to_l2e(l3start[3]), d); + l2t =3D map_l2t_from_l3e(l3start[3]); + init_xen_pae_l2_slots(l2t, d); + unmap_domain_page(l2t); } =20 /* Pages that are part of page tables must be read only. */ --=20 2.24.1.AMZN