|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86: allow disabling the emulated PIC
commit afa14d87bdc7a1cb4ab3f77c54425a6cf6beab4e
Author: Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Tue Nov 10 12:06:09 2015 +0100
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Nov 10 12:06:09 2015 +0100
x86: allow disabling the emulated PIC
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/arch/x86/hvm/vpic.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 7c2edc8..6a2e87b 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -377,6 +377,9 @@ static int vpic_save(struct domain *d, hvm_domain_context_t
*h)
struct hvm_hw_vpic *s;
int i;
+ if ( !has_vpic(d) )
+ return 0;
+
/* Save the state of both PICs */
for ( i = 0; i < 2 ; i++ )
{
@@ -392,7 +395,10 @@ static int vpic_load(struct domain *d,
hvm_domain_context_t *h)
{
struct hvm_hw_vpic *s;
uint16_t inst;
-
+
+ if ( !has_vpic(d) )
+ return -ENODEV;
+
/* Which PIC is this? */
inst = hvm_load_instance(h);
if ( inst > 1 )
@@ -412,6 +418,9 @@ void vpic_reset(struct domain *d)
{
struct hvm_hw_vpic *vpic;
+ if ( !has_vpic(d) )
+ return;
+
/* Master PIC. */
vpic = &d->arch.hvm_domain.vpic[0];
memset(vpic, 0, sizeof(*vpic));
@@ -425,6 +434,9 @@ void vpic_reset(struct domain *d)
void vpic_init(struct domain *d)
{
+ if ( !has_vpic(d) )
+ return;
+
vpic_reset(d);
register_portio_handler(d, 0x20, 2, vpic_intercept_pic_io);
@@ -439,6 +451,7 @@ void vpic_irq_positive_edge(struct domain *d, int irq)
struct hvm_hw_vpic *vpic = &d->arch.hvm_domain.vpic[irq >> 3];
uint8_t mask = 1 << (irq & 7);
+ ASSERT(has_vpic(d));
ASSERT(irq <= 15);
ASSERT(vpic_is_locked(vpic));
@@ -456,6 +469,7 @@ void vpic_irq_negative_edge(struct domain *d, int irq)
struct hvm_hw_vpic *vpic = &d->arch.hvm_domain.vpic[irq >> 3];
uint8_t mask = 1 << (irq & 7);
+ ASSERT(has_vpic(d));
ASSERT(irq <= 15);
ASSERT(vpic_is_locked(vpic));
@@ -473,6 +487,8 @@ int vpic_ack_pending_irq(struct vcpu *v)
int irq, vector;
struct hvm_hw_vpic *vpic = &v->domain->arch.hvm_domain.vpic[0];
+ ASSERT(has_vpic(v->domain));
+
TRACE_2D(TRC_HVM_EMUL_PIC_PEND_IRQ_CALL, vlapic_accept_pic_intr(v),
vpic->int_output);
if ( !vlapic_accept_pic_intr(v) || !vpic->int_output )
--
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 |