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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DB4D7C19F2A for ; Thu, 4 Aug 2022 14:38:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.380472.614635 (Exim 4.92) (envelope-from ) id 1oJbzU-00040D-UY; Thu, 04 Aug 2022 14:38:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 380472.614635; Thu, 04 Aug 2022 14:38:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oJbzU-000406-RO; Thu, 04 Aug 2022 14:38:24 +0000 Received: by outflank-mailman (input) for mailman id 380472; Thu, 04 Aug 2022 14:38:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oJbzT-0003zx-Ka for xen-devel@lists.xenproject.org; Thu, 04 Aug 2022 14:38:23 +0000 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 16f0ed50-1403-11ed-924f-1f966e50362f; Thu, 04 Aug 2022 16:38:22 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C045B5C0066; Thu, 4 Aug 2022 10:38:21 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 04 Aug 2022 10:38:21 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Aug 2022 10:38:20 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 16f0ed50-1403-11ed-924f-1f966e50362f 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=fm3; t=1659623901; x= 1659710301; bh=dA+hyGXTIok9ZxbAmCC9zKgn4+fCIrM/mBZELAbHZ9g=; b=a iUNN7+3jlWYnWg47+YAxYNLPqRuIzIwBby36VTJS9qQ9zsUYQYBgeZvUTxPVXwOJ FRINwagGkNUGdwcLIDTCK9RMjCkYvelZaCVzC09ANXGI52O2u/obapEpT25ke/dM kDlii848uS/N1NiiIN/bX8cI30GBKCiDuvPDlFh1FgS1Uu/cz5/VfoUmeTGDS1Zq 8ZN83o6QGLO1+g/772U8/fL69bWgJydSBlC6lVgBxhonZLg06vlO8y/PJOF1wFOo dGeynR58rFMpUSvxQNyNSBfKbKhh2kZIDS4vPRS85WyCs16/ANvBOZQ6PYILBJSF /TaRG+4FtgNQdkyU6QNmQ== 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= fm3; t=1659623901; x=1659710301; bh=dA+hyGXTIok9ZxbAmCC9zKgn4+fC IrM/mBZELAbHZ9g=; b=kfhuu/Os43w7cHdFcji8VNiSJYjcwXdMGN4FtBIyxl+B Z6yqRcCPJ1dhc10vdIR55u5FL9hMJajwOVtPrCHJDTeqXmiId/FmvK3DKp+um8bL 5l92rS2rFDdJ+Cuj2aqMdFQwV/++VRNIHHXAhwnPT3Pn3r1lExvo7+HWGN1Cz1Nz 4ZSiOS/F7ySdKOkUg8yyt7Pgqmj8SV7DyBVbE91PNQsErACbvg9/jZVkIzfN/MK5 xVw3jo8G8nm23yf8gJy3spdm2g9pj2wAmgMIotVG8SpYJauwSjA26Ebn+1dG1/1I psWcTluZoEF5nFhRMM4xQ7R7cu2q5YKGz3VAm4VEeg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddvledgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofgrrhgv khcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghksehinh hvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepgfdu leetfeevhfefheeiteeliefhjefhleduveetteekveettddvgeeuteefjedunecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghk sehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Feedback-ID: i1568416f:Fastmail Date: Thu, 4 Aug 2022 16:38:17 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Jan Beulich Cc: Paul Durrant , Roger Pau =?utf-8?B?TW9ubsOp?= , xen-devel@lists.xenproject.org Subject: Re: [PATCH v3 05/10] IOMMU: add common API for device reserved memory Message-ID: References: <6a99f9b99b419a20e895d54db2e345c80270248c.1658804819.git-series.marmarek@invisiblethingslab.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="obIwdAUoZzEWHPl2" Content-Disposition: inline In-Reply-To: --obIwdAUoZzEWHPl2 Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Thu, 4 Aug 2022 16:38:17 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Jan Beulich Cc: Paul Durrant , Roger Pau =?utf-8?B?TW9ubsOp?= , xen-devel@lists.xenproject.org Subject: Re: [PATCH v3 05/10] IOMMU: add common API for device reserved memory On Thu, Aug 04, 2022 at 04:25:38PM +0200, Jan Beulich wrote: > On 26.07.2022 05:23, Marek Marczykowski-G=C3=B3recki wrote: > > --- a/xen/drivers/passthrough/iommu.c > > +++ b/xen/drivers/passthrough/iommu.c > > @@ -651,6 +651,51 @@ bool_t iommu_has_feature(struct domain *d, enum io= mmu_feature feature) > > return is_iommu_enabled(d) && test_bit(feature, dom_iommu(d)->feat= ures); > > } > > =20 > > +#define MAX_EXTRA_RESERVED_RANGES 20 > > +struct extra_reserved_range { > > + unsigned long start; > > + unsigned long nr; > > + uint32_t sbdf; >=20 > It's not easy to judge why this isn't pci_sbdf_t when no callers > exist at this point. I'm following here types used in the rest of IOMMU code. Especially, this field is later passed to iommu_grdm_t func, which is: typedef int iommu_grdm_t(xen_pfn_t start, xen_ulong_t nr, u32 id, void *ctx= t); ^^^^ I can probably use pci_sbdf_t here, but it will be cast to u32 later anyway... > > +}; > > +static unsigned int __initdata nr_extra_reserved_ranges; > > +static struct extra_reserved_range __initdata > > + extra_reserved_ranges[MAX_EXTRA_RESERVED_RANGES]; >=20 > With __initdata here, ... >=20 > > +int iommu_add_extra_reserved_device_memory(unsigned long start, > > + unsigned long nr, > > + uint32_t sbdf) >=20 > ... this and the other function want to be __init. Ok. --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --obIwdAUoZzEWHPl2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmLr2dkACgkQ24/THMrX 1yyyUggAhE8UHt73HotcbffIMIcg+Ew1fmjKpmWMSkGy+hZCMtUatHt8YROEDLwk bqIKEP6GSa7/YGd7slftBbUmBzGxQ1nzyyWqRdenCWvgwabcJN7VmzD+TAf8kqxV NWY1LrhzPQ7PUPrB9Dow2MJxHwehC1oPQtnUNghqnRZ5VbeXLqd7im1yLBx00iIB UPmejU9jJeIKRpbFW+Bft1dk5+6CdI7CxXkJWspSleIdTqT3+g7Ifvy7Hdw+WL2q XO9St3FyQnQlk1RTsybYoneY8Q5Q9F6faRA/mlA1evAeXSg212YFZQ7g62/H8Zs1 jab1BDQkIvlXZJofYNVnXu8dWsIEKQ== =Jn/X -----END PGP SIGNATURE----- --obIwdAUoZzEWHPl2--