From nobody Tue Feb 10 17:14:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1663383135334173.39252882877963; Fri, 16 Sep 2022 19:52:15 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.408202.650949 (Exim 4.92) (envelope-from ) id 1oZNvq-0003VM-MA; Sat, 17 Sep 2022 02:51:50 +0000 Received: by outflank-mailman (output) from mailman id 408202.650949; Sat, 17 Sep 2022 02:51:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oZNvq-0003UU-CP; Sat, 17 Sep 2022 02:51:50 +0000 Received: by outflank-mailman (input) for mailman id 408202; Sat, 17 Sep 2022 02:51:49 +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 1oZNvp-0002wS-71 for xen-devel@lists.xenproject.org; Sat, 17 Sep 2022 02:51:49 +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 abb65e3e-3633-11ed-9761-273f2230c3a0; Sat, 17 Sep 2022 04:51:47 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id DC6A45C00A9; Fri, 16 Sep 2022 22:51:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 16 Sep 2022 22:51:46 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 16 Sep 2022 22:51:45 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: abb65e3e-3633-11ed-9761-273f2230c3a0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :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=1663383106; x=1663469506; bh=/pD4K+B9L0 ba8VyhoGCQP8h4YWebGtRYWp1NDk3Q7sk=; b=itEbC7X1dp21xKuLNKJyo8Ai0w CJ9n5XfOAD85GITEj4vmv8VMnIBniOsGpsAL4KO64mvbNEpzEdD6WsSp3R4mLIVK D5VaNsG2eqjfLgDgXhaOWu5sU7upEDdaZANeecRs1ALGHbQprAdeKTOsQCqnvCqu wL4kO9FmGM9jhmUZ9KhZUIWGck+shy7RNc2+t6tfzHOmwfKudVnVY5bAPsa9LraX WUIIL9+AuFfOxPiarxjdLdxBXn0qYwltuq7g3Nf5ch/U/dQk40VD4oVDnOlRTr+l k0bsN58zDYLosOOFS7QoGIGlK8KPXh8mYsb47yvH+3Z9B4z4CXUAUGao7Wxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1663383106; x= 1663469506; bh=/pD4K+B9L0ba8VyhoGCQP8h4YWebGtRYWp1NDk3Q7sk=; b=c 9hkK3BV+CD1f2jOiqRsY+BY0mKGT1abbztFWy5uhlS0PYPsjkf2GvsWsN+AS7L5A ZdMdbJ5uayyTnNeJW5zWWdzFuUQe0/f2ay03nEBp7xsf2ok+XYJ7oKECulj4krgZ 9/N7t3yEGSsP8JziQpVLaA/mhdD21PkUTDZeby3CwJLfPteoRvDSyjM6FiPZ+bkl m0jWMjOgcTEQFlYGv4khM74k6TAjCtj84sNFPSMI5ju4n0U/kY6jPYkBclTJRYyz /iXzkFj9JgFfCyFiSe2sS5VNIyWidxhLxqaOU5jMdGmCXH7dORmUp9uk5TCaKvUZ 57gbJBgS2Q2fU7LnObAZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvuddgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghr vghkucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesih hnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefg ueduhefgvdefheehudejheefudevueeghfekhfehleegveduteeuiedugffgffenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgv khesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich , Andrew Cooper Subject: [PATCH v7 03/11] IOMMU/AMD: wire common device reserved memory API Date: Sat, 17 Sep 2022 04:51:22 +0200 Message-Id: <49615badb40907157c900996f185e169b7f3d611.1663383053.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1663383136605100006 Register common device reserved memory similar to how ivmd=3D parameter is handled. Signed-off-by: Marek Marczykowski-G=C3=B3recki Acked-by: Jan Beulich --- Changes in v3: - use variable initializer - use pfn_to_paddr() --- xen/drivers/passthrough/amd/iommu_acpi.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthr= ough/amd/iommu_acpi.c index ac6835225bae..3b577c9b390c 100644 --- a/xen/drivers/passthrough/amd/iommu_acpi.c +++ b/xen/drivers/passthrough/amd/iommu_acpi.c @@ -1078,6 +1078,25 @@ static inline bool_t is_ivmd_block(u8 type) type =3D=3D ACPI_IVRS_TYPE_MEMORY_IOMMU); } =20 +static int __init cf_check add_one_extra_ivmd(unsigned long start, + unsigned long nr, + uint32_t id, void *ctxt) +{ + struct acpi_ivrs_memory ivmd =3D { + .header =3D { + .length =3D sizeof(ivmd), + .flags =3D ACPI_IVMD_UNITY | ACPI_IVMD_READ | ACPI_IVMD_WRITE, + .device_id =3D id, + .type =3D ACPI_IVRS_TYPE_MEMORY_ONE, + }, + }; + + ivmd.start_address =3D pfn_to_paddr(start); + ivmd.memory_length =3D pfn_to_paddr(nr); + + return parse_ivmd_block(&ivmd); +} + static int __init cf_check parse_ivrs_table(struct acpi_table_header *tabl= e) { const struct acpi_ivrs_header *ivrs_block; @@ -1121,6 +1140,8 @@ static int __init cf_check parse_ivrs_table(struct ac= pi_table_header *table) AMD_IOMMU_DEBUG("IVMD: %u command line provided entries\n", nr_ivm= d); for ( i =3D 0; !error && i < nr_ivmd; ++i ) error =3D parse_ivmd_block(user_ivmds + i); + if ( !error ) + error =3D iommu_get_extra_reserved_device_memory(add_one_extra_ivm= d, NULL); =20 /* Each IO-APIC must have been mentioned in the table. */ for ( apic =3D 0; !error && iommu_intremap && apic < nr_ioapics; ++api= c ) --=20 git-series 0.9.1