[Qemu-devel] Re: [PATCH v6 05/18] virtio-serial: Use control messages to notify guest of new ports

2010-04-28 Thread Amit Shah
On (Tue) Apr 27 2010 [12:37:00], Anthony Liguori wrote: On 04/27/2010 07:33 AM, Amit Shah wrote: Allow the port 'id's to be set by a user on the command line. This is needed by management apps that will want a stable port numbering scheme for hot-plug/unplug and migration. Since the port

[Qemu-devel] Re: [PATCH] A bit optimization for tlb_set_page()

2010-04-28 Thread Jan Kiszka
Jun Koi wrote: On Wed, Apr 28, 2010 at 8:48 AM, Jun Koi junkoi2...@gmail.com wrote: On Wed, Apr 28, 2010 at 3:36 AM, Jan Kiszka jan.kis...@web.de wrote: Jun Koi wrote: It is not necessary to continue searching for watchpoint when we already found one and setup for handling watchpoint in a

[Qemu-devel] Re: [PATCH] A bit optimization for tlb_set_page()

2010-04-28 Thread Jun Koi
On Wed, Apr 28, 2010 at 3:53 PM, Jan Kiszka jan.kis...@web.de wrote: Jun Koi wrote: On Wed, Apr 28, 2010 at 8:48 AM, Jun Koi junkoi2...@gmail.com wrote: On Wed, Apr 28, 2010 at 3:36 AM, Jan Kiszka jan.kis...@web.de wrote: Jun Koi wrote: It is not necessary to continue searching for watchpoint

[Qemu-devel] Re: Question on implementatio of GETPC()

2010-04-28 Thread Jan Kiszka
Jun Koi wrote: Hi, In x86, GETPC() is implemented as below: # define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 1)) As I understand, it gets the returned address on the stack, then subtract 1 to get back to the above address. Imagine we have code like this (pseudo

Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-28 Thread Stefan Hajnoczi
On Tue, Apr 27, 2010 at 10:26 PM, Stefan Hajnoczi stefa...@gmail.com wrote: Can you double check that qemu-kvm.o is being linked in instead of kvm-all.o? I looked again and noticed that qemu-kvm.c is included from kvm-all.c. Please ignore my question of whether qemu-kvm.c is being linked in :).

[Qemu-devel] Re: Question on implementatio of GETPC()

2010-04-28 Thread Jun Koi
On Wed, Apr 28, 2010 at 5:12 PM, Jan Kiszka jan.kis...@siemens.com wrote: Jun Koi wrote: Hi, In x86, GETPC() is implemented as below: # define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 1)) As I understand, it gets the returned address on the stack, then subtract 1 to

Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-28 Thread Kevin Wolf
Am 27.04.2010 22:39, schrieb Chunqiang (CQ) Tang: kvm-all.c:kvm_cpu_exec: qemu_mutex_unlock_iothread(); ret = kvm_vcpu_ioctl(env, KVM_RUN, 0); qemu_mutex_lock_iothread(); Thank you for the information. I also suspected that qemu_mutex_lock_iothread() does the

[Qemu-devel] Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Jes Sorensen
On 04/22/10 03:12, Kevin O'Connor wrote: As I understand it, the hotplug support was only in the kvm copy of bochs bios. It also limited the number of cpus one could use (I think 16). The current smp support in SeaBIOS doesn't limit the number of cpus. So, there has been reluctance to

[Qemu-devel] [PATCH v2] qcow2: Implement bdrv_truncate() for growing images

2010-04-28 Thread Stefan Hajnoczi
This patch adds the ability to grow qcow2 images in-place using bdrv_truncate(). This enables qemu-img resize command support for qcow2. Snapshots are not supported and bdrv_truncate() will return -ENOTSUP. The notion of resizing an image with snapshots could lead to confusion: users may expect

Re: [Qemu-devel] [PATCH v2] qcow2: Implement bdrv_truncate() for growing images

2010-04-28 Thread Kevin Wolf
Am 28.04.2010 11:24, schrieb Stefan Hajnoczi: This patch adds the ability to grow qcow2 images in-place using bdrv_truncate(). This enables qemu-img resize command support for qcow2. Snapshots are not supported and bdrv_truncate() will return -ENOTSUP. The notion of resizing an image with

[Qemu-devel] Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 11:31:00AM +0200, Jes Sorensen wrote: On 04/22/10 03:12, Kevin O'Connor wrote: As I understand it, the hotplug support was only in the kvm copy of bochs bios. It also limited the number of cpus one could use (I think 16). The current smp support in SeaBIOS

[Qemu-devel] [PATCH v3] qcow2: Implement bdrv_truncate() for growing images

2010-04-28 Thread Stefan Hajnoczi
This patch adds the ability to grow qcow2 images in-place using bdrv_truncate(). This enables qemu-img resize command support for qcow2. Snapshots are not supported and bdrv_truncate() will return -ENOTSUP. The notion of resizing an image with snapshots could lead to confusion: users may expect

[Qemu-devel] Re: Question on implementatio of GETPC()

2010-04-28 Thread Jan Kiszka
Jun Koi wrote: On Wed, Apr 28, 2010 at 5:12 PM, Jan Kiszka jan.kis...@siemens.com wrote: Jun Koi wrote: Hi, In x86, GETPC() is implemented as below: # define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 1)) As I understand, it gets the returned address on the stack, then

[Qemu-devel] Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Jes Sorensen
On 04/28/10 12:30, Gleb Natapov wrote: On Wed, Apr 28, 2010 at 11:31:00AM +0200, Jes Sorensen wrote: On 04/22/10 03:12, Kevin O'Connor wrote: Generating the more complex tables dynamically would be preferred, but it requires like half an AML compiler in Seabios, so it kinda stalled there

[Qemu-devel] Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 12:41:51PM +0200, Jes Sorensen wrote: On 04/28/10 12:30, Gleb Natapov wrote: On Wed, Apr 28, 2010 at 11:31:00AM +0200, Jes Sorensen wrote: On 04/22/10 03:12, Kevin O'Connor wrote: Generating the more complex tables dynamically would be preferred, but it requires

[Qemu-devel] Re: [PATCH v3] qcow2: Implement bdrv_truncate() for growing images

2010-04-28 Thread Kevin Wolf
Am 28.04.2010 12:36, schrieb Stefan Hajnoczi: This patch adds the ability to grow qcow2 images in-place using bdrv_truncate(). This enables qemu-img resize command support for qcow2. Snapshots are not supported and bdrv_truncate() will return -ENOTSUP. The notion of resizing an image with

Re: [Qemu-devel] Multiple monitor interfaces?

2010-04-28 Thread Luiz Capitulino
On Wed, 28 Apr 2010 12:20:42 +0900 Jun Koi junkoi2...@gmail.com wrote: On Wed, Apr 28, 2010 at 3:26 AM, Luiz Capitulino lcapitul...@redhat.com wrote: On Tue, 27 Apr 2010 23:23:45 +0900 Jun Koi junkoi2...@gmail.com wrote: Hi, I am wondering if is it possible to have multiple monitor

[Qemu-devel] [PATCH] fix old typos in help header

2010-04-28 Thread Thomas Monjalon
From: Thomas Monjalon tho...@monjalon.net 1) Qemu is not only a PC emulator. 2) image image has already been changed to disk image in qemu-doc.texi Signed-off-by: Thomas Monjalon tho...@monjalon.net --- vl.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c

[Qemu-devel] Re: [PATCH v6 18/18] virtio-serial-bus: wake up iothread upon guest read notification

2010-04-28 Thread Amit Shah
On (Tue) Apr 27 2010 [12:41:27], Anthony Liguori wrote: On 04/27/2010 07:34 AM, Amit Shah wrote: From: Marcelo Tosattimtosa...@redhat.com Wake up iothread when buffers are consumed. Signed-off-by: Marcelo Tosattimtosa...@redhat.com Signed-off-by: Amit Shahamit.s...@redhat.com What's

[Qemu-devel] Re: [PATCH v6 18/18] virtio-serial-bus: wake up iothread upon guest read notification

2010-04-28 Thread Anthony Liguori
On 04/28/2010 02:29 AM, Amit Shah wrote: On (Tue) Apr 27 2010 [12:41:27], Anthony Liguori wrote: On 04/27/2010 07:34 AM, Amit Shah wrote: From: Marcelo Tosattimtosa...@redhat.com Wake up iothread when buffers are consumed. Signed-off-by: Marcelo Tosattimtosa...@redhat.com

[Qemu-devel] Re: [PATCH v6 05/18] virtio-serial: Use control messages to notify guest of new ports

2010-04-28 Thread Anthony Liguori
On 04/27/2010 11:27 PM, Amit Shah wrote: On (Tue) Apr 27 2010 [12:37:00], Anthony Liguori wrote: On 04/27/2010 07:33 AM, Amit Shah wrote: Allow the port 'id's to be set by a user on the command line. This is needed by management apps that will want a stable port numbering scheme for

Re: [Qemu-devel] thread synchronization in qcow2.c and qcow2-cluster.c

2010-04-28 Thread Chunqiang (CQ) Tang
On Wed, Apr 28, 2010 at 4:13 AM, Stefan Hajnoczi stefa...@gmail.com wrote: On Tue, Apr 27, 2010 at 10:26 PM, Stefan Hajnoczi stefa...@gmail.com wrote: Can you double check that qemu-kvm.o is being linked in instead of kvm-all.o? I looked again and noticed that qemu-kvm.c is included from

[Qemu-devel] Re: [PATCH 06/10] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu

2010-04-28 Thread Anthony Liguori
On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: This is now done via the initialization's qemu_system_reset call. Signed-off-by: Avi Kivitya...@redhat.com --- kvm-all.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 9c8aa7d..eabb097 100644

[Qemu-devel] Re: [PATCH] virtio-spec: document block CMD and FLUSH

2010-04-28 Thread Michael S. Tsirkin
On Tue, Apr 20, 2010 at 12:26:27AM +0300, Michael S. Tsirkin wrote: On Fri, Feb 19, 2010 at 12:22:20AM +0200, Michael S. Tsirkin wrote: I took a stub at documenting CMD and FLUSH request types in virtio block. Any comments? Rusty?

[Qemu-devel] [PATCH 2/2] block: Extend info blockstats monitor command

2010-04-28 Thread Kevin Wolf
Now the high watermark and statistics of the underlying images are exposed via QMP, but they are missing in the user monitor. This patch changes the user monitor to provide the same functionality. Note that it's not possible to maintain compatibility with older clients that try to parse the

[Qemu-devel] [PATCH 0/2] block: wr_highest_sector blockstat

2010-04-28 Thread Kevin Wolf
This is the minimal high watermark implementation that is needed to allow clients to poll the value. I hope everyone can live with this solution now. The second patch of this series is optional. It breaks clients that consider the user monitor a stable API. They should be using QMP, but I'm not

[Qemu-devel] [PATCH 1/2] block: Add wr_highest_sector blockstat

2010-04-28 Thread Kevin Wolf
This adds the wr_highest_sector blockstat which implements what is generally known as the high watermark. It is the highest offset of a sector written to the respective BlockDriverState since it has been opened. The query-blockstat QMP command is extended to add this value to the result, and also

[Qemu-devel] Re: [PATCH 1/2] block: Add wr_highest_sector blockstat

2010-04-28 Thread Anthony Liguori
On 04/28/2010 10:56 AM, Kevin Wolf wrote: This adds the wr_highest_sector blockstat which implements what is generally known as the high watermark. It is the highest offset of a sector written to the respective BlockDriverState since it has been opened. The query-blockstat QMP command is

[Qemu-devel] Re: [PATCH 1/2] block: Add wr_highest_sector blockstat

2010-04-28 Thread Anthony Liguori
On 04/28/2010 10:56 AM, Kevin Wolf wrote: This adds the wr_highest_sector blockstat which implements what is generally known as the high watermark. It is the highest offset of a sector written to the respective BlockDriverState since it has been opened. The query-blockstat QMP command is

Re: [Qemu-devel] Re: [PATCH 06/10] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu

2010-04-28 Thread Marcelo Tosatti
On Wed, Apr 28, 2010 at 10:39:06AM -0500, Anthony Liguori wrote: On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: This is now done via the initialization's qemu_system_reset call. Signed-off-by: Avi Kivitya...@redhat.com --- kvm-all.c |1 - 1 files changed, 0 insertions(+), 1

Re: [Qemu-devel] Re: [PATCH 06/10] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu

2010-04-28 Thread Anthony Liguori
On 04/28/2010 11:22 AM, Marcelo Tosatti wrote: On Wed, Apr 28, 2010 at 10:39:06AM -0500, Anthony Liguori wrote: On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: This is now done via the initialization's qemu_system_reset call. Signed-off-by: Avi Kivitya...@redhat.com --- kvm-all.c |

Re: [Qemu-devel] Re: [PATCH 06/10] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu

2010-04-28 Thread Marcelo Tosatti
On Wed, Apr 28, 2010 at 01:22:14PM -0300, Marcelo Tosatti wrote: On Wed, Apr 28, 2010 at 10:39:06AM -0500, Anthony Liguori wrote: On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: This is now done via the initialization's qemu_system_reset call. Signed-off-by: Avi Kivitya...@redhat.com

[Qemu-devel] Re: [PATCH 1/2] block: Add wr_highest_sector blockstat

2010-04-28 Thread Luiz Capitulino
On Wed, 28 Apr 2010 11:01:12 -0500 Anthony Liguori anth...@codemonkey.ws wrote: On 04/28/2010 10:56 AM, Kevin Wolf wrote: This adds the wr_highest_sector blockstat which implements what is generally known as the high watermark. It is the highest offset of a sector written to the respective

[Qemu-devel] Re: [PATCH v6 18/18] virtio-serial-bus: wake up iothread upon guest read notification

2010-04-28 Thread Amit Shah
On (Wed) Apr 28 2010 [08:25:59], Anthony Liguori wrote: On 04/28/2010 02:29 AM, Amit Shah wrote: On (Tue) Apr 27 2010 [12:41:27], Anthony Liguori wrote: On 04/27/2010 07:34 AM, Amit Shah wrote: From: Marcelo Tosattimtosa...@redhat.com Wake up iothread when buffers are consumed.

[Qemu-devel] Re: [PATCH 1/2] block: Add wr_highest_sector blockstat

2010-04-28 Thread Luiz Capitulino
On Wed, 28 Apr 2010 17:56:20 +0200 Kevin Wolf kw...@redhat.com wrote: This adds the wr_highest_sector blockstat which implements what is generally known as the high watermark. It is the highest offset of a sector written to the respective BlockDriverState since it has been opened. The

[Qemu-devel] Re: [PATCH 1/2] block: Add wr_highest_sector blockstat

2010-04-28 Thread Anthony Liguori
On 04/28/2010 12:04 PM, Luiz Capitulino wrote: On Wed, 28 Apr 2010 11:01:12 -0500 Anthony Liguorianth...@codemonkey.ws wrote: On 04/28/2010 10:56 AM, Kevin Wolf wrote: This adds the wr_highest_sector blockstat which implements what is generally known as the high watermark. It is

[Qemu-devel] Re: [PATCH v6 01/18] virtio-serial: save/load: Ensure target has enough ports

2010-04-28 Thread Anthony Liguori
Applied 1-17. Thanks. Regards, Anthony Liguori On 04/27/2010 07:33 AM, Amit Shah wrote: The target could be started with max_nr_ports for a virtio-serial device lesser than what was available on the source machine. Fail the migration in such a case. Signed-off-by: Amit

Re: [Qemu-devel] Re: [PATCH] flush TB on singlestep command

2010-04-28 Thread Stefan Weil
Am 28.04.2010 01:50, schrieb Jun Koi: On Wed, Apr 28, 2010 at 4:55 AM, Stefan Weil w...@mail.berlios.de wrote: Typical use case: execution trace of some code which is run after OS boot with an explicit trigger. This can be loading of a linux kernel module, a user space application or kernel

[Qemu-devel] [PATCH 02/22] tcg-i386: Tidy initialization of tcg_target_call_clobber_regs.

2010-04-28 Thread Richard Henderson
Setting the registers one by one is easier to read, and gets optimized by the compiler just the same. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tcg/i386/tcg-target.c

[Qemu-devel] [PATCH 09/22] tcg-i386: Tidy jumps.

2010-04-28 Thread Richard Henderson
Define OPC_JCC*, OC_JMP*, and EXT_JMPN_Ev. Use them throughout. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 58 +++- 1 files changed, 33 insertions(+), 25 deletions(-) diff --git a/tcg/i386/tcg-target.c

[Qemu-devel] [PATCH 03/22] tcg-i386: Tidy ext8u and ext16u operations.

2010-04-28 Thread Richard Henderson
Define OPC_MOVZBL and OPC_MOVZWL. Factor opcode emission to separate functions. Don't restrict the input register to the low 4 q registers; emit an AND instead if needed. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 68

[Qemu-devel] [PATCH 12/22] tcg-i386: Tidy movi.

2010-04-28 Thread Richard Henderson
Define and use OPC_MOVL_Iv. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index b4e8e74..06946e5 100644 --- a/tcg/i386/tcg-target.c +++

[Qemu-devel] [PATCH 01/22] tcg-i386: Allocate call-saved registers first.

2010-04-28 Thread Richard Henderson
Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index e684b33..f5c24f7 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@

[Qemu-devel] [PATCH 10/22] tcg-i386: Tidy immediate arithmetic operations.

2010-04-28 Thread Richard Henderson
Define OPC_ARITH_EvI[bz]; use throughout. Use tcg_out_ext8u directly in setcond. Use tgen_arithi in qemu_ld/st. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 28 +++- 1 files changed, 11 insertions(+), 17 deletions(-) diff --git

[Qemu-devel] [PATCH 13/22] tcg-i386: Tidy push/pop.

2010-04-28 Thread Richard Henderson
Move tcg_out_push/pop up in the file so that they can be used by qemu_ld/st. Define a tcg_out_pushi to be used as well. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 50 +++- 1 files changed, 32 insertions(+), 18

[Qemu-devel] [PATCH 08/22] tcg-i386: Eliminate extra move from qemu_ld64.

2010-04-28 Thread Richard Henderson
If the address register overlaps one of the output registers simply issue the clobbering load last, rather than emitting an extra move of the address register. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 20 +--- 1 files changed, 9

[Qemu-devel] [PATCH 00/22] tcg-i386 cleanup and improvement, v2

2010-04-28 Thread Richard Henderson
Changes v1-v2: * Dropped controversial bswap changes; bswap16 continues to use rolw. * Tidy data16 as the last of the hard-coded constants. r~ Richard Henderson (22): tcg-i386: Allocate call-saved registers first. tcg-i386: Tidy initialization of tcg_target_call_clobber_regs.

[Qemu-devel] [PATCH 04/22] tcg-i386: Tidy ext8s and ext16s operations.

2010-04-28 Thread Richard Henderson
Define OPC_MOVSBL and OPC_MOVSWL. Factor opcode emission to separate functions. Don't restrict the input register to the low 4 q registers; emit shifts instead if needed. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 49

[Qemu-devel] [PATCH 11/22] tcg-i386: Tidy non-immediate arithmetic operations.

2010-04-28 Thread Richard Henderson
Add more OPC values, and tgen_arithr. Use the later throughout. Note that normal reg/reg arithmetic now uses the Gv,Ev opcode form instead of the Ev,Gv opcode form used previously. Both forms disassemble properly, and so there's no visible change when diffing log files before and after the

[Qemu-devel] [PATCH 06/22] tcg-i386: Tidy shift operations.

2010-04-28 Thread Richard Henderson
Define OPC_SHIFT_{1,Ib,cl}. Factor opcode emission to a function. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 43 ++- 1 files changed, 22 insertions(+), 21 deletions(-) diff --git a/tcg/i386/tcg-target.c

[Qemu-devel] [PATCH 17/22] tcg-i386: Tidy unary arithmetic.

2010-04-28 Thread Richard Henderson
Define OPC_GRP3 and EXT3_FOO to match. Use them instead of bare constants. Define OPC_GRP5 and rename the existing EXT_BAR to EXT5_BAR to make it clear which extension should be used with which opcode. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 38

[Qemu-devel] [PATCH 20/22] tcg-i386: Tidy lea.

2010-04-28 Thread Richard Henderson
Implement full modrm+sib addressing mode processing. Use that in qemu_ld/st to output the LEA. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 91 - 1 files changed, 60 insertions(+), 31 deletions(-) diff --git

[Qemu-devel] [PATCH 07/22] tcg-i386: Tidy move operations.

2010-04-28 Thread Richard Henderson
Define OPC_MOVB* and OPC_MOVL*; use them throughout. Use tcg_out_ld/st instead of bare tcg_out_modrm_offset when it makes sense. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 51 +++- 1 files changed, 24 insertions(+),

[Qemu-devel] [PATCH 19/22] tcg-i386: Tidy xchg.

2010-04-28 Thread Richard Henderson
Define and use OPC_XCHG_ax_r32. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index 020faf0..bf3c0d6 100644 --- a/tcg/i386/tcg-target.c +++

[Qemu-devel] [PATCH 22/22] tcg-i386: Tidy data16 prefixes.

2010-04-28 Thread Richard Henderson
Include it in the opcode as an extension, as with P_EXT or the REX bits in the x86-64 port. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 21 + 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tcg/i386/tcg-target.c

[Qemu-devel] [PATCH 21/22] tcg-i386: Use lea for three-operand add.

2010-04-28 Thread Richard Henderson
The result is shorter than the mov+add that TCG would otherwise generate for us. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tcg/i386/tcg-target.c

[Qemu-devel] [PATCH 16/22] tcg-i386: Tidy setcc.

2010-04-28 Thread Richard Henderson
Define and use OPC_SETCC. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index 27e9e9e..0c1a53a 100644 --- a/tcg/i386/tcg-target.c +++

[Qemu-devel] [PATCH 14/22] tcg-i386: Tidy calls.

2010-04-28 Thread Richard Henderson
Define OPC_CALL_Jz, generated by tcg_out_calli; use the later throughout. Unify the calls within qemu_st; adjust the stack with a single pop if applicable. Define and use EXT_CALLN_Ev for indirect calls. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 49

[Qemu-devel] [PATCH 15/22] tcg-i386: Tidy ret.

2010-04-28 Thread Richard Henderson
Define and use OPC_RET. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index e82788d..27e9e9e 100644 --- a/tcg/i386/tcg-target.c +++

[Qemu-devel] [PATCH 18/22] tcg-i386: Tidy multiply.

2010-04-28 Thread Richard Henderson
Define and use OPC_IMUL_GvEv{,Ib,Iz}. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index c3f3e4d..020faf0 100644 ---

[Qemu-devel] [PATCH 05/22] tcg-i386: Tidy bswap operations.

2010-04-28 Thread Richard Henderson
Define OPC_BSWAP. Factor opcode emission to separate functions. Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 52 ++-- 1 files changed, 24 insertions(+), 28 deletions(-) diff --git a/tcg/i386/tcg-target.c

Re: [Qemu-devel] NPTL user mode fixes

2010-04-28 Thread Richard Henderson
On 04/26/2010 04:00 PM, David Munday wrote: I starting to work with qemu to enable NPTL dependent binaries to run in user mode. I see that currently NPTL is not supported for SPARC or x86. What is still left to do for NPTL support? The thing that's missing to enable the compile with NPTL is

Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH.

2010-04-28 Thread Artyom Tarasenko
2010/4/27 Richard Henderson r...@twiddle.net: On 04/26/2010 02:54 PM, Artyom Tarasenko wrote: This patch introduces a regression. qemu crashes on lance test: I'm not sure how to get to this, since the sparc-test images don't include ifconfig, and I havn't been able to find a sparc install

[Qemu-devel] [PATCH 04/14] linux-user: Reduce lseek+reads while loading elf files.

2010-04-28 Thread Richard Henderson
Define BPRM_BUF_SIZE to 4k and read that amount initially. If the data we want from the binary is in this buffer, use it instead of reading from the file again. Signed-off-by: Richard Henderson r...@twiddle.net --- linux-user/elfload.c | 105 ---

[Qemu-devel] [PATCH 01/14] linux-user: Handle filesz memsz for any PT_LOAD segment.

2010-04-28 Thread Richard Henderson
I caught padzero not properly initializing the .bss segment on a statically linked Alpha program. Rather than a minimal patch, replace the gross code with a single mmap+memset. Share more code between load_elf_interp and load_elf_binary. Legally, an ELF program need not have just a single .bss;

[Qemu-devel] [PATCH 00/14] Implement VDSO for x86-64-linux-user, v2

2010-04-28 Thread Richard Henderson
Changes v1-v2 * Formatting bugs pointed out by malc. r~ Richard Henderson (14): linux-user: Handle filesz memsz for any PT_LOAD segment. Add more DT_* and AT_* constants to qemu's copy of elf.h. linux-user: Reindent elfload.c. linux-user: Reduce lseek+reads while loading elf files.

[Qemu-devel] [PATCH 02/14] Add more DT_* and AT_* constants to qemu's copy of elf.h.

2010-04-28 Thread Richard Henderson
Moving some PPC AT_* constants from elfload.c at the same time. Signed-off-by: Richard Henderson r...@twiddle.net --- elf.h| 44 linux-user/elfload.c |9 - 2 files changed, 44 insertions(+), 9 deletions(-) diff --git

[Qemu-devel] [PATCH 09/14] linux-user: Put the stack guard page at the top.

2010-04-28 Thread Richard Henderson
There are no supported stack-grows-up targets. We were putting the guard page at the highest address, i.e. the bottom of the stack. Use the maximum of host and guest page size for the guard size. Signed-off-by: Richard Henderson r...@twiddle.net --- linux-user/elfload.c | 29

[Qemu-devel] [PATCH 05/14] linux-user: Fix ELF_DATA for Alpha.

2010-04-28 Thread Richard Henderson
Alpha is little-endian on Linux. Signed-off-by: Richard Henderson r...@twiddle.net --- linux-user/elfload.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 962f9ba..5814702 100644 --- a/linux-user/elfload.c +++

[Qemu-devel] [PATCH 06/14] linux-user: Clean up byte-swapping in elfload.c.

2010-04-28 Thread Richard Henderson
Remove ifdefs from code by defining empty inline functions when byte swapping isn't needed. Push loops over swapping arrays of structures into the swapping functions. Signed-off-by: Richard Henderson r...@twiddle.net --- linux-user/elfload.c | 119

[Qemu-devel] [PATCH 10/14] linux-user: Remove partial support for a.out interpreters.

2010-04-28 Thread Richard Henderson
At the bottom of the a.out support was the unimplemented load_aout_interp function. There were other portions of the support that didn't look right; when I went to look in the Linux kernel for clarification, I found that the support for such interpreters has been removed from binfmt_elf. There

[Qemu-devel] [PATCH 08/14] linux-user: Improve consistency checking in elf headers.

2010-04-28 Thread Richard Henderson
Validate more fields of the elf header. Extract those checks into two common functions to be used in both load_elf_interp and load_elf_binary. Signed-off-by: Richard Henderson r...@twiddle.net --- linux-user/elfload.c | 57 +- 1 files changed,

[Qemu-devel] [PATCH 11/14] linux-user: Extract load_elf_image from load_elf_interp.

2010-04-28 Thread Richard Henderson
Moving toward a single copy of the elf binary loading code. Fill in the details of the loaded image into a struct image_info. Adjust create_elf_tables to read from such structures instead of from a collection of passed arguments. Don't return error values from load_elf_interp; always exit(-1)

[Qemu-devel] [PATCH 13/14] linux-user: Build vdso for x64.

2010-04-28 Thread Richard Henderson
... Well, sortof. The Makefile bits are broken. Patch to load the vdso into the running program to follow. Signed-off-by: Richard Henderson r...@twiddle.net --- Makefile |3 +- pc-bios/Makefile |5 ++ pc-bios/vdso-linux-x64.S | 102

[Qemu-devel] [PATCH 14/14] linux-user: Load a VDSO for x86-64.

2010-04-28 Thread Richard Henderson
Signed-off-by: Richard Henderson r...@twiddle.net --- linux-user/elfload.c | 201 -- 1 files changed, 193 insertions(+), 8 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5771344..e8eca86 100644 ---

[Qemu-devel] [PATCH 07/14] linux-user: Load symbols from the interpreter.

2010-04-28 Thread Richard Henderson
First, adjust load_symbols to accept a load_bias parameter. At the same time, read the entire section header table in one go, use pread instead f lseek+read for the symbol and string tables, and properly free allocated structures on error exit paths. Second, adjust load_elf_interp to compute

[Qemu-devel] [PATCH 12/14] linux-user: Re-use load_elf_image for the main binary.

2010-04-28 Thread Richard Henderson
This requires moving the PT_INTERP extraction and GUEST_BASE handling into load_elf_image. Key this off a non-null pointer argument to receive the interpreter name. Signed-off-by: Richard Henderson r...@twiddle.net --- linux-user/elfload.c | 272

[Qemu-devel] [PATCH 03/14] linux-user: Reindent elfload.c.

2010-04-28 Thread Richard Henderson
Signed-off-by: Richard Henderson r...@twiddle.net --- linux-user/elfload.c | 594 +- 1 files changed, 301 insertions(+), 293 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ead22fc..ab741fd 100644 ---

Re: [Qemu-devel] [PATCH -V5 02/21] virtio-9p: Add a virtio 9p device to qemu

2010-04-28 Thread Anthony Liguori
On 04/15/2010 09:10 AM, Aneesh Kumar K.V wrote: From: Anthony Liguorialigu...@us.ibm.com This patch doesn't implement the 9p protocol handling code. It adds a simple device which dump the protocol data. [jv...@linux.vnet.ibm.com: Little-Endian to host format conversion]

Re: [Qemu-devel] [PATCH -V5 01/21] virtio-9p: Create a commandline option -fsdev

2010-04-28 Thread Anthony Liguori
On 04/15/2010 09:10 AM, Aneesh Kumar K.V wrote: From: Gautham R Shenoye...@in.ibm.com This patch creates a new command line option named -fsdev to hold any file system specific information. The option will currently hold the following attributes: -fsdev fstype id=id,path=path_to_share where

[Qemu-devel] Re: OBP under qemu-system-sparc64

2010-04-28 Thread Artyom Tarasenko
2010/4/21 Artyom Tarasenko atar4q...@googlemail.com: What is actually the closest sun4u model that qemu emulates? I'll put it the other way round then: Does qemu sun4u have anything in common with any real sun4u machine? Like PCI/EBUS/Serial addr? Since it's a pci one I gave Ultra-5's OBP a

[Qemu-devel] Re: OBP under qemu-system-sparc64

2010-04-28 Thread Blue Swirl
On 4/28/10, Artyom Tarasenko atar4q...@googlemail.com wrote: 2010/4/21 Artyom Tarasenko atar4q...@googlemail.com: What is actually the closest sun4u model that qemu emulates? At least Ultra-5 and Netra-T1. I'll put it the other way round then: Does qemu sun4u have anything in common with

[Qemu-devel] Re: [PATCH 1/2] block: Add wr_highest_sector blockstat

2010-04-28 Thread Luiz Capitulino
On Wed, 28 Apr 2010 12:47:49 -0500 Anthony Liguori anth...@codemonkey.ws wrote: On 04/28/2010 12:04 PM, Luiz Capitulino wrote: On Wed, 28 Apr 2010 11:01:12 -0500 Anthony Liguorianth...@codemonkey.ws wrote: On 04/28/2010 10:56 AM, Kevin Wolf wrote: This adds the

[Qemu-devel] [PATCH 0/2]: QMP: expose errno in the BLOCK_IO_ERROR event

2010-04-28 Thread Luiz Capitulino
Details in the patches.

[Qemu-devel] [PATCH 1/2] qemu-error: Introduce get_errno_name()

2010-04-28 Thread Luiz Capitulino
We need to expose errno in QMP, for three reasons: 1. Some error handling functions print errno codes to the user, while it's debatable whether this is good or not from a user perspective, sometimes it's the best we can do because it's what system calls and libraries return 2.

[Qemu-devel] [PATCH 2/2] QMP: Add 'reason' member to the BLOCK_IO_ERROR event

2010-04-28 Thread Luiz Capitulino
It's a parsable errno string representation, this is needed because some management tools want to base their action on the error cause. Signed-off-by: Luiz Capitulino lcapitul...@redhat.com --- QMP/qmp-events.txt |4 +++- block.c|8 +--- block.h|2 +-

Re: [Qemu-devel] Atomicity of i386 guest atomic instructions

2010-04-28 Thread Paul Brook
Alexander Graf wrote: They should be atomic. TCG SMP swaps between different vCPUs only after translation blocks are done. In fact, the only way I'm aware of to stop the execution of a TB mid-way is a page fault. A page fault would interrupt it if the atomic is implemented as a read

[Qemu-devel] [PATCH 1/5] target-i386: Remove duplicate CPU log.

2010-04-28 Thread Richard Henderson
The proper logging for -d cpu is done in generic code. Signed-off-by: Richard Henderson r...@twiddle.net --- target-i386/translate.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 6311b68..38c6016 100644 ---

[Qemu-devel] [PATCH 3/5] target-ppc: Remove duplicate cpu log.

2010-04-28 Thread Richard Henderson
Logging for -d cpu is done in generic code. Signed-off-by: Richard Henderson r...@twiddle.net --- target-ppc/translate.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 3d9d5ee..86cca51 100644 ---

[Qemu-devel] [PATCH 0/5] Remove duplicate cpu logging, v2

2010-04-28 Thread Richard Henderson
Changes from v1-v2: * Change cpu-exec.c to include the ifdef conditions that had been used in translate.c, i.e. DEBUG_DISAS, enabled by default. r~ Richard Henderson (5): target-i386: Remove duplicate CPU log. target-mips: Remove duplicate CPU log. target-ppc: Remove duplicate

[Qemu-devel] [PATCH 2/5] target-mips: Remove duplicate CPU log.

2010-04-28 Thread Richard Henderson
Logging for -d cpu is done in generic code. Signed-off-by: Richard Henderson r...@twiddle.net --- target-mips/translate.c |6 -- 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/target-mips/translate.c b/target-mips/translate.c index 7cb539d..c95ecb1 100644 ---

[Qemu-devel] [PATCH 4/5] target-sh4: Remove duplicate CPU log.

2010-04-28 Thread Richard Henderson
Logging for -d cpu is done in generic code. Signed-off-by: Richard Henderson r...@twiddle.net --- target-sh4/translate.c |6 -- 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/target-sh4/translate.c b/target-sh4/translate.c index 3537f8c..d0d6c00 100644 ---

[Qemu-devel] [PATCH 5/5] Enable -d cpu logging by default.

2010-04-28 Thread Richard Henderson
When -d cpu logging was handled by target-foo/translate.c, it was controled by DEBUG_DISAS, which is enabled by default. Use the same condition in cpu_exec. At the same time, reduce the if-deffery by assuming no flags update is required for the target. Signed-off-by: Richard Henderson

Re: [Qemu-devel] [PATCH 2/2] QMP: Add 'reason' member to the BLOCK_IO_ERROR event

2010-04-28 Thread Anthony Liguori
On 04/28/2010 03:32 PM, Luiz Capitulino wrote: It's a parsable errno string representation, this is needed because some management tools want to base their action on the error cause. Signed-off-by: Luiz Capitulinolcapitul...@redhat.com Does anyone differentiate beyond ENOSPC and EIO?