[Qemu-devel] [PATCH, RFT] Speedup 'tb_find_slow' by using the same heuristic as during memory page lookup

2010-11-22 Thread Kirill Batuzov
Move the last found TB to the head of the list so it will be found more quickly next time it will be looked for. Signed-off-by: Kirill Batuzov batuz...@ispras.ru Signed-off-by: Pavel Yushchenko p...@ispras.ru --- Hello. This patch gives significant boost to a used by us rather rich

[Qemu-devel] [PATCH] Speedup 'tb_find_slow' by using the same heuristic as during memory page lookup

2010-12-02 Thread Kirill Batuzov
Move the last found TB to the head of the list so it will be found more quickly next time it will be looked for. Signed-off-by: Kirill Batuzov batuz...@ispras.ru Signed-off-by: Pavel Yushchenko p...@ispras.ru --- This patch appeared during investigation of performance issues with S5PC110

Re: [Qemu-devel] [PATCH] Speedup 'tb_find_slow' by using the same heuristic as during memory page lookup

2010-12-04 Thread Kirill Batuzov
On 04.12.2010 23:11, Blue Swirl wrote: On Thu, Dec 2, 2010 at 1:12 PM, Kirill Batuzovbatuz...@ispras.ru wrote: Move the last found TB to the head of the list so it will be found more quickly next time it will be looked for. Signed-off-by: Kirill Batuzovbatuz...@ispras.ru Signed-off-by: Pavel

[Qemu-devel] [PATCH 0/6] Implement constant folding and copy propagation in TCG

2011-05-20 Thread Kirill Batuzov
1760.496 1936.387 -0.29% 256.bzip2 1007.658 1007.682 1007.316 1007.982 1007.747 1007.682 0.68% 300.twolf 1334.139 1333.791 1333.795 1334.147 1333.732 1333.795 0.67% ARM guests for 254.gap and 255.vortex and x86_64 guest for 252.eon does not work under QEMU for some unrelated reason. Kirill

[Qemu-devel] [PATCH 1/6] Add TCG optimizations stub

2011-05-20 Thread Kirill Batuzov
Added file tcg/optimize.c to hold TCG optimizations. Function tcg_optimize is called from tcg_gen_code_common. It calls other functions performing specific optimizations. Stub for constant folding was added. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- Makefile.target |2 +- tcg

[Qemu-devel] [PATCH 6/6] Do constant folding for unary operations.

2011-05-20 Thread Kirill Batuzov
Perform constant folding for NOT and EXT{8,16,32}{S,U} operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 82 1 files changed, 82 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

[Qemu-devel] [PATCH 5/6] Do constant folding for shift operations.

2011-05-20 Thread Kirill Batuzov
Perform constant forlding for SHR, SHL, SAR, ROTR, ROTL operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 87 1 files changed, 87 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

[Qemu-devel] [PATCH 4/6] Do constant folding for boolean operations.

2011-05-20 Thread Kirill Batuzov
Perform constant folding for AND, OR, XOR operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 58 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 4073f05

[Qemu-devel] [PATCH 2/6] Add copy and constant propagation.

2011-05-20 Thread Kirill Batuzov
Make tcg_constant_folding do copy and constant propagation. It is a preparational work before actual constant folding. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 123 1 files changed, 123 insertions(+), 0

[Qemu-devel] [PATCH 3/6] Do constant folding for basic arithmetic operations.

2011-05-20 Thread Kirill Batuzov
Perform actual constant folding for ADD, SUB and MUL operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 102 1 files changed, 102 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

Re: [Qemu-devel] [PATCH 0/6] Implement constant folding and copy propagation in TCG

2011-05-21 Thread Kirill Batuzov
On 21.05.2011 14:46, Aurelien Jarno wrote: We definitely need to rewrite/improve the register allocator to save a global back to memory when it is not used later in the TB. I am currently working on that, I hope to have something ready soon. I think I have this done already. The patches need

[Qemu-devel] [RFC][PATCH v0 6/8] Spill globals early if their next use is in call.

2011-05-23 Thread Kirill Batuzov
Spill globals early if their next use is in call. They'll be spilled anyway in this case. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 8ab556d..ad5bd71 100644

[Qemu-devel] [RFC][PATCH v0 4/8] Calculate NEXT_CALL liveness information.

2011-05-23 Thread Kirill Batuzov
Keep track of where is the next call for each TCG operation. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg.c | 11 +++ tcg/tcg.h |2 ++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 61689e2..799b245 100644 --- a/tcg/tcg.c

[Qemu-devel] [RFC][PATCH v0 2/8] Propagate REG_NEXT_USE value through process of register allocation.

2011-05-23 Thread Kirill Batuzov
Propagate next use of each register through process of register allocation. This would be needed to do a better spill choice. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg.c | 36 +--- 1 files changed, 33 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [RFC][PATCH v0 1/8] Compute additional liveness information for register allocator.

2011-05-23 Thread Kirill Batuzov
Compute next use for each operation argument. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg.c | 73 - tcg/tcg.h |4 +++ 2 files changed, 71 insertions(+), 6 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index

[Qemu-devel] [RFC][PATCH v0 8/8] Add spill count profiling.

2011-05-23 Thread Kirill Batuzov
Gather generated spills statistics. It is useful for debugging and evaluating of new register allocator. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg.c | 69 + tcg/tcg.h |6 + 2 files changed, 75 insertions

[Qemu-devel] [RFC][PATCH v0 7/8] Spill globals early if their next use is at the BB end.

2011-05-23 Thread Kirill Batuzov
Spill globals early if their next use is at the BB end. They'll be spilled anyway in this case. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index ad5bd71..022eef9 100644

[Qemu-devel] [RFC][PATCH v0 5/8] Track call-clobbered uses of registers

2011-05-23 Thread Kirill Batuzov
Adjust next use for call-clobbered registers. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 799b245..8ab556d 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2125,6 +2125,9

[Qemu-devel] [RFC][PATCH v0 0/8] Improve register allocator

2011-05-23 Thread Kirill Batuzov
because it seems other people are working on the same thing and I'd like to avoid unnecessary work duplication if possible. Kirill Batuzov (8): Compute additional liveness information for register allocator. Propagate REG_NEXT_USE value through process of register allocation. Do better spill

[Qemu-devel] [RFC][PATCH v0 3/8] Do better spill choice.

2011-05-23 Thread Kirill Batuzov
Choose register with farthest next use for spilling. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index c6e920e..61689e2 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c

Re: [Qemu-devel] [RFC][PATCH v0 0/8] Improve register allocator

2011-05-24 Thread Kirill Batuzov
On Mon, 23 May 2011, Aurelien Jarno wrote: Thanks for this patch series. Your approach to solve this issue is really different than mine. Instead I added more state to the dead/live states, and use them to mark some input deads even for global, and mark some output arguments to be synced.

Re: [Qemu-devel] [RFC][PATCH v0 0/8] Improve register allocator

2011-05-24 Thread Kirill Batuzov
On Tue, 24 May 2011, Laurent Desnogues wrote: On Tue, May 24, 2011 at 1:31 PM, Kirill Batuzov batuz...@ispras.ru wrote: [...] Gathered statistics shows some interesting things too. I've run matrix multiplication benchmark (guest - ARM, host - x86, linux-user mode, with my patches

Re: [Qemu-devel] [PATCH 5/6] Do constant folding for shift operations.

2011-05-26 Thread Kirill Batuzov
On Fri, 20 May 2011, Richard Henderson wrote: On 05/20/2011 05:39 AM, Kirill Batuzov wrote: +case INDEX_op_sar_i32: +#if TCG_TARGET_REG_BITS == 64 +x = 0x; +y = 0x; +#endif +r = x 0x8000; +x = ~0x8000; +x

[Qemu-devel] [PATCH v2 3/6] Do constant folding for basic arithmetic operations.

2011-06-09 Thread Kirill Batuzov
Perform actual constant folding for ADD, SUB and MUL operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 156 1 files changed, 156 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

[Qemu-devel] [PATCH v2 5/6] Do constant folding for shift operations.

2011-06-09 Thread Kirill Batuzov
Perform constant forlding for SHR, SHL, SAR, ROTR, ROTL operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 86 1 files changed, 86 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

[Qemu-devel] [PATCH v2 2/6] Add copy and constant propagation.

2011-06-09 Thread Kirill Batuzov
Make tcg_constant_folding do copy and constant propagation. It is a preparational work before actual constant folding. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 161 1 files changed, 161 insertions(+), 0

[Qemu-devel] [PATCH v2 4/6] Do constant folding for boolean operations.

2011-06-09 Thread Kirill Batuzov
Perform constant folding for AND, OR, XOR operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 56 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 29da6fa

[Qemu-devel] [PATCH v2 6/6] Do constant folding for unary operations.

2011-06-09 Thread Kirill Batuzov
Perform constant folding for NOT and EXT{8,16,32}{S,U} operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 83 1 files changed, 83 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

[Qemu-devel] [PATCH v2 0/6] Implement constant folding and copy propagation in TCG

2011-06-09 Thread Kirill Batuzov
expression simplifications into independent switch. - Let compiler handle signed shifts and sign/zero extends in it's implementation defined way. Kirill Batuzov (6): Add TCG optimizations stub Add copy and constant propagation. Do constant folding for basic arithmetic operations. Do

[Qemu-devel] [PATCH v2 1/6] Add TCG optimizations stub

2011-06-09 Thread Kirill Batuzov
Added file tcg/optimize.c to hold TCG optimizations. Function tcg_optimize is called from tcg_gen_code_common. It calls other functions performing specific optimizations. Stub for constant folding was added. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- Makefile.target |2 +- tcg

Re: [Qemu-devel] [PATCH v2 2/6] Add copy and constant propagation.

2011-07-07 Thread Kirill Batuzov
flush of all temps is only needed at labels. Not much better unfortunately. Globals got spilled at basic block end, temps just die. The only things we can keep are locals but I have not seen much of them in the intermediate representation. Kirill Batuzov

[Qemu-devel] [PATCH v3 0/6] Implement constant folding and copy propagation in TCG

2011-07-07 Thread Kirill Batuzov
to reduce amount of ifdefdsi. Checkpatch is not happy about this change but I do not think spaces would be appropriate here. - Some constraints during copy propagation are relaxed. - Functions tcg_opt_gen_mov and tcg_opt_gen_movi are introduced to reduce code duplication. Kirill Batuzov (6

[Qemu-devel] [PATCH v3 6/6] Do constant folding for unary operations.

2011-07-07 Thread Kirill Batuzov
Perform constant folding for NOT and EXT{8,16,32}{S,U} operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 59 1 files changed, 59 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

[Qemu-devel] [PATCH v3 2/6] Add copy and constant propagation.

2011-07-07 Thread Kirill Batuzov
Make tcg_constant_folding do copy and constant propagation. It is a preparational work before actual constant folding. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 182 +++- 1 files changed, 180 insertions(+), 2

[Qemu-devel] [PATCH v3 4/6] Do constant folding for boolean operations.

2011-07-07 Thread Kirill Batuzov
Perform constant folding for AND, OR, XOR operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 37 + 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 42a1bda..c469952 100644

[Qemu-devel] [PATCH v3 3/6] Do constant folding for basic arithmetic operations.

2011-07-07 Thread Kirill Batuzov
Perform actual constant folding for ADD, SUB and MUL operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 125 1 files changed, 125 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

[Qemu-devel] [PATCH v3 1/6] Add TCG optimizations stub

2011-07-07 Thread Kirill Batuzov
Added file tcg/optimize.c to hold TCG optimizations. Function tcg_optimize is called from tcg_gen_code_common. It calls other functions performing specific optimizations. Stub for constant folding was added. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- Makefile.target |2 +- tcg

[Qemu-devel] [PATCH v3 5/6] Do constant folding for shift operations.

2011-07-07 Thread Kirill Batuzov
Perform constant forlding for SHR, SHL, SAR, ROTR, ROTL operations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/optimize.c | 72 1 files changed, 72 insertions(+), 0 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c

Re: [Qemu-devel] [PATCH v3 0/6] Implement constant folding and copy propagation in TCG

2011-07-07 Thread Kirill Batuzov
On Thu, 7 Jul 2011, Peter Maydell wrote: On 7 July 2011 13:37, Kirill Batuzov batuz...@ispras.ru wrote: ARM guests for 254.gap and 255.vortex and x86_64 guest for 252.eon does not work under QEMU for some unrelated reason. If you can provide a binary and a command line for these I can

Re: [Qemu-devel] [PATCH 0/1] Fix large memory chunks allocation with tcg_malloc

2012-03-15 Thread Kirill Batuzov
Ping? Somebody please review this patch... And whom should I Cc in case of changes to tcg/ ? File MAINTAINERS lists only qemu-devel for this subsystem. On Fri, 2 Mar 2012, Kirill Batuzov wrote: Currently large memory chunk allocation with tcg_malloc is broken. An attempt to allocate

Re: [Qemu-devel] [PATCH v1 1/2] pl330: initial version

2012-03-29 Thread Kirill Batuzov
On Thu, 29 Mar 2012, Peter A. G. Crosthwaite wrote: Device model for Primecell PL330 dma controller. Signed-off-by: Peter A. G. Crosthwaite peter.crosthwa...@petalogix.com --- Signed-off-by: Kirill Batuzov batuz...@ispras.ru +static int PL330Fifo_get(PL330Fifo *s, uint8_t *buf, int len

[Qemu-devel] [PATCH 0/1] Fix large memory chunks allocation with tcg_malloc

2012-03-02 Thread Kirill Batuzov
and is allocated unconditionally for each translation block. Kirill Batuzov (1): Fix large memory chunks allocation with tcg_malloc. tcg/tcg.c | 14 +- tcg/tcg.h |2 +- 2 files changed, 10 insertions(+), 6 deletions(-) --- diff --git a/tcg/tcg.c b/tcg/tcg.c index 351a0a3

[Qemu-devel] [PATCH 1/1] Fix large memory chunks allocation with tcg_malloc.

2012-03-02 Thread Kirill Batuzov
can not reuse them. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg.c | 14 +- tcg/tcg.h |2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 351a0a3..7db8340 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -173,11 +173,9

Re: [Qemu-devel] [PATCH 0/1] Fix large memory chunks allocation with tcg_malloc

2012-03-06 Thread Kirill Batuzov
clarify that I found this issue when I was writing an unrelated modification to the register allocator which required large memory allocations. Current code in TCG probably never does such allocations and does not trigger memory corruption. -- Kirill Batuzov

Re: [Qemu-devel] 64-on-32 TCG broken

2012-11-07 Thread Kirill Batuzov
: qemu-system-x86_64 -cdrom install-amd64-minimal-20121013.iso -- Kirill BatuzovFrom 33e1fc03934cebea8d32c98ea34961c80f05d94a Mon Sep 17 00:00:00 2001 From: Kirill Batuzov batuz...@ispras.ru Date: Wed, 7 Nov 2012 15:26:38 +0400 Subject: [PATCH] tcg: properly check that op's output needs to be synced

Re: [Qemu-devel] disk image: self-organized format or raw file

2014-08-12 Thread Kirill Batuzov
On Tue, 12 Aug 2014, Fam Zheng wrote: On Mon, 08/11 19:38, 吴兴博 wrote: Hello, The introduction in the wiki page present several advantages of qcow2 [1]. But I'm a little confused. I really appreciate if any one can give me some help on this :). (1) Currently the raw format

Re: [Qemu-devel] [RFC PATCH] tcg: add ability to dump /tmp/perf-pid.map files

2014-03-28 Thread Kirill Batuzov
On Thu, 27 Mar 2014, alex.ben...@linaro.org wrote: From: Alex Bennée alex.ben...@linaro.org This allows the perf tool to map samples to each individual translation block. This could be expanded for user space but currently it gives enough information to find any hotblocks by other means.

Re: [Qemu-devel] [RFC PATCH] tcg: add ability to dump /tmp/perf-pid.map files

2014-03-28 Thread Kirill Batuzov
On 28.03.2014 20:34, Alex Bennée wrote: @@ -2575,6 +2579,8 @@ static inline int tcg_gen_code_common(TCGContext *s, uint64_t target_pc, the_end: /* Generate TB finalization at the end of block */ tcg_out_tb_finalize(s); + +tcg_write_perfmap(gen_code_buf, s-code_ptr -

[Qemu-devel] [PATCH trivial] init_paths: fix minor memory leak

2014-04-10 Thread Kirill Batuzov
Fields name (created with strdup in new_entry) and pathname (created with g_strdup_printf in new_entry) of pathelem struct should be freed before the whole struct is. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- util/path.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion

Re: [Qemu-devel] [PATCH qom v2 2/4] hw: Fix qemu_allocate_irqs() leaks

2014-06-18 Thread Kirill Batuzov
On Wed, 18 Jun 2014, Peter Crosthwaite wrote: From: Andreas Färber afaer...@suse.de Replace qemu_allocate_irqs(foo, bar, 1)[0] with qemu_allocate_irq(foo, bar, 0). This avoids leaking the dereferenced qemu_irq *. Cc: Kirill Batuzov batuz...@ispras.ru Cc: Markus Armbruster arm

Re: [Qemu-devel] [PATCH 3/4] machine: convert ram_size, maxram_size, ram_slots to properties

2014-06-25 Thread Kirill Batuzov
On Wed, 25 Jun 2014, Igor Mammedov wrote: +if (ram_size) { +object_property_set_int(OBJECT(current_machine), ram_size, +MACHINE_MEMORY_SIZE_OPT, local_err); +if (local_err) { +error_report(%s, error_get_pretty(local_err)); +

[Qemu-devel] [PATCH] qemu-char: initialize chr_write_lock

2014-06-26 Thread Kirill Batuzov
Zheng f...@redhat.com Signed-off-by: Kirill Batuzov batuz...@ispras.ru Signed-off-by: Nikita Belov zod...@ispras.ru --- qemu-char.c |1 + 1 file changed, 1 insertion(+) diff --git a/qemu-char.c b/qemu-char.c index 2e50a10..17bd360 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -94,6 +94,7

[Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int

2014-04-18 Thread Kirill Batuzov
leak. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- hw/acpi/pcihp.c | 23 ++- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index f80c480..ff44aec 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -61,24 +61,11

[Qemu-devel] [PATCH 3/4] graphic_console_init: do not receive unneeded error descriptions

2014-04-18 Thread Kirill Batuzov
Error set by error_set is dynamically allocated and needs to be cleared properly later. graphic_console_init neither needs error descriptions nor frees them. Pass NULL instead of actual pointers to avoid unnecessary memory allocations. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- ui

[Qemu-devel] [PATCH 4/4] PortioList: fix PortioList uses so they do not leak memory

2014-04-18 Thread Kirill Batuzov
platforms. The following testcases cover all changed lines: qemu-system-ppc -M prep qemu-system-i386 -vga qxl qemu-system-i386 -M isapc -soundhw adlib -device ib700,id=watchdog0,bus=isa.0 Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- hw/audio/adlib.c|7 --- hw/display

[Qemu-devel] [PATCH 0/4] Fix memory leaks in QEMU

2014-04-18 Thread Kirill Batuzov
will need to keep very close watch to not allow new bad code to slip into upstream. Any thoughts on how to deal with qemu_allocate_irqs? Is there any archive of guest system images for testing purposes? The list on the wiki page covers only small part of supported boards. Kirill Batuzov (4

[Qemu-devel] [PATCH 2/4] acpi-build: properly decrement objects' reference counters

2014-04-18 Thread Kirill Batuzov
Object returned bu object_property_get_qobject needs it's reference counter to be decremented when it is not needed by caller anymore. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- hw/i386/acpi-build.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw

Re: [Qemu-devel] [PATCH 0/4] Fix memory leaks in QEMU

2014-04-18 Thread Kirill Batuzov
Note that generally these leaks are not really leaks, because we set up the board and wire IRQs together once, and they remain that way for the lifetime of QEMU and are freed automatically when QEMU exits. Unfortunately they are really leaks. As I said qemu_allocate_irqs allocates two chunks

Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int

2014-04-18 Thread Kirill Batuzov
Andreas Färber писал 2014-04-18 20:30: Am 18.04.2014 15:41, schrieb Kirill Batuzov: acpi_pcihp_get_bsel implements functionality of object_property_get_int for specific property named ACPI_PCIHP_PROP_BSEL, but fails to decrement object's reference counter properly. Replacing it with generic

Re: [Qemu-devel] [PATCH 3/4] graphic_console_init: do not receive unneeded error descriptions

2014-04-22 Thread Kirill Batuzov
On Tue, 22 Apr 2014, Gerd Hoffmann wrote: if (dev) { -object_property_set_link(OBJECT(s), OBJECT(dev), - device, local_err); -object_property_set_int(OBJECT(s), head, -head, local_err); +

Re: [Qemu-devel] [PATCH 1/4] Replace acpi_pcihp_get_bsel with generic object_property_get_int

2014-04-22 Thread Kirill Batuzov
m...@redhat.com wrote: On Fri, Apr 18, 2014 at 06:30:37PM +0200, Andreas Färber wrote: Am 18.04.2014 15:41, schrieb Kirill Batuzov: acpi_pcihp_get_bsel implements functionality of object_property_get_int for specific property named ACPI_PCIHP_PROP_BSEL, but fails to decrement

[Qemu-devel] [PATCH v2 1/4] acpi/pcihp.c: Rewrite acpi_pcihp_get_bsel using object_property_get_int

2014-04-24 Thread Kirill Batuzov
leak. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- hw/acpi/pcihp.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) v1 - v2: Keep acpi_pcihp_get_bsel, but rewrite it using object_property_get_int and validate returned value. diff --git a/hw/acpi/pcihp.c b/hw

[Qemu-devel] [PATCH v2 4/4] PortioList: Store PortioList in device state

2014-04-24 Thread Kirill Batuzov
-by: Kirill Batuzov batuz...@ispras.ru --- hw/audio/adlib.c|6 +++--- hw/display/qxl.c|7 +++ hw/display/qxl.h|1 + hw/display/vga.c| 12 +--- hw/display/vga_int.h|2 ++ hw/dma/i82374.c |7 --- hw/isa/isa-bus.c| 28

[Qemu-devel] [PATCH v2 0/4] Fix memory leaks in QEMU

2014-04-24 Thread Kirill Batuzov
. - Missing Error set by error_set deallocation in ui/console.c. - Several missing qobject_decref. - Incorrect usage of PortioList. v1 - v2: All review feedback incorporated. Changes are listed in each individual patch. Kirill Batuzov (4): acpi/pcihp.c: Rewrite acpi_pcihp_get_bsel using

[Qemu-devel] [PATCH v2 3/4] console: Abort on property access errors

2014-04-24 Thread Kirill Batuzov
where an attempt was made to write to a read-only property head. Set head property's value at creation time and do not attempt to change it later. This fixes the bug mentioned above. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- ui/console.c | 30 +- 1 file

[Qemu-devel] [PATCH v2 2/4] acpi-build: properly decrement objects' reference counters

2014-04-24 Thread Kirill Batuzov
Object returned by object_property_get_qobject needs its reference counter to be decremented when it is not needed by caller anymore. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- hw/i386/acpi-build.c |6 ++ 1 file changed, 6 insertions(+) v1 - v2: No changes. diff --git a/hw

[Qemu-devel] [PATCH v3] PortioList: Store PortioList in device state

2014-04-29 Thread Kirill Batuzov
-by: Kirill Batuzov batuz...@ispras.ru --- hw/audio/adlib.c|6 +++--- hw/display/qxl.c|7 +++ hw/display/qxl.h|1 + hw/display/vga.c| 12 +--- hw/display/vga_int.h|2 ++ hw/dma/i82374.c |7 --- hw/isa/isa-bus.c| 11

[Qemu-devel] [PATCH] vl.c: remove init_clocks call from main

2014-05-06 Thread Kirill Batuzov
init_clocks call from main and add an assertion to qemu_clock_init that corresponding clock has not been initialized yet. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- qemu-timer.c |3 +++ vl.c |1 - 2 files changed, 3 insertions(+), 1 deletion(-) The init_clocks call was added

Re: [Qemu-devel] [PATCH v2 3/4] console: Abort on property access errors

2014-05-08 Thread Kirill Batuzov
On Thu, 24 Apr 2014, Kirill Batuzov wrote: All defined properties of QemuConsole are mandatory and no access to them should fail. Nevertheless not checking returned errors is bad because in case of unexpected failure it will hide the bug and cause a memory leak. Abort in case of unexpected

Re: [Qemu-devel] [PATCH qom v1 2/4] hw: Fix qemu_allocate_irqs() leaks

2014-06-03 Thread Kirill Batuzov
On Mon, 2 Jun 2014, Peter Crosthwaite wrote: From: Andreas Färber afaer...@suse.de Replace qemu_allocate_irqs(foo, bar, 1)[0] with qemu_allocate_irq(foo, bar, 0). You missed one occurrence in hw/sh4/sh7750.c in function sh7750_irl. -- Kirill

[Qemu-devel] [PATCH] Handle G_IO_HUP in tcp_chr_read for tcp chardev

2014-07-01 Thread Kirill Batuzov
...@redhat.com Signed-off-by: Kirill Batuzov batuz...@ispras.ru Signed-off-by: Nikita Belov zod...@ispras.ru --- GLib limitation resulted in a bug on Windows host. Steps to reproduce: Start qemu: qemu-system-i386 -qmp tcp:127.0.0.1::server:nowait Connect with telnet: telnet 127.0.0.1 Try

Re: [Qemu-devel] [PATCH] Handle G_IO_HUP in tcp_chr_read for tcp chardev

2014-07-01 Thread Kirill Batuzov
On Tue, 1 Jul 2014, Alex Bennée wrote: Kirill Batuzov writes: Due to GLib limitations it is not possible to create several watches on one channel on Windows hosts. See bug #338943 in GNOME bugzilla for details: https://bugzilla.gnome.org/show_bug.cgi?id=338943 Handle G_IO_HUP

Re: [Qemu-devel] [RFC PATCH 01/22] Makefiles

2014-07-02 Thread Kirill Batuzov
On Tue, 1 Jul 2014, Pavel Dovgaluk wrote: Changes in main makefiles. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@gmail.com --- diff --git a/Makefile.target b/Makefile.target index 6089d29..357ab4d --- a/Makefile.target +++ b/Makefile.target @@ -76,6 +76,7 @@ all: $(PROGS) stap

Re: [Qemu-devel] [RFC PATCH 19/22] Deterministic replay core functions

2014-07-02 Thread Kirill Batuzov
On Tue, 1 Jul 2014, Pavel Dovgaluk wrote: Functions for writing and reading replay log. These functions are used to record the following events: * Output of the time() function * Sound in and sound out events in winaudio * Hardware interrupts and exceptions * Special replay debug

Re: [Qemu-devel] [RFC PATCH 08/22] Monitor commands

2014-07-02 Thread Kirill Batuzov
On Wed, 2 Jul 2014, Pavel Dovgaluk wrote: -Original Message- From: Eric Blake [mailto:ebl...@redhat.com] Sent: Tuesday, July 01, 2014 9:33 PM To: Pavel Dovgaluk; 'QEMU Developers' Subject: Re: [Qemu-devel] [RFC PATCH 08/22] Monitor commands On 07/01/2014 05:23 AM, Pavel

[Qemu-devel] [PATCH] qemu-char: add chr_add_watch support in mux chardev

2014-07-04 Thread Kirill Batuzov
Forward chr_add_watch call from mux chardev to underlying implementation. This should fix bug #1335444 Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- qemu-char.c |9 + 1 file changed, 9 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index 51917de..e1bd6f5 100644

Re: [Qemu-devel] [PATCH] Handle G_IO_HUP in tcp_chr_read for tcp chardev

2014-07-08 Thread Kirill Batuzov
On Mon, 7 Jul 2014, Nikolay Nikolaev wrote: On Tue, Jul 1, 2014 at 2:52 PM, Kirill Batuzov batuz...@ispras.ru wrote: Due to GLib limitations it is not possible to create several watches on one channel on Windows hosts. See bug #338943 in GNOME bugzilla for details: https

[Qemu-devel] [Bug 1335444] Re: qemu loses serial console data on EAGAIN

2014-07-09 Thread Kirill Batuzov
Thank you for detailed bug report. I've submitted a patch that should fix the problem. http://git.qemu.org/?p=qemu.git;a=commitdiff;h=3f0838ab8557c6071a5931183b2d7fed568cd35c;hp=8b81bb3b069d4007bc44c8d5888d630b7f0b42ff -- You received this bug notification because you are a member of qemu-

[Qemu-devel] [PATCH for-2.1] serial: change retry logic to avoid concurrency

2014-07-11 Thread Kirill Batuzov
{} while () loop in serial_xmit (diff is a bit erratic for this part, diff -w will show actual change), - do not call serial_xmit from serial_ioport_write if there is one waiting on the watch already. This should fix another issue causing bug #1335444. Signed-off-by: Kirill Batuzov batuz

[Qemu-devel] [Bug 1335444] Re: qemu loses serial console data on EAGAIN

2014-07-11 Thread Kirill Batuzov
I see. There is an issue with retry logic of serial port emulation. I've send a patch to the mailing list that should help. http://lists.nongnu.org/archive/html/qemu-devel/2014-07/msg01976.html With it both methods pass the test for me. Note that in the first method you'll need to disable

[Qemu-devel] [Bug 1335444] Re: qemu loses serial console data on EAGAIN

2014-07-17 Thread Kirill Batuzov
v2.1.0-rc2 has both patches. ** Changed in: qemu Status: New = Fix Committed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1335444 Title: qemu loses serial console data on EAGAIN Status

Re: [Qemu-devel] Serial: possible hang during intensive interaction over the console

2014-09-04 Thread Kirill Batuzov
On Wed, 3 Sep 2014, Andrey Korolyov wrote: Given 2.1 and isa-serial output, set as ttyS0 for the guest VM with 9600 baud rate. The test case is quite simple - display as much data as possible over serial console and do not hang the system. While qemu-1.1 works perfectly, with complaining

Re: [Qemu-devel] Serial: possible hang during intensive interaction over the console

2014-09-04 Thread Kirill Batuzov
On Thu, 4 Sep 2014, Andrey Korolyov wrote: Thanks, the launch string can be borrowed from attach here: http://lists.nongnu.org/archive/html/qemu-devel/2014-09/msg00482.html, the same VM is going under test. By hang I mean stopping ability to send icmp replies, it is like a kind of a

Re: [Qemu-devel] Serial: possible hang during intensive interaction over the console

2014-09-09 Thread Kirill Batuzov
On Fri, 5 Sep 2014, Andrey Korolyov wrote: Heh, it is kernel- (defaults-) dependent after all. Debian hangs always, on 3.10, 3.14 and 3.16, Fedora 20 works fine on 3.15. I`ll check if there are any 82550-specific patches in Fedora tree a bit later. It is a setting-dependent issue,

Re: [Qemu-devel] [PATCH] qemu-char: Do not disconnect when there's data for reading

2014-09-16 Thread Kirill Batuzov
a related bug when running socat in write-only mode, with $ echo quit | socat -u - UNIX-CONNECT:qemu-monitor the monitor won't not run the 'quit' command. CC: Kirill Batuzov batuz...@ispras.ru CC: Nikolay Nikolaev n.nikol...@virtualopensystems.com CC: Anthony Liguori aligu...@amazon.com

Re: [Qemu-devel] [PATCH v3] qemu-char: Do not disconnect when there's data for reading

2014-09-19 Thread Kirill Batuzov
of connection as suggested by Kirill. Cc: Kirill Batuzov batuz...@ispras.ru Cc: Nikolay Nikolaev n.nikol...@virtualopensystems.com Cc: Markus Armbruster arm...@redhat.com Cc: Anthony Liguori aligu...@amazon.com Signed-off-by: Zifei Tong zifeit...@gmail.com --- Changes in v3: handle EWOULDBLOCK, remove

[Qemu-devel] [PATCH RFC 6/7] target-arm: use add_i32x4 opcode to handle vadd.i32 instruction

2014-10-16 Thread Kirill Batuzov
Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- target-arm/translate.c | 12 1 file changed, 12 insertions(+) diff --git a/target-arm/translate.c b/target-arm/translate.c index 22855d8..00ea5cf 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -5239,6

[Qemu-devel] [PATCH RFC 0/7] Translate guest vector operations to host vector operations

2014-10-16 Thread Kirill Batuzov
. Still there are some cons I mentioned earlier. The need to support a lot of opcodes is the most significant in the long run I think. So before I commit my time to conversion of more operations I'd like to hear your opinions if this approach is acceptable and worth spending efforts. Kirill Batuzov (7

[Qemu-devel] [PATCH RFC 7/7] tcg/i386: add support for vector opcodes

2014-10-16 Thread Kirill Batuzov
to support any other opcodes we want. INDEX_op_add_i32x4 is the only one for now. PADDD instruction handles it perfectly. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/i386/tcg-target.c | 103 ++--- tcg/i386/tcg-target.h | 24

[Qemu-devel] [PATCH RFC 4/7] tcg: add add_i32x4 opcode

2014-10-16 Thread Kirill Batuzov
in a serious performance degradation. Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- tcg/tcg-op.h | 108 + tcg/tcg-opc.h | 12 +++ tcg/tcg.h |5 +++ 3 files changed, 125 insertions(+) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h

Re: [Qemu-devel] [PATCH RFC 0/7] Translate guest vector operations to host vector operations

2014-10-16 Thread Kirill Batuzov
On Thu, 16 Oct 2014, Alex Bennée wrote: From Valgrind experience there are enough genericism. Valgrind can translate SSE, AltiVec and NEON instructions to vector opcodes. Most of the opcodes are reused between instruction sets. Doesn't Valgrind have the advantage of

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Kirill Batuzov
On Tue, 21 Oct 2014, Markus Armbruster wrote: Michael S. Tsirkin m...@redhat.com writes: On Mon, Oct 20, 2014 at 03:04:44PM +0100, Peter Maydell wrote: On 20 October 2014 10:19, Markus Armbruster arm...@redhat.com wrote: Contributors rely on this script to find maintainers to copy. The

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Kirill Batuzov
On Tue, 21 Oct 2014, Markus Armbruster wrote: Paolo Bonzini pbonz...@redhat.com writes: On 10/20/2014 04:15 PM, Michael S. Tsirkin wrote: What do you want to happen in this case? Won't this cause even more patches to fall to the floor? The benefit seems marginal, the risk high. I

Re: [Qemu-devel] [PATCH] MAINTAINERS: Add more TCG files

2014-10-22 Thread Kirill Batuzov
On Wed, 22 Oct 2014, Paolo Bonzini wrote: Unfortunately, TCG files do not really have a maintainer yet. But at least there will be fewer unmaintained files. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- MAINTAINERS | 16 1 file changed, 16 insertions(+) diff

Re: [Qemu-devel] [PATCH] hw/arm/realview.c: Fix memory leak in realview_init()

2014-10-31 Thread Kirill Batuzov
On Fri, 31 Oct 2014, Peter Maydell wrote: On 31 October 2014 10:42, Nikita Belov zod...@ispras.ru wrote: On 2014-10-29 19:03, Peter Maydell wrote: We leak all of the MemoryRegions we allocate here, because we don't have a persistent state struct to keep them in. This doesn't really

Re: [Qemu-devel] [PATCH RFC 0/7] Translate guest vector operations to host vector operations

2014-11-11 Thread Kirill Batuzov
On Thu, 16 Oct 2014, Kirill Batuzov wrote: (4) Consider supporting generic vector operations in the TCG? I gave it a go and was quite happy with the result. I have implemented the add_i32x4 opcode which is addition of 128-bit vectors composed of four 32-bit integers and used

Re: [Qemu-devel] [PATCH] hw/arm/realview.c: Fix memory leak in realview_init()

2014-11-20 Thread Kirill Batuzov
On Wed, 19 Nov 2014, Peter Maydell wrote: Not for 2.2, Fair enough. and I'm still not really convinced in general that it's worthwhile at all. I'm surprised that this small patch caused so much controversy. It seems very simple and straightforward to me. This patch fixes a memory leak.

Re: [Qemu-devel] [PATCH] hw/arm/realview.c: Fix memory leak in realview_init()

2014-11-20 Thread Kirill Batuzov
On 20 November 2014 11:53, Kirill Batuzov batuz...@ispras.ru wrote: I'm surprised that this small patch caused so much controversy. It seems very simple and straightforward to me. This patch fixes a memory leak. The fact that it indeed was a memory leak is indicated by Valgrind output

Re: [Qemu-devel] Update on TCG Multithreading

2014-12-02 Thread Kirill Batuzov
On Mon, 1 Dec 2014, Mark Burton wrote: One issue I’d like to see more opinions on is the question of a cache per core, or a shared cache. I have heard anecdotal evidence that a shared cache gives a major performance benefit…. Does anybody have anything more concrete? There is a

[Qemu-devel] [PATCH v2] target-arm: check that LSB = MSB in BFI instruction

2015-01-30 Thread Kirill Batuzov
. To reproduce issue run the following program int main(void) { asm volatile (.long 0x07c00c12 :: ); return 0; } compiled with gcc -marm -static badop_arm.c -o badop_arm Signed-off-by: Kirill Batuzov batuz...@ispras.ru --- target-arm/translate.c |4 1 file changed, 4 insertions

  1   2   >