Re: [Qemu-devel] [RFC 01/28] target-xtensa: add target stubs

2011-05-03 Thread Max Filippov
> +#elif defined(TARGET_XTENSA) > +                    if (interrupt_request & CPU_INTERRUPT_HARD) { > +                        env->exception_index = EXC_IRQ; > +                        do_interrupt(env); > +                        next_tb = 0; > +                    } Looks like I've moved this

Re: [Qemu-devel] [PATCH 05/17] kvm: add kvm stub for arch specific stuff

2011-05-03 Thread Alexander Graf
On 03.05.2011, at 16:57, Jan Kiszka wrote: > On 2011-05-03 16:17, Alexander Graf wrote: >> >> On 18.04.2011, at 20:34, Aurelien Jarno wrote: >> >>> On Fri, Apr 15, 2011 at 05:32:46PM +0200, Alexander Graf wrote: We have a generic stub architecture for kvm calls, but some architectures

Re: [Qemu-devel] [PATCH 11/17] s390x: helper functions for system emulation

2011-05-03 Thread Alexander Graf
On 20.04.2011, at 12:38, Aurelien Jarno wrote: > On Fri, Apr 15, 2011 at 05:32:52PM +0200, Alexander Graf wrote: >> When running system emulation, we need to transverse through the MMU and >> deliver interrupts according to the specification. >> >> This patch implements those two pieces and in a

[Qemu-devel] [RFC 27/28] target-xtensa: implement CPENABLE and PRID SRs

2011-05-03 Thread Max Filippov
Signed-off-by: Max Filippov --- hw/xtensa_sample.c|1 + target-xtensa/cpu.h |2 ++ target-xtensa/translate.c |7 +++ 3 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/xtensa_sample.c b/hw/xtensa_sample.c index b1da7e1..797a0c4 100644 --- a/hw/xtensa_

[Qemu-devel] [RFC 23/28] target-xtensa: implement unaligned exception option

2011-05-03 Thread Max Filippov
See ISA, 4.4.4 for details. Correct (aligned as per ISA) address for unaligned access is generated in case this option is not enabled. Signed-off-by: Max Filippov --- target-xtensa/translate.c | 33 +++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --gi

[Qemu-devel] [RFC 28/28] target-xtensa: implement relocatable vectors

2011-05-03 Thread Max Filippov
See ISA, 4.4.3 for details. Vector addresses recorded in core configuration are absolute values that correspond to default VECBASE value. Signed-off-by: Max Filippov --- target-xtensa/cpu.h |2 ++ target-xtensa/helper.c| 18 -- target-xtensa/translate.c |1 +

[Qemu-devel] [RFC 24/28] target-xtensa: implement SIMCALL

2011-05-03 Thread Max Filippov
Tensilica iss provides support for applications running in freestanding environment through SIMCALL command. It is used by Tensilica libc to access argc/argv, for file I/O, etc. Signed-off-by: Max Filippov --- target-xtensa/helpers.h |1 + target-xtensa/op_helper.c |7 ++ target-xtensa

[Qemu-devel] [RFC 21/28] target-xtensa: implement loop option

2011-05-03 Thread Max Filippov
See ISA, 4.3.2 for details. Operations that change LEND SR value invalidate TBs at the old and at the new LEND. LEND value at TB compilation time is considered constant and loop instruction is generated based on this value. Invalidation may be avoided for the TB at the old LEND address, since loo

[Qemu-devel] [RFC 26/28] target-xtensa: implement accurate window check

2011-05-03 Thread Max Filippov
See ISA, 4.7.1.3 for details. Window check is inserted before commands that push "used register watermark" beyond its current level. Used register watermark is reset on instructions that change WINDOW_BASE/WINDOW_START SRs. Signed-off-by: Max Filippov --- target-xtensa/translate.c | 105 ++

[Qemu-devel] [RFC 17/28] target-xtensa: implement CACHE group

2011-05-03 Thread Max Filippov
All operations in this group are no-ops, because cache ought to be transparent to applications. However cache may be abused, then we'll need to actually implement these opcodes. Signed-off-by: Max Filippov --- target-xtensa/translate.c | 95 - 1 file

[Qemu-devel] [RFC 25/28] target-xtensa: implement interrupt option

2011-05-03 Thread Max Filippov
See ISA, 4.4.6 (interrupt option), 4.4.7 (high priority interrupt option) and 4.4.7 (timer interrupt option) for details. CCOUNT SR is incremented before every command and timer interrupt checking is inserted before every command. It may be done on TB boundary for optimization. WAITI doesn't go t

[Qemu-devel] [RFC 19/28] target-xtensa: implement RST2 group (32 bit mul/div/rem)

2011-05-03 Thread Max Filippov
Signed-off-by: Max Filippov --- target-xtensa/translate.c | 60 - 1 files changed, 59 insertions(+), 1 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index faf1adc..d635229 100644 --- a/target-xtensa/translate.c +++ b

[Qemu-devel] [RFC 15/28] target-xtensa: big endian support

2011-05-03 Thread Max Filippov
Big endian opcode decoding is slightly different. Signed-off-by: Max Filippov --- configure |7 --- hw/xtensa_sample.c|6 +- target-xtensa/translate.c | 31 +-- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/c

[Qemu-devel] [RFC 22/28] target-xtensa: implement extended L32R

2011-05-03 Thread Max Filippov
See ISA, 4.3.3 for details. Enable bit of LITBASE may be stored separately for further speedup. Signed-off-by: Max Filippov --- target-xtensa/cpu.h |1 + target-xtensa/helper.c|1 + target-xtensa/translate.c | 18 -- 3 files changed, 18 insertions(+), 2 delet

[Qemu-devel] [RFC 11/28] target-xtensa: implement RST3 group

2011-05-03 Thread Max Filippov
- access to Special Registers (wsr, rsr); - access to User Registers (wur, rur); - misc. operations option (value clamp, sign extension, min, max); - conditional moves. Signed-off-by: Max Filippov --- target-xtensa/translate.c | 147 + 1 files changed

[Qemu-devel] [RFC 18/28] target-xtensa: implement exceptions

2011-05-03 Thread Max Filippov
- mark privileged opcodes with ring check; - make debug exception on exception handler entry. Signed-off-by: Max Filippov --- target-xtensa/cpu.h | 91 + target-xtensa/helper.c| 39 ++- target-xtensa/helpers.h |2 + target-xtensa/op

[Qemu-devel] [RFC 13/28] target-xtensa: implement LSAI group

2011-05-03 Thread Max Filippov
- base + offset load/store operations for 1/2/4 byte values; - cache operations (not implemented); - multiprocessor synchronization operations. Signed-off-by: Max Filippov --- target-xtensa/cpu.h |1 + target-xtensa/translate.c | 88 + 2 fi

[Qemu-devel] [RFC 20/28] target-xtensa: implement windowed registers

2011-05-03 Thread Max Filippov
See ISA, 4.7.1 for details. Physical registers and currently visible window are separate fields in CPUEnv. Only current window is accessible to TCG. On operations that change window base helpers copy current window to and from physical registers. Window overflow check described in 4.7.1.3 is in s

[Qemu-devel] [RFC 10/28] target-xtensa: add special and user registers

2011-05-03 Thread Max Filippov
Special Registers hold the majority of the state added to the processor by the options. See ISA, 5.3 for details. User Registers hold state added in support of designer’s TIE and in some cases of options that Tensilica provides. See ISA, 5.4 for details. Only registers mapped in sregnames or ureg

[Qemu-devel] [RFC 12/28] target-xtensa: implement shifts (ST1 and RST1 groups)

2011-05-03 Thread Max Filippov
- ST1: SAR (shift amount special register) manipulation, NSA(U); - RST1: shifts, 16-bit multiplication. Signed-off-by: Max Filippov --- target-xtensa/cpu.h |4 + target-xtensa/translate.c | 210 + 2 files changed, 214 insertions(+), 0 deleti

[Qemu-devel] [RFC 08/28] target-xtensa: implement conditional jumps

2011-05-03 Thread Max Filippov
- BZ (comparison to zero); - BI0 (comparison to signed immediate); - BI1 (comparison to unsigned immediate); - B (two registers comparison, bit sets comparison). Signed-off-by: Max Filippov --- target-xtensa/translate.c | 188 + 1 files changed, 188 i

[Qemu-devel] [RFC 16/28] target-xtensa: implement SYNC group

2011-05-03 Thread Max Filippov
All operations in this group are no-ops, because there are no delayed side effects. Signed-off-by: Max Filippov --- target-xtensa/translate.c | 31 ++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translat

[Qemu-devel] [RFC 09/28] target-xtensa: implement JX/RET0/CALLX

2011-05-03 Thread Max Filippov
Group SNM0 (indirect jumps and calls). Signed-off-by: Max Filippov --- target-xtensa/translate.c | 49 - 1 files changed, 48 insertions(+), 1 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 2bfa801..f4d74e0 1006

[Qemu-devel] [RFC 07/28] target-xtensa: add gdb support

2011-05-03 Thread Max Filippov
Signed-off-by: Max Filippov --- configure |1 + default-configs/xtensa-softmmu.mak |1 + gdb-xml/xtensa-core.xml| 24 ++ gdbstub.c | 39 4 files changed, 65 insertion

[Qemu-devel] [RFC 14/28] target-xtensa: mark reserved and TBD opcodes

2011-05-03 Thread Max Filippov
Reserved opcodes must generate illegal instruction exception. Usually they signal emulation quality problems. Not implemented opcodes are good to see. Signed-off-by: Max Filippov --- target-xtensa/translate.c | 111 - 1 files changed, 110 insertions(+

[Qemu-devel] [RFC 04/28] target-xtensa: implement narrow instructions

2011-05-03 Thread Max Filippov
Instructions with op0 >= 8 are 2 bytes long, others are 3 bytes long. Signed-off-by: Max Filippov --- target-xtensa/translate.c | 57 + 1 files changed, 57 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translat

[Qemu-devel] [RFC 06/28] target-xtensa: add sample board

2011-05-03 Thread Max Filippov
Sample board and sample CPU core are used for debug and may be used for development of custom SoC emulators. This board has two fixed size memory regions for DTCM and ITCM and variable length SRAM region. Signed-off-by: Max Filippov --- Makefile.target|1 + hw/xtensa_sample.c | 68 +++

[Qemu-devel] [RFC 01/28] target-xtensa: add target stubs

2011-05-03 Thread Max Filippov
Signed-off-by: Max Filippov --- Makefile.target |2 + arch_init.c |2 + arch_init.h |1 + cpu-exec.c| 10 + elf.h |2 + hw/xtensa_pic.c | 11 ++ target-xtensa/cpu.h | 84 +++

[Qemu-devel] [RFC 05/28] target-xtensa: implement RT0 group

2011-05-03 Thread Max Filippov
NEG and ABS are the only members of RT0 group. Signed-off-by: Max Filippov --- target-xtensa/translate.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 26fc28b..49f4940 100644 --- a/target-xt

[Qemu-devel] [RFC 03/28] target-xtensa: implement disas_xtensa_insn

2011-05-03 Thread Max Filippov
Set up disas_xtensa_insn switch structure, mark required options on high level groups. Implement arithmetic/bit logic/jump/call0. Implement code generation loop with single step/breakpoint checking. Signed-off-by: Max Filippov --- target-xtensa/cpu.h | 60 +++ target-xtensa/helper.c

[Qemu-devel] [RFC 02/28] target-xtensa: add target to the configure script

2011-05-03 Thread Max Filippov
Signed-off-by: Max Filippov --- configure |9 + default-configs/xtensa-softmmu.mak |1 + 2 files changed, 10 insertions(+), 0 deletions(-) create mode 100644 default-configs/xtensa-softmmu.mak diff --git a/configure b/configure index 6f75e2e..d8c33b9 100

Re: [Qemu-devel] [PATCH v3 5/5] hpet 'driftfix': add code in hpet_timer() to compensate delayed callbacks and coalesced interrupts

2011-05-03 Thread Marcelo Tosatti
On Tue, May 03, 2011 at 07:08:25PM -0300, Glauber Costa wrote: > On Tue, 2011-05-03 at 16:03 -0300, Marcelo Tosatti wrote: > > On Thu, Apr 28, 2011 at 04:25:00PM +0200, Ulrich Obergfell wrote: > > > Loss of periodic timer interrupts caused by delayed callbacks and by > > > interrupt coalescing is c

Re: [Qemu-devel] [PATCH v3 5/5] hpet 'driftfix': add code in hpet_timer() to compensate delayed callbacks and coalesced interrupts

2011-05-03 Thread Glauber Costa
On Tue, 2011-05-03 at 16:03 -0300, Marcelo Tosatti wrote: > On Thu, Apr 28, 2011 at 04:25:00PM +0200, Ulrich Obergfell wrote: > > Loss of periodic timer interrupts caused by delayed callbacks and by > > interrupt coalescing is compensated by gradually injecting additional > > interrupts during subs

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Michael S. Tsirkin
On Tue, May 03, 2011 at 12:59:06PM -0500, Anthony Liguori wrote: > On 05/03/2011 12:55 PM, Jan Kiszka wrote: > >On 2011-05-03 19:45, Anthony Liguori wrote: > >>On 05/03/2011 12:30 PM, Peter Maydell wrote: > >>>On 3 May 2011 17:48, Jan Kiszka wrote: > Kernel headers were automatically imported

Re: [Qemu-devel] [PATCH] doc: Add explanation that -alt-grab and -ctrl-grab affect special keys

2011-05-03 Thread Brad Hards
ping?

Re: [Qemu-devel] [PATCH v2] configure: List available targets in --help output

2011-05-03 Thread Stefan Weil
Am 03.05.2011 15:50, schrieb Peter Maydell: Include the list of available targets in the --help output for the --target-list= option. Signed-off-by: Peter Maydell --- v2: As suggested by Stefan Weil, put the target list in --help rather than using '--target-list=?'. This patch includes using fo

[Qemu-devel] [PATCH v4 09/10] trace-state: [stderr] add support for dynamically enabling/disabling events

2011-05-03 Thread Lluís
Uses the generic interface provided in "trace/control.h" in order to provide a programmatic interface as well as command line and monitor controls. Signed-off-by: Fabien Chouteau Signed-off-by: Lluís Vilanova --- configure |3 +++ docs/tracing.txt |5 - scripts/tracetool |

[Qemu-devel] [PATCH v4 07/10] trace-state: always use the "nop" backend on events with the "disable" keyword

2011-05-03 Thread Lluís
Any event with the keyword/property "disable" generates an empty trace event using the "nop" backend, regardless of the current backend. Signed-off-by: Lluís Vilanova --- docs/tracing.txt | 25 +++-- scripts/tracetool | 15 ++- 2 files changed, 17 insertions(

[Qemu-devel] [PATCH v4 10/10] trace: enable all events

2011-05-03 Thread Lluís
Given that all events with programmatically-controlled state are disabled by default, we can delete the "disable" property from all events. Signed-off-by: Lluís Vilanova --- trace-events | 492 +- 1 files changed, 246 insertions(+), 246 de

[Qemu-devel] [PATCH v4 06/10] trace-state: add "-trace events" argument to control initial state

2011-05-03 Thread Lluís
The "-trace events" argument can be used to provide a file with a list of trace event names that will be enabled prior to starting execution, thus providing early tracing. This saves the user from manually toggling event states through the monitor interface or whichever backend-specific interface.

[Qemu-devel] [PATCH v4 03/10] trace: generalize the "property" concept in the trace-events file

2011-05-03 Thread Lluís
This adds/modifies the following functions: * get_name: Get _only_ the event name * has_property: Return whether an event has a property (keyword before the event name) Signed-off-by: Lluís Vilanova --- docs/tracing.txt |4 +-- scripts/tracetool | 73 ---

[Qemu-devel] [PATCH v4 04/10] trace-state: separate trace event control and query routines from the simple backend

2011-05-03 Thread Lluís
Move the 'st_print_trace_events' and 'st_change_trace_event_state' into backend-agnostic 'trace_print_events' and 'trace_event_set_state' (respectively) in the "trace/control.c" file. By moving them, other backends will later be able to provide their own implementation. Signed-off-by: Lluís Vilan

[Qemu-devel] [PATCH v4 08/10] trace-state: [simple] disable all trace points by default

2011-05-03 Thread Lluís
Note that this refers to the backend-specific state (whether the output must be generated), not the event "disabled" property (which always uses the "nop" backend). Signed-off-by: Lluís Vilanova --- scripts/tracetool |9 ++--- trace-events |3 --- 2 files changed, 2 insertions(+

[Qemu-devel] [PATCH v4 05/10] trace-state: always compile support for controlling and querying trace event states

2011-05-03 Thread Lluís
The current interface is generic for this small set of operations, and thus other backends can easily modify the "trace/control.c" file to add their own implementation. Signed-off-by: Lluís Vilanova --- docs/tracing.txt | 39 +-- hmp-commands.hx |7

[Qemu-devel] [PATCH v4 01/10] trace: move backend-specific code into the trace/ directory

2011-05-03 Thread Lluís
Signed-off-by: Lluís Vilanova --- .gitignore|2 Makefile |1 Makefile.objs |4 - scripts/tracetool |2 simpletrace.c | 355 - simpletrace.h | 48 --- trace/simple.c| 355 +++

[Qemu-devel] [PATCH v4 02/10] trace: avoid conditional code compilation during option parsing

2011-05-03 Thread Lluís
Instead of conditionally compiling option support, perform checks and issue the corresponding error messages. Signed-off-by: Lluís Vilanova --- configure |4 +++- qemu-config.c |4 qemu-options.hx |6 -- vl.c| 17 + 4 files changed, 20 i

[Qemu-devel] [RFC][PATCH v4 00/10] trace-state: make the behaviour of "disable" consistent across all backends

2011-05-03 Thread Lluís
This patch defines the "disable" trace event state to always use the "nop" backend. As a side-effect, all events are now enabled (without "disable") by default, as all backends (except "stderr") have programmatic support for dynamically (de)activating each trace event. In order to make this true,

Re: [Qemu-devel] [PATCH 01/18] Fix typos in comments (dependancy -> dependency)

2011-05-03 Thread Stefan Weil
Am 28.04.2011 17:20, schrieb Stefan Weil: Signed-off-by: Stefan Weil --- Changelog | 2 +- Makefile.objs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) There were no replies to the patch series up to now. Should I have added a remark that all 18 patches are independent, so they are t

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Peter Maydell
On 3 May 2011 17:48, Jan Kiszka wrote: > +++ b/scripts/update-linux-headers.sh > @@ -0,0 +1,47 @@ > +#!/bin/sh No -e ? > +rm -rf $output/include/linux/* Given that updating the kernel headers will blow away large subsets of include/ like this, maybe we should use a less generic name than "inclu

Re: [Qemu-devel] [RFC][PATCH v3 00/10] trace-state: make the behaviour of "disable" consistent across all backends

2011-05-03 Thread Lluís
Ignore the whole series, as it has accumulated some minor errors and typos. I will send a new series later. Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Nort

[Qemu-devel] [PATCH] ide: cleanup warnings

2011-05-03 Thread Andrea Arcangeli
Hello, This is just a minor cleanup adding \n. On a side note, it was good idea to keep it under DEBUG_IDE because if iscsi server reboots or goes down, this would generate a flood of errors if it's enabled (a flood of these warnings would have been shown with DEBUG_IDE on in such a condition).

Re: [Qemu-devel] [PATCH v3 09/10] trace-state: [stderr] add support for dynamically enabling/disabling events

2011-05-03 Thread Lluís
The previous mail is an update to the original patch in v3 with a header name fix in scripts/tracetool. Please tell me if you prefer to have the whole fixed series in a new v4. Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world become

Re: [Qemu-devel] [PATCH v3 09/10] trace-state: [stderr] add support for dynamically enabling/disabling events

2011-05-03 Thread Lluís
Uses the generic interface provided in "trace/control.h" in order to provide a programmatic interface as well as command line and monitor controls. Signed-off-by: Fabien Chouteau Signed-off-by: Lluís Vilanova --- configure |3 +++ docs/tracing.txt |5 - scripts/tracetool |

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Arnd Bergmann
On Tuesday 03 May 2011 19:57:18 Scott Wood wrote: > > I agree, it doesn't feel quite right to bring in the headers. I don't have > > any alternative suggestions (besides better HOWTOs/Documentation) though. > > If you try to use the non-sanitized kernel headers, you'll get this warning > from lin

Re: [Qemu-devel] [PATCH 5/6] PPC: Implement e500 (FSL) MMU

2011-05-03 Thread Scott Wood
On Mon, 2 May 2011 17:03:21 +0200 Alexander Graf wrote: > Most of the code to support e500 style MMUs is already in place, but > we're missing on some of the special TLB0-TLB1 handling code and slightly > different TLB modification. > > This patch adds support for the FSL style MMU. > > Signed-

Re: [Qemu-devel] [PATCH v3 5/5] hpet 'driftfix': add code in hpet_timer() to compensate delayed callbacks and coalesced interrupts

2011-05-03 Thread Marcelo Tosatti
On Thu, Apr 28, 2011 at 04:25:00PM +0200, Ulrich Obergfell wrote: > Loss of periodic timer interrupts caused by delayed callbacks and by > interrupt coalescing is compensated by gradually injecting additional > interrupts during subsequent timer intervals, starting at a rate of > one additional int

Re: [Qemu-devel] [PATCH v3 05/10] trace-state: always compile support for controlling and querying trace event states

2011-05-03 Thread Lluís
The previous mail is an update to the original patch in v3 with some obsolete documentation deleted. Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster

[Qemu-devel] [RESEND2 PATCH] exec: Implement qemu_ram_free_from_ptr()

2011-05-03 Thread Alex Williamson
Required for regions mapped via qemu_ram_alloc_from_ptr(). VFIO and ivshmem will make use of this to remove mappings when devices are hot unplugged. Signed-off-by: Alex Williamson --- Trying to clean out my patch queuer;, I've proposed this twice, Cam has proposed this once, it's an obvious mis

[Qemu-devel] [PATCH v3 05/10] trace-state: always compile support for controlling and querying trace event states

2011-05-03 Thread Lluís
The current interface is generic for this small set of operations, and thus other backends can easily modify the "trace/control.c" file to add their own implementation. Signed-off-by: Lluís Vilanova --- docs/tracing.txt | 39 +-- hmp-commands.hx |7

[Qemu-devel] [PATCH v2 3/3] CPUPhysMemoryClient: Batch contiguous addresses when playing catchup

2011-05-03 Thread Alex Williamson
When a phys memory client registers and we play catchup by walking the page tables, we can make a huge improvement in the number of times the set_memory callback is called by batching contiguous pages together. With a 4G guest, this reduces the number of callbacks at registration from 1048866 to 2

[Qemu-devel] [PATCH v2 2/3] CPUPhysMemoryClient: Pass guest physical address not region offset

2011-05-03 Thread Alex Williamson
When we're trying to get a newly registered phys memory client updated with the current page mappings, we end up passing the region offset (a ram_addr_t) as the start address rather than the actual guest physical memory address (target_phys_addr_t). If your guest has less than 3.5G of memory, thes

[Qemu-devel] [PATCH v2 1/3] CPUPhysMemoryClient: Fix typo in phys memory client registration

2011-05-03 Thread Alex Williamson
When we register a physical memory client, we try to walk the page tables, calling the set_memory hook for every entry. Effectively playing catchup for the client for everything already registered. With this type, we only walk the 2nd entry of the l1 table, typically missing all of the registered

[Qemu-devel] [PATCH v2 0/3] CPUPhysMemoryClient: Fixes and batching

2011-05-03 Thread Alex Williamson
This series pulls together several related patches for bugs and performance that I found last week. Only the 2nd patch is actually modified from inital posting, adding the comments suggested by Markus. The 1st two patches fix pretty serious brokeness in the CPUPhysMemoryClient interface. Of the

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Anthony Liguori
On 05/03/2011 12:55 PM, Jan Kiszka wrote: On 2011-05-03 19:45, Anthony Liguori wrote: On 05/03/2011 12:30 PM, Peter Maydell wrote: On 3 May 2011 17:48, Jan Kiszka wrote: Kernel headers were automatically imported from current kvm.git, 93c016c8c4. Some are not covered by any license and can b

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Scott Wood
On Tue, 3 May 2011 19:32:00 +0200 "Edgar E. Iglesias" wrote: > On Tue, May 03, 2011 at 08:13:04PM +0300, Avi Kivity wrote: > > On 05/03/2011 08:09 PM, Jan Kiszka wrote: > > > > > > > > Reluctant ack. > > > > > > What downsides do you see? > > > > The usual "it shouldn't be this way". Every oth

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Jan Kiszka
On 2011-05-03 19:45, Anthony Liguori wrote: > On 05/03/2011 12:30 PM, Peter Maydell wrote: >> On 3 May 2011 17:48, Jan Kiszka wrote: >>> Kernel headers were automatically imported from current kvm.git, >>> 93c016c8c4. Some are not covered by any license and can be considered >>> GPLv2 with user sp

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Anthony Liguori
On 05/03/2011 12:30 PM, Peter Maydell wrote: On 3 May 2011 17:48, Jan Kiszka wrote: Kernel headers were automatically imported from current kvm.git, 93c016c8c4. Some are not covered by any license and can be considered GPLv2 with user space exception. Hmm. Can't we just get whoever owns those

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Jan Kiszka
On 2011-05-03 19:30, Peter Maydell wrote: > On 3 May 2011 17:48, Jan Kiszka wrote: >> Kernel headers were automatically imported from current kvm.git, >> 93c016c8c4. Some are not covered by any license and can be considered >> GPLv2 with user space exception. > > Hmm. Can't we just get whoever ow

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Jan Kiszka
On 2011-05-03 19:32, Edgar E. Iglesias wrote: > On Tue, May 03, 2011 at 08:13:04PM +0300, Avi Kivity wrote: >> On 05/03/2011 08:09 PM, Jan Kiszka wrote: Reluctant ack. >>> >>> What downsides do you see? >> >> The usual "it shouldn't be this way". Every other package (including, I >> th

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Edgar E. Iglesias
On Tue, May 03, 2011 at 08:13:04PM +0300, Avi Kivity wrote: > On 05/03/2011 08:09 PM, Jan Kiszka wrote: > > > > > > Reluctant ack. > > > > What downsides do you see? > > The usual "it shouldn't be this way". Every other package (including, I > think, glibc) uses the sanitized system headers. E

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Peter Maydell
On 3 May 2011 17:48, Jan Kiszka wrote: > Kernel headers were automatically imported from current kvm.git, > 93c016c8c4. Some are not covered by any license and can be considered > GPLv2 with user space exception. Hmm. Can't we just get whoever owns those files to apply a suitable copyright and li

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Avi Kivity
On 05/03/2011 08:09 PM, Jan Kiszka wrote: > > Reluctant ack. What downsides do you see? The usual "it shouldn't be this way". Every other package (including, I think, glibc) uses the sanitized system headers. Except for kvm-kmod, the system headers are always available. But if it's caus

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Jan Kiszka
On 2011-05-03 18:55, Avi Kivity wrote: > On 05/03/2011 07:48 PM, Jan Kiszka wrote: >> This helps reducing our build-time checks for feature support in the >> available Linux kernel headers. And it helps users that do not have >> sufficiently recent headers installed on their build machine. >> >> He

Re: [Qemu-devel] [PATCH v2] Import Linux headers for KVM and vhost

2011-05-03 Thread Avi Kivity
On 05/03/2011 07:48 PM, Jan Kiszka wrote: This helps reducing our build-time checks for feature support in the available Linux kernel headers. And it helps users that do not have sufficiently recent headers installed on their build machine. Header upstate is triggered via scripts/update-li

[Qemu-devel] [PATCH 18/20] scsi-disk: add data direction checking

2011-05-03 Thread Paolo Bonzini
From: Hannes Reinecke scsi_req_parse() already provides for a data direction setting, so we should be using it to check for correct direction. And we should return the sense code 'INVALID FIELD IN CDB' in these cases. Signed-off-by: Hannes Reinecke Signed-off-by: Paolo Bonzini --- hw/scsi-dis

[Qemu-devel] [PATCH 15/20] scsi: introduce scsi_req_kick

2011-05-03 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/esp.c | 26 ++ hw/lsi53c895a.c | 22 -- hw/scsi-bus.c| 10 ++ hw/scsi.h|1 + hw/spapr_vscsi.c | 26 ++ hw/usb-msd.c | 15 --- trace-ev

[Qemu-devel] [PATCH 17/20] scsi: Implement 'get_sense' callback

2011-05-03 Thread Paolo Bonzini
From: Hannes Reinecke The get_sense callback copies existing sense information into the provided buffer. This is required if sense information should be transferred together with the command response. Signed-off-by: Hannes Reinecke Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c |9 +++

Re: [Qemu-devel] [PATCH] posix-aio-compat: Fix idle_threads counter

2011-05-03 Thread Kevin Wolf
Am 03.05.2011 17:56, schrieb Stefan Hajnoczi: > On Tue, May 3, 2011 at 2:26 PM, Kevin Wolf wrote: >> A thread should only be counted as idle when it really is waiting for new >> requests. Without this patch, sometimes too few threads are started as busy >> threads are counted as idle. >> >> Not su

[Qemu-devel] [PATCH 10/20] scsi: introduce scsi_req_cancel

2011-05-03 Thread Paolo Bonzini
This is for when the request must be dropped in the void, but still memory should be freed. To this end, the devices register a second callback in SCSIBusOps. Signed-off-by: Paolo Bonzini --- hw/esp.c | 16 ++-- hw/lsi53c895a.c | 30 +- hw/

[Qemu-devel] [PATCH 16/20] scsi: introduce scsi_req_get_buf

2011-05-03 Thread Paolo Bonzini
... and remove some SCSIDevice variables or fields that now become unused. Signed-off-by: Paolo Bonzini --- hw/esp.c |2 +- hw/lsi53c895a.c |2 +- hw/scsi-bus.c|5 + hw/scsi.h|1 + hw/spapr_vscsi.c |8 ++-- hw/usb-msd.c |2 +- 6 files chan

[Qemu-devel] [PATCH 20/20] scsi-generic: Handle queue full

2011-05-03 Thread Paolo Bonzini
The sg driver currently has a hardcoded limit of commands it can handle simultaneously. When this limit is reached the driver will return -EDOM. So we need to capture this to enable proper return values here. Signed-off-by: Hannes Reinecke Signed-off-by: Paolo Bonzini --- hw/scsi-generic.c |

[Qemu-devel] [PATCH 07/20] scsi: Use 'SCSIRequest' directly

2011-05-03 Thread Paolo Bonzini
From: Hannes Reinecke Currently the SCSIRequest structure is abstracted away and cannot accessed directly from the driver. This requires the handler to do a lookup on an abstract 'tag' which identifies the SCSIRequest structure. With this patch the SCSIRequest structure is exposed to the driver.

[Qemu-devel] [PATCH 12/20] scsi: Update sense code handling

2011-05-03 Thread Paolo Bonzini
From: Hannes Reinecke The SCSI spec has a quite detailed list of sense codes available. It even mandates the use of specific ones for some failure cases. The current implementation just has one type of generic error which is actually a violation of the spec in certain cases. This patch introduces

[Qemu-devel] [PATCH 13/20] scsi: do not call send_command directly

2011-05-03 Thread Paolo Bonzini
Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer. Signed-off-by: Paolo Bonzini --- hw/esp.c |2 +- hw/lsi53c895a.c |2 +- hw/scsi-bus.c |3 ++- hw/scsi-disk.c|1 - hw/scsi-generic.c |1 - hw/scsi.h |2 +- hw/spapr_vscsi.c

[Qemu-devel] [PATCH 19/20] scsi: make write_data return void

2011-05-03 Thread Paolo Bonzini
The return value is unused anyway. Signed-off-by: Paolo Bonzini --- hw/scsi-disk.c|6 ++ hw/scsi-generic.c |7 ++- hw/scsi.h |2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 65744c7..4c7a53e 100644 --- a/

[Qemu-devel] [PATCH 05/20] scsi: reference-count requests

2011-05-03 Thread Paolo Bonzini
With the next patch, a device may hold SCSIRequest for an indefinite time. Split a rather big patch, and protect against access errors, by reference counting them. There is some ugliness in scsi_send_command implementation due to the need to unref the request when it fails. This will go away wit

[Qemu-devel] [PATCH 14/20] scsi: introduce scsi_req_new

2011-05-03 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/esp.c |2 +- hw/lsi53c895a.c |3 +-- hw/scsi-bus.c|5 + hw/scsi.h|1 + hw/spapr_vscsi.c |2 +- hw/usb-msd.c |2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/esp.c b/hw/esp.c index 3a6

[Qemu-devel] [PATCH 11/20] scsi: use scsi_req_complete

2011-05-03 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/scsi-generic.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index 5bfbb8a..e1f8a8a 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -288,7 +288,6 @@ static int32_t scsi_send_command(

[Qemu-devel] [PATCH 09/20] scsi: introduce scsi_req_abort

2011-05-03 Thread Paolo Bonzini
This covers the case of canceling a request's I/O and still completing it. Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c|9 + hw/scsi.h|1 + hw/spapr_vscsi.c |8 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.

[Qemu-devel] [PATCH 03/20] scsi: introduce scsi_req_data

2011-05-03 Thread Paolo Bonzini
This abstracts calling the command_complete callback, reducing churn in the following patches. Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c |6 ++ hw/scsi-disk.c|8 hw/scsi-generic.c |6 +++--- hw/scsi.h |1 + trace-events |1 + 5 files cha

[Qemu-devel] [PATCH 04/20] scsi: introduce SCSIBusOps

2011-05-03 Thread Paolo Bonzini
There are more operations than a SCSI bus can handle, besides completing commands. One example, which this series will introduce, is cleaning up after a request is cancelled. More long term, a "SCSI bus" can represent the LUNs attached to a target; in this case, while all commands will ultimately

[Qemu-devel] [PATCH 08/20] scsi: commonize purging requests

2011-05-03 Thread Paolo Bonzini
The code for canceling requests upon reset is already the same. Clean it up and move it to scsi-bus.c. Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c | 12 hw/scsi-disk.c| 18 ++ hw/scsi-generic.c | 18 ++ hw/scsi.h |1 + 4

[Qemu-devel] [PATCH 06/20] lsi: extract lsi_find_by_tag

2011-05-03 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/lsi53c895a.c | 63 +- 1 files changed, 38 insertions(+), 25 deletions(-) diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 56329c2..fc21158 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -652,38 +

[Qemu-devel] [PATCH 02/20] scsi-generic: Remove bogus double complete

2011-05-03 Thread Paolo Bonzini
scsi-generic scsi_read_complete() should not -both- call the client complete callback with SCSI_REASON_DATA -and- call scsi_command_complete(). The former will cause the client to queue a new read or write request, while the later will free the request data structure, thus causing the new read or

[Qemu-devel] [PATCH 00/20] SCSI subsystem improvements

2011-05-03 Thread Paolo Bonzini
This series includes the following improvements to the SCSI subsystem: 1) introduction of SCSIBusOps that generalize the existing command_complete callback; 2) widespread use of the SCSIRequest abstraction, with simpler memory management (refcounting) and with various common idioms converted into

[Qemu-devel] [PATCH 01/20] scsi: add tracing of scsi requests

2011-05-03 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c |6 ++ trace-events |6 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index ceeb4ec..0fd85fc 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -4,6 +4,7 @@ #include "scsi-defs.h" #

[Qemu-devel] [PATCH 4/4] milkymist: use cpu_physical_memory_map_fast

2011-05-03 Thread Paolo Bonzini
This patch adds proper unmapping of the memory when the addresses cross multiple memory blocks, and it also uses a single map_fast operation for the RMW access to the destination frame buffer. Cc: Michael Walle Signed-off-by: Paolo Bonzini --- Compile-tested only. hw/milkymist-tmu2.c |

[Qemu-devel] [PATCH 2/4] exec: introduce cpu_physical_memory_map_fast and cpu_physical_memory_map_check

2011-05-03 Thread Paolo Bonzini
Paravirtualized devices (and also some real devices) can assume they are going to access RAM. For this reason, provide a fast-path function with the following properties: 1) it will never allocate a bounce buffer 2) it can be used for read-modify-write operations 3) unlike qemu_get_ram_ptr, it

[Qemu-devel] [PATCH 3/4] virtio: use cpu_physical_memory_map_fast

2011-05-03 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/vhost.c | 10 +- hw/virtio.c |2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index 14b571d..763ee4c 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -283,7 +283,7 @@ static int vhost_verify_ring_mappings(s

[Qemu-devel] [PATCH 1/4] exec: extract cpu_physical_memory_map_internal

2011-05-03 Thread Paolo Bonzini
This function performs all the work on the fast path, and returns enough information for the slow path to pick up the work. This will be used later by other functions that only do the fast path. Signed-off-by: Paolo Bonzini --- exec.c | 77 -

  1   2   >