From patchwork Thu Oct 24 03:45:02 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: 11208237 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 805DC14E5 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 5BE4920856 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="T/vgC/pj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BE4920856 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 1iNU3p-0003ex-Q0; Thu, 24 Oct 2019 03:45:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNU3n-0003es-E8 for xen-devel@lists.xenproject.org; Thu, 24 Oct 2019 03:45:15 +0000 X-Inumbo-ID: afc1c0c2-f610-11e9-beca-bc764e2007e4 Received: from new2-smtp.messagingengine.com (unknown [66.111.4.224]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id afc1c0c2-f610-11e9-beca-bc764e2007e4; Thu, 24 Oct 2019 03:45:14 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id E2FA76FA5; 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:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=/zrI8S HfQt9/Kqm8uD+OrMAZIKLwoQZHBlW2dhofSW0=; b=T/vgC/pjPOXtsPwz/DRr2y f6IxuCxqr3Dt1EW2R/tmGkA1pYvf0b7ZY8lWr5derOZsjYO1vx4eFObnOKdJXyVT v1NL0ccon21xmiqmcRvB6spTNY4EVj9JlVwMTNeTUY0yMpQRkh9gzFaoCx/OT8hA POeHWzwEmTl6J8PNp0wk3QBHvCS8x9F2urdo69t60BZF13cY2OBAIjAl5s8nCvZy uU4zoe+1H+zzz/0lKdFfuRuuxklg9foI55WMEZ/z7sqW/SDntDZ1SGuPb17v5h++ DvEGiuf0pJvAJ+3gHoxYCWq3GYB6E86SoVyEeRJRxzAKYtQ7NZVGvTebnutdfY/Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrledtgdejvdcutefuodetggdotefrodftvf 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 0113680064; Wed, 23 Oct 2019 23:45:10 -0400 (EDT) From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Thu, 24 Oct 2019 05:45:02 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 0/3] 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 , Jason Andryuk , George Dunlap , Andrew Cooper , Konrad Rzeszutek Wilk , Ian Jackson , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=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 Tested-by: Marek Marczykowski-Górecki Dell Latitude 5580, firmware 1.16.0 - without the patch: works - with patch: works - tested only xen.efi Tested-by: Jason Andryuk 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? Changes in v4: - reword commit messages, drop mentions of kexec - new patch (3) 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 (3): efi: remove old SetVirtualAddressMap() arrangement xen/efi: optionally call SetVirtualAddressMap() xen/efi: use directmap to access runtime services table xen/common/Kconfig | 10 ++++++++- xen/common/efi/boot.c | 52 +++++++++++++++++++++++------------------ xen/common/efi/runtime.c | 19 +++------------ 3 files changed, 44 insertions(+), 37 deletions(-) base-commit: 7a4e6711114905b3cbbe48e81c3222361a7f3579