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

[Xen-changelog] [xen master] x86: hap_enabled() is HVM-only



commit 82f7659c9bd72e80c4734113f30907198326e39c
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Sep 28 17:13:38 2018 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Sep 28 17:13:38 2018 +0200

    x86: hap_enabled() is HVM-only
    
    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@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/include/asm-x86/hvm/domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 172d27ff49..80b2ab041e 100644
--- 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
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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