All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 3/5] pvh: add rwmem_ranges to keep mapped special regions
@ 2015-02-13 18:52 Elena Ufimtseva
  2015-02-17 12:27 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Elena Ufimtseva @ 2015-02-13 18:52 UTC (permalink / raw)
  To: xen-devel
  Cc: kevin.tian, tim, jbeulich, yang.z.zhang, boris.ostrovsky, roger.pau

Patch adds rwmem_ranges in arch_hvm_iommu to keep specail regions
specified by dom0_iommu_rwmem boot option.
These special regions mapped with p2m_sys_rw type introduced
in the previous patch.

TODO:
- specify mapped flag in rwmem_range struct to indicte that actual mapping
  was successful;

Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
---
 xen/drivers/passthrough/x86/iommu.c |    1 +
 xen/include/asm-x86/hvm/iommu.h     |    2 ++
 xen/include/xen/iommu.h             |    5 +++++
 3 files changed, 8 insertions(+)

diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index 52d8948..2e266a7 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -118,6 +118,7 @@ int arch_iommu_domain_init(struct domain *d)
     spin_lock_init(&hd->arch.mapping_lock);
     INIT_LIST_HEAD(&hd->arch.g2m_ioport_list);
     INIT_LIST_HEAD(&hd->arch.mapped_rmrrs);
+    INIT_LIST_HEAD(&hd->arch.rwmem_ranges);
 
     return 0;
 }
diff --git a/xen/include/asm-x86/hvm/iommu.h b/xen/include/asm-x86/hvm/iommu.h
index 46cb126..3261b5c 100644
--- a/xen/include/asm-x86/hvm/iommu.h
+++ b/xen/include/asm-x86/hvm/iommu.h
@@ -2,6 +2,7 @@
 #define __ASM_X86_HVM_IOMMU_H__
 
 #include <xen/errno.h>
+#include <xen/iommu.h>
 
 struct iommu_ops;
 extern const struct iommu_ops intel_iommu_ops;
@@ -54,6 +55,7 @@ struct arch_hvm_iommu
     struct list_head g2m_ioport_list;   /* guest to machine ioport mapping */
     u64 iommu_bitmap;              /* bitmap of iommu(s) that the domain uses */
     struct list_head mapped_rmrrs;
+    struct list_head rwmem_ranges;
 
     /* amd iommu support */
     int paging_mode;
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 8eb764a..a5762e0 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -191,4 +191,9 @@ DECLARE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
 extern struct spinlock iommu_pt_cleanup_lock;
 extern struct page_list_head iommu_pt_cleanup_list;
 
+struct rwmem_range {
+    struct list_head list;
+    u64 start, end;
+};
+
 #endif /* _IOMMU_H_ */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RFC 3/5] pvh: add rwmem_ranges to keep mapped special regions
  2015-02-13 18:52 [PATCH RFC 3/5] pvh: add rwmem_ranges to keep mapped special regions Elena Ufimtseva
@ 2015-02-17 12:27 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2015-02-17 12:27 UTC (permalink / raw)
  To: Elena Ufimtseva
  Cc: kevin.tian, tim, xen-devel, yang.z.zhang, boris.ostrovsky, roger.pau

>>> On 13.02.15 at 19:52, <elena.ufimtseva@oracle.com> wrote:
> --- a/xen/include/asm-x86/hvm/iommu.h
> +++ b/xen/include/asm-x86/hvm/iommu.h
> @@ -2,6 +2,7 @@
>  #define __ASM_X86_HVM_IOMMU_H__
>  
>  #include <xen/errno.h>
> +#include <xen/iommu.h>

Why?

> --- a/xen/include/xen/iommu.h
> +++ b/xen/include/xen/iommu.h
> @@ -191,4 +191,9 @@ DECLARE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
>  extern struct spinlock iommu_pt_cleanup_lock;
>  extern struct page_list_head iommu_pt_cleanup_list;
>  
> +struct rwmem_range {
> +    struct list_head list;
> +    u64 start, end;
> +};

Without this being used anywhere you leave us to guess what the
fields are for. I think patches 2, 3, and at least 4 are unhelpful to
be split apart.

Jan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-17 12:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-13 18:52 [PATCH RFC 3/5] pvh: add rwmem_ranges to keep mapped special regions Elena Ufimtseva
2015-02-17 12:27 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.