All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: hap_enabled() is HVM-only
@ 2018-09-27 15:30 Jan Beulich
  2018-09-27 15:32 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2018-09-27 15:30 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper

There at least two cases where the field so far got accessed for PV
guests as well: One is in iommu_construct(), via iommu_use_hap_pt(),
and the other is
arch_domain_create()
-> paging_domain_init()
   -> p2m_init()
      -> p2m_init_hostp2m()
         -> p2m_init_one()
            -> p2m_initialise()
It just so happens that the field currently lives in struct hvm_domain
at an offset larger than sizeof(struct pv_domain).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -195,7 +195,7 @@ struct hvm_domain {
 };
 
 #ifdef CONFIG_HVM
-#define hap_enabled(d)  ((d)->arch.hvm.hap_enabled)
+#define hap_enabled(d)  (is_hvm_domain(d) && (d)->arch.hvm.hap_enabled)
 #else
 #define hap_enabled(d)  ({(void)(d); false;})
 #endif



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

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

* Re: [PATCH] x86: hap_enabled() is HVM-only
  2018-09-27 15:30 [PATCH] x86: hap_enabled() is HVM-only Jan Beulich
@ 2018-09-27 15:32 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2018-09-27 15:32 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

On 27/09/18 16:30, Jan Beulich wrote:
> There at least two cases where the field so far got accessed for PV
> guests as well: One is in iommu_construct(), via iommu_use_hap_pt(),
> and the other is
> arch_domain_create()
> -> paging_domain_init()
>    -> p2m_init()
>       -> p2m_init_hostp2m()
>          -> p2m_init_one()
>             -> p2m_initialise()
> It just so happens that the field currently lives in struct hvm_domain
> at an offset larger than sizeof(struct pv_domain).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

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

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

end of thread, other threads:[~2018-09-27 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27 15:30 [PATCH] x86: hap_enabled() is HVM-only Jan Beulich
2018-09-27 15:32 ` Andrew Cooper

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.