From nobody Tue Feb 10 08:04:54 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 1657121603721918.3810016770129; Wed, 6 Jul 2022 08:33:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.362337.592392 (Exim 4.92) (envelope-from ) id 1o971U-0001YW-Ce; Wed, 06 Jul 2022 15:33:04 +0000 Received: by outflank-mailman (output) from mailman id 362337.592392; Wed, 06 Jul 2022 15:33:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o971U-0001YA-8Z; Wed, 06 Jul 2022 15:33:04 +0000 Received: by outflank-mailman (input) for mailman id 362337; Wed, 06 Jul 2022 15:33:02 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o971S-000854-48 for xen-devel@lists.xenproject.org; Wed, 06 Jul 2022 15:33:02 +0000 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id eb2c432a-fd40-11ec-bd2d-47488cf2e6aa; Wed, 06 Jul 2022 17:33:01 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 866095C0136; Wed, 6 Jul 2022 11:33:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 06 Jul 2022 11:33:00 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Jul 2022 11:32:59 -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: eb2c432a-fd40-11ec-bd2d-47488cf2e6aa 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=1657121580; x=1657207980; bh=A6IUb5PhcA I6HvRB0V+hA466Exyej9hEMYg/SSDCyCk=; b=giNnmr03OleSnwJ++SmNzG+uUj 8dD7FzdmjgL6RasPbWwx2xu8FR+i2dUcygeQYdNTW07eJrKH93fykc0tQv6kV89J PH54TA0cHlkfO0VYAeOpqOkFP+85JgzUY5Dfb5c/6lyB/FB43dpt9phtc7NabxfZ EwXqksbscPpcjN743r+8Mlue2qWELTz5Mq6/ICORGAeKee9ycgp7toAYmfmTYAYv 10xAZNKsTJqTsItteWEjL19hGTThWsjeNa75lFfCgUhg5RLMYyzJfywdUQKNTYeO i3Vu7SjFZe81SJ8xloGQ7ich8DwDMr1ulI2av4H9iGN4o3GcqwqpJlCvJQtw== 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=fm3; t=1657121580; x= 1657207980; bh=A6IUb5PhcAI6HvRB0V+hA466Exyej9hEMYg/SSDCyCk=; b=k dH3cTDdbnh8i9bmHzv3nUXSMx+X5/hrxJtrRxwWOMYqpUsDSDjv0PYag8iREk4lO MP/Mhw/4Xxmc5DmeIucyvQRyMHJEIUOJ9V2m7QvjZUgxN21B3LFREFTNN+KoIEo4 JoT2ozwE6sTgNQ9/3uofMaMT9TGjRxVV10eEX0Un7CvZQ9K8+41yjPvEgzUMVsGo SA9sOjhr3OmJp2MCjYQA6iugzKmfNRlghA7AMkEvNCIqkK9syzwCQ5jRtw5f2Q5+ SVsp3LZJqTm7xYKQQQS3wp9/If08pvWeWRUDVQWao7T8dhDrET9d+wd1HKKjFtsB linyVnuHSSePJaxqAsmng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeifedgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghr vghkucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesih hnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefg ueduhefgvdefheehudejheefudevueeghfekhfehleegveduteeuiedugffgffenucevlh hushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgv 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 v2 7/9] IOMMU/AMD: wire common device reserved memory API Date: Wed, 6 Jul 2022 17:32:12 +0200 Message-Id: <457056cbc6dcc00958b1f4e0cad35121e0cd1557.1657121519.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: 1657121605365100007 Register common device reserved memory similar to how ivmd=3D parameter is handled. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- xen/drivers/passthrough/amd/iommu_acpi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthr= ough/amd/iommu_acpi.c index ac6835225bae..2a4896c05442 100644 --- a/xen/drivers/passthrough/amd/iommu_acpi.c +++ b/xen/drivers/passthrough/amd/iommu_acpi.c @@ -1078,6 +1078,20 @@ 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(xen_pfn_t start, xen_ulong_t= nr, u32 id, void *ctxt) +{ + struct acpi_ivrs_memory ivmd; + + ivmd.start_address =3D start << PAGE_SHIFT; + ivmd.memory_length =3D nr << PAGE_SHIFT; + ivmd.header.flags =3D ACPI_IVMD_UNITY | + ACPI_IVMD_READ | ACPI_IVMD_WRITE; + ivmd.header.length =3D sizeof(ivmd); + ivmd.header.device_id =3D id; + ivmd.header.type =3D ACPI_IVRS_TYPE_MEMORY_ONE; + 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 +1135,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