Quantcast

[Trusty][SRU][PATCH 0/2] LP#1660519 -- Windows guest got 0x5c BSOD when rebooting

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Trusty][SRU][PATCH 0/2] LP#1660519 -- Windows guest got 0x5c BSOD when rebooting

Seyeong Kim
[Impact]

When rebooting Windows guest, it gets 0x5c BSOD
Impact to 3.13 ( trusty )
no Impact to 4.x

[Fix]

Upstream development
4114c27d450bef228be9c7b0c40a888e18a3a636
("KVM: x86: reset RVI upon system reset")
6d2a0526b09e551d0f395cfb63e7cb965db825af
("KVM: x86: Emulator should set DR6 upon GD like real CPU")

and got one MACRO definition from below commit as 6d2a05's dependency
6f43ed01e87c8a8dbd8c826eaf0f714c1342c039
(whole 6f43ed commit has a lot of dependency to the other commits)

[Testcase]

Running 6 windows vms( 2012r2 ) on one single server.
auto rebooting scripts in windows guest.
after one day (around hundred rebooting), can get 0x5c certainly


Nadav Amit (1):
  KVM: x86: Emulator should set DR6 upon GD like real CPU

Wei Wang (1):
  KVM: x86: reset RVI upon system reset

 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kvm/emulate.c          |  9 ++++++++-
 arch/x86/kvm/lapic.c            |  3 +++
 arch/x86/kvm/vmx.c              | 25 ++++++++++++++++++++++++-
 4 files changed, 36 insertions(+), 2 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
|  
Report Content as Inappropriate

[PATCH 1/2] KVM: x86: reset RVI upon system reset

Seyeong Kim
From: Wei Wang <[hidden email]>

A bug was reported as follows: when running Windows 7 32-bit guests on qemu-kvm,
sometimes the guests run into blue screen during reboot. The problem was that a
guest's RVI was not cleared when it rebooted. This patch has fixed the problem.

Signed-off-by: Wei Wang <[hidden email]>
Signed-off-by: Yang Zhang <[hidden email]>
Tested-by: Rongrong Liu <[hidden email]>, Da Chun <[hidden email]>
Signed-off-by: Paolo Bonzini <[hidden email]>

Conflicts:
        arch/x86/kvm/vmx.c
---
 arch/x86/kvm/lapic.c |  3 +++
 arch/x86/kvm/vmx.c   | 25 ++++++++++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 701fd95..b805ae4 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1692,6 +1692,9 @@ void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu,
  apic->isr_count = kvm_apic_vid_enabled(vcpu->kvm) ?
  1 : count_vectors(apic->regs + APIC_ISR);
  apic->highest_isr_cache = -1;
+ if (kvm_x86_ops->hwapic_irr_update)
+ kvm_x86_ops->hwapic_irr_update(vcpu,
+ apic_find_highest_irr(apic));
  kvm_x86_ops->hwapic_isr_update(vcpu->kvm, apic_find_highest_isr(apic));
  kvm_make_request(KVM_REQ_EVENT, vcpu);
  kvm_rtc_eoi_tracking_restore_one(vcpu);
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 2b45251..6658c0b 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6919,6 +6919,9 @@ static void vmx_set_rvi(int vector)
  u16 status;
  u8 old;
 
+ if (vector == -1)
+ vector = 0;
+
  status = vmcs_read16(GUEST_INTR_STATUS);
  old = (u8)status & 0xff;
  if ((u8)vector != old) {
@@ -6930,10 +6933,30 @@ static void vmx_set_rvi(int vector)
 
 static void vmx_hwapic_irr_update(struct kvm_vcpu *vcpu, int max_irr)
 {
+ if (!is_guest_mode(vcpu)) {
+ vmx_set_rvi(max_irr);
+ return;
+ }
+
  if (max_irr == -1)
  return;
 
- vmx_set_rvi(max_irr);
+ /*
+ * In guest mode.  If a vmexit is needed, vmx_check_nested_events
+ * handles it.
+ */
+ if (nested_exit_on_intr(vcpu))
+ return;
+
+ /*
+ * Else, fall back to pre-APICv interrupt injection since L2
+ * is run without virtual interrupt delivery.
+ */
+ if (!kvm_event_needs_reinjection(vcpu) &&
+    vmx_interrupt_allowed(vcpu)) {
+ kvm_queue_interrupt(vcpu, max_irr, false);
+ vmx_inject_irq(vcpu);
+ }
 }
 
 static void vmx_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap)
--
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
|  
Report Content as Inappropriate

[PATCH 2/2] KVM: x86: Emulator should set DR6 upon GD like real CPU

Seyeong Kim
In reply to this post by Seyeong Kim
From: Nadav Amit <[hidden email]>

It should clear B0-B3 and set BD.

Signed-off-by: Nadav Amit <[hidden email]>
Signed-off-by: Paolo Bonzini <[hidden email]>
---
 arch/x86/include/asm/kvm_host.h | 1 +
 arch/x86/kvm/emulate.c          | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 70427d1..4d2cfd8 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -157,6 +157,7 @@ enum {
 
 #define DR6_BD (1 << 13)
 #define DR6_BS (1 << 14)
+#define DR6_RTM         (1 << 16)
 #define DR6_FIXED_1 0xffff0ff0
 #define DR6_VOLATILE 0x0000e00f
 
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index f8eea19..46d0145 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3533,8 +3533,15 @@ static int check_dr_read(struct x86_emulate_ctxt *ctxt)
  if ((cr4 & X86_CR4_DE) && (dr == 4 || dr == 5))
  return emulate_ud(ctxt);
 
- if (check_dr7_gd(ctxt))
+ if (check_dr7_gd(ctxt)) {
+ ulong dr6;
+
+ ctxt->ops->get_dr(ctxt, 6, &dr6);
+ dr6 &= ~15;
+ dr6 |= DR6_BD | DR6_RTM;
+ ctxt->ops->set_dr(ctxt, 6, dr6);
  return emulate_db(ctxt);
+ }
 
  return X86EMUL_CONTINUE;
 }
--
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
|  
Report Content as Inappropriate

NAK: [Trusty][SRU][PATCH 0/2] LP#1660519 -- Windows guest got 0x5c BSOD when rebooting

Tim Gardner-2
In reply to this post by Seyeong Kim
These patches need a Buglink and 'cherry-picked from' in the commit log.
Use 'git cherry-pick -s -x' and
'kteam-tools/maintscripts/maint-modify-patch -b'

rtg
--
Tim Gardner [hidden email]

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

NAK: [Trusty][SRU][PATCH 0/2] LP#1660519 -- Windows guest got 0x5c BSOD when rebooting

brad.figg
In reply to this post by Seyeong Kim

Seyeong,

These patches are missing:

1. A buglink which poins at the Launchpad bug that they are supposedly
   fixing.

2. Your SOB.

3. Either a cherry-pick or backport line that tells us where these patches
   came from.

These are required for all SRU patches.

Thanks,
Brad

On Tue, Jan 31, 2017 at 10:32:02PM +0900, Seyeong Kim wrote:

> [Impact]
>
> When rebooting Windows guest, it gets 0x5c BSOD
> Impact to 3.13 ( trusty )
> no Impact to 4.x
>
> [Fix]
>
> Upstream development
> 4114c27d450bef228be9c7b0c40a888e18a3a636
> ("KVM: x86: reset RVI upon system reset")
> 6d2a0526b09e551d0f395cfb63e7cb965db825af
> ("KVM: x86: Emulator should set DR6 upon GD like real CPU")
>
> and got one MACRO definition from below commit as 6d2a05's dependency
> 6f43ed01e87c8a8dbd8c826eaf0f714c1342c039
> (whole 6f43ed commit has a lot of dependency to the other commits)
>
> [Testcase]
>
> Running 6 windows vms( 2012r2 ) on one single server.
> auto rebooting scripts in windows guest.
> after one day (around hundred rebooting), can get 0x5c certainly
>
>
> Nadav Amit (1):
>   KVM: x86: Emulator should set DR6 upon GD like real CPU
>
> Wei Wang (1):
>   KVM: x86: reset RVI upon system reset
>
>  arch/x86/include/asm/kvm_host.h |  1 +
>  arch/x86/kvm/emulate.c          |  9 ++++++++-
>  arch/x86/kvm/lapic.c            |  3 +++
>  arch/x86/kvm/vmx.c              | 25 ++++++++++++++++++++++++-
>  4 files changed, 36 insertions(+), 2 deletions(-)
>
> --
> 2.7.4
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
Brad Figg [hidden email] http://www.canonical.com

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