aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/physdev.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-04-05 13:02:57 +0100
committerJan Beulich <jbeulich@novell.com>2011-04-05 13:02:57 +0100
commit1dd3a56b4338962b953545ed16f4de1d1a394189 (patch)
tree5af2df0c8c1ae58f372f88dac6f19ff1a41f2b29 /xen/arch/x86/physdev.c
parent6b063a4a6f44245a727aa04ef76408b2e00af9c7 (diff)
downloadxen-1dd3a56b4338962b953545ed16f4de1d1a394189.tar.gz
xen-1dd3a56b4338962b953545ed16f4de1d1a394189.tar.bz2
xen-1dd3a56b4338962b953545ed16f4de1d1a394189.zip
x86: split struct domain
This is accomplished by converting a couple of embedded arrays (in one case a structure containing an array) into separately allocated pointers, and (just as for struct arch_vcpu in a prior patch) overlaying some PV-only fields with HVM-only ones. One particularly noteworthy change in the opposite direction is that of PITState - this field so far lived in the HVM-only portion, but is being used by PV guests too, and hence needed to be moved out of struct hvm_domain. The change to XENMEM_set_memory_map (and hence libxl__build_pre() and the movement of the E820 related pieces to struct pv_domain) are subject to a positive response to a query sent to xen-devel regarding the need for this to happen for HVM guests (see http://lists.xensource.com/archives/html/xen-devel/2011-03/msg01848.html). The protection of arch.hvm_domain.irq.dpci accesses by is_hvm_domain() is subject to confirmation that the field is used for HVM guests only (see http://lists.xensource.com/archives/html/xen-devel/2011-03/msg02004.html). In the absence of any reply to these queries, and given the early state of 4.2 development, I think it should be acceptable to take the risk of having to later undo/redo some of this. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/physdev.c')
-rw-r--r--xen/arch/x86/physdev.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 8fdd4df37d..e15dd0a95d 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -264,7 +264,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
ret = -EINVAL;
if ( eoi.irq >= v->domain->nr_pirqs )
break;
- if ( v->domain->arch.pirq_eoi_map )
+ if ( !is_hvm_domain(v->domain) &&
+ v->domain->arch.pv_domain.pirq_eoi_map )
evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
if ( !is_hvm_domain(v->domain) ||
domain_pirq_to_emuirq(v->domain, eoi.irq) == IRQ_PT )
@@ -289,17 +290,18 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
PGT_writable_page) )
break;
- if ( cmpxchg(&v->domain->arch.pirq_eoi_map_mfn, 0, mfn) != 0 )
+ if ( cmpxchg(&v->domain->arch.pv_domain.pirq_eoi_map_mfn,
+ 0, mfn) != 0 )
{
put_page_and_type(mfn_to_page(mfn));
ret = -EBUSY;
break;
}
- v->domain->arch.pirq_eoi_map = map_domain_page_global(mfn);
- if ( v->domain->arch.pirq_eoi_map == NULL )
+ v->domain->arch.pv_domain.pirq_eoi_map = map_domain_page_global(mfn);
+ if ( v->domain->arch.pv_domain.pirq_eoi_map == NULL )
{
- v->domain->arch.pirq_eoi_map_mfn = 0;
+ v->domain->arch.pv_domain.pirq_eoi_map_mfn = 0;
put_page_and_type(mfn_to_page(mfn));
ret = -ENOSPC;
break;