1 commit 3a148e0a7ee0ae56a498be5ba973314ec50cd999
2 Author: Mukesh Rathor <mukesh.rathor@oracle.com>
3 Date: Fri Apr 4 10:36:29 2014 +0200
5 x86: call pit_init for pvh also
7 During halt of a pvh guest, the guest may do speaker shutdown. This
8 results in call to handle_speaker_io in xen. It will hang on the vpit
9 spin lock because it has not been initialized.
10 Since, pit_init is also called for both pv and hvm, the call is
11 moved to a more generic place.
13 Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
14 Reviewed-by: Jan Beulich <jbeulich@suse.com>
15 master commit: c30c544b199f70eada597c7352cdcb44648f6dcd
16 master date: 2014-03-11 13:56:50 +0100
18 diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
19 index 6618ae6..bc073e5 100644
20 --- a/xen/arch/x86/domain.c
21 +++ b/xen/arch/x86/domain.c
22 @@ -422,10 +422,6 @@ int vcpu_initialise(struct vcpu *v)
24 /* PV guests by default have a 100Hz ticker. */
25 v->periodic_period = MILLISECS(10);
27 - /* PV guests get an emulated PIT too for video BIOSes to use. */
28 - if ( v->vcpu_id == 0 )
29 - pit_init(v, cpu_khz);
32 v->arch.schedule_tail = continue_nonidle_domain;
33 @@ -579,6 +575,9 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
34 tsc_set_info(d, TSC_MODE_DEFAULT, 0UL, 0, 0);
35 spin_lock_init(&d->arch.vtsc_lock);
37 + /* PV/PVH guests get an emulated PIT too for video BIOSes to use. */
38 + pit_init(d, cpu_khz);
43 @@ -1980,6 +1979,8 @@ int domain_relinquish_resources(struct domain *d)
49 if ( has_hvm_container_domain(d) )
50 hvm_domain_relinquish_resources(d);
52 diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
53 index 6150899..a666471 100644
54 --- a/xen/arch/x86/hvm/hvm.c
55 +++ b/xen/arch/x86/hvm/hvm.c
56 @@ -643,7 +643,6 @@ void hvm_domain_relinquish_resources(struct domain *d)
58 if ( d->vcpu != NULL && d->vcpu[0] != NULL )
64 @@ -1217,7 +1216,6 @@ int hvm_vcpu_initialise(struct vcpu *v)
65 if ( v->vcpu_id == 0 )
67 /* NB. All these really belong in hvm_domain_initialise(). */
68 - pit_init(v, cpu_khz);
72 diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c
73 index c0d6bc2..f7493b8 100644
74 --- a/xen/arch/x86/hvm/i8254.c
75 +++ b/xen/arch/x86/hvm/i8254.c
76 @@ -447,9 +447,8 @@ void pit_reset(struct domain *d)
77 spin_unlock(&pit->lock);
80 -void pit_init(struct vcpu *v, unsigned long cpu_khz)
81 +void pit_init(struct domain *d, unsigned long cpu_khz)
83 - struct domain *d = v->domain;
84 PITState *pit = domain_vpit(d);
86 spin_lock_init(&pit->lock);
87 diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
88 index 87c3a66..9f3ec8d 100644
89 --- a/xen/include/asm-x86/hvm/vpt.h
90 +++ b/xen/include/asm-x86/hvm/vpt.h
91 @@ -175,7 +175,7 @@ void destroy_periodic_time(struct periodic_time *pt);
92 int pv_pit_handler(int port, int data, int write);
93 void pit_reset(struct domain *d);
95 -void pit_init(struct vcpu *v, unsigned long cpu_khz);
96 +void pit_init(struct domain *d, unsigned long cpu_khz);
97 void pit_stop_channel0_irq(PITState * pit);
98 void pit_deinit(struct domain *d);
99 void rtc_init(struct domain *d);
101 commit b44b5d2fe0ae1546a14d0800e094535aa3359334
102 Author: Mukesh Rathor <mukesh.rathor@oracle.com>
103 Date: Fri Apr 4 10:37:57 2014 +0200
105 x86: fix pirq path for pvh
107 Just like hvm, pirq eoi shared page is not there for pvh. pvh should
108 not touch any pv_domain fields.
110 Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
111 master commit: bea8ee1a5ff2bbe04fcc6297db45fac178a5abc9
112 master date: 2014-03-13 14:24:19 +0100
114 diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
115 index db70077..88444be 100644
116 --- a/xen/arch/x86/irq.c
117 +++ b/xen/arch/x86/irq.c
118 @@ -1068,13 +1068,13 @@ bool_t cpu_has_pending_apic_eoi(void)
120 static inline void set_pirq_eoi(struct domain *d, unsigned int irq)
122 - if ( !is_hvm_domain(d) && d->arch.pv_domain.pirq_eoi_map )
123 + if ( is_pv_domain(d) && d->arch.pv_domain.pirq_eoi_map )
124 set_bit(irq, d->arch.pv_domain.pirq_eoi_map);
127 static inline void clear_pirq_eoi(struct domain *d, unsigned int irq)
129 - if ( !is_hvm_domain(d) && d->arch.pv_domain.pirq_eoi_map )
130 + if ( is_pv_domain(d) && d->arch.pv_domain.pirq_eoi_map )
131 clear_bit(irq, d->arch.pv_domain.pirq_eoi_map);
135 commit 1e83fa5ee8064cc81e25f2a04cd47aeb5104413c
136 Author: Mukesh Rathor <mukesh.rathor@oracle.com>
137 Date: Fri Apr 4 10:38:52 2014 +0200
139 x86/pvh: disallow PHYSDEVOP_pirq_eoi_gmfn_v2/v1
141 A call to do_physdev_op with PHYSDEVOP_pirq_eoi_gmfn_v2/v1 will corrupt
142 struct hvm_domain when it writes to domain->arch.pv_domain.pirq_eoi_map.
143 Disallow that. Currently, such a path exists for linux dom0 pvh.
145 Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
146 master commit: a7ca5c402e8cf61c5e8dd6e6797a627863f5a243
147 master date: 2014-03-24 09:47:59 +0100
149 diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
150 index a666471..4228cf4 100644
151 --- a/xen/arch/x86/hvm/hvm.c
152 +++ b/xen/arch/x86/hvm/hvm.c
153 @@ -3292,6 +3292,12 @@ static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
154 case PHYSDEVOP_irq_status_query:
155 case PHYSDEVOP_get_free_pirq:
156 return do_physdev_op(cmd, arg);
158 + /* pvh fixme: coming soon */
159 + case PHYSDEVOP_pirq_eoi_gmfn_v1:
160 + case PHYSDEVOP_pirq_eoi_gmfn_v2: