From nobody Mon Feb 9 14:34:39 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=1587737398; cv=none; d=zohomail.com; s=zohoarc; b=SsEFawBVEGwOynfKVLGLJ/qQAkeeBPyzNOUaa5wAa7ZG7vJn+dMc+u9wyIbbh6jLrUgmV2ueHZ3ruuQGrh4fJvs+kdDUoMpQnNCrz9dSVUgUxI8iUS7uOHvAgiutJvN1KL0kB8dUH5WCrUB2+S9iDizBjF1hDaUKeGjRMcpKYU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587737398; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=i73GryKu2F55P7dpYQ8AYC2nWGmKgcztTRkoevvtces=; b=Ee8B1lVeCysEgjUCEr/uAf7eVw29tW6GpsmxUOhOvK5kl0hfg99GEwI4USQ8etMk0eMTrEfQLXCNgxThVghvFpo41KogCAIxRYPrwuHQ8yl87nWk0xm2xKLEotSiZakeyWZoEhFPl6HN9rO62OLmOWSn2fYJ8KVpDREwuLwSsoY= 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 1587737398694856.3639247785718; Fri, 24 Apr 2020 07:09:58 -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 1jRz1T-00032p-Ci; Fri, 24 Apr 2020 14:09:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jRz1S-00031w-F9 for xen-devel@lists.xenproject.org; Fri, 24 Apr 2020 14:09:42 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 385d13f0-8635-11ea-b58d-bc764e2007e4; Fri, 24 Apr 2020 14:09:32 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jRz1I-0001he-AR; Fri, 24 Apr 2020 14:09:32 +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 1jRz1H-0001fN-Uj; Fri, 24 Apr 2020 14:09:32 +0000 X-Inumbo-ID: 385d13f0-8635-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=i73GryKu2F55P7dpYQ8AYC2nWGmKgcztTRkoevvtces=; b=ifCSB49tKxVEMTt06aZ/ovgvXd t1kpGS79L8/8OmM9hEi/dgd4F9cGlvrTrmvj8P1XtE41DVKzPKukZDFIK7+TWMMHw7CaXksJVBmO6 MwZ6JX1GW/YZZBV7LR1N9aUar7fp1HCXfx1SU4fjf4xfPACBU270w13b5bcB7iwyc8y0=; From: Hongyan Xia To: xen-devel@lists.xenproject.org Subject: [PATCH v6 09/15] efi: use new page table APIs in copy_mapping Date: Fri, 24 Apr 2020 15:09:00 +0100 Message-Id: <6c27c79964eb16eba4743515689b9fd7eb3409d1.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: julien@xen.org, Jan Beulich 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 After inspection ARM doesn't have alloc_xen_pagetable so this function is x86 only, which means it is safe for us to change. Signed-off-by: Wei Liu --- xen/common/efi/boot.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index a6f84c945a..8e96ef8de2 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -1454,16 +1454,20 @@ static __init void copy_mapping(unsigned long mfn, = unsigned long end, continue; if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) ) { - l3dst =3D alloc_xen_pagetable(); - BUG_ON(!l3dst); + mfn_t l3mfn =3D alloc_xen_pagetable_new(); + + BUG_ON(mfn_eq(l3mfn, INVALID_MFN)); + l3dst =3D map_domain_page(l3mfn); clear_page(l3dst); efi_l4_pgtable[l4_table_offset(mfn << PAGE_SHIFT)] =3D - l4e_from_paddr(virt_to_maddr(l3dst), __PAGE_HYPERVISOR); + l4e_from_mfn(l3mfn, __PAGE_HYPERVISOR); } else - l3dst =3D l4e_to_l3e(l4e); - l3src =3D l4e_to_l3e(idle_pg_table[l4_table_offset(va)]); + l3dst =3D map_l3t_from_l4e(l4e); + l3src =3D map_l3t_from_l4e(idle_pg_table[l4_table_offset(va)]); l3dst[l3_table_offset(mfn << PAGE_SHIFT)] =3D l3src[l3_table_offse= t(va)]; + unmap_domain_page(l3src); + unmap_domain_page(l3dst); } } =20 --=20 2.24.1.AMZN