From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 535DCC433FE for ; Mon, 3 Oct 2022 16:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229549AbiJCQEp (ORCPT ); Mon, 3 Oct 2022 12:04:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbiJCQEo (ORCPT ); Mon, 3 Oct 2022 12:04:44 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 175AD9FC5 for ; Mon, 3 Oct 2022 09:04:43 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id BFEF832008FB; Mon, 3 Oct 2022 12:04:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 03 Oct 2022 12:04:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1664813081; x= 1664899481; bh=hPHwu5Dbn/ufBf96HVOzRpEY5YT9lHBBtz4R/zB3JH8=; b=t lotJ1zD+SzDDJvsFW7ghMNYgZ4CEmu23sc2KgNYLTNlLMsw4Db3OCcEyT33xC2xr uZvr2ulFndsbgLg+6Re7cbt2YpXH7rTb7hJ+wSI+m4xscvGtVxHlup+Tonh9jTfF K5OIQlErLv0NVqpEDo4/ZWBLjX0MAr55AbAsSF5HooxjMujEMwqkc8oyF/kWCHYX jd1VHiexqI6b1lxbyI7ZfUsrve0o0L87zzVhsMAegdrrMPkJlY3QYMKSmG9TNwLz tJJ4upkj78k7ts3D7lrmW9hmlbmeaTHE9ZBHHlulTAUoaHywsrnfVeNxLKv2jCLN iV3yoQUdrTlngFf9c8x4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1664813081; x=1664899481; bh=hPHwu5Dbn/ufBf96HVOzRpEY5YT9 lHBBtz4R/zB3JH8=; b=l7io6zaJc401brzklTjwNQBd/t4lXo/EqDyQErWN7u7n VNAX4sATa4xynnul+l5jBbmCmohQUSF4U8s4Wv4jfUDebu9+MTVj08NMrl+mcZ53 BBzX40nIAZ0VFaiSp7fjU4KJrxzgKtEESda7EhHzPDXRs+AF/pliPfp7VxzB0wsb X8IJAwJDsS6zYRGYcE/PqAZCMh4LA6rFd2geyYF7uS+SHYM/CG+7LWuTGCUHoElz Tc4K0t97YzeaoXrLNtMQFitpGcNRiGwFTd1/cMPRl1RUu1QHVRH4+JKDvGiZGlS0 tOUxk3A5i2Xda2Qh4Y6X5tfkpfQIdbauMnuWi7DXjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeehledgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofgrrhgv khcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghksehinh hvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepgfdu leetfeevhfefheeiteeliefhjefhleduveetteekveettddvgeeuteefjedunecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghk sehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Feedback-ID: i1568416f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Oct 2022 12:04:38 -0400 (EDT) Date: Mon, 3 Oct 2022 18:04:32 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Ard Biesheuvel Cc: Demi Marie Obenour , linux-efi@vger.kernel.org, Xen developer discussion , Peter Jones , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck Subject: Re: [PATCH v2 5/6] efi: xen: Implement memory descriptor lookup based on hypercall Message-ID: References: <20221003112625.972646-1-ardb@kernel.org> <20221003112625.972646-6-ardb@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9ODiTydC+G+MHh2u" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org --9ODiTydC+G+MHh2u Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Mon, 3 Oct 2022 18:04:32 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Ard Biesheuvel Cc: Demi Marie Obenour , linux-efi@vger.kernel.org, Xen developer discussion , Peter Jones , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck Subject: Re: [PATCH v2 5/6] efi: xen: Implement memory descriptor lookup based on hypercall On Mon, Oct 03, 2022 at 05:59:52PM +0200, Ard Biesheuvel wrote: > On Mon, 3 Oct 2022 at 17:29, Demi Marie Obenour > wrote: > > > > On Mon, Oct 03, 2022 at 01:26:24PM +0200, Ard Biesheuvel wrote: > > > + out_md->phys_addr =3D info->mem.addr; > > > > This will be equal to phys_addr, not the actual start of the memory > > region. > > > > > + out_md->num_pages =3D info->mem.size >> EFI_PAGE_SHIFT; > > > > Similarly, this will be the number of bytes in the memory region > > after phys_addr, not the total number of bytes in the region. These two > > differences mean that this function is not strictly equivalent to the > > original efi_mem_desc_lookup(). > > > > I am not sure if this matters in practice, but I thought you would want > > to be aware of it. >=20 > This is a bit disappointing. Is there no way to obtain this > information via a Xen hypercall? I don't think so, unfortunately. That said, with the below adjustment, I think that's okay for the _current_ users of efi_mem_desc_lookup(). > In any case, it means we'll need to round down phys_addr to page size > at the very least. --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --9ODiTydC+G+MHh2u Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmM7CBEACgkQ24/THMrX 1yzd3gf+Mr3VN3b4/zRc61OLrM64hiVHAtOrHmidG80iN1l5JGVhjO/5i4H/8ZFT GnfuEXC9vtCuwsJa3k2tKAlUPFxvIFQskN7aZvgVRexgB05zNB3MexEh5AwEbi6U vjt8AZKFjuvnouYe/2hLXLb5taMyRk2h9jnVn/FkcYeGgcC7/76fsdi53bfjtYmP GeBCzMfR9YxmhJvRK2JAjlftrb9wJSqO4weQaormHre3nxi5Hep2752BOcFCBcXK 3Kct9AKRO/ozPfRzUtkUHt2bzA9HUAqLqKPvmXGmLV4jFyiwFd3onAlnCdeTonz2 xGdDfEFEyhzlTlMTu0TwHV1yvH0+LQ== =9EcE -----END PGP SIGNATURE----- --9ODiTydC+G+MHh2u--