|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86: allow disabling the emulated PIT
commit c55f69e5c4e490071075b3a8f53188d7ac25df26
Author: Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Tue Nov 10 12:06:28 2015 +0100
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Nov 10 12:06:28 2015 +0100
x86: allow disabling the emulated PIT
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Reported by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/arch/x86/hvm/i8254.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c
index 8a93c88..b517cd6 100644
--- a/xen/arch/x86/hvm/i8254.c
+++ b/xen/arch/x86/hvm/i8254.c
@@ -382,6 +382,9 @@ static uint32_t pit_ioport_read(struct PITState *pit,
uint32_t addr)
void pit_stop_channel0_irq(PITState *pit)
{
+ if ( !has_vpit(current->domain) )
+ return;
+
TRACE_0D(TRC_HVM_EMUL_PIT_STOP_TIMER);
spin_lock(&pit->lock);
destroy_periodic_time(&pit->pt0);
@@ -393,6 +396,9 @@ static int pit_save(struct domain *d, hvm_domain_context_t
*h)
PITState *pit = domain_vpit(d);
int rc;
+ if ( !has_vpit(d) )
+ return 0;
+
spin_lock(&pit->lock);
rc = hvm_save_entry(PIT, 0, h, &pit->hw);
@@ -407,6 +413,9 @@ static int pit_load(struct domain *d, hvm_domain_context_t
*h)
PITState *pit = domain_vpit(d);
int i;
+ if ( !has_vpit(d) )
+ return -ENODEV;
+
spin_lock(&pit->lock);
if ( hvm_load_entry(PIT, h, &pit->hw) )
@@ -437,6 +446,9 @@ void pit_reset(struct domain *d)
struct hvm_hw_pit_channel *s;
int i;
+ if ( !has_vpit(d) )
+ return;
+
TRACE_0D(TRC_HVM_EMUL_PIT_STOP_TIMER);
destroy_periodic_time(&pit->pt0);
pit->pt0.source = PTSRC_isa;
@@ -458,6 +470,9 @@ void pit_init(struct domain *d, unsigned long cpu_khz)
{
PITState *pit = domain_vpit(d);
+ if ( !has_vpit(d) )
+ return;
+
spin_lock_init(&pit->lock);
if ( is_hvm_domain(d) )
@@ -473,6 +488,9 @@ void pit_deinit(struct domain *d)
{
PITState *pit = domain_vpit(d);
+ if ( !has_vpit(d) )
+ return;
+
TRACE_0D(TRC_HVM_EMUL_PIT_STOP_TIMER);
destroy_periodic_time(&pit->pt0);
}
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |