From patchwork Thu Sep 26 09:46:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xia, Hongyan" X-Patchwork-Id: 11162195 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF66813BD for ; Thu, 26 Sep 2019 09:51:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CB97E2053B for ; Thu, 26 Sep 2019 09:51:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="Obc0RyPS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB97E2053B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iDQQE-0001AD-Pb; Thu, 26 Sep 2019 09:50:50 +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 1iDQQ9-0000ze-W6 for xen-devel@lists.xenproject.org; Thu, 26 Sep 2019 09:50:46 +0000 X-Inumbo-ID: 1a310348-e043-11e9-964c-12813bfff9fa Received: from smtp-fw-4101.amazon.com (unknown [72.21.198.25]) by localhost (Halon) with ESMTPS id 1a310348-e043-11e9-964c-12813bfff9fa; Thu, 26 Sep 2019 09:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1569491441; x=1601027441; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=+D3aSBpu/9jGRBhfqGVbSAXhO++vMOcqH3ZAlDGs2+w=; b=Obc0RyPSQiQCt90QNpGKb4SiiHDxtsGCHs/MiiKZxIHlT/wYqvOgwQWc L37aFnrcZbldDwMh9SFALjwSPDRxJgRRzE6D/auectgdcftJRO900yStT SVzzr+rsEa13P869bYlBf0gqFANgLv98sYPV7dpZ+nmERvsE8cVc12dNo Y=; X-IronPort-AV: E=Sophos;i="5.64,551,1559520000"; d="scan'208";a="787535493" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-67b371d8.us-east-1.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 26 Sep 2019 09:50:41 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1a-67b371d8.us-east-1.amazon.com (Postfix) with ESMTPS id 2B4CDA05FE; Thu, 26 Sep 2019 09:50:40 +0000 (UTC) Received: from EX13D28EUC003.ant.amazon.com (10.43.164.43) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 26 Sep 2019 09:50:06 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX13D28EUC003.ant.amazon.com (10.43.164.43) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 26 Sep 2019 09:50:04 +0000 Received: from u9d785c4ba99158.ant.amazon.com (10.125.106.58) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 26 Sep 2019 09:50:02 +0000 From: To: Date: Thu, 26 Sep 2019 10:46:43 +0100 Message-ID: <969374c5a1c62eabb329694092d551b04d77b8be.1569489002.git.hongyax@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [RFC PATCH 80/84] x86/setup: Install dummy 1:1 mappings for all mem passed to allocators. X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= , Wei Liu , Jan Beulich , Hongyan Xia Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Hongyan Xia This means we no longer have an always-mapped direct map now. Signed-off-by: Hongyan Xia --- xen/arch/x86/setup.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 9015e3b723..e6a3f1e0a1 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -240,7 +240,9 @@ void __init discard_initial_images(void) uint64_t start = (uint64_t)initial_images[i].mod_start << PAGE_SHIFT; init_domheap_pages(start, - start + PAGE_ALIGN(initial_images[i].mod_end)); + start + PAGE_ALIGN(initial_images[i].mod_end)); + map_pages_to_xen((unsigned long)__va(start), INVALID_MFN, + PFN_DOWN(PAGE_ALIGN(initial_images[i].mod_end)), _PAGE_NONE); } nr_initial_images = 0; @@ -1346,6 +1348,8 @@ void __init noreturn __start_xen(unsigned long mbi_p) /* Pass mapped memory to allocator /before/ creating new mappings. */ init_boot_pages(s, min(map_s, e)); + map_pages_to_xen((unsigned long)__va(s), INVALID_MFN, + PFN_DOWN(min(map_s, e) - s), _PAGE_NONE); s = map_s; if ( s < map_e ) { @@ -1354,6 +1358,8 @@ void __init noreturn __start_xen(unsigned long mbi_p) map_s = (s + mask) & ~mask; map_e &= ~mask; init_boot_pages(map_s, map_e); + map_pages_to_xen((unsigned long)__va(map_s), INVALID_MFN, + PFN_DOWN(map_e - map_s), _PAGE_NONE); } if ( map_s > map_e ) @@ -1367,9 +1373,9 @@ void __init noreturn __start_xen(unsigned long mbi_p) if ( map_e < end ) { + init_boot_pages(map_e, end); map_pages_to_xen((unsigned long)__va(map_e), INVALID_MFN, PFN_DOWN(end - map_e), _PAGE_NONE); - init_boot_pages(map_e, end); map_e = end; } } @@ -1382,9 +1388,9 @@ void __init noreturn __start_xen(unsigned long mbi_p) } if ( s < map_s ) { + init_boot_pages(s, map_s); map_pages_to_xen((unsigned long)__va(s), INVALID_MFN, PFN_DOWN(map_s - s), _PAGE_NONE); - init_boot_pages(s, map_s); } } @@ -1506,6 +1512,8 @@ void __init noreturn __start_xen(unsigned long mbi_p) if ( PFN_DOWN(s) <= limit ) s = pfn_to_paddr(limit + 1); init_domheap_pages(s, e); + map_pages_to_xen((unsigned long)__va(s), INVALID_MFN, + PFN_DOWN(e - s), _PAGE_NONE); } } else