[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v3 06/14] AMD/IOMMU: pass IOMMU to amd_iommu_alloc_intremap_table()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Tue, 16 Jul 2019 16:37:26 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=74tPzzI88SGeLujMDy+MkuBhcruVjVhC7jmG06u5pj0=; b=LiIBUcr5Qz5z579NQIV06osFySQBCm5Sfemkyy5wiVF9KVGgFwKyA5q99ZL4njXN1dmOJjVZrTaP0o/Rsja7X0+/dUaNhFVY7EsmpF7hcFWLLRATXokcgSE6PzzwPFaV4W518+flPzJ2wux7/IEMykTrWgAzUML4ZWJ7KLmKMu+YcIu8jxbtTTGl7woFXhZmKDYQW1jpJdUBceFtvY/21u/+ygypu5O2KCgtWJO1A07uz8o5SJLTawIemYAKqYBA33LsZRzvVCqZUYPBGtKMEoucbl74uIEzpYPcbhAkubyg1OUxaktSfn/mx8mXsp6aH75l5wVEZqItbDWYFh3L0A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AnEDs38BXRfIOf5GfJ2wM48jTVUasEWpKTc0WRHw0HAheReGm/mfnhZhusydu9Tt531WXnn8cZR/Tr3O5nPgClE7iNjc3wIedJ2PY9PBGawt30Z6DJZe3KHBmACJAlumh9o7n6uyJ8N46Q/rlkuSXiAoaaqCu6PbTC7tBK8Sr40/aBzPVLfyvnVZBF/esK+2Lpvf2xCVBoRLdykCwKVq0whHtwLKinttDgOBiRwPKZ4wJnuuvmw0lFa+Ab1i3ypVPAFw+2/tQ25FomAvIsSZ/e3Vl59BjBIN1UUWzR8od1BLNGC21GvstLbrXb41NyWv+kojJ/EG2FNWpHrqkno35A==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Brian Woods <brian.woods@xxxxxxx>, Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
  • Delivery-date: Tue, 16 Jul 2019 16:40:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVO/TAIRl5Ah5EYkaFnnBT6ODwsg==
  • Thread-topic: [PATCH v3 06/14] AMD/IOMMU: pass IOMMU to amd_iommu_alloc_intremap_table()

The function will want to know IOMMU properties (specifically the IRTE
size) subsequently.

Correct indentation of one of the call sites at this occasion.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v3: New.

--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -74,12 +74,14 @@ static void __init add_ivrs_mapping_entr
           /* allocate per-device interrupt remapping table */
           if ( amd_iommu_perdev_intremap )
               ivrs_mappings[alias_id].intremap_table =
-                amd_iommu_alloc_intremap_table(
-                    &ivrs_mappings[alias_id].intremap_inuse);
+                 amd_iommu_alloc_intremap_table(
+                     iommu,
+                     &ivrs_mappings[alias_id].intremap_inuse);
           else
           {
               if ( shared_intremap_table == NULL  )
                   shared_intremap_table = amd_iommu_alloc_intremap_table(
+                     iommu,
                       &shared_intremap_inuse);
               ivrs_mappings[alias_id].intremap_table = shared_intremap_table;
               ivrs_mappings[alias_id].intremap_inuse = shared_intremap_inuse;
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -632,7 +632,8 @@ int __init amd_iommu_free_intremap_table
      return 0;
  }
  
-void* __init amd_iommu_alloc_intremap_table(unsigned long **inuse_map)
+void *__init amd_iommu_alloc_intremap_table(
+    const struct amd_iommu *iommu, unsigned long **inuse_map)
  {
      void *tb;
      tb = __alloc_amd_iommu_tables(INTREMAP_TABLE_ORDER);
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
@@ -97,7 +97,8 @@ struct amd_iommu *find_iommu_for_device(
  
  /* interrupt remapping */
  int amd_iommu_setup_ioapic_remapping(void);
-void *amd_iommu_alloc_intremap_table(unsigned long **);
+void *amd_iommu_alloc_intremap_table(
+    const struct amd_iommu *, unsigned long **);
  int amd_iommu_free_intremap_table(
      const struct amd_iommu *, struct ivrs_mappings *);
  void amd_iommu_ioapic_update_ire(

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.