From patchwork Sat Oct 12 22:11:37 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: 11187143 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 D45D876 for ; Sat, 12 Oct 2019 22:13:23 +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 B0392206A1 for ; Sat, 12 Oct 2019 22:13:23 +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="rjPlriL8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0392206A1 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 1iJPc6-0004gn-2x; Sat, 12 Oct 2019 22:11:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iJPc5-0004gi-G1 for xen-devel@lists.xenproject.org; Sat, 12 Oct 2019 22:11:49 +0000 X-Inumbo-ID: 4906cbe2-ed3d-11e9-bbab-bc764e2007e4 Received: from new4-smtp.messagingengine.com (unknown [66.111.4.230]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4906cbe2-ed3d-11e9-bbab-bc764e2007e4; Sat, 12 Oct 2019 22:11:48 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 4CF1D48DB; Sat, 12 Oct 2019 18:11:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 12 Oct 2019 18:11:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=MsDRlL YP9wj3ZZoPvChl1copIaD66k1xqFH16E06zJ4=; b=rjPlriL8FUrOlynZruSpgZ AAtVX3jr0bDt+O5qbe8k5WZsQ4ZcNwcSELNDSZTCUtn3ID/BvSl37S3ToQq3v/sl BDp2gSdJpjwt0UyVH0+19nAmo9/fclepub3nHGw2NCXyUn1fmYzAiIuz9W0z/n5q yaMTesV3Regen7uBcjOktMJ8B2zRu8+F5LOEGaeVq+HDyPB5WMPcFRslYk+vZw8H 7WTQq14PVJvxAEidqB5AY4oLCbGxxfFg6bs70Tj9PaODmg0tirDqKNajZ2PsOQBv TkXpcMkodrV2xCdvXUACSIoa0rShDwVl6e/LaUlY2B3gmaBD3LlbG28/GHDZUoXw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrieekgddtjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghkucfo rghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvhhish hisghlvghthhhinhhgshhlrggsrdgtohhmqeenucffohhmrghinhepgigvnhhprhhojhgv tghtrdhorhhgnecukfhppeeluddrieehrdefgedrfeefnecurfgrrhgrmhepmhgrihhlfh hrohhmpehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm necuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 4CA978005A; Sat, 12 Oct 2019 18:11:45 -0400 (EDT) From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Sun, 13 Oct 2019 00:11:37 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 0/2] Optionally call EFI SetVirtualAddressMap() 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: Juergen Gross , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Jason Andryuk , Ian Jackson , =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Tim Deegan , Julien Grall , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Workaround buggy UEFI accessing boot services memory after ExitBootServices(). Patches discussed here: https://lists.xenproject.org/archives/html/xen-devel/2019-08/msg00701.html In addition to the tests below, I've tested kexec on xen.efi with this option enabled and it (still) works. Test results on few laptops: Thinkpad x230, firmware version 2.77: - without the patch: crashes on RS call (mapbs helps) - with patch: works - same with xen.efi and MB2 Librem 14 v1, firmware version (AMI) ARUD026 (06/18/2015): - without the patch: works - with the patch: works - same with xen.efi and MB2 Dell Latitude E6420, firmware version A21: this machine requires efi=attr=uc workaround - without the patch: dom0 hangs before sending any message to the console (even with earlyprintk=xen etc) - with the patch: crashes before dom0 prints anything: mm.c:896:d0v0 non-privileged attempt to map MMIO space 2c2c2c2c2c - same with xen.efi and MB2 Thinkpad W540: - without the patch: crashes on RS call (only efi=no-rs helps) - with patch: works - tested only with MB2 Thinkpad X1 Carbon gen5, firmware version 1.22 (2017-07-04): - without the patch: works - with patch: works - tested only xen.efi Thinkpad P52, firmware version 1.25 (2018-04-15): - without the patch (MB2): hangs on RS call (mapbs helps) - without the patch (xen.efi): works(?!) - with the patch: works - tested with xen.efi and MB2 Changes in v2: - fix boot with xen.efi (efi_memmap at this point still needs to be accessed via physical address). TBH, I don't understand why previous version worked with MB2 - is directmap mapped at this point? Cc: Juergen Gross Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu Cc: Jason Andryuk Marek Marczykowski-Górecki (2): efi: remove old SetVirtualAddressMap() arrangement xen/efi: optionally call SetVirtualAddressMap() xen/common/Kconfig | 13 ++++++++++++- xen/common/efi/boot.c | 48 +++++++++++++++++++++++--------------------- 2 files changed, 39 insertions(+), 22 deletions(-) base-commit: 7a4e6711114905b3cbbe48e81c3222361a7f3579 Tested-by: Jason Andryuk