[PATCH 0/4] Fix for LP:#1791286

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/4] Fix for LP:#1791286

Gavin Guo
BugLink: https://bugs.launchpad.net/bugs/1791286

[Impact]

After the VM(Guest OS is Windows Server 2012R2) has been live-migrated
serveral times, the screen is blackout or freeze when the VM is
connected via VNC.

The Windows Guest OS Server has been investigated that all of kernel
threads of Windows Server OS are waiting(idle state) for interrupt
request(IRQ) from hypervisor.

The following environment is tested:
* Host OS: Ubuntu 14.04(kernel 3.13.0-40.69)
* qemu-kvm_2.0.0+dfsg-2ubuntu1.22
* libvert-bin_1.2.2-0ubuntu13.1.5
* nova-compute_1:2014.2.3-0ubuntu1.2~cloud0
* GuestOS: Windows Server 2012R2
* virtio-win-0.1.126


[Fix]

The patch set is needed:

673f7b4257a1 KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
44847dea7975 KVM: ioapic: extract body of kvm_ioapic_set_irq
0bc830b05c66 KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
0b10a1c87a2b KVM: ioapic: merge ioapic_deliver into ioapic_service


[Test]

Prepare two machines with the same environment mentioned above and run
the following script.

#!/bin/bash
INSTANCE="test"

FROM="elite"
virsh -c qemu+ssh://ubuntu@${FROM}/system list| grep -q ${INSTANCE}
if [[ $? != 0 ]]; then
FROM="dixie";
TO="elite";
else
TO="dixie"
fi

echo "= Migrating ${INSTANCE} from ${FROM} to ${TO} ="
ssh ubuntu@${FROM} -- virsh migrate --live --domain ${INSTANCE}
--desturi qemu+ssh://ubuntu@${TO}/system


The VNC script I use to keep track of the VNC console is:

#!/bin/bash
INSTANCE="test"

while true; do
HOST="elite"
virsh -c qemu+ssh://ubuntu@${HOST}/system list| grep -q ${INSTANCE}
if [[ $? != 0 ]]; then HOST="dixie"; fi

virt-viewer -c qemu+ssh://ubuntu@${HOST}/system test
sleep 3
done


Paolo Bonzini (4):
  KVM: ioapic: merge ioapic_deliver into ioapic_service
  KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
  KVM: ioapic: extract body of kvm_ioapic_set_irq
  KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP

 virt/kvm/ioapic.c | 109 +++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 70 insertions(+), 39 deletions(-)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/4] KVM: ioapic: merge ioapic_deliver into ioapic_service

Gavin Guo
From: Paolo Bonzini <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1791286

Commonize the handling of masking, which was absent for kvm_ioapic_set_irq.
Setting remote_irr does not need a separate function either, and merging
the two functions avoids confusion.

Reviewed-by: Alex Williamson <[hidden email]>
Signed-off-by: Paolo Bonzini <[hidden email]>
(cherry picked from commit 0b10a1c87a2b0fb459baaefba9cb163dbb8d3344)
Signed-off-by: Gavin Guo <[hidden email]>
---
 virt/kvm/ioapic.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 5eaf18f90e83..3a0ccff16830 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -50,7 +50,7 @@
 #else
 #define ioapic_debug(fmt, arg...)
 #endif
-static int ioapic_deliver(struct kvm_ioapic *vioapic, int irq,
+static int ioapic_service(struct kvm_ioapic *vioapic, int irq,
  bool line_status);
 
 static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic,
@@ -163,23 +163,6 @@ static bool rtc_irq_check_coalesced(struct kvm_ioapic *ioapic)
  return false;
 }
 
-static int ioapic_service(struct kvm_ioapic *ioapic, unsigned int idx,
- bool line_status)
-{
- union kvm_ioapic_redirect_entry *pent;
- int injected = -1;
-
- pent = &ioapic->redirtbl[idx];
-
- if (!pent->fields.mask) {
- injected = ioapic_deliver(ioapic, idx, line_status);
- if (injected && pent->fields.trig_mode == IOAPIC_LEVEL_TRIG)
- pent->fields.remote_irr = 1;
- }
-
- return injected;
-}
-
 static void update_handled_vectors(struct kvm_ioapic *ioapic)
 {
  DECLARE_BITMAP(handled_vectors, 256);
@@ -281,12 +264,15 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
  }
 }
 
-static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq, bool line_status)
+static int ioapic_service(struct kvm_ioapic *ioapic, int irq, bool line_status)
 {
  union kvm_ioapic_redirect_entry *entry = &ioapic->redirtbl[irq];
  struct kvm_lapic_irq irqe;
  int ret;
 
+ if (entry->fields.mask)
+ return -1;
+
  ioapic_debug("dest=%x dest_mode=%x delivery_mode=%x "
      "vector=%x trig_mode=%x\n",
      entry->fields.dest_id, entry->fields.dest_mode,
@@ -309,6 +295,9 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq, bool line_status)
  } else
  ret = kvm_irq_delivery_to_apic(ioapic->kvm, NULL, &irqe, NULL);
 
+ if (ret && irqe.trig_mode == IOAPIC_LEVEL_TRIG)
+ entry->fields.remote_irr = 1;
+
  return ret;
 }
 
@@ -393,7 +382,7 @@ static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu,
 
  ASSERT(ent->fields.trig_mode == IOAPIC_LEVEL_TRIG);
  ent->fields.remote_irr = 0;
- if (!ent->fields.mask && (ioapic->irr & (1 << i)))
+ if (ioapic->irr & (1 << i))
  ioapic_service(ioapic, i, false);
  }
 }
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/4] KVM: ioapic: clear IRR for edge-triggered interrupts at delivery

Gavin Guo
In reply to this post by Gavin Guo
From: Paolo Bonzini <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1791286

This ensures that IRR bits are set in the KVM_GET_IRQCHIP result only if
the interrupt is still sitting in the IOAPIC.  After the next patches, it
avoids spurious reinjection of the interrupt when KVM_SET_IRQCHIP is
called.

Reviewed-by: Alex Williamson <[hidden email]>
Signed-off-by: Paolo Bonzini <[hidden email]>
(cherry picked from commit 0bc830b05c667218d703f2026ec866c49df974fc)
Signed-off-by: Gavin Guo <[hidden email]>
---
 virt/kvm/ioapic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 3a0ccff16830..1cc1851812fa 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -287,6 +287,9 @@ static int ioapic_service(struct kvm_ioapic *ioapic, int irq, bool line_status)
  irqe.level = 1;
  irqe.shorthand = 0;
 
+ if (irqe.trig_mode == IOAPIC_EDGE_TRIG)
+ ioapic->irr &= ~(1 << irq);
+
  if (irq == RTC_GSI && line_status) {
  BUG_ON(ioapic->rtc_status.pending_eoi != 0);
  ret = kvm_irq_delivery_to_apic(ioapic->kvm, NULL, &irqe,
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 3/4] KVM: ioapic: extract body of kvm_ioapic_set_irq

Gavin Guo
In reply to this post by Gavin Guo
From: Paolo Bonzini <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1791286

We will reuse it to process a nonzero IRR that is passed to KVM_SET_IRQCHIP.

Reviewed-by: Alex Williamson <[hidden email]>
Signed-off-by: Paolo Bonzini <[hidden email]>
(backported from commit 44847dea79751e95665a439f8c63a65e51da8e1f)
Signed-off-by: Gavin Guo <[hidden email]>
---
 virt/kvm/ioapic.c | 76 +++++++++++++++++++++++++++++++++++++------------------
 1 file changed, 51 insertions(+), 25 deletions(-)

diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 1cc1851812fa..6f6460a7c562 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -163,6 +163,56 @@ static bool rtc_irq_check_coalesced(struct kvm_ioapic *ioapic)
  return false;
 }
 
+static int ioapic_set_irq(struct kvm_ioapic *ioapic, unsigned int irq,
+ int irq_level, bool line_status)
+{
+ union kvm_ioapic_redirect_entry entry;
+ u32 mask = 1 << irq;
+ u32 old_irr;
+ int edge, ret;
+
+ entry = ioapic->redirtbl[irq];
+ irq_level ^= entry.fields.polarity;
+ edge = (entry.fields.trig_mode == IOAPIC_EDGE_TRIG);
+
+ if (!irq_level) {
+ ioapic->irr &= ~mask;
+ ret = 1;
+ goto out;
+ }
+
+ /*
+ * Return 0 for coalesced interrupts; for edge-triggered interrupts,
+ * this only happens if a previous edge has not been delivered due
+ * do masking.  For level interrupts, the remote_irr field tells
+ * us if the interrupt is waiting for an EOI.
+ *
+ * RTC is special: it is edge-triggered, but userspace likes to know
+ * if it has been already ack-ed via EOI because coalesced RTC
+ * interrupts lead to time drift in Windows guests.  So we track
+ * EOI manually for the RTC interrupt.
+ */
+ if (irq == RTC_GSI && line_status &&
+ rtc_irq_check_coalesced(ioapic)) {
+ ret = 0;
+ goto out;
+ }
+
+ old_irr = ioapic->irr;
+ ioapic->irr |= mask;
+ if ((edge && old_irr == ioapic->irr) ||
+    (!edge && entry.fields.remote_irr)) {
+ ret = 0;
+ goto out;
+ }
+
+ ret = ioapic_service(ioapic, irq, line_status);
+
+out:
+ trace_kvm_ioapic_set_irq(entry.bits, irq, ret == 0);
+ return ret;
+}
+
 static void update_handled_vectors(struct kvm_ioapic *ioapic)
 {
  DECLARE_BITMAP(handled_vectors, 256);
@@ -307,39 +357,15 @@ static int ioapic_service(struct kvm_ioapic *ioapic, int irq, bool line_status)
 int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int irq_source_id,
        int level, bool line_status)
 {
- u32 old_irr;
- u32 mask = 1 << irq;
- union kvm_ioapic_redirect_entry entry;
  int ret, irq_level;
 
  BUG_ON(irq < 0 || irq >= IOAPIC_NUM_PINS);
 
  spin_lock(&ioapic->lock);
- old_irr = ioapic->irr;
  irq_level = __kvm_irq_line_state(&ioapic->irq_states[irq],
  irq_source_id, level);
- entry = ioapic->redirtbl[irq];
- irq_level ^= entry.fields.polarity;
- if (!irq_level) {
- ioapic->irr &= ~mask;
- ret = 1;
- } else {
- int edge = (entry.fields.trig_mode == IOAPIC_EDGE_TRIG);
+ ret = ioapic_set_irq(ioapic, irq, irq_level, line_status);
 
- if (irq == RTC_GSI && line_status &&
- rtc_irq_check_coalesced(ioapic)) {
- ret = 0; /* coalesced */
- goto out;
- }
- ioapic->irr |= mask;
- if ((edge && old_irr != ioapic->irr) ||
-    (!edge && !entry.fields.remote_irr))
- ret = ioapic_service(ioapic, irq, line_status);
- else
- ret = 0; /* report coalesced interrupt */
- }
-out:
- trace_kvm_ioapic_set_irq(entry.bits, irq, ret == 0);
  spin_unlock(&ioapic->lock);
 
  return ret;
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 4/4] KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP

Gavin Guo
In reply to this post by Gavin Guo
From: Paolo Bonzini <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1791286

After the previous patches, an interrupt whose bit is set in the IRR
register will never be in the LAPIC's IRR and has never been injected
on the migration source.  So inject it on the destination.

This fixes migration of Windows guests without HPET (they use the RTC
to trigger the scheduler tick, and lose it after migration).

Reviewed-by: Alex Williamson <[hidden email]>
Signed-off-by: Paolo Bonzini <[hidden email]>
(cherry picked from commit 673f7b4257a1fe7b181e1a1182ecc2b6b2b795f1)
Signed-off-by: Gavin Guo <[hidden email]>
---
 virt/kvm/ioapic.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index 6f6460a7c562..05bdad6c6369 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -213,6 +213,18 @@ out:
  return ret;
 }
 
+static void kvm_ioapic_inject_all(struct kvm_ioapic *ioapic, unsigned long irr)
+{
+ u32 idx;
+
+ rtc_irq_eoi_tracking_reset(ioapic);
+ for_each_set_bit(idx, &irr, IOAPIC_NUM_PINS)
+ ioapic_set_irq(ioapic, idx, 1, true);
+
+ kvm_rtc_eoi_tracking_restore_all(ioapic);
+}
+
+
 static void update_handled_vectors(struct kvm_ioapic *ioapic)
 {
  DECLARE_BITMAP(handled_vectors, 256);
@@ -612,9 +624,10 @@ int kvm_set_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state)
 
  spin_lock(&ioapic->lock);
  memcpy(ioapic, state, sizeof(struct kvm_ioapic_state));
+ ioapic->irr = 0;
  update_handled_vectors(ioapic);
  kvm_vcpu_request_scan_ioapic(kvm);
- kvm_rtc_eoi_tracking_restore_all(ioapic);
+ kvm_ioapic_inject_all(ioapic, state->irr);
  spin_unlock(&ioapic->lock);
  return 0;
 }
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 0/4] Fix for LP:#1791286

Stefan Bader-2
In reply to this post by Gavin Guo
On 10.09.2018 16:23, Gavin Guo wrote:

> BugLink: https://bugs.launchpad.net/bugs/1791286
>
> [Impact]
>
> After the VM(Guest OS is Windows Server 2012R2) has been live-migrated
> serveral times, the screen is blackout or freeze when the VM is
> connected via VNC.
>
> The Windows Guest OS Server has been investigated that all of kernel
> threads of Windows Server OS are waiting(idle state) for interrupt
> request(IRQ) from hypervisor.
>
> The following environment is tested:
> * Host OS: Ubuntu 14.04(kernel 3.13.0-40.69)
> * qemu-kvm_2.0.0+dfsg-2ubuntu1.22
> * libvert-bin_1.2.2-0ubuntu13.1.5
> * nova-compute_1:2014.2.3-0ubuntu1.2~cloud0
> * GuestOS: Windows Server 2012R2
> * virtio-win-0.1.126
>
>
> [Fix]
>
> The patch set is needed:
>
> 673f7b4257a1 KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
> 44847dea7975 KVM: ioapic: extract body of kvm_ioapic_set_irq
> 0bc830b05c66 KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
> 0b10a1c87a2b KVM: ioapic: merge ioapic_deliver into ioapic_service
>
>
> [Test]
>
> Prepare two machines with the same environment mentioned above and run
> the following script.
>
> #!/bin/bash
> INSTANCE="test"
>
> FROM="elite"
> virsh -c qemu+ssh://ubuntu@${FROM}/system list| grep -q ${INSTANCE}
> if [[ $? != 0 ]]; then
> FROM="dixie";
> TO="elite";
> else
> TO="dixie"
> fi
>
> echo "= Migrating ${INSTANCE} from ${FROM} to ${TO} ="
> ssh ubuntu@${FROM} -- virsh migrate --live --domain ${INSTANCE}
> --desturi qemu+ssh://ubuntu@${TO}/system
>
>
> The VNC script I use to keep track of the VNC console is:
>
> #!/bin/bash
> INSTANCE="test"
>
> while true; do
> HOST="elite"
> virsh -c qemu+ssh://ubuntu@${HOST}/system list| grep -q ${INSTANCE}
> if [[ $? != 0 ]]; then HOST="dixie"; fi
>
> virt-viewer -c qemu+ssh://ubuntu@${HOST}/system test
> sleep 3
> done
>
>
> Paolo Bonzini (4):
>   KVM: ioapic: merge ioapic_deliver into ioapic_service
>   KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
>   KVM: ioapic: extract body of kvm_ioapic_set_irq
>   KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
>
>  virt/kvm/ioapic.c | 109 +++++++++++++++++++++++++++++++++++-------------------
>  1 file changed, 70 insertions(+), 39 deletions(-)
>
For what (release) is this? I don't want to hunt breadcrumbs following mailing
list submissions.

-Stefan


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 0/4] Fix for LP:#1791286

Gavin Guo
Sorry, my fault, it's Trusty. I forgot to add [Trusty][SRU].

On Wed, Sep 12, 2018 at 3:35 PM, Stefan Bader
<[hidden email]> wrote:

> On 10.09.2018 16:23, Gavin Guo wrote:
>> BugLink: https://bugs.launchpad.net/bugs/1791286
>>
>> [Impact]
>>
>> After the VM(Guest OS is Windows Server 2012R2) has been live-migrated
>> serveral times, the screen is blackout or freeze when the VM is
>> connected via VNC.
>>
>> The Windows Guest OS Server has been investigated that all of kernel
>> threads of Windows Server OS are waiting(idle state) for interrupt
>> request(IRQ) from hypervisor.
>>
>> The following environment is tested:
>> * Host OS: Ubuntu 14.04(kernel 3.13.0-40.69)
>> * qemu-kvm_2.0.0+dfsg-2ubuntu1.22
>> * libvert-bin_1.2.2-0ubuntu13.1.5
>> * nova-compute_1:2014.2.3-0ubuntu1.2~cloud0
>> * GuestOS: Windows Server 2012R2
>> * virtio-win-0.1.126
>>
>>
>> [Fix]
>>
>> The patch set is needed:
>>
>> 673f7b4257a1 KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
>> 44847dea7975 KVM: ioapic: extract body of kvm_ioapic_set_irq
>> 0bc830b05c66 KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
>> 0b10a1c87a2b KVM: ioapic: merge ioapic_deliver into ioapic_service
>>
>>
>> [Test]
>>
>> Prepare two machines with the same environment mentioned above and run
>> the following script.
>>
>> #!/bin/bash
>> INSTANCE="test"
>>
>> FROM="elite"
>> virsh -c qemu+ssh://ubuntu@${FROM}/system list| grep -q ${INSTANCE}
>> if [[ $? != 0 ]]; then
>> FROM="dixie";
>> TO="elite";
>> else
>> TO="dixie"
>> fi
>>
>> echo "= Migrating ${INSTANCE} from ${FROM} to ${TO} ="
>> ssh ubuntu@${FROM} -- virsh migrate --live --domain ${INSTANCE}
>> --desturi qemu+ssh://ubuntu@${TO}/system
>>
>>
>> The VNC script I use to keep track of the VNC console is:
>>
>> #!/bin/bash
>> INSTANCE="test"
>>
>> while true; do
>> HOST="elite"
>> virsh -c qemu+ssh://ubuntu@${HOST}/system list| grep -q ${INSTANCE}
>> if [[ $? != 0 ]]; then HOST="dixie"; fi
>>
>> virt-viewer -c qemu+ssh://ubuntu@${HOST}/system test
>> sleep 3
>> done
>>
>>
>> Paolo Bonzini (4):
>>   KVM: ioapic: merge ioapic_deliver into ioapic_service
>>   KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
>>   KVM: ioapic: extract body of kvm_ioapic_set_irq
>>   KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
>>
>>  virt/kvm/ioapic.c | 109 +++++++++++++++++++++++++++++++++++-------------------
>>  1 file changed, 70 insertions(+), 39 deletions(-)
>>
>
> For what (release) is this? I don't want to hunt breadcrumbs following mailing
> list submissions.
>
> -Stefan
>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK[Trusty]: [PATCH 0/4] Fix for LP:#1791286

Kleber Souza
In reply to this post by Gavin Guo
On 09/10/18 16:23, Gavin Guo wrote:

> BugLink: https://bugs.launchpad.net/bugs/1791286
>
> [Impact]
>
> After the VM(Guest OS is Windows Server 2012R2) has been live-migrated
> serveral times, the screen is blackout or freeze when the VM is
> connected via VNC.
>
> The Windows Guest OS Server has been investigated that all of kernel
> threads of Windows Server OS are waiting(idle state) for interrupt
> request(IRQ) from hypervisor.
>
> The following environment is tested:
> * Host OS: Ubuntu 14.04(kernel 3.13.0-40.69)
> * qemu-kvm_2.0.0+dfsg-2ubuntu1.22
> * libvert-bin_1.2.2-0ubuntu13.1.5
> * nova-compute_1:2014.2.3-0ubuntu1.2~cloud0
> * GuestOS: Windows Server 2012R2
> * virtio-win-0.1.126
>
>
> [Fix]
>
> The patch set is needed:
>
> 673f7b4257a1 KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
> 44847dea7975 KVM: ioapic: extract body of kvm_ioapic_set_irq
> 0bc830b05c66 KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
> 0b10a1c87a2b KVM: ioapic: merge ioapic_deliver into ioapic_service
>
>
> [Test]
>
> Prepare two machines with the same environment mentioned above and run
> the following script.
>
> #!/bin/bash
> INSTANCE="test"
>
> FROM="elite"
> virsh -c qemu+ssh://ubuntu@${FROM}/system list| grep -q ${INSTANCE}
> if [[ $? != 0 ]]; then
> FROM="dixie";
> TO="elite";
> else
> TO="dixie"
> fi
>
> echo "= Migrating ${INSTANCE} from ${FROM} to ${TO} ="
> ssh ubuntu@${FROM} -- virsh migrate --live --domain ${INSTANCE}
> --desturi qemu+ssh://ubuntu@${TO}/system
>
>
> The VNC script I use to keep track of the VNC console is:
>
> #!/bin/bash
> INSTANCE="test"
>
> while true; do
> HOST="elite"
> virsh -c qemu+ssh://ubuntu@${HOST}/system list| grep -q ${INSTANCE}
> if [[ $? != 0 ]]; then HOST="dixie"; fi
>
> virt-viewer -c qemu+ssh://ubuntu@${HOST}/system test
> sleep 3
> done
>
>
> Paolo Bonzini (4):
>   KVM: ioapic: merge ioapic_deliver into ioapic_service
>   KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
>   KVM: ioapic: extract body of kvm_ioapic_set_irq
>   KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
>
>  virt/kvm/ioapic.c | 109 +++++++++++++++++++++++++++++++++++-------------------
>  1 file changed, 70 insertions(+), 39 deletions(-)
>

All clean cherry-picks and tested.

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK[Trusty]: [PATCH 0/4] Fix for LP:#1791286

Stefan Bader-2
In reply to this post by Gavin Guo
On 10.09.2018 16:23, Gavin Guo wrote:

> BugLink: https://bugs.launchpad.net/bugs/1791286
>
> [Impact]
>
> After the VM(Guest OS is Windows Server 2012R2) has been live-migrated
> serveral times, the screen is blackout or freeze when the VM is
> connected via VNC.
>
> The Windows Guest OS Server has been investigated that all of kernel
> threads of Windows Server OS are waiting(idle state) for interrupt
> request(IRQ) from hypervisor.
>
> The following environment is tested:
> * Host OS: Ubuntu 14.04(kernel 3.13.0-40.69)
> * qemu-kvm_2.0.0+dfsg-2ubuntu1.22
> * libvert-bin_1.2.2-0ubuntu13.1.5
> * nova-compute_1:2014.2.3-0ubuntu1.2~cloud0
> * GuestOS: Windows Server 2012R2
> * virtio-win-0.1.126
>
>
> [Fix]
>
> The patch set is needed:
>
> 673f7b4257a1 KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
> 44847dea7975 KVM: ioapic: extract body of kvm_ioapic_set_irq
> 0bc830b05c66 KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
> 0b10a1c87a2b KVM: ioapic: merge ioapic_deliver into ioapic_service
>
>
> [Test]
>
> Prepare two machines with the same environment mentioned above and run
> the following script.
>
> #!/bin/bash
> INSTANCE="test"
>
> FROM="elite"
> virsh -c qemu+ssh://ubuntu@${FROM}/system list| grep -q ${INSTANCE}
> if [[ $? != 0 ]]; then
> FROM="dixie";
> TO="elite";
> else
> TO="dixie"
> fi
>
> echo "= Migrating ${INSTANCE} from ${FROM} to ${TO} ="
> ssh ubuntu@${FROM} -- virsh migrate --live --domain ${INSTANCE}
> --desturi qemu+ssh://ubuntu@${TO}/system
>
>
> The VNC script I use to keep track of the VNC console is:
>
> #!/bin/bash
> INSTANCE="test"
>
> while true; do
> HOST="elite"
> virsh -c qemu+ssh://ubuntu@${HOST}/system list| grep -q ${INSTANCE}
> if [[ $? != 0 ]]; then HOST="dixie"; fi
>
> virt-viewer -c qemu+ssh://ubuntu@${HOST}/system test
> sleep 3
> done
>
>
> Paolo Bonzini (4):
>   KVM: ioapic: merge ioapic_deliver into ioapic_service
>   KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
>   KVM: ioapic: extract body of kvm_ioapic_set_irq
>   KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
>
>  virt/kvm/ioapic.c | 109 +++++++++++++++++++++++++++++++++++-------------------
>  1 file changed, 70 insertions(+), 39 deletions(-)
>
Acked-by: Stefan Bader <[hidden email]>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [PATCH 0/4] Fix for LP:#1791286

Stefan Bader-2
In reply to this post by Gavin Guo
On 10.09.2018 16:23, Gavin Guo wrote:

> BugLink: https://bugs.launchpad.net/bugs/1791286
>
> [Impact]
>
> After the VM(Guest OS is Windows Server 2012R2) has been live-migrated
> serveral times, the screen is blackout or freeze when the VM is
> connected via VNC.
>
> The Windows Guest OS Server has been investigated that all of kernel
> threads of Windows Server OS are waiting(idle state) for interrupt
> request(IRQ) from hypervisor.
>
> The following environment is tested:
> * Host OS: Ubuntu 14.04(kernel 3.13.0-40.69)
> * qemu-kvm_2.0.0+dfsg-2ubuntu1.22
> * libvert-bin_1.2.2-0ubuntu13.1.5
> * nova-compute_1:2014.2.3-0ubuntu1.2~cloud0
> * GuestOS: Windows Server 2012R2
> * virtio-win-0.1.126
>
>
> [Fix]
>
> The patch set is needed:
>
> 673f7b4257a1 KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
> 44847dea7975 KVM: ioapic: extract body of kvm_ioapic_set_irq
> 0bc830b05c66 KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
> 0b10a1c87a2b KVM: ioapic: merge ioapic_deliver into ioapic_service
>
>
> [Test]
>
> Prepare two machines with the same environment mentioned above and run
> the following script.
>
> #!/bin/bash
> INSTANCE="test"
>
> FROM="elite"
> virsh -c qemu+ssh://ubuntu@${FROM}/system list| grep -q ${INSTANCE}
> if [[ $? != 0 ]]; then
> FROM="dixie";
> TO="elite";
> else
> TO="dixie"
> fi
>
> echo "= Migrating ${INSTANCE} from ${FROM} to ${TO} ="
> ssh ubuntu@${FROM} -- virsh migrate --live --domain ${INSTANCE}
> --desturi qemu+ssh://ubuntu@${TO}/system
>
>
> The VNC script I use to keep track of the VNC console is:
>
> #!/bin/bash
> INSTANCE="test"
>
> while true; do
> HOST="elite"
> virsh -c qemu+ssh://ubuntu@${HOST}/system list| grep -q ${INSTANCE}
> if [[ $? != 0 ]]; then HOST="dixie"; fi
>
> virt-viewer -c qemu+ssh://ubuntu@${HOST}/system test
> sleep 3
> done
>
>
> Paolo Bonzini (4):
>   KVM: ioapic: merge ioapic_deliver into ioapic_service
>   KVM: ioapic: clear IRR for edge-triggered interrupts at delivery
>   KVM: ioapic: extract body of kvm_ioapic_set_irq
>   KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
>
>  virt/kvm/ioapic.c | 109 +++++++++++++++++++++++++++++++++++-------------------
>  1 file changed, 70 insertions(+), 39 deletions(-)
>
Applied to trusty/master-next. Thanks.

-Stefan


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment