From patchwork Thu Oct 24 03:45:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 11208239 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 846C61864 for ; Thu, 24 Oct 2019 03:47:21 +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 6035121655 for ; Thu, 24 Oct 2019 03:47:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="EO5V3vVC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6035121655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.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 1iNU3t-0003fe-G4; Thu, 24 Oct 2019 03:45:21 +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 1iNU3s-0003fP-Jm for xen-devel@lists.xenproject.org; Thu, 24 Oct 2019 03:45:20 +0000 X-Inumbo-ID: afb7c4a0-f610-11e9-9494-12813bfff9fa Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id afb7c4a0-f610-11e9-9494-12813bfff9fa; Thu, 24 Oct 2019 03:45:14 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id AD6A92134B; Wed, 23 Oct 2019 23:45:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 23 Oct 2019 23:45:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=lgZCu5yV+InqhKNSR1+N8kS9ueRzlky1xKj+fUwK+ R0=; b=EO5V3vVC/OaMQtIMjtYIomfQkQf8Y0mpYKjPkaYkL7//wIzZqG0/MeRxI JhNgFTJCwupA0PXEp2+S1lt2pu3bLhl2ArCwFMoGYbmoiGEtKYFiuJIzl1v/51VM azOdtX52aaff9F6a3MBHip5Gj0tRfLiDNR/DklzxW63/CeXoHpnwl1wF5UAf2jLz FMKfbAnA5+CXY2TSEljI+s8s/ZH7kgUk3FOfKkhnFgxtJNw4ZMCydUsgtuNGsMzv uZtVoeXQJcZvmzOmKESPZF+sLkYTAJZw0VYx/09rT4YNukqEE+riSOLiUb+Ra3Ru CbZ0bvQBP+eQrWg4w+Z03u3to4Lkg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrledtgdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id B7B5F80065; Wed, 23 Oct 2019 23:45:12 -0400 (EDT) From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Thu, 24 Oct 2019 05:45:03 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 1/3] efi: remove old SetVirtualAddressMap() arrangement 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 , =?utf-8?q?Marek_Marczykowski-?= =?utf-8?q?G=C3=B3recki?= , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Remove unused (#ifdef-ed out) code. Reviving it in its current shape won't fly because: - SetVirtualAddressMap() needs to be called with 1:1 mapping, which isn't the case at this time - it uses directmap, which may go away soon - it uses directmap, which is mapped with NX, breaking EfiRuntimeServicesCode No functional change. Signed-off-by: Marek Marczykowski-Górecki Acked-by: Andrew Cooper Acked-by: Jan Beulich --- xen/common/efi/boot.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 7919378..cddf3de 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -29,9 +29,6 @@ #undef __ASSEMBLY__ #endif -/* Using SetVirtualAddressMap() is incompatible with kexec: */ -#undef USE_SET_VIRTUAL_ADDRESS_MAP - #define EFI_REVISION(major, minor) (((major) << 16) | (minor)) #define SMBIOS3_TABLE_GUID \ @@ -1099,9 +1096,6 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *Syste /* Adjust pointers into EFI. */ efi_ct = (void *)efi_ct + DIRECTMAP_VIRT_START; -#ifdef USE_SET_VIRTUAL_ADDRESS_MAP - efi_rs = (void *)efi_rs + DIRECTMAP_VIRT_START; -#endif efi_memmap = (void *)efi_memmap + DIRECTMAP_VIRT_START; efi_fw_vendor = (void *)efi_fw_vendor + DIRECTMAP_VIRT_START; } @@ -1422,7 +1416,6 @@ static int __init parse_efi_param(const char *s) } custom_param("efi", parse_efi_param); -#ifndef USE_SET_VIRTUAL_ADDRESS_MAP static __init void copy_mapping(unsigned long mfn, unsigned long end, bool (*is_valid)(unsigned long smfn, unsigned long emfn)) @@ -1466,7 +1459,6 @@ static bool __init rt_range_valid(unsigned long smfn, unsigned long emfn) { return true; } -#endif #define INVALID_VIRTUAL_ADDRESS (0xBAAADUL << \ (EFI_PAGE_SHIFT + BITS_PER_LONG - 32)) @@ -1474,13 +1466,11 @@ static bool __init rt_range_valid(unsigned long smfn, unsigned long emfn) void __init efi_init_memory(void) { unsigned int i; -#ifndef USE_SET_VIRTUAL_ADDRESS_MAP struct rt_extra { struct rt_extra *next; unsigned long smfn, emfn; unsigned int prot; } *extra, *extra_head = NULL; -#endif free_ebmalloc_unused_mem(); @@ -1563,7 +1553,6 @@ void __init efi_init_memory(void) printk(XENLOG_ERR "Could not map MFNs %#lx-%#lx\n", smfn, emfn - 1); } -#ifndef USE_SET_VIRTUAL_ADDRESS_MAP else if ( !((desc->PhysicalStart + len - 1) >> (VADDR_BITS - 1)) && (extra = xmalloc(struct rt_extra)) != NULL ) { @@ -1574,12 +1563,8 @@ void __init efi_init_memory(void) extra_head = extra; desc->VirtualStart = desc->PhysicalStart; } -#endif else { -#ifdef USE_SET_VIRTUAL_ADDRESS_MAP - /* XXX allocate e.g. down from FIXADDR_START */ -#endif printk(XENLOG_ERR "No mapping for MFNs %#lx-%#lx\n", smfn, emfn - 1); } @@ -1591,10 +1576,6 @@ void __init efi_init_memory(void) return; } -#ifdef USE_SET_VIRTUAL_ADDRESS_MAP - efi_rs->SetVirtualAddressMap(efi_memmap_size, efi_mdesc_size, - mdesc_ver, efi_memmap); -#else /* Set up 1:1 page tables to do runtime calls in "physical" mode. */ efi_l4_pgtable = alloc_xen_pagetable(); BUG_ON(!efi_l4_pgtable); @@ -1680,6 +1661,5 @@ void __init efi_init_memory(void) for ( i = l4_table_offset(HYPERVISOR_VIRT_START); i < l4_table_offset(DIRECTMAP_VIRT_END); ++i ) efi_l4_pgtable[i] = idle_pg_table[i]; -#endif } #endif