qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Illumos/SmarOS support
@ 2012-03-15 11:19 Lee Essen
  2012-03-15 11:56 ` Stefan Hajnoczi
  2012-03-15 12:23 ` Andreas Färber
  0 siblings, 2 replies; 8+ messages in thread
From: Lee Essen @ 2012-03-15 11:19 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

Resend from different email -- not sure what happened to my first 2 attempts!

Hi,

I've been working on getting the mainline qemu tree working on SmartOS (illumos), the current qemu support seems to be a branch of qemu-kvm and we've been having some problems getting spice working, so moving to the main qemu tree seemed sensible.

Anyway, couple of questions…

1. Are you happy to accept patches that enable this?   
	- There are a few build related things that don't work … assumption of sh being bash, missing -64 argument to dtrace etc. 
	- There are also some dtrace language problems with tracetool (no support for bool, and self being reserved.) 
	- More fundamentally some object linking issues with dtrace which I'll need some help to find the best way to resolve.
	- Specific #ifdef CONFIG_SOLARIS/__sun__ stuff to support differences
	- ultimately the support for vnic's … but I haven't even looked at that yet.

	The current state is that it's working ok for Windows guests, and non-KVM for Linux, but kvm & linux seems to fail, hence question number 2.

2. The last thing that happens when I try to boot linux with kvm enabled is some apic mmio accesses, then it stops at a hlt instruction and never gets going again. Is there something I can enable to help debug this? Or has anyone else seen similar behaviour? I've run out of places to look.

Many thanks,

Lee.

[-- Attachment #2.1: Type: text/html, Size: 1459 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Illumos/SmarOS support
@ 2012-03-15 12:39 lee.essen
  2012-03-15 12:57 ` Stefan Hajnoczi
  2012-03-15 13:12 ` Andreas Färber
  0 siblings, 2 replies; 8+ messages in thread
From: lee.essen @ 2012-03-15 12:39 UTC (permalink / raw)
  To: stefanha; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3755 bytes --]

On 15/03/2012 11:56, Stefan Hajnoczi wrote:
>> Anyway, couple of questions…
>>
>> 1. Are you happy to accept patches that enable this?
>> 	- There are a few build related things that don't work … assumption of sh
>> being bash, missing -64 argument to dtrace etc.
> Sounds good, but have you checked the Joyent qemu-kvm Illumos port to
> see what fixes they already have?
>
> https://github.com/joyent/illumos-kvm-cmd
 
Yes, they have solved the same problems .. however the build mechanism seems to be sufficiently different that things need to be done slightly differently for qemu.git.

These aren't complex changes and amount to generally only a couple of lines.

The illumos-kvm-cmd tree seems to be only updated to address joyent live-image build requirements, and hasn't really moved in about 7 months. I've been posting profusely on the smartos mailing list and they also don't seem that concerned about this work.

However, there are a few of us that would like to get spice up and running and the illumos fork doesn't seem like a sensible place to start when they are so far behind.

They have said that they will incorporate the spice work once it's complete, so I'm pretty confident that we can push them to the main qemu tree at that point.
>> 	- More fundamentally some object linking issues with dtrace which I'll need
>> some help to find the best way to resolve.
> I think Joyent has already done this, they said they use QEMU tracing
> with DTrace as the backend.
 
Yes they have, but again the build mechanism has changed quite significantly.

The basic issue here is that dtrace on Illumos seems to need all objects to be provided to it when you create the dtrace provider object, I'm guessing it uses the objects to work out which probes to actually include ... if you don't provide any objects you get an output object with none of the symbols you need in it.

So for each binary created you need to do something like...

dtrace -o <binary>-dtrace.o -G -s <dtrace-source> <all-the-objects-used-by-the-binary>

... then include the specific <binary>-drace.o when linking the main binary.
> So you are using qemu.git/master with the IllumOS KVM port?
>
> I think what you are trying to do makes sense - IllumOS as a host OS
> and QEMU platform should be actively involved in the upstream QEMU
> community.  But you may want to first check the Joyent port to see
> what can easily be upstreamed and also try talking with them if you
> haven't already.  I'm not sure why things aren't being pushed upstream
> but perhaps the process can be started.
 
Yes, and (other than my Linux issue) it's working well.

The changes needed to get it working are pretty minimal, most of them are #ifdef's around KVM_CAP's that are assumed to be defined (at least in some of the code.)

The specific code changes boil down to:
- a different mechanism for creating a vcpu filehandle (which is cloned from /dev/kvm rather than the return code of KVM_CREATE_VCPU)
- some of the kvm ioctls using different filehandles.
- the requirement to lock guest memory
- a KVM_EXIT_INTR case with ret=0 from the ioctl (exernal interrupt)

... which amounts to probably less than 50 lines of changes, and again the code structure is pretty different to their port, so I think it's easier to apply new rather than push upstream.

I would have thought that applying this (minimal) stuff to the qemu.git tree and using that for illumos would remove the need for a specific joyent version, and hence be a good thing.

The joyent guys are very focused (understandably) on their specific needs, however if someone else is prepared to do the work they do seem pretty willing to adopt it.

Regards,

Lee.


[-- Attachment #2.1: Type: text/html, Size: 4462 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-03-15 16:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15 11:19 [Qemu-devel] Illumos/SmarOS support Lee Essen
2012-03-15 11:56 ` Stefan Hajnoczi
2012-03-15 12:23 ` Andreas Färber
  -- strict thread matches above, loose matches on Subject: below --
2012-03-15 12:39 lee.essen
2012-03-15 12:57 ` Stefan Hajnoczi
2012-03-15 13:12 ` Andreas Färber
2012-03-15 15:48   ` Lee Essen
2012-03-15 15:59     ` Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).