[Qemu-devel] [PATCH] target-alpha: Fix compilation errors for 32 bit hosts

2011-10-08 Thread Stefan Weil
On i386, these errors were reported:

qemu/hw/alpha_dp264.c: In function ‘clipper_init’:
qemu/hw/alpha_dp264.c:158: error: integer constant is too large for ‘unsigned 
long’ type

qemu/hw/alpha_typhoon.c: In function ‘typhoon_init’:
qemu/hw/alpha_typhoon.c:737: error: integer constant is too large for ‘long’ 
type
qemu/hw/alpha_typhoon.c:741: error: integer constant is too large for ‘long’ 
type
qemu/hw/alpha_typhoon.c:745: error: integer constant is too large for ‘long’ 
type
qemu/hw/alpha_typhoon.c:749: error: integer constant is too large for ‘long’ 
type
qemu/hw/alpha_typhoon.c:757: error: integer constant is too large for ‘long’ 
type
qemu/hw/alpha_typhoon.c:767: error: integer constant is too large for ‘long’ 
type
qemu/hw/alpha_typhoon.c:772: error: integer constant is too large for ‘long’ 
type

Signed-off-by: Stefan Weil 
---
 hw/alpha_dp264.c   |2 +-
 hw/alpha_typhoon.c |   21 ++---
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/hw/alpha_dp264.c b/hw/alpha_dp264.c
index 7c36b21..fcc20e9 100644
--- a/hw/alpha_dp264.c
+++ b/hw/alpha_dp264.c
@@ -155,7 +155,7 @@ static void clipper_init(ram_addr_t ram_size,
 load_image_targphys(initrd_filename, initrd_base,
 ram_size - initrd_base);
 
-stq_phys(param_offset + 0x100, initrd_base + 0xfc00UL);
+stq_phys(param_offset + 0x100, initrd_base + 
0xfc00ULL);
 stq_phys(param_offset + 0x108, initrd_size);
 }
 }
diff --git a/hw/alpha_typhoon.c b/hw/alpha_typhoon.c
index c769fcc..c7608bb 100644
--- a/hw/alpha_typhoon.c
+++ b/hw/alpha_typhoon.c
@@ -734,19 +734,23 @@ PCIBus *typhoon_init(ram_addr_t ram_size, qemu_irq 
*p_rtc_irq,
 
 /* Pchip0 CSRs, 0x801.8000., 256MB.  */
 memory_region_init_io(&s->pchip.region, &pchip_ops, s, "pchip0", 256*MB);
-memory_region_add_subregion(addr_space, 0x8018000, &s->pchip.region);
+memory_region_add_subregion(addr_space, 0x8018000ULL,
+&s->pchip.region);
 
 /* Cchip CSRs, 0x801.A000., 256MB.  */
 memory_region_init_io(&s->cchip.region, &cchip_ops, s, "cchip0", 256*MB);
-memory_region_add_subregion(addr_space, 0x801a000, &s->cchip.region);
+memory_region_add_subregion(addr_space, 0x801a000ULL,
+&s->cchip.region);
 
 /* Dchip CSRs, 0x801.B000., 256MB.  */
 memory_region_init_io(&s->dchip_region, &dchip_ops, s, "dchip0", 256*MB);
-memory_region_add_subregion(addr_space, 0x801b000, &s->dchip_region);
+memory_region_add_subregion(addr_space, 0x801b000ULL,
+&s->dchip_region);
 
 /* Pchip0 PCI memory, 0x800.., 4GB.  */
 memory_region_init(&s->pchip.reg_mem, "pci0-mem", 4*GB);
-memory_region_add_subregion(addr_space, 0x800, &s->pchip.reg_mem);
+memory_region_add_subregion(addr_space, 0x800ULL,
+&s->pchip.reg_mem);
 
 /* Pchip0 PCI I/O, 0x801.FC00., 32MB.  */
 /* ??? Ideally we drop the "system" i/o space on the floor and give the
@@ -754,7 +758,8 @@ PCIBus *typhoon_init(ram_addr_t ram_size, qemu_irq 
*p_rtc_irq,
We can't do that until the MEM and IO paths in memory.c are unified.  */
 memory_region_init_io(&s->pchip.reg_io, &alpha_pci_bw_io_ops, NULL,
   "pci0-io", 32*MB);
-memory_region_add_subregion(addr_space, 0x801fc00, &s->pchip.reg_io);
+memory_region_add_subregion(addr_space, 0x801fc00ULL,
+&s->pchip.reg_io);
 
 b = pci_register_bus(&s->host.busdev.qdev, "pci",
  typhoon_set_irq, sys_map_irq, s,
@@ -764,12 +769,14 @@ PCIBus *typhoon_init(ram_addr_t ram_size, qemu_irq 
*p_rtc_irq,
 /* Pchip0 PCI special/interrupt acknowledge, 0x801.F800., 64MB.  */
 memory_region_init_io(&s->pchip.reg_iack, &alpha_pci_iack_ops, b,
   "pci0-iack", 64*MB);
-memory_region_add_subregion(addr_space, 0x801f800, &s->pchip.reg_iack);
+memory_region_add_subregion(addr_space, 0x801f800ULL,
+&s->pchip.reg_iack);
 
 /* Pchip0 PCI configuration, 0x801.FE00., 16MB.  */
 memory_region_init_io(&s->pchip.reg_conf, &alpha_pci_conf1_ops, b,
   "pci0-conf", 16*MB);
-memory_region_add_subregion(addr_space, 0x801fe00, &s->pchip.reg_conf);
+memory_region_add_subregion(addr_space, 0x801fe00ULL,
+&s->pchip.reg_conf);
 
 /* For the record, these are the mappings for the second PCI bus.
We can get away with not implementing them because we indicate
-- 
1.7.0.4




[Qemu-devel] buildbot failure in qemu on xen_x86_64_debian_6_0

2011-10-08 Thread qemu
The Buildbot has detected a new failure on builder xen_x86_64_debian_6_0 while 
building qemu.
Full details are available at:
 http://buildbot.b1-systems.de/qemu/builders/xen_x86_64_debian_6_0/builds/55

Buildbot URL: http://buildbot.b1-systems.de/qemu/

Buildslave for this Build: yuzuki

Build Reason: The Nightly scheduler named 'nightly_xen' triggered this build
Build Source Stamp: [branch xen-next] HEAD
Blamelist: 

BUILD FAILED: failed git

sincerely,
 -The Buildbot



Re: [Qemu-devel] [PATCH] rsqrte_f32: No need to copy sign bit.

2011-10-08 Thread Peter Maydell
On 3 October 2011 15:28, Christophe Lyon  wrote:
> Indeed, the result is known to be always positive.

> -    val = ((val64 >> 63)  & 0x8000)
> -        | ((result_exp & 0xff) << 23)
> +    val = ((result_exp & 0xff) << 23)
>         | ((val64 >> 29)  & 0x7f);
>     return make_float32(val);

So we weren't generating incorrect results, we were just doing
slightly more work than we really needed, right? I'm curious
what prompted this patch :-)

-- PMM



[Qemu-devel] buildbot failure in qemu on default_i386_rhel61

2011-10-08 Thread qemu
The Buildbot has detected a new failure on builder default_i386_rhel61 while 
building qemu.
Full details are available at:
 http://buildbot.b1-systems.de/qemu/builders/default_i386_rhel61/builds/48

Buildbot URL: http://buildbot.b1-systems.de/qemu/

Buildslave for this Build: kraxel_rhel61_32bit

Build Reason: The Nightly scheduler named 'nightly_default' triggered this build
Build Source Stamp: [branch master] HEAD
Blamelist: 

BUILD FAILED: failed compile

sincerely,
 -The Buildbot



Re: [Qemu-devel] [PATCH 0/6] Alpha system emulation, v11

2011-10-08 Thread Blue Swirl
On Sat, Oct 8, 2011 at 3:51 PM, Richard Henderson  wrote:
> On 10/08/2011 08:37 AM, Blue Swirl wrote:
>> On Sat, Oct 1, 2011 at 3:22 PM, Richard Henderson  wrote:
>>> Ping 2.
>>>
>>> On 09/27/2011 08:32 AM, Richard Henderson wrote:
 Ping.

 On 09/22/2011 09:04 AM, Edgar E. Iglesias wrote:
> On Thu, Sep 22, 2011 at 08:30:43AM -0700, Richard Henderson wrote:
>> Changes v10 - v11:
>>   * Fixes for icount, based on feedback from Peter and Edgar.
>>   * Re-based against master.
>>
>> The patch set is also available at
>>
>>   git://repo.or.cz/qemu/rth.git axp-system-7
>>
>>
>> r~
>>
>>
>> Richard Henderson (6):
>>   target-alpha: Honor icount for RPCC instruction.
>>   target-alpha: Add custom PALcode image for CLIPPER emulation.
>>   target-alpha: Add CLIPPER emulation.
>>
>>   CC    alpha-softmmu/alpha_typhoon.o
>> /src/qemu/hw/alpha_typhoon.c: In function 'typhoon_init':
>> /src/qemu/hw/alpha_typhoon.c:788: error: too few arguments to function
>> 'isa_bus_new'
>
> Rebased, fixed, and pushed back to repo.or.cz.

Thanks, pulled.



Re: [Qemu-devel] [PULL] lm32 fixes and new milkymist hardware support

2011-10-08 Thread Blue Swirl
On Mon, Oct 3, 2011 at 1:36 PM, Michael Walle  wrote:
> Hi Anthony,
>
>> Please publish a git URI. Fetching over HTTP is painful, particularly when
>> the connection to the server isn't very good.
>
> The following changes since commit d11cf8cc80d946dfc9a23597cd9a0bb1c487cfa7:
>
>  etrax-dma: Remove bogus if statement (2011-10-03 10:20:13 +0200)
>
> are available in the git repository at:
>  git://git.serverraum.org/git/mw/qemu-lm32.git for-upstream

Thanks, pulled.

> Michael Walle (3):
>      lm32: add missing qemu_init_vcpu() call
>      milkymist_uart: support new core version
>      milkymist: new interrupt map
>
>  hw/milkymist-hw.h    |    5 +--
>  hw/milkymist-uart.c  |   72 +++--
>  hw/milkymist.c       |   14 +-
>  target-lm32/helper.c |    1 +
>  trace-events         |    4 +-
>  5 files changed, 75 insertions(+), 21 deletions(-)
>
>



Re: [Qemu-devel] [PULL 0/4] Tracing patches

2011-10-08 Thread Blue Swirl
On Mon, Oct 3, 2011 at 11:30 AM, Stefan Hajnoczi
 wrote:
> The following changes since commit d11cf8cc80d946dfc9a23597cd9a0bb1c487cfa7:
>
>  etrax-dma: Remove bogus if statement (2011-10-03 10:20:13 +0200)
>
> are available in the git repository at:
>  ssh://repo.or.cz/srv/git/qemu/stefanha.git tracing

Thanks, pulled.

>
> Michael Roth (1):
>      hmp: re-enable trace-file command
>
> Stefan Hajnoczi (3):
>      trace: trace bdrv_open_common()
>      trace: trace monitor qmp dispatch/completion
>      trace: add arguments to bdrv_co_io_em() trace event
>
>  block.c         |    4 +++-
>  hmp-commands.hx |    2 +-
>  monitor.c       |    7 +--
>  trace-events    |    7 ++-
>  4 files changed, 15 insertions(+), 5 deletions(-)
>
> --
> 1.7.6.3
>
>



Re: [Qemu-devel] [PATCH 1/2] tcg/ia64: Remove unused tcg_out_addi()

2011-10-08 Thread Blue Swirl
Thanks, applied both.

On Sat, Oct 1, 2011 at 12:56 PM, Peter Maydell  wrote:
> Remove the unused function tcg_out_addi() from the ia64 TCG backend;
> this brings it into line with other backends.
>
> Signed-off-by: Peter Maydell 
> ---
>  tcg/ia64/tcg-target.c |   19 ---
>  1 files changed, 0 insertions(+), 19 deletions(-)
>
> diff --git a/tcg/ia64/tcg-target.c b/tcg/ia64/tcg-target.c
> index 3803ab6..bb22b9a 100644
> --- a/tcg/ia64/tcg-target.c
> +++ b/tcg/ia64/tcg-target.c
> @@ -847,25 +847,6 @@ static inline void tcg_out_movi(TCGContext *s, TCGType 
> type,
>                    tcg_opc_x2 (TCG_REG_P0, OPC_MOVL_X2, reg, arg));
>  }
>
> -static inline void tcg_out_addi(TCGContext *s, TCGArg reg, tcg_target_long 
> val)
> -{
> -    if (val == ((int32_t)val << 10) >> 10) {
> -        tcg_out_bundle(s, MmI,
> -                       tcg_opc_a5(TCG_REG_P0, OPC_ADDL_A5,
> -                                  TCG_REG_R2, val, TCG_REG_R0),
> -                       tcg_opc_m48(TCG_REG_P0, OPC_NOP_M48, 0),
> -                       tcg_opc_a1 (TCG_REG_P0, OPC_ADD_A1, reg,
> -                                   reg, TCG_REG_R2));
> -    } else {
> -        tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_R2, val);
> -        tcg_out_bundle(s, mmI,
> -                       tcg_opc_m48(TCG_REG_P0, OPC_NOP_M48, 0),
> -                       tcg_opc_m48(TCG_REG_P0, OPC_NOP_M48, 0),
> -                       tcg_opc_a1 (TCG_REG_P0, OPC_ADD_A1, reg,
> -                                   reg, TCG_REG_R2));
> -    }
> -}
> -
>  static void tcg_out_br(TCGContext *s, int label_index)
>  {
>     TCGLabel *l = &s->labels[label_index];
> --
> 1.7.4.1
>
>
>



Re: [Qemu-devel] [PATCH 0/6] Alpha system emulation, v11

2011-10-08 Thread Richard Henderson
On 10/08/2011 08:37 AM, Blue Swirl wrote:
> On Sat, Oct 1, 2011 at 3:22 PM, Richard Henderson  wrote:
>> Ping 2.
>>
>> On 09/27/2011 08:32 AM, Richard Henderson wrote:
>>> Ping.
>>>
>>> On 09/22/2011 09:04 AM, Edgar E. Iglesias wrote:
 On Thu, Sep 22, 2011 at 08:30:43AM -0700, Richard Henderson wrote:
> Changes v10 - v11:
>   * Fixes for icount, based on feedback from Peter and Edgar.
>   * Re-based against master.
>
> The patch set is also available at
>
>   git://repo.or.cz/qemu/rth.git axp-system-7
>
>
> r~
>
>
> Richard Henderson (6):
>   target-alpha: Honor icount for RPCC instruction.
>   target-alpha: Add custom PALcode image for CLIPPER emulation.
>   target-alpha: Add CLIPPER emulation.
> 
>   CCalpha-softmmu/alpha_typhoon.o
> /src/qemu/hw/alpha_typhoon.c: In function 'typhoon_init':
> /src/qemu/hw/alpha_typhoon.c:788: error: too few arguments to function
> 'isa_bus_new'

Rebased, fixed, and pushed back to repo.or.cz.


r~



Re: [Qemu-devel] [PATCH 0/6] Alpha system emulation, v11

2011-10-08 Thread Blue Swirl
On Sat, Oct 1, 2011 at 3:22 PM, Richard Henderson  wrote:
> Ping 2.
>
> On 09/27/2011 08:32 AM, Richard Henderson wrote:
>> Ping.
>>
>> On 09/22/2011 09:04 AM, Edgar E. Iglesias wrote:
>>> On Thu, Sep 22, 2011 at 08:30:43AM -0700, Richard Henderson wrote:
 Changes v10 - v11:
   * Fixes for icount, based on feedback from Peter and Edgar.
   * Re-based against master.

 The patch set is also available at

   git://repo.or.cz/qemu/rth.git axp-system-7


 r~


 Richard Henderson (6):
   target-alpha: Honor icount for RPCC instruction.
   target-alpha: Add custom PALcode image for CLIPPER emulation.
   target-alpha: Add CLIPPER emulation.

  CCalpha-softmmu/alpha_typhoon.o
/src/qemu/hw/alpha_typhoon.c: In function 'typhoon_init':
/src/qemu/hw/alpha_typhoon.c:788: error: too few arguments to function
'isa_bus_new'

I don't know how to fix that while pulling, please fix or educate.

   target-alpha: Implement WAIT IPR.
   target-alpha: Implement HALT IPR.
   target-alpha: Add high-resolution access to wall clock and an alarm.
>>>
>>> Thanks
>>>
>>> Ack on everything but 2/6. Someone else can maybe check if the submodulery
>>> is OK..
>>>
>>> Acked-by: Edgar E. Iglesias 
>>
>
>
>



Re: [Qemu-devel] [Question] dump memory when host pci device is used by guest

2011-10-08 Thread Richard W.M. Jones
On Fri, Oct 07, 2011 at 12:16:07PM +0200, Jan Kiszka wrote:
> On 2011-10-07 11:46, Wen Congyang wrote:
> > Currently, virsh dump uses monitor command migrate to dump guest's memory
> > to file, and we can use crash to analyze the file.
> > 
> > Unfortunately, virsh dump can not work if guest uses host pci device. The
> > reason is that the device's status is also needed to migrate to remote 
> > machine,
> > and the host pci device's status is not stored in qemu. So it is 
> > unmigratable.
> > 
> > I think we can  we can add a option to qmp command migrate(eg: skip) to 
> > allow
> > the user to skip the check, and this option should be used only when dumping
> > the guest's memory.
> 
> Why not simply attach gdb? That works independently of migration.

It's a lot more hairy and requires dev tools to be installed on the
production host.

The core file is technically simple, has no dependencies, can be moved
to another machine for analysis, and contains all the data (not just a
backtrace).

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/



Re: [Qemu-devel] [PATCH] Make cpu_single_env thread local (Linux only for now)

2011-10-08 Thread Paolo Bonzini

On 10/07/2011 07:29 PM, David Gilbert wrote:

Hmm this got a bit more complex than the original patch; still it covers a lot
more bases.

Should this also replace the THREAD that's defined in
linux-user/qemu.h and bsd-user/qemu.h (that is __thread if built with
NPTL)?
It seems to only be there for 'thread_env' which is also a CPUState*
(hmm - what state does that contain that cpu_single_env doesn't?)


Yes, I wouldn't be surprised if thread_env can just go.  That would be a 
separate cleanup, however.


Paolo



Re: [Qemu-devel] [PATCH] qemu-kvm: Restore VAPIC option ROM installation

2011-10-08 Thread Jan Kiszka
On 2011-10-07 09:03, Jan Kiszka wrote:
> Still needed but was accidentally removed by 8bc62bc6be.
> 
> Signed-off-by: Jan Kiszka 
> ---
> 
> As the guilty patch is only in next so far, you may also fold this one
> in.
> 
>  hw/pc.c |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/pc.c b/hw/pc.c
> index a616029..70e0d08 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -1049,6 +1049,10 @@ void pc_memory_init(MemoryRegion *system_memory,
>  (uint32_t)(-bios_size),
>  bios);
>  
> +option_rom[nb_option_roms].name = g_strdup(VAPIC_FILENAME);
> +option_rom[nb_option_roms].bootindex = -1;
> +nb_option_roms++;
> +
>  fw_cfg = bochs_bios_init();
>  rom_set_fw(fw_cfg);
>  

Oops. This obviously belongs on the kvm list.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux



Re: [Qemu-devel] [PATCH 1/2] hw/9pfs: Add new virtfs option cache=writethrough to skip host page cache

2011-10-08 Thread Stefan Hajnoczi
On Fri, Oct 7, 2011 at 7:46 AM, Aneesh Kumar K.V
 wrote:
> cache=writethrough implies the file are opened in the host with O_SYNC open 
> flag
>
> Signed-off-by: Aneesh Kumar K.V 
> ---
>  fsdev/file-op-9p.h         |    1 +
>  fsdev/qemu-fsdev.c         |   10 --
>  fsdev/qemu-fsdev.h         |    2 ++
>  hw/9pfs/virtio-9p-device.c |    5 +
>  hw/9pfs/virtio-9p.c        |   24 ++--
>  qemu-config.c              |    6 ++
>  qemu-options.hx            |   17 -
>  vl.c                       |    6 ++
>  8 files changed, 58 insertions(+), 13 deletions(-)

When would this be used?  For serving up vanilla 9P?

I think 9P.u and 9P.l have support for fsync(2) while vanilla 9P does not.

Stefan



Re: [Qemu-devel] [PATCH] hw/9pfs: Use ioeventfd for 9p

2011-10-08 Thread Stefan Hajnoczi
On Fri, Oct 7, 2011 at 7:28 AM, Aneesh Kumar K.V
 wrote:
> With ioeventfd:
> [root@qemu-img-64 storage]# dd if=/dev/zero of=/storage/testx bs=8k 
> count=131072 oflag=direct
> 131072+0 records in
> 131072+0 records out
> 1073741824 bytes (1.1 GB) copied, 26.767 s, 40.1 MB/s
>
> Without:
> [root@qemu-img-64 storage]# dd if=/dev/zero of=/storage/testx bs=8k 
> count=131072 oflag=direct
> 131072+0 records in
> 131072+0 records out
> 1073741824 bytes (1.1 GB) copied, 65.3361 s, 16.4 MB/s
>
> Signed-off-by: Aneesh Kumar K.V 
> ---
>  hw/9pfs/virtio-9p-device.c |    2 ++
>  hw/virtio-pci.c            |    5 -
>  hw/virtio-pci.h            |    5 +
>  3 files changed, 7 insertions(+), 5 deletions(-)

Reviewed-by: Stefan Hajnoczi 



[Qemu-devel] Conversation with Victoria Bennett and others

2011-10-08 Thread Victoria Bennett
We have Good news you've been picked to be an official Apple product tester! 
The products will be shipped Fed-Ex.  After testing is completed you will keep
the products! All you have to do click on your special link 
http://chosentesters.com then follow the simple instructions to get started. 
Hurry as your special link will only be valid for 48 hours!


Conversation with lnew...@mac.com, lw...@medicine.ucsf.edu, 
jamesdaehn...@mac.com, undorenaudmic...@mac.com, lesliei...@mac.com, 
potsyquil...@hotmail.com, lesatel...@mac.com, plpart...@gmail.com, 
undosch...@machomes.com, n...@lists.ca.ibm.com, j...@tblaw.com, 
calegalservi...@mccarthyholthus.com, undodebbiebartu...@mac.com, 
laurace...@mac.com, jorda...@mac.com, beverlyke...@mac.com, 
lesliedavisgl...@cox.net, jlear...@mac.com, qemu-devel@nongnu.org, 
bernicebe...@gmail.com, undolesliemass...@mac.com, ab...@mac.com, 
mizte...@mac.com, tucker3...@bellsouth.net, bdaure...@mac.com, 
dahje...@mac.com, birdstud...@mac.com, m...@newsandtribune.com, 
book...@macdelavega.com, lesliew...@mac.com and Victoria Bennett


Re: [Qemu-devel] [PATCH 08/26] Sparc: fix coding style

2011-10-08 Thread Blue Swirl
On Fri, Oct 7, 2011 at 12:26 PM, Dong Xu Wang
 wrote:
> I checked the patch with ./scripts/checkpatch.pl, and met errors and
> warnings:
> total: 10 errors, 46 warnings, 2195 lines checked
>
> I think if the patch makes checkpatch happy, it will be better. :).

I get this instead:
total: 0 errors, 0 warnings, 2118 lines checked

Your patch has no obvious style problems and is ready for submission.



Re: [Qemu-devel] [PATCH] tcg: Introduce TCGReg for all TCG hosts (fixes build for s390 hosts)

2011-10-08 Thread Blue Swirl
On Fri, Oct 7, 2011 at 6:26 PM, Stefan Weil  wrote:
> Am 07.10.2011 20:13, schrieb Richard Henderson:
>>
>> On 10/07/2011 11:00 AM, Stefan Weil wrote:
>>>
>>> +#define TCGReg int /* TODO: Remove this line when tcg-target.c uses
>>> TCGReg. */
>>
>> Nack. This is too ugly to live.

Fully agree.

>>
>> How hard can it be to simply change the prototype in each
>> of the backend files instead? Yes, full conversion to
>> TCGReg is desirable, but this is not C++ -- integers and
>> enums are interchangable without casts.
>>
>> r~
>
> The goal of my patch is to get code which compiles again
> on all hosts with minimum risk and which is a base for further
> improvements.
>
> I cannot run build tests for all possible hosts, and even
> changing 4 prototypes for each host is a risk when it is not
> tested. Yes, you can review the changes, some developers can
> try builds, but that takes a lot of time.

The only problem with changing ints to enums is that enums may be
unsigned depending on the compiler, otherwise it is safe. I don't
think any arithmetic is performed with the register numbers.

> As soon as my patch is applied, it is possible to add
> more TCGReg usage to tcg.c, s390/tcg-target.c and all
> other TCG targets in independent patches.
>
> I'm just preparing patches for tcg.c and i386/tcg-target.*.
>
> But let me repeat: these new patches need a good review
> which will take some time. The bug fix should be applied soon.
> Maybe you can change your mind and send an ack.
>
> - Stefan
>
>



Re: [Qemu-devel] [RFC] 1.0 release schedule adjustment (spreading out RCs)

2011-10-08 Thread Blue Swirl
On Thu, Oct 6, 2011 at 3:26 PM, Anthony Liguori  wrote:
> Hi,
>
> I'm trying to map out the 1.1 release using the same formula as the 1.0
> release.  To make things work a bit better, I'd like to adjust the -rc
> schedule a bit. Namely:
>
> | 2011-11-01
> | Freeze master
> |-
> | 2011-11-04  ->   2011-11-07
> | Tag qemu-1.0-rc1
> |-
> | 2011-11-11  ->   2011-11-14
> | Tag qemu-1.0-rc2
> |-
> | 2011-11-18  ->   2011-11-21
> | Tag qemu-1.0-rc3
> |-
> | 2011-11-23  ->   2011-11-28
> | Tag qemu-1.0-rc4
> |-
> | 2011-12-01
> | Tag qemu-1.0
>
> I had squashed things originally because of the US Thanksgiving holiday on
> the 25th but realistically, the 28th is no better than the 23rd.  This
> spreads out the -rcs a bit more evenly.
>
> Any thoughts/objections?

Looks doable now since PPC works again.



Re: [Qemu-devel] [PULL 00/64] ppc patch queue 2011-10-06

2011-10-08 Thread Blue Swirl
On Thu, Oct 6, 2011 at 8:05 AM, Alexander Graf  wrote:
> Hi Blue,
>
> This is my current patch queue for ppc. Please pull.

Thanks, pulled. This fixes PPC boot, also nographic works.

>
> Alex
>
>
> The following changes since commit e4fc8781db7c49b0c5ac5d24762e17c59dfe0871:
>  Stefan Hajnoczi (1):
>        qed: fix use-after-free during l2 cache commit
>
> are available in the git repository at:
>
>  git://repo.or.cz/qemu/agraf.git ppc-next
>
> Alexander Graf (41):
>      PPC: Move openpic to target specific code compilation
>      PPC: Add CPU local MMIO regions to MPIC
>      PPC: Extend MPIC MMIO range
>      PPC: Fix IPI support in MPIC
>      PPC: Set MPIC IDE for IPI to 0
>      PPC: MPIC: Remove read functionality for WO registers
>      PPC: MPIC: Fix CI bit definitions
>      PPC: Bump MPIC up to 32 supported CPUs
>      PPC: E500: create multiple envs
>      PPC: E500: Generate IRQ lines for many CPUs
>      device tree: add nop_node
>      PPC: bamboo: Move host fdt copy to target
>      PPC: KVM: Add generic function to read host clockfreq
>      PPC: E500: Use generic kvm function for freq
>      PPC: E500: Remove mpc8544_copy_soc_cell
>      PPC: bamboo: Use kvm api for freq and clock frequencies
>      PPC: KVM: Remove kvmppc_read_host_property
>      PPC: KVM: Add stubs for kvm helper functions
>      PPC: E500: Update freqs for all CPUs
>      PPC: E500: Remove unneeded CPU nodes
>      PPC: E500: Add PV spinning code
>      PPC: E500: Update cpu-release-addr property in cpu nodes
>      device tree: add add_subnode command
>      device tree: dont fail operations
>      device tree: give dt more size
>      MPC8544DS: Remove CPU nodes
>      MPC8544DS: Generate CPU nodes on init
>      PPC: E500: Bump CPU count to 15
>      PPC: Add new target config for pseries
>      KVM: update kernel headers
>      PPC: Enable to use PAPR with PR style KVM
>      PPC: SPAPR: Use KVM function for time info
>      KVM: Update kernel headers
>      openpic: Unfold read_IRQreg
>      openpic: Unfold write_IRQreg
>      PPC: Fix via-cuda memory registration
>      PPC: Fix heathrow PIC to use little endian MMIO
>      KVM: Update kernel headers
>      KVM: Update kernel headers
>      KVM: PPC: Use HIOR setting for -M pseries with PR KVM
>      PPC: Clean up BookE timer code
>
> Andreas Färber (1):
>      ppc64: Fix linker script
>
> Breno Leitao (1):
>      pseries: Implement set-time-of-day RTAS function
>
> David Gibson (8):
>      pseries: Bugfixes for interrupt numbering in XICS code
>      pseries: Add a phandle to the xicp interrupt controller device tree node
>      pseries: interrupt controller should not have a 'reg' property
>      pseries: More complete WIMG validation in H_ENTER code
>      pseries: Add real mode debugging hcalls
>      Implement POWER7's CFAR in TCG
>      pseries: Implement hcall-bulk hypervisor interface
>      pseries: Refactor spapr irq allocation
>
> Elie Richa (1):
>      PPC: Fix sync instructions problem in SMP
>
> Fabien Chouteau (2):
>      Gdbstub: handle read of fpscr
>      PPC: booke timers
>
> Laurent Vivier (1):
>      ppc: move ADB stuff from ppc_mac.h to adb.h
>
> Nishanth Aravamudan (1):
>      pseries: use macro for firmware filename
>
> Paolo Bonzini (4):
>      spapr: proper qdevification
>      spapr: prepare for qdevification of irq
>      spapr: make irq customizable via qdev
>      vscsi: send the CHECK_CONDITION status down together with autosense data
>
> Scott Wood (3):
>      kvm: ppc: booke206: use MMU API
>      ppc: booke206: add "info tlb" support
>      ppc: booke206: use MAV=2.0 TSIZE definition, fix 4G pages
>
> Stefan Hajnoczi (1):
>      ppc405: use RAM_ADDR_FMT instead of %08lx
>
>  Makefile.objs                    |    1 -
>  Makefile.target                  |   12 +-
>  configure                        |    3 +
>  cpu-exec.c                       |    1 +
>  device_tree.c                    |   92 ++--
>  device_tree.h                    |    2 +
>  gdbstub.c                        |    2 +-
>  hmp-commands.hx                  |    2 +-
>  hw/adb.c                         |    2 +-
>  hw/adb.h                         |   67 +
>  hw/cuda.c                        |   29 +++--
>  hw/heathrow_pic.c                |    2 +-
>  hw/openpic.c                     |  289 
> +-
>  hw/ppc.c                         |  138 +++---
>  hw/ppc.h                         |   37 +-
>  hw/ppc405_boards.c               |    5 +-
>  hw/ppc440_bamboo.c               |   16 ++-
>  hw/ppc4xx_devs.c                 |    2 +-
>  hw/ppc_booke.c                   |  254 +
>  hw/ppc_mac.h                     |   42 --
>  hw/ppc_newworld.c                |    1 +
>  hw/ppc_oldworld.c                |    1 +
>  hw/ppce500_mpc8544ds.c           |  191 +++---
>  hw/ppce500_spin.c                |  215 
>  hw/spapr.c    

Re: [Qemu-devel] segfault on current HEAD, qemu-system-arm

2011-10-08 Thread Blue Swirl
On Wed, Oct 5, 2011 at 1:22 PM, Peter Maydell  wrote:
> On 2 October 2011 19:44, Blue Swirl  wrote:
>> Bah, bug in bccd9ec5f098668576342c83d90d6d6833d61d33,
>> target-arm/op_helper.c missed this change unlike all other targets:
>> diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
>> index ab9c923..1892b35 100644
>> --- a/target-arm/op_helper.c
>> +++ b/target-arm/op_helper.c
>> @@ -84,6 +84,7 @@ void tlb_fill(CPUState *env1, target_ulong addr, int
>> is_write, int mmu_idx,
>>     int ret;
>>
>>     saved_env = env;
>> +    env = env1;
>>     ret = cpu_arm_handle_mmu_fault(env, addr, is_write, mmu_idx);
>>     if (unlikely(ret)) {
>>         if (retaddr) {
>>
>
> This fixes the segfault for me.
>
> Reviewed-by: Peter Maydell 

Thanks for the review, applied.



Re: [Qemu-devel] Integrating Dynamips and GNS3 UDP tunnels (Patches)

2011-10-08 Thread Stefan Weil

Am 08.10.2011 19:31, schrieb Benjamin:

diff --git a/net/udp.c b/net/udp.c
new file mode 100644
index 000..7b4b702
--- /dev/null
+++ b/net/udp.c
@@ -0,0 +1,140 @@
+/*
+ * QEMU System Emulator


What about using a title which matches better?
Maybe 'UDP tunnel' or something like that?



+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard


And here you might use your own copyright.
Or did Fabrice start writing this code in 2003?



diff --git a/net/udp.h b/net/udp.h
new file mode 100644
index 000..e614077
--- /dev/null
+++ b/net/udp.h
@@ -0,0 +1,32 @@
+/*
+ * QEMU System Emulator
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ *


See comments given above.

Regards,
Stefan Weil




Re: [Qemu-devel] Integrating Dynamips and GNS3 UDP tunnels (Patches)

2011-10-08 Thread Jan Kiszka
On 2011-10-08 19:31, Benjamin wrote:
> On 10/07/11 10:35, Jan Kiszka wrote:
>>
>> You should send out the changes as proper patch series, rebased on
>> current git head. See http://wiki.qemu.org/Contribute/SubmitAPatch for
>> further requirements. And make sure that no patch breaks the build so
>> that bisectability is preserved.
>>
>> Jan
>>
> 
> Tested and used for several years by GNS3, it doesn't break the build.

If you split the changes into multiple patches, there would have been
the risk that some patch breaks the build until a succeeding one is applied.

> 
> I could not access http://git.qemu.org/qemu.git/plain/CODING_STYLE and
> http://git.qemu.org/qemu.git/plain/HACKING (404) so these patches may
> not be 100% conform. The script didn't report any error though.

You also find those files in your local qemu tree.

> 
> Signed-off-by: Benjamin MARSILI 

Patch title and description are missing.

> 
> diff --git a/Makefile.objs b/Makefile.objs
> index 8d23fbb..6b4896b 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -45,6 +45,7 @@ net-obj-y = net.o
>  net-nested-y = queue.o checksum.o util.o
>  net-nested-y += socket.o
>  net-nested-y += dump.o
> +net-nested-y += udp.o
>  net-nested-$(CONFIG_POSIX) += tap.o
>  net-nested-$(CONFIG_LINUX) += tap-linux.o
>  net-nested-$(CONFIG_WIN32) += tap-win32.o
> diff --git a/net.c b/net.c
> index d05930c..6a3b2ba 100644
> --- a/net.c
> +++ b/net.c
> @@ -30,6 +30,7 @@
>  #include "net/dump.h"
>  #include "net/slirp.h"
>  #include "net/vde.h"
> +#include "net/udp.h"
>  #include "net/util.h"
>  #include "monitor.h"
>  #include "qemu-common.h"
> @@ -1036,6 +1037,27 @@ static const struct {
>  },
>  },
>  #endif
> +[NET_CLIENT_TYPE_UDP] = {
> +.type = "udp",
> +.init = net_init_udp,
> +.desc = {
> +NET_COMMON_PARAMS_DESC,
> +{
> +.name = "sport",
> +.type = QEMU_OPT_NUMBER,
> +.help = "source port number",
> +}, {
> +.name = "daddr",
> +.type = QEMU_OPT_STRING,
> +.help = "destination IP address",
> +}, {
> +.name = "dport",
> +.type = QEMU_OPT_NUMBER,
> +.help = "destination port number",
> +},
> +{ /* end of list */ }
> +},
> +},
>  [NET_CLIENT_TYPE_DUMP] = {
>  .type = "dump",
>  .init = net_init_dump,
> diff --git a/net.h b/net.h
> index 9f633f8..ac6118c 100644
> --- a/net.h
> +++ b/net.h
> @@ -35,6 +35,7 @@ typedef enum {
>  NET_CLIENT_TYPE_TAP,
>  NET_CLIENT_TYPE_SOCKET,
>  NET_CLIENT_TYPE_VDE,
> +NET_CLIENT_TYPE_UDP,
>  NET_CLIENT_TYPE_DUMP,
> 
>  NET_CLIENT_TYPE_MAX
> diff --git a/net/udp.c b/net/udp.c
> new file mode 100644
> index 000..7b4b702
> --- /dev/null
> +++ b/net/udp.c
> @@ -0,0 +1,140 @@
> +/*
> + * QEMU System Emulator
> + *
> + * Copyright (c) 2003-2008 Fabrice Bellard
> + *
> + * Permission is hereby granted, free of charge, to any person
> obtaining a copy
> + * of this software and associated documentation files (the
> "Software"), to deal
> + * in the Software without restriction, including without limitation
> the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or
> sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be
> included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> DEALINGS IN
> + * THE SOFTWARE.
> + */
> +#include "net/udp.h"
> +
> +#include "config-host.h"
> +
> +#ifndef _WIN32
> +#include 
> +#include 
> +#include 
> +#endif
> +
> +#include "net.h"
> +#include "qemu-char.h"
> +#include "qemu-common.h"
> +#include "qemu-option.h"
> +#include "qemu_socket.h"
> +#include "sysemu.h"
> +
> +
> +typedef struct UDPState {
> +VLANClientState nc;
> +int rfd;
> +struct sockaddr_in sender;
> +} UDPState;
> +
> +static void udp_to_qemu(void *opaque)
> +{
> +UDPState *s = opaque;
> +uint8_t buf[4096];
> +int size;
> +
> +size = recvfrom(s->rfd, (char *)buf, sizeof(buf), 0, NULL, NULL);
> +if (size > 0) {
> +qemu_send_packet(&s->nc, buf, size);
> +}
> +}
> +
> +static ssize_t udp_receive(VLANClientState *nc, const uint8_t *buf,
> size_t size)
> +{
> +UDPState *s = DO_UPCAST(UDPState, nc, nc);
> 

[Qemu-devel] usb_packet_complete assert(p->owner != NULL)

2011-10-08 Thread Stefan Hajnoczi
Hi,
I hit an assertion in hw/usb.c when passing through a host USB device
on qemu.git/master (e4fc8781db7c49b0c5ac5d24762e17c59dfe0871).  This
device has never worked before and I was curious to see how
qemu.git/master would do.

The assertion is:
void usb_packet_complete(USBDevice *dev, USBPacket *p)
{
/* Note: p->owner != dev is possible in case dev is a hub */
assert(p->owner != NULL);

The problem seems to be that usb_packet_complete() is called on the
hub device and the hub calls usb_packet_complete() again on the actual
leaf device.  Since usb_packet_complete() sets packet->owner to NULL
we hit the assertion immediately when trying to invoke the leaf device
.complete().

I don't understand how USB emulation hangs together, so I added this quick hack:

diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 286e3ad..277cb47 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -210,7 +210,7 @@ static void usb_hub_complete(USBPort *port,
USBPacket *packet)
  * If we ever inplement usb 2.0 split transactions this will
  * become a little more complicated ...
  */
-usb_packet_complete(&s->dev, packet);
+s->dev.port->ops->complete(s->dev.port, packet);
 }

 static void usb_hub_handle_reset(USBDevice *dev)

The hub is now directly invoking .complete() and not messing with
packet->owner (which is already NULL).  We don't hit the assertion
anymore.  Unfortunately the device does not work in my Windows guest -
it must be another problem though.

I'm not sending it as a patch because there's probably a better way of
fixing this.  Any ideas?

Stefan



Re: [Qemu-devel] Integrating Dynamips and GNS3 UDP tunnels (Patches)

2011-10-08 Thread Benjamin

On 10/07/11 10:35, Jan Kiszka wrote:
>
> You should send out the changes as proper patch series, rebased on
> current git head. See http://wiki.qemu.org/Contribute/SubmitAPatch for
> further requirements. And make sure that no patch breaks the build so
> that bisectability is preserved.
>
> Jan
>

Tested and used for several years by GNS3, it doesn't break the build.

I could not access http://git.qemu.org/qemu.git/plain/CODING_STYLE and
http://git.qemu.org/qemu.git/plain/HACKING (404) so these patches may
not be 100% conform. The script didn't report any error though.

Signed-off-by: Benjamin MARSILI  



diff --git a/Makefile.objs b/Makefile.objs
index 8d23fbb..6b4896b 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -45,6 +45,7 @@ net-obj-y = net.o
 net-nested-y = queue.o checksum.o util.o
 net-nested-y += socket.o
 net-nested-y += dump.o
+net-nested-y += udp.o
 net-nested-$(CONFIG_POSIX) += tap.o
 net-nested-$(CONFIG_LINUX) += tap-linux.o
 net-nested-$(CONFIG_WIN32) += tap-win32.o
diff --git a/net.c b/net.c
index d05930c..6a3b2ba 100644
--- a/net.c
+++ b/net.c
@@ -30,6 +30,7 @@
 #include "net/dump.h"
 #include "net/slirp.h"
 #include "net/vde.h"
+#include "net/udp.h"
 #include "net/util.h"
 #include "monitor.h"
 #include "qemu-common.h"
@@ -1036,6 +1037,27 @@ static const struct {
 },
 },
 #endif
+[NET_CLIENT_TYPE_UDP] = {
+.type = "udp",
+.init = net_init_udp,
+.desc = {
+NET_COMMON_PARAMS_DESC,
+{
+.name = "sport",
+.type = QEMU_OPT_NUMBER,
+.help = "source port number",
+}, {
+.name = "daddr",
+.type = QEMU_OPT_STRING,
+.help = "destination IP address",
+}, {
+.name = "dport",
+.type = QEMU_OPT_NUMBER,
+.help = "destination port number",
+},
+{ /* end of list */ }
+},
+},
 [NET_CLIENT_TYPE_DUMP] = {
 .type = "dump",
 .init = net_init_dump,
diff --git a/net.h b/net.h
index 9f633f8..ac6118c 100644
--- a/net.h
+++ b/net.h
@@ -35,6 +35,7 @@ typedef enum {
 NET_CLIENT_TYPE_TAP,
 NET_CLIENT_TYPE_SOCKET,
 NET_CLIENT_TYPE_VDE,
+NET_CLIENT_TYPE_UDP,
 NET_CLIENT_TYPE_DUMP,

 NET_CLIENT_TYPE_MAX
diff --git a/net/udp.c b/net/udp.c
new file mode 100644
index 000..7b4b702
--- /dev/null
+++ b/net/udp.c
@@ -0,0 +1,140 @@
+/*
+ * QEMU System Emulator
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person 
obtaining a copy
+ * of this software and associated documentation files (the 
"Software"), to deal
+ * in the Software without restriction, including without limitation 
the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or 
sell

+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be 
included in

+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
EXPRESS OR

+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
DEALINGS IN

+ * THE SOFTWARE.
+ */
+#include "net/udp.h"
+
+#include "config-host.h"
+
+#ifndef _WIN32
+#include 
+#include 
+#include 
+#endif
+
+#include "net.h"
+#include "qemu-char.h"
+#include "qemu-common.h"
+#include "qemu-option.h"
+#include "qemu_socket.h"
+#include "sysemu.h"
+
+
+typedef struct UDPState {
+VLANClientState nc;
+int rfd;
+struct sockaddr_in sender;
+} UDPState;
+
+static void udp_to_qemu(void *opaque)
+{
+UDPState *s = opaque;
+uint8_t buf[4096];
+int size;
+
+size = recvfrom(s->rfd, (char *)buf, sizeof(buf), 0, NULL, NULL);
+if (size > 0) {
+qemu_send_packet(&s->nc, buf, size);
+}
+}
+
+static ssize_t udp_receive(VLANClientState *nc, const uint8_t *buf, 
size_t size)

+{
+UDPState *s = DO_UPCAST(UDPState, nc, nc);
+int ret;
+
+do {
+ret = sendto(s->rfd, (const char *)buf, size, 0,
+   (struct sockaddr *)&s->sender, sizeof(s->sender));
+} while (ret < 0 && errno == EINTR);
+
+return ret;
+}
+
+static void udp_cleanup(VLANClientState *nc)
+{
+UDPState *s = DO_UPCAST(UDPState, nc, nc);
+qemu_set_fd_handler(s->rfd, NULL, NULL, NULL);
+close(s->rfd);
+}
+
+static NetClientInfo net_udp_info = {
+.type = NET_CLIENT_TYPE_UDP,
+.size = sizeof(UDPState),
+.receive = udp_receive,
+.cleanup = udp_cleanup,
+};
+
+static int net_udp_