From patchwork Sat Oct 12 14:36:07 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: 11186795 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 83D5E1668 for ; Sat, 12 Oct 2019 14:38:01 +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 5F0CE2089C for ; Sat, 12 Oct 2019 14:38:01 +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="LNrU3iTV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F0CE2089C 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 1iJIVS-0000Xa-VR; Sat, 12 Oct 2019 14:36:30 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iJIVR-0000XV-Fw for xen-devel@lists.xenproject.org; Sat, 12 Oct 2019 14:36:29 +0000 X-Inumbo-ID: ad1dfc1c-ecfd-11e9-beca-bc764e2007e4 Received: from new1-smtp.messagingengine.com (unknown [66.111.4.221]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ad1dfc1c-ecfd-11e9-beca-bc764e2007e4; Sat, 12 Oct 2019 14:36:28 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 68E423FB6; Sat, 12 Oct 2019 10:36:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sat, 12 Oct 2019 10:36:28 -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=ppxNNE GgwsM7Pwhg0lijPhQNrvYvzN6ANI55hWP5aeE=; b=LNrU3iTVCnTgjOZxmSZZH0 mgbmlpCLFRjjZ6aoRbv0n+cN9m+BHOzdBqu4KnLhOA7FBxkXoF0yLdqIMt2vpEla kRryvWqr+a8p60WO2uYGti8jfmCyRMApy+71rXMoTmMDGwGCJcVHzt98WZNc85I6 rbSIfq7Of7pPBVyHhJF48bUkJydl5XkzMqZawNvmP0XYKAisI/x2sOe0aFOfMpHU L9r0WWFPLuK7Cnte0/6T7oWklfThDY808oTH+uEoJj79ae+hjLvfxolHpDnoEa24 jtYeOmjOsPuuCezUzOm/qrCt4dBUPqwlm4AxeKUWQiUiDDJhbBFv7OrHWrsrTuLQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrieejgdejlecutefuodetggdotefrodftvf 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 98EF6D6005F; Sat, 12 Oct 2019 10:36:25 -0400 (EDT) From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Sat, 12 Oct 2019 16:36:07 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 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 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