From nobody Tue Feb 10 05:14:26 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1571888809; cv=none; d=zoho.com; s=zohoarc; b=fJhxvpGUm2dmcqUesmtyKks7fI4lnUs+JPuEBtvP1kBhRyG0bLfFapu+lnNH5C0q1JdtGuQRTrVOmlBugRvJFEJwKy+Lo5lBsBCWwTtfc+sGApAk/O2vrHGDyMnYNUcJ8V9qzqJ8l14t2gfqhMzyajVMzN/GkHV0uLGAml7VM7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571888809; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0ETz5UUHbVsRawbxaumVIYrZopLZfKxVwV5Og+NHJs4=; b=D3ZocT3Ze454g+okqsXAoFyQ5OA5oXgJpz1Il3Cu0rmhlQRzw/ghPWCYQ9cOzY2EBAiHmawtD9KD+aRrdpgRx8o0TjpCye61V0MHbLhyL5+SGzsYT7pwpp5a41jVSqSAbeogThygMgsjZuUg+3xlUWsxSxy2kk+MTRCVLOmJrzk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1571888809755707.9578092583773; Wed, 23 Oct 2019 20:46:49 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNU3y-0003g6-Os; Thu, 24 Oct 2019 03:45:26 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNU3x-0003fz-AT for xen-devel@lists.xenproject.org; Thu, 24 Oct 2019 03:45:25 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b0f7560a-f610-11e9-beca-bc764e2007e4; Thu, 24 Oct 2019 03:45:16 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 03D6221A4B; Wed, 23 Oct 2019 23:45:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 23 Oct 2019 23:45:16 -0400 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 21C9280064; Wed, 23 Oct 2019 23:45:15 -0400 (EDT) X-Inumbo-ID: b0f7560a-f610-11e9-beca-bc764e2007e4 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=AXNTUt0DwKKYunJg2u3lsSTDFRY/EEBhJ/qzUbLuo MA=; b=mBixlKnCFn8M12zmsrSYF4szjClVWh4uEMu7hzBd9EEx861oMV9oPceoW Z7HySF/TTe8HJsNA33L3g72idvL1WSbmT1Qyft2fz2jkgdeV3Ui/RZAK7cDD3iLU YnwPC9/UQAc+UtsU8sY/hMRIfJjcwoR4t78slvKMs+S02RZdf2b+5MxRZpS+MhfQ jmaAEPCTUgVPcdBzYTGltVC2iuI1FER3yyJCBcOuYsv1NKNHUiEecyqM/L45VVek TQbkUnSXX345Adtb9EoqON56BOMDWr8cxeMQx9oW/puDVDJwRryNigJ8D3hoHmd/ fgHmossEMJpGWy3dtlHVSiSDTo+gA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrledtgdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Thu, 24 Oct 2019 05:45:05 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 3/3] xen/efi: use directmap to access runtime services table 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 , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Do not require switching page tables to access (static) information in the runtime services table itself, use directmap for this. This allows exiting early from XEN_EFI_query_capsule_capabilities, XEN_EFI_update_capsule and XEN_EFI_query_variable_info (in case of not supported call) without all the impact of page table switch. Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jan Beulich --- New patch in v4. Can be applied independently of the other two. Specifically can be defered beyond 4.13. I'm also fine with dropping it, if adding directmap users is undesired. Cc: Juergen Gross --- xen/common/efi/boot.c | 1 + xen/common/efi/runtime.c | 19 ++++--------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 9debc5b..89b1c8a 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -1122,6 +1122,7 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHand= le, EFI_SYSTEM_TABLE *Syste =20 /* Adjust pointers into EFI. */ efi_ct =3D (void *)efi_ct + DIRECTMAP_VIRT_START; + efi_rs =3D (void *)efi_rs + DIRECTMAP_VIRT_START; efi_memmap =3D (void *)efi_memmap + DIRECTMAP_VIRT_START; efi_fw_vendor =3D (void *)efi_fw_vendor + DIRECTMAP_VIRT_START; } diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c index ab53ebc..22fd6c9 100644 --- a/xen/common/efi/runtime.c +++ b/xen/common/efi/runtime.c @@ -211,12 +211,7 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *i= nfo) break; case XEN_FW_EFI_RT_VERSION: { - struct efi_rs_state state =3D efi_rs_enter(); - - if ( !state.cr3 ) - return -EOPNOTSUPP; info->version =3D efi_rs->Hdr.Revision; - efi_rs_leave(&state); break; } case XEN_FW_EFI_CONFIG_TABLE: @@ -618,12 +613,11 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *o= p) break; } =20 + if ( (efi_rs->Hdr.Revision >> 16) < 2 ) + return -EOPNOTSUPP; state =3D efi_rs_enter(); - if ( !state.cr3 || (efi_rs->Hdr.Revision >> 16) < 2 ) - { - efi_rs_leave(&state); + if ( !state.cr3 ) return -EOPNOTSUPP; - } status =3D efi_rs->QueryVariableInfo( op->u.query_variable_info.attr, &op->u.query_variable_info.max_store_size, @@ -637,13 +631,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op) if ( op->misc ) return -EINVAL; =20 - state =3D efi_rs_enter(); - if ( !state.cr3 || (efi_rs->Hdr.Revision >> 16) < 2 ) - { - efi_rs_leave(&state); + if ( (efi_rs->Hdr.Revision >> 16) < 2 ) return -EOPNOTSUPP; - } - efi_rs_leave(&state); /* XXX fall through for now */ default: return -ENOSYS; --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel