[Qemu-devel] [Bug 902720] [NEW] TIME_MAX not set correctly for OpenBSD in qemu-common.h

2011-12-10 Thread Brad Smith
Public bug reported: Looking at the OpenBSD buildbot logs I noticed a warning that appears to be a bug in the code. OpenBSD has a 32-bit time_t on all archs at the moment (32-bit and 64-bit). CCi386-softmmu/monitor.o /buildbot-qemu/default_openbsd_current/build/monitor.c: In function 'exp

[Qemu-devel] [Bug 902413] Re: qemu-i386-user on ARM host: wine hangs/spins when trying to run anything

2011-12-10 Thread Peter Maydell
QEMU has no separate amd64 target; it is all handled by target-i386. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/902413 Title: qemu-i386-user on ARM host: wine hangs/spins when trying to run an

[Qemu-devel] [Bug 902413] Re: qemu-i386-user on ARM host: wine hangs/spins when trying to run anything

2011-12-10 Thread Pierre-Loup A. Griffais
Understood, thanks a lot for the pointers. From a quick skim it doesn't look like I'm directly running into any of these ARM host issues (yet). I'm hopeful that the i386 target will get increasing attention in the future as ARM devices get more widespread after x86 was the standard for so long. Out

[Qemu-devel] [PATCH v2] tcg: Convert *_tl*() macros to inline functions

2011-12-10 Thread Andreas Färber
Using {GET,MAKE}_TCGV_*() on parameters requires properly passing arguments into the macro, so use strongly-typed functions while at it. Signed-off-by: Andreas Färber --- v1 -> v2: * Use target_long for immediate arguments, not tcg_target_long tcg/tcg-op.h | 1021

Re: [Qemu-devel] [PATCH] tcg: make tcg_const_ptr actually accept a pointer argument

2011-12-10 Thread Andreas Färber
Am 10.12.2011 17:35, schrieb Peter Maydell: > Make tcg_const_ptr() include a cast so that you can pass it a > pointer. This allows us to drop the casts we had in all the places > that use this macro. > > Signed-off-by: Peter Maydell Acked-by: Andreas Färber At first the use of tcg_target_long

Re: [Qemu-devel] [RFC] Device sandboxing

2011-12-10 Thread Blue Swirl
On Fri, Dec 9, 2011 at 16:17, Paul Brook wrote: >> A group of us are starting to work on sandboxing QEMU device emulation >> code.  We're just getting started investigating various approaches, and >> want to engage the community to gather input. >> >> Following are the design points that we are cu

Re: [Qemu-devel] [PATCH 2/2] i8254: Rework & fix interaction with HPET in legacy mode

2011-12-10 Thread Blue Swirl
On Sat, Dec 10, 2011 at 16:29, Jan Kiszka wrote: > On 2011-12-10 17:26, Blue Swirl wrote: >> On Sat, Dec 10, 2011 at 16:03, Jan Kiszka wrote: >>> On 2011-12-10 16:54, Blue Swirl wrote: On Sat, Dec 10, 2011 at 15:51, Jan Kiszka wrote: > On 2011-12-10 16:49, Blue Swirl wrote: >>>

[Qemu-devel] [PATCH 6/6] vga: compile cirrus_vga in hwlib

2011-12-10 Thread Blue Swirl
Remove target dependencies and compile Cirrus VGA in hwlib. Signed-off-by: Blue Swirl --- Makefile.objs |1 + Makefile.target |1 - hw/cirrus_vga.c |3 --- 3 files changed, 1 insertions(+), 4 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 3a699ee..932c68a 100644 ---

[Qemu-devel] [PATCH 5/6] sga: fix copypasta

2011-12-10 Thread Blue Swirl
Signed-off-by: Blue Swirl --- hw/sga.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sga.c b/hw/sga.c index 7ef750a..ea11937 100644 --- a/hw/sga.c +++ b/hw/sga.c @@ -35,7 +35,7 @@ typedef struct ISAGAState { ISADevice dev; } ISASGAState; -static int isa_cir

[Qemu-devel] [PATCH 4/6] memory: find dirty range

2011-12-10 Thread Blue Swirl
Instead of each target knowing or guessing the guest page size, iterate through the dirty ranges. Signed-off-by: Blue Swirl --- cpu-all.h | 30 ++ hw/tcx.c | 54 ++ hw/vga.c | 16 +++- memory.c |

[Qemu-devel] [PATCH 3/6] vga: make Cirrus ISA device optional

2011-12-10 Thread Blue Swirl
Signed-off-by: Blue Swirl --- Makefile.target | 13 +++--- default-configs/alpha-softmmu.mak|2 + default-configs/arm-softmmu.mak |1 + default-configs/i386-softmmu.mak |2 + default-configs/mips-softmmu.mak |2 + default-configs/mips64-

[Qemu-devel] [PATCH 2/6] memory: change dirty setting APIs to take a size

2011-12-10 Thread Blue Swirl
Instead of each target knowing or guessing the guest page size, just pass the desired size of dirtied memory area. This should also improve performance due to memset() optimizations. Signed-off-by: Blue Swirl --- arch_init.c |3 ++- cpu-all.h |9 +++-- hw/cirrus_vga.c | 1

[Qemu-devel] [PATCH 1/6] vga: improve VGA logic

2011-12-10 Thread Blue Swirl
Improve VGA selection logic, push check for device availabilty to vl.c. Create the devices at board level unconditionally. Remove now unused pci_try_create*() functions. Make PCI VGA devices optional. Signed-off-by: Blue Swirl --- hw/alpha_pci.c| 11 +++-- hw/boards.h |1 -

[Qemu-devel] [PATCH v3 0/6] VGA patches

2011-12-10 Thread Blue Swirl
I'm not happy with the iterative dirty range finding API (fully implemented on TCX here). It is not very useful from the device point of view since memory address to coordinate conversion may be nontrivial. Any suggestions? Blue Swirl (6): vga: improve VGA logic memory: change dirty setting AP

[Qemu-devel] [PATCH] tcg: make tcg_const_ptr actually accept a pointer argument

2011-12-10 Thread Peter Maydell
Make tcg_const_ptr() include a cast so that you can pass it a pointer. This allows us to drop the casts we had in all the places that use this macro. Signed-off-by: Peter Maydell --- Minor cleanup; I have a patchset cooking that wants to use tcg_const_ptr(), which is why I noticed this infelicity

Re: [Qemu-devel] [PATCH 2/2] i8254: Rework & fix interaction with HPET in legacy mode

2011-12-10 Thread Jan Kiszka
On 2011-12-10 17:26, Blue Swirl wrote: > On Sat, Dec 10, 2011 at 16:03, Jan Kiszka wrote: >> On 2011-12-10 16:54, Blue Swirl wrote: >>> On Sat, Dec 10, 2011 at 15:51, Jan Kiszka wrote: On 2011-12-10 16:49, Blue Swirl wrote: >> >> +ISADevice *pit_init(int base, qemu_irq irq) > >>>

Re: [Qemu-devel] [PATCH 2/2] i8254: Rework & fix interaction with HPET in legacy mode

2011-12-10 Thread Blue Swirl
On Sat, Dec 10, 2011 at 16:03, Jan Kiszka wrote: > On 2011-12-10 16:54, Blue Swirl wrote: >> On Sat, Dec 10, 2011 at 15:51, Jan Kiszka wrote: >>> On 2011-12-10 16:49, Blue Swirl wrote: > > +ISADevice *pit_init(int base, qemu_irq irq) Please retain this function in pc.h, or even

Re: [Qemu-devel] [PATCH v4 12/15] kvm: x86: Add user space part for in-kernel APIC

2011-12-10 Thread Blue Swirl
On Sat, Dec 10, 2011 at 15:58, Jan Kiszka wrote: > On 2011-12-10 16:40, Blue Swirl wrote: >> On Fri, Dec 9, 2011 at 07:52, Jan Kiszka wrote: >>> On 2011-12-09 08:45, Jan Kiszka wrote: On 2011-12-08 22:16, Blue Swirl wrote: > On Thu, Dec 8, 2011 at 11:52, Jan Kiszka wrote: >> This in

Re: [Qemu-devel] [PATCH 2/2] i8254: Rework & fix interaction with HPET in legacy mode

2011-12-10 Thread Jan Kiszka
On 2011-12-10 16:54, Blue Swirl wrote: > On Sat, Dec 10, 2011 at 15:51, Jan Kiszka wrote: >> On 2011-12-10 16:49, Blue Swirl wrote: +ISADevice *pit_init(int base, qemu_irq irq) >>> >>> Please retain this function in pc.h, or even better, introduce i8254.h. >> >> No concerns about i8254.h

Re: [Qemu-devel] [PATCH v4 12/15] kvm: x86: Add user space part for in-kernel APIC

2011-12-10 Thread Jan Kiszka
On 2011-12-10 16:40, Blue Swirl wrote: > On Fri, Dec 9, 2011 at 07:52, Jan Kiszka wrote: >> On 2011-12-09 08:45, Jan Kiszka wrote: >>> On 2011-12-08 22:16, Blue Swirl wrote: On Thu, Dec 8, 2011 at 11:52, Jan Kiszka wrote: > This introduces the alternative APIC backend which makes use of

Re: [Qemu-devel] [PATCH 2/2] i8254: Rework & fix interaction with HPET in legacy mode

2011-12-10 Thread Blue Swirl
On Sat, Dec 10, 2011 at 15:51, Jan Kiszka wrote: > On 2011-12-10 16:49, Blue Swirl wrote: >>> >>> +ISADevice *pit_init(int base, qemu_irq irq) >> >> Please retain this function in pc.h, or even better, introduce i8254.h. > > No concerns about i8254.h, but this function does not qualify for static

Re: [Qemu-devel] [PATCH 0/2] pit/hpet: Fix legacy mode switching

2011-12-10 Thread Blue Swirl
On Sat, Dec 10, 2011 at 12:28, Jan Kiszka wrote: > This is a small preparatory series to allow the introduction of the KVM > in-kernel PIT. Of course, it is also a fix for the various bugs in the > related PIT/HPET code. See patches for details. > > Jan Kiszka (2): >  hpet: Save/restore cached RTC

Re: [Qemu-devel] [PATCH 2/2] i8254: Rework & fix interaction with HPET in legacy mode

2011-12-10 Thread Jan Kiszka
On 2011-12-10 16:49, Blue Swirl wrote: >> >> +ISADevice *pit_init(int base, qemu_irq irq) > > Please retain this function in pc.h, or even better, introduce i8254.h. No concerns about i8254.h, but this function does not qualify for static inline. > >> +{ >> +ISADevice *dev; >> + >> +dev

Re: [Qemu-devel] [PATCH 2/2] i8254: Rework & fix interaction with HPET in legacy mode

2011-12-10 Thread Blue Swirl
On Sat, Dec 10, 2011 at 12:28, Jan Kiszka wrote: > From: Jan Kiszka > > When the HPET enters legacy mode, the IRQ output of the PIT is > suppressed and replaced by the HPET timer 0. But the current code to > emulate this was broken in many ways. It reset the PIT state after > re-enabling, it work

Re: [Qemu-devel] [PATCH v4 12/15] kvm: x86: Add user space part for in-kernel APIC

2011-12-10 Thread Blue Swirl
On Fri, Dec 9, 2011 at 07:52, Jan Kiszka wrote: > On 2011-12-09 08:45, Jan Kiszka wrote: >> On 2011-12-08 22:16, Blue Swirl wrote: >>> On Thu, Dec 8, 2011 at 11:52, Jan Kiszka wrote: This introduces the alternative APIC backend which makes use of KVM's in-kernel device model. External N

Re: [Qemu-devel] [PATCH] target-i386: fix cmpxchg instruction emulation

2011-12-10 Thread Andreas Gustafsson
malc wrote: > > Inefficient in what way? The generated code only grows by a single > > unconditional branch. > > The generated code grows by a memory write Yes, an additional store instruction is generated, but the number of store instructions *executed* does not change. The original code alrea

[Qemu-devel] [Bug 902413] Re: qemu-i386-user on ARM host: wine hangs/spins when trying to run anything

2011-12-10 Thread Peter Maydell
For ARM hosts (mostly being worked on): https://bugs.launchpad.net/qemu/+bug/893208 https://bugs.launchpad.net/qemu/+bug/883136 https://bugs.launchpad.net/qemu/+bug/883133 https://bugs.launchpad.net/qemu/+bug/870990 For x86 multithreaded (mostly *not* being worked on): https://bugs.launchpad.net/q

[Qemu-devel] [Bug 870990] Re: compile failure on ARMv7 hosts when compiled for thumb if --enable-debug

2011-12-10 Thread Peter Maydell
** Also affects: qemu Importance: Undecided Status: New -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/870990 Title: compile failure on ARMv7 hosts when compiled for thumb if --enable- d

[Qemu-devel] [Bug 893208] Re: qemu on ARM hosts can't boot i386 image

2011-12-10 Thread Peter Maydell
** Also affects: qemu Importance: Undecided Status: New -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/893208 Title: qemu on ARM hosts can't boot i386 image Status in QEMU: New Status i

[Qemu-devel] [RFC 4/6] target-i386: Use tcg_gen_{ld,st}64_tl()

2011-12-10 Thread Andreas Färber
Use new helper function to avoid new temporaries and moves. Signed-off-by: Andreas Färber --- target-i386/translate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index c929ef9..17465e9 100644 --- a/target-i386/tran

[Qemu-devel] [RFC 6/6] target-i386: Cleanup pextrq

2011-12-10 Thread Andreas Färber
gen_op_mov_reg_v() wants a TCGv, so use cpu_T[0] like pextrd does. Signed-off-by: Andreas Färber --- target-i386/translate.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 6d09496..5ce8d3e 100644 --

[Qemu-devel] [RFC 3/6] tcg: Add tcg_gen_qemu_{ld,st}64_tl()

2011-12-10 Thread Andreas Färber
Encapsule the conversion from/to i64. This avoids a temporary and a tcg_gen_trunc_i64_tl()/ext_tl_i64(). Signed-off-by: Andreas Färber --- tcg/tcg-op.h | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index d065e74..07c6d3e 100644 -

[Qemu-devel] [PATCH 1/6] target-i386: Fix sloppy uses of i32/i64 functions

2011-12-10 Thread Andreas Färber
Use TCGv (tl) versions instead. Signed-off-by: Andreas Färber --- target-i386/translate.c | 130 +++--- 1 files changed, 65 insertions(+), 65 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 1ef8d16..0ffc450 100644 --- a/

[Qemu-devel] [Bug 902413] Re: qemu-i386-user on ARM host: wine hangs/spins when trying to run anything

2011-12-10 Thread Pierre-Loup A. Griffais
Thanks for your quick reply, Peter. Are there more specific bug entries tracking both the general problems you're talking about that I could monitor for progress, or any pointers on the direction to go to improve the situation? -- You received this bug notification because you are a member of qe

[Qemu-devel] [PATCH 2/6] target-i386: Cleanup movd xmm, ea

2011-12-10 Thread Andreas Färber
Insert call to tcg_gen_ext_tl_i64(). Signed-off-by: Andreas Färber --- target-i386/translate.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 0ffc450..c929ef9 100644 --- a/target-i386/translate.c +++ b/target-

[Qemu-devel] [RFC 5/6] target-i386: Cleanup pinsrq

2011-12-10 Thread Andreas Färber
gen_op_mov_v_reg() wants a TCGv, so use cpu_tmp0 like pinsrd does. Signed-off-by: Andreas Färber --- target-i386/translate.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 17465e9..6d09496 100644 --

[Qemu-devel] [RFC 0/6] target-i386: TCGv cleanups

2011-12-10 Thread Andreas Färber
Hello, This series makes target-i386 compile with DEBUG_TCGV_TL. Patches 1-2 could be cherry-picked already. Patch 1 is fairly trivial. Patch 2 is the only patch in the series that needs an additional temporary. Patch 3 introduces two new functions to avoid that elsewhere. Needs TCGv series. Wi

Re: [Qemu-devel] [PATCH] target-i386: fix cmpxchg instruction emulation

2011-12-10 Thread malc
On Sat, 10 Dec 2011, Andreas Gustafsson wrote: > malc wrote: > > On Sat, 10 Dec 2011, Andreas Gustafsson wrote: > > > > > When the i386 cmpxchg instruction is executed with a memory operand > > > and the comparison result is "unequal", do the memory write before > > > changing the accumulator ins

[Qemu-devel] [PATCH 2/2] i8254: Rework & fix interaction with HPET in legacy mode

2011-12-10 Thread Jan Kiszka
From: Jan Kiszka When the HPET enters legacy mode, the IRQ output of the PIT is suppressed and replaced by the HPET timer 0. But the current code to emulate this was broken in many ways. It reset the PIT state after re-enabling, it worked against a stale static PIT structure, and it did not prope

[Qemu-devel] [PATCH 0/2] pit/hpet: Fix legacy mode switching

2011-12-10 Thread Jan Kiszka
This is a small preparatory series to allow the introduction of the KVM in-kernel PIT. Of course, it is also a fix for the various bugs in the related PIT/HPET code. See patches for details. Jan Kiszka (2): hpet: Save/restore cached RTC IRQ level i8254: Rework & fix interaction with HPET in le

[Qemu-devel] [PATCH 1/2] hpet: Save/restore cached RTC IRQ level

2011-12-10 Thread Jan Kiszka
From: Jan Kiszka In legacy mode, the HPET suppresses the RTC interrupt delivery via IRQ 8 but keeps track of the RTC output level and applies it when legacy mode is turned off again. This value has to be preserved across save/ restore as it cannot be reconstructed otherwise. Signed-off-by: Jan K

Re: [Qemu-devel] [PATCH] target-i386: fix cmpxchg instruction emulation

2011-12-10 Thread Andreas Gustafsson
malc wrote: > On Sat, 10 Dec 2011, Andreas Gustafsson wrote: > > > When the i386 cmpxchg instruction is executed with a memory operand > > and the comparison result is "unequal", do the memory write before > > changing the accumulator instead of the other way around, because > > otherwise the new

Re: [Qemu-devel] [PATCH 0/4] tcg: Add debug facilities for TCGv

2011-12-10 Thread Andreas Färber
Am 10.12.2011 11:07, schrieb Peter Maydell: > On 10 December 2011 09:02, Andreas Färber wrote: >> Working on 16- and 20-bit targets using TARGET_LONG_BITS == 32, I found it >> too >> easy to accidentally use, e.g., tcg_temp_free() in place of >> tcg_temp_free_i32(). >> In case of 78k0/rl78 it ma

Re: [Qemu-devel] [PATCH V2 5/5] vga-cirrus: Workaround during restore when using Xen.

2011-12-10 Thread Jan Kiszka
On 2011-12-09 22:54, Anthony PERARD wrote: > During the initialisation of the machine at restore time, the access to the > VRAM will fail because QEMU does not know yet the right guest address to map, > so the vram_ptr is NULL. > > So this patch avoid using a NULL pointer during initialisation, an

Re: [Qemu-devel] [PATCH] target-i386: fix cmpxchg instruction emulation

2011-12-10 Thread malc
On Sat, 10 Dec 2011, Andreas Gustafsson wrote: > When the i386 cmpxchg instruction is executed with a memory operand > and the comparison result is "unequal", do the memory write before > changing the accumulator instead of the other way around, because > otherwise the new accumulator value will i

[Qemu-devel] [Bug 902413] Re: qemu-i386-user on ARM host: wine hangs/spins when trying to run anything

2011-12-10 Thread Peter Maydell
Multithreaded programs don't work (reliably) in x86 user emulation mode. This is a known (longstanding) bug. ARM hosts are also currently known to have problems (as stated in the qemu 1.0 release notes). -- You received this bug notification because you are a member of qemu- devel-ml, which is

Re: [Qemu-devel] [PATCH 0/4] tcg: Add debug facilities for TCGv

2011-12-10 Thread Peter Maydell
On 10 December 2011 09:02, Andreas Färber wrote: > Working on 16- and 20-bit targets using TARGET_LONG_BITS == 32, I found it too > easy to accidentally use, e.g., tcg_temp_free() in place of > tcg_temp_free_i32(). > In case of 78k0/rl78 it may not practically matter yet, but it complicates > goi

[Qemu-devel] [PATCH] target-i386: fix cmpxchg instruction emulation

2011-12-10 Thread Andreas Gustafsson
When the i386 cmpxchg instruction is executed with a memory operand and the comparison result is "unequal", do the memory write before changing the accumulator instead of the other way around, because otherwise the new accumulator value will incorrectly be used in the comparison when the instructio

Re: [Qemu-devel] [PATCH 1/6] Add spelling exceptions for codespell

2011-12-10 Thread Stefan Weil
Am 10.12.2011 01:49, schrieb Andreas Färber: Am 10.12.2011 00:19, schrieb Stefan Weil: This file can be used with codespell to suppress wrong misspelling reports. Signed-off-by: Stefan Weil --- scripts/codespell.exclude | 215 + 1 files changed, 215

[Qemu-devel] [PATCH 3/4] tcg: Update TCGV_{UNUSED,EQUAL}() macros

2011-12-10 Thread Andreas Färber
Switch them to use the new {MAKE,GET}_TCGV_TL() macros. Signed-off-by: Andreas Färber --- tcg/tcg-op.h |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index e5c2e37..a6c3d5f 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -2129,16 +2129,

[Qemu-devel] [PATCH 2/4] tcg: Convert *_tl*() macros to inline functions

2011-12-10 Thread Andreas Färber
Using {GET,MAKE}_TCGV_*() on parameters requires properly passing arguments into the macro, so use strongly-typed functions while at it. Signed-off-by: Andreas Färber --- tcg/tcg-op.h | 1021 +- 1 files changed, 866 insertions(+), 155 delet

[Qemu-devel] [PATCH 0/4] tcg: Add debug facilities for TCGv

2011-12-10 Thread Andreas Färber
Hello, Working on 16- and 20-bit targets using TARGET_LONG_BITS == 32, I found it too easy to accidentally use, e.g., tcg_temp_free() in place of tcg_temp_free_i32(). In case of 78k0/rl78 it may not practically matter yet, but it complicates going from a 32-bit target to 64 bits, as in the case of

[Qemu-devel] [PATCH 4/4] tcg: Allow to detect TCGv misuses

2011-12-10 Thread Andreas Färber
It's easy to omit _i32 somewhere if working on one 32-bit target, despite DEBUG_TCGV, because TCGv is simply aliased to TCGv_i32/i64. If DEBUG_TCGV_TL is defined, use a new struct TCGv with distinguished accessors to catch mixups. This cannot be done unconditionally for DEBUG_TCGV because some ta

[Qemu-devel] [PATCH 1/4] tcg: Introduce {MAKE,GET}_TCGV_TL macros

2011-12-10 Thread Andreas Färber
Signed-off-by: Andreas Färber --- tcg/tcg-op.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index 82e04e7..cbccaef 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -2127,6 +2127,8 @@ static inline void tcg_gen_deposit_i64(TCGv_i64 ret, TC