Skip to contentSkip to conversation

x86/hvm: separate ioreq server code from generic hvm code

PATCH Superseded Paul Durrant 3 participants 4 messages Mar 31, 2016 – Apr 1, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/hvm: separate ioreq server code from generic hvm code

The code in hvm/hvm.c related to handling I/O emulation using the ioreq server framework is large and mostly self-contained.

This patch separates the ioreq server code into a new hvm/ioreq.c source module and accompanying asm-x86/hvm/ioreq.h header file. There is no intended functional change, only code movement.

Cc Keir Fraser <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Andrew Cooper <[email protected]>
Cc Jun Nakajima <[email protected]>
Cc Kevin Tian <[email protected]>
---
 xen/arch/x86/hvm/Makefile       |    1 +
 xen/arch/x86/hvm/emulate.c      |    1 +
 xen/arch/x86/hvm/hvm.c          | 1461 ++-------------------------------------
 xen/arch/x86/hvm/io.c           |    1 +
 xen/arch/x86/hvm/ioreq.c        | 1375 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/hvm/stdvga.c       |    1 +
 xen/arch/x86/hvm/vmx/vvmx.c     |    1 +
 xen/include/asm-x86/hvm/hvm.h   |    7 -
 xen/include/asm-x86/hvm/ioreq.h |   67 ++
 9 files changed, 1522 insertions(+), 1393 deletions(-)
 create mode 100644 xen/arch/x86/hvm/ioreq.c
 create mode 100644 xen/include/asm-x86/hvm/ioreq.h
xen/arch/x86/hvm/Makefile +1 -0
index 794e793..8bc55a9 100644
@@ -9,6 +9,7 @@ obj-y += hvm.o
 obj-y += i8254.o
 obj-y += intercept.o
 obj-y += io.o
+obj-y += ioreq.o
 obj-y += irq.o
 obj-y += mtrr.o
 obj-y += nestedhvm.o
xen/arch/x86/hvm/emulate.c +1 -0
index ddc8007..4063c6a 100644
@@ -19,6 +19,7 @@
 #include <asm/xstate.h>
 #include <asm/hvm/emulate.h>
 #include <asm/hvm/hvm.h>
+#include <asm/hvm/ioreq.h>
 #include <asm/hvm/trace.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/svm/svm.h>
xen/arch/x86/hvm/hvm.c +75 -1386

1,520 lines not on this page · raw message

xen/arch/x86/hvm/io.c +1 -0
index fee812a..b27ffa1 100644
@@ -35,6 +35,7 @@
 #include <asm/shadow.h>
 #include <asm/p2m.h>
 #include <asm/hvm/hvm.h>
+#include <asm/hvm/ioreq.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vpt.h>
 #include <asm/hvm/vpic.h>
xen/arch/x86/hvm/ioreq.c new file +1375 -0

1,375 lines not on this page · raw message

xen/arch/x86/hvm/stdvga.c +1 -0
index bd23b52..47bb8fd 100644
@@ -31,6 +31,7 @@
 #include <xen/types.h>
 #include <xen/sched.h>
 #include <xen/domain_page.h>
+#include <asm/hvm/ioreq.h>
 #include <asm/hvm/support.h>
 #include <xen/numa.h>
 #include <xen/paging.h>
xen/arch/x86/hvm/vmx/vvmx.c +1 -0
index d88e172..35f3687 100644
@@ -23,6 +23,7 @@
 #include <asm/types.h>
 #include <asm/mtrr.h>
 #include <asm/p2m.h>
+#include <asm/hvm/ioreq.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vvmx.h>
 #include <asm/hvm/nestedhvm.h>
xen/include/asm-x86/hvm/hvm.h +0 -7
index 751ab1c..7b7ff3f 100644
@@ -25,7 +25,6 @@
 #include <asm/hvm/asid.h>
 #include <public/domctl.h>
 #include <public/hvm/save.h>
-#include <public/hvm/ioreq.h>
 #include <xen/mm.h>
 
 #ifndef NDEBUG
@@ -257,11 +256,6 @@ int hvm_vcpu_cacheattr_init(struct vcpu *v);
 void hvm_vcpu_cacheattr_destroy(struct vcpu *v);
 void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip);
 
-struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
-                                                 ioreq_t *p);
-int hvm_send_ioreq(struct hvm_ioreq_server *s, ioreq_t *p, bool_t buffered);
-unsigned int hvm_broadcast_ioreq(ioreq_t *p, bool_t buffered);
-
 void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat);
 int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat);
 
@@ -411,7 +405,6 @@ void hvm_hypervisor_cpuid_leaf(uint32_t sub_idx,
 void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
                                    unsigned int *ecx, unsigned int *edx);
 void hvm_migrate_timers(struct vcpu *v);
-bool_t hvm_io_pending(struct vcpu *v);
 void hvm_do_resume(struct vcpu *v);
 void hvm_migrate_pirqs(struct vcpu *v);
 
xen/include/asm-x86/hvm/ioreq.h new file +67 -0

45 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 8 lines · Paul Durrant

The code in hvm/hvm.c related to handling I/O emulation using the ioreq server framework is large and mostly self-contained.

This patch separates the ioreq server code into a new hvm/ioreq.c source module and accompanying asm-x86/hvm/ioreq.h header file. There is no intended functional change, only code movement.

FWIW I approve of this change. diff unfortunately chose to see blank lines as code that was being merged, so I can't give a proper reviewed-by. But I do have one minor comment...

xen/include/asm-x86/hvm/ioreq.h line 5

Quoted 11 lines
xen/include/asm-x86/hvm/ioreq.h new file +5 -0
new file mode 100644
index 0000000..54b521f
@@ -0,0 +1,67 @@
+/*
+ * hvm.h: Hardware virtual machine assist interface definitions.
+ *
+ * Leendert van Doorn, [email protected]
+ * Copyright (c) 2005, International Business Machines Corporation.

Copy and paste error here.

-George

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 27 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of George Dunlap
Sent: 31 March 2016 17:53
To: Paul Durrant
Cc: xen-devel; Kevin Tian; Keir (Xen.org); Jan Beulich; Andrew Cooper; Jun Nakajima
Subject: Re: [Xen-devel] [PATCH] x86/hvm: separate ioreq server code from generic hvm code

Quoted 8 lines · Paul Durrant

The code in hvm/hvm.c related to handling I/O emulation using the ioreq server framework is large and mostly self-contained.

This patch separates the ioreq server code into a new hvm/ioreq.c source module and accompanying asm-x86/hvm/ioreq.h header file. There is no intended functional change, only code movement.

FWIW I approve of this change. diff unfortunately chose to see blank lines as code that was being merged, so I can't give a proper reviewed-by. But I do have one minor comment...

xen/include/asm-

Quoted 1 line
xen/include/asm- renamed from xen/include/asm-x86/hvm/ioreq.h +0 -0

x86/hvm/ioreq.h

Quoted 12 lines

xen/include/asm-x86/hvm/ioreq.h line 5

Quoted 10 lines

new file mode 100644
index 0000000..54b521f

xen/include/asm-x86/hvm/ioreq.h new file +5 -0
@@ -0,0 +1,67 @@
+/*
+ * hvm.h: Hardware virtual machine assist interface definitions.
+ *
+ * Leendert van Doorn, [email protected]
+ * Copyright (c) 2005, International Business Machines Corporation.

Copy and paste error here.

Damn. That does need to be fixed. I'll post v2.

Paul

Quoted 2 lines

-George

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v1 1/1
#3 lore raw
In reply to Paul Durrant
Quoted 10 lines

From: Paul Durrant [mailto:[email protected]]
Sent: Thursday, March 31, 2016 6:21 PM

The code in hvm/hvm.c related to handling I/O emulation using the ioreq server framework is large and mostly self-contained.

This patch separates the ioreq server code into a new hvm/ioreq.c source module and accompanying asm-x86/hvm/ioreq.h header file. There is no intended functional change, only code movement.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel