Yang, Sheng wrote:

> Please refer to my another patch comment. Basicly, AP is running
> HLT in 0x10038, but it can exit due to some reason, here QEmu
> want to raise it up . But after AP exit from HLT, it can't return
> to it because the code was overrided by grub and no HLT loop
> there. Then AP had gone away...

Thank you for pointing me to "[PATCH] KVM: Fix QEmu interrupted HLT
emulation". You wrote there:
"Though I also sent a patch for BIOS, it's necessary to get correct
behavior here."

Would i be correct saying the problem is kvm/qemu only and with
that patch applied the bios fix is not needed?

No... I think more important is get bios fixed. Anyway, copy BIOS part of running code to a place that may overwritten by userspace program is wrong, if you expect AP still running when userspace program is running.

In fact, if BIOS code in right place, we won't need fix HLT, for HLT have a assumption that it might be interrupt by some event, so usually it is wrapped by a loop, as current BIOS did.

The AP enters HALT state with IF=0. What can make it resume at the
following "jmp 1b"? NMI? SMI?

If you still want to change the bios code i would suggest jumping
to the original smp_ap_boot_code location in rombios32.bin which
should not get overwritten. The following patch is based on the
bochs version.


Yeah, I just curious why we need to copy BIOS here and there in the beginning...
Thanks for your patch, but is it based on bochs upstream?

Yes it's based on bochs upstream rombios32start.S r1.5.

I found the patch don't apply...

This one should apply to current kvm version.

I also want to know why we need copy AP boot code, if anyone know the detail...

I think i read something about a need for 4kb alignment for the
startup vector in the mp specs. AP_BOOT_ADDR is currently
at 0x10000 (16 x 4kb).

- Sebastian

--- rombios32start.S.orig Wed Aug  6 21:37:22 2008
+++ rombios32start.S Wed Aug  6 21:39:17 2008
@@ -40,6 +40,7 @@ _start:

  .code16
smp_ap_boot_code_start:
+  cli
  xor %ax, %ax
  mov %ax, %ds
  xor %eax, %eax
@@ -60,6 +61,7 @@ smp_ap_boot_code_start:
12:

  incw CPU_COUNT_ADDR
+  ljmp $0xe000, $(1f-_start)
1:
  hlt
  jmp 1b

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to