Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solaris 10 #GP #173

Open
polprog opened this issue Feb 14, 2019 · 11 comments

Comments

Projects
None yet
4 participants
@polprog
Copy link
Contributor

commented Feb 14, 2019

Describe the Bug
This bug makes it unable to boot solaris 10 in QEMU/HAXM on NetBSD/amd64

Summary: Solaris 10 install CD bootloader fails to boot, triggers a GPF (code 0)

Host Environment

  • HAXM version: 7.4.1 built from emulators/haxm
  • Host OS version: NetBSD 8.0/amd64
  • Host OS architecture: x86_64
  • Host CPU model: Core i3-3220
  • Host RAM size: 8GB
  • (Optional) Host computer model: Dell Optiplex 7010

Guest Environment

  • Android Emulator or QEMU version:
  • Guest OS version: Oracle Solaris 10
  • Guest OS architecture: x86

To Reproduce
1. Boot in qemu with default options, a little more RAM and HAX enabled
qemu-system-i386 -accel hax -cdrom [solaris install CD iso] -m 4G

Expected Behavior
Solaris boots as if it was a physical machine.

Reproducibility
Always

Diagnostic Information

Host crash dump: n/a

HAXM log: No useful information (Only the start version info, HAX_LOWMEM_4G ignored and hax_teardown_vm, we've already recompiled it with noisiest loglevel)

Screenshots: Boot panic, solaris prints a very verbose panic with a stack dump

Additional context
This install medium uses GNU GRUB for boot option selection. GRUB works fine, then there is a sequence of dots (indicating loading of some sort), then panic (screenshot below)

Host and env same as in #172

@raphaelning

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2019

Thanks. This looks similar to #172, except that the guest exception is #GP (General Protection Fault). But still, the first step is to disassemble the guest code and locate the faulting instruction (%cs : %eip = 0x0010:0x0100f494).

@raphaelning raphaelning added the bug label Feb 15, 2019

@polprog

This comment has been minimized.

Copy link
Contributor Author

commented Feb 16, 2019

Ive extracted the offending instruction. Its related to MSR as in #172

   0x0100f486:	nop
   0x0100f487:	nop
   0x0100f488:	nop
   0x0100f489:	nop
   0x0100f48a:	nop
   0x0100f48b:	nop
   0x0100f48c:	nop
   0x0100f48d:	nop
   0x0100f48e:	nop
   0x0100f48f:	nop
   0x0100f490:	mov    0x4(%esp),%ecx
   0x0100f494:	rdmsr  
   0x0100f496:	mov    0x8(%esp),%ecx
   0x0100f49a:	mov    %eax,(%ecx)
   0x0100f49c:	mov    %edx,0x4(%ecx)
   0x0100f49f:	ret    
   0x0100f4a0:	mov    0x8(%esp),%ecx
   0x0100f4a4:	mov    (%ecx),%eax
   0x0100f4a6:	mov    0x4(%ecx),%edx
   0x0100f4a9:	mov    0x4(%esp),%ecx
   0x0100f4ad:	wrmsr  
   0x0100f4af:	ret  

I don't know which way to read the stack dump but there is a 0xc0000080 (leftmost col, 2nd from the top) - looks like MSR number. I'll set up a breakpoint at 0x0100f490 and peek at the stack.

@krytarowski

This comment has been minimized.

Copy link
Contributor

commented Feb 16, 2019

It looks like %ecx is IA32_EFER and %eip on rdmsr so the same issue.

Does it boot for you with this patch: #172 (comment)

@polprog

This comment has been minimized.

Copy link
Contributor Author

commented Feb 16, 2019

@polprog

This comment has been minimized.

Copy link
Contributor Author

commented Feb 16, 2019

Unfortunately this patch crashes the host system for me, before the GRUB even appears.
sol-msr-crash1
sol-msr-crash2

@polprog

This comment has been minimized.

Copy link
Contributor Author

commented Feb 16, 2019

My fault for having old haxm, after updating to HEAD and applying @krytarowski 's patch it boots up to a later stage.

The kernel crashes though as this turned out to be a 64-bit os, the 32 bit bootloader works for sure.

@krytarowski

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2019

The kernel crashes though as this turned out to be a 64-bit os, the 32 bit bootloader works for sure.

Please test with qemu-system-x86_64

@krytarowski

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2019

#172 (comment) Please test the newest HAXM with this patch applied... and use qemu-system-x86_64.

@sskras

This comment has been minimized.

Copy link

commented Apr 14, 2019

Any news about Sol 10 ? BTW, which particular Solaris release do you use for testing?

@polprog

This comment has been minimized.

Copy link
Contributor Author

commented Apr 14, 2019

@sskras Solaris 10u10. I have not tested it yet with the newest patches like #185

@krytarowski

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

Solaris needs CR8 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.