[xen staging] x86: XENMEM_resource_ioreq_server is HVM only

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen staging] x86: XENMEM_resource_ioreq_server is HVM only

patchbot
commit 49136c3898fc71c4d9e9a8c93bb59b4c601b1eec
Author:     Wei Liu <[hidden email]>
AuthorDate: Thu Sep 6 16:18:31 2018 +0100
Commit:     Wei Liu <[hidden email]>
CommitDate: Thu Sep 6 16:54:38 2018 +0100

    x86: XENMEM_resource_ioreq_server is HVM only
   
    Put the entire case branch under CONFIG_HVM.
   
    Lift the check from hvm_get_ioreq_server_frame into its caller.
   
    Signed-off-by: Wei Liu <[hidden email]>
    Reviewed-by: Paul Durrant <[hidden email]>
    Reviewed-by: Jan Beulich <[hidden email]>
---
 xen/arch/x86/hvm/ioreq.c | 3 +--
 xen/arch/x86/mm.c        | 5 +++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c
index b3e1a3a36f..3569beaad5 100644
--- a/xen/arch/x86/hvm/ioreq.c
+++ b/xen/arch/x86/hvm/ioreq.c
@@ -898,8 +898,7 @@ int hvm_get_ioreq_server_frame(struct domain *d, ioservid_t id,
     struct hvm_ioreq_server *s;
     int rc;
 
-    if ( !is_hvm_domain(d) )
-        return -EINVAL;
+    ASSERT(is_hvm_domain(d));
 
     spin_lock_recursive(&d->arch.hvm.ioreq_server.lock);
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 409814ce0a..baea2f5e63 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4381,12 +4381,16 @@ int arch_acquire_resource(struct domain *d, unsigned int type,
 
     switch ( type )
     {
+#ifdef CONFIG_HVM
     case XENMEM_resource_ioreq_server:
     {
         ioservid_t ioservid = id;
         unsigned int i;
 
         rc = -EINVAL;
+        if ( !is_hvm_domain(d) )
+            break;
+
         if ( id != (unsigned int)ioservid )
             break;
 
@@ -4409,6 +4413,7 @@ int arch_acquire_resource(struct domain *d, unsigned int type,
         *flags |= XENMEM_rsrc_acq_caller_owned;
         break;
     }
+#endif
 
     default:
         rc = -EOPNOTSUPP;
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog