[Qemu-devel] [PATCH 08/57] target-i386: move eflags computation closer to gen_op_set_cc_op

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini This ensures the invariant that cpu_cc_op matches s->cc_op when calling the helpers. The next patches need this because gen_compute_eflags and gen_compute_eflags_c will take care of setting cpu_cc_op. Always compute EFLAGS first since it is needed whenever the shift is non-z

[Qemu-devel] [PATCH 05/57] target-i386: factor setting of s->cc_op handling for string functions

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Set it to the appropriate CC_OP_SUBx constant in gen_scas/gen_cmps. In the repz case it can be overridden to CC_OP_DYNAMIC after generating the code. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 9 + 1 file changed, 5

[Qemu-devel] [PATCH 18/57] target-i386: do not compute eflags multiple times consecutively

2013-01-23 Thread Richard Henderson
After calling gen_compute_eflags, leave the computed value in cc_reg_src and set cc_op to CC_OP_EFLAGS. The next few patches will remove anyway most calls to gen_compute_eflags. As a result of this change it is more natural to remove the register argument from gen_compute_eflags and change all th

[Qemu-devel] [PATCH 56/57] target-i386: Simplify bsf/bsr flags computation

2013-01-23 Thread Richard Henderson
There's no need for a branch or for a local temporary. Signed-off-by: Richard Henderson --- target-i386/translate.c | 60 + 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index fdb0

[Qemu-devel] [PATCH 16/57] target-i386: Use gen_update_cc_op everywhere

2013-01-23 Thread Richard Henderson
All of the conditional calls to gen_op_set_cc_op go away, and gen_op_set_cc_op itself gets inlined into its only remaining caller. Signed-off-by: Richard Henderson --- target-i386/translate.c | 176 +++- 1 file changed, 56 insertions(+), 120 deletions(

[Qemu-devel] [PATCH 11/57] target-i386: use gen_jcc1 to compile loopz

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 55eaba2..124fe52 100644 --- a/target-i386/translate.c

[Qemu-devel] [PATCH 44/57] target-i386: Decode the VEX prefixes

2013-01-23 Thread Richard Henderson
No actual required uses of these encodings yet. Signed-off-by: Richard Henderson --- target-i386/translate.c | 68 ++--- 1 file changed, 64 insertions(+), 4 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 91d3957..a9c

[Qemu-devel] [PATCH 53/57] target-i386: Implement RORX

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/translate.c | 32 1 file changed, 32 insertions(+) diff --git a/target-i386/translate.c b/target-i386/translate.c index 1519566..ec8234d 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -4429,6

[Qemu-devel] [PATCH 23/57] target-i386: convert gen_compute_eflags_c to TCG

2013-01-23 Thread Richard Henderson
Do the switch at translation time, converting the helper templates to TCG opcodes. In some cases CF can be computed with a single setcond, though others it may require a little more work. In the CC_OP_DYNAMIC case, compute the whole EFLAGS, same as for ZF/SF/PF. Reviewed-by: Blue Swirl Signed-o

[Qemu-devel] [PATCH 43/57] target-i386: Tidy prefix parsing

2013-01-23 Thread Richard Henderson
Avoid duplicating switch statement between 32 and 64-bit modes. Signed-off-by: Richard Henderson --- target-i386/translate.c | 134 +++- 1 file changed, 52 insertions(+), 82 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c i

[Qemu-devel] [PATCH 55/57] target-i386: Use clz/ctz for bsf/bsr helpers

2013-01-23 Thread Richard Henderson
And mark the helpers as NO_RWG_SE. Signed-off-by: Richard Henderson --- target-i386/helper.h | 6 +++--- target-i386/int_helper.c | 45 +++-- 2 files changed, 14 insertions(+), 37 deletions(-) diff --git a/target-i386/helper.h b/target-i386/helper.h

[Qemu-devel] [PATCH 57/57] target-i386: Implement tzcnt and fix lzcnt

2013-01-23 Thread Richard Henderson
We weren't computing flags for lzcnt at all. Signed-off-by: Richard Henderson --- target-i386/helper.h | 5 ++--- target-i386/int_helper.c | 11 +++ target-i386/translate.c | 50 3 files changed, 38 insertions(+), 28 deletions(-) di

[Qemu-devel] [PATCH 31/57] target-i386: inline gen_prepare_cc_slow

2013-01-23 Thread Richard Henderson
Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 91 + 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index be8d3a3..df2cb3d 100644 --- a/

[Qemu-devel] [PATCH 40/57] target-i386: Use CC_SRC2 for ADC and SBB

2013-01-23 Thread Richard Henderson
Now that we've got two slots in ENV, store two of the three inputs. This lets us do less work when carry-out is not needed, and avoids the unpredictable CC_OP after translating these insns. Signed-off-by: Richard Henderson --- target-i386/cc_helper_template.h | 44 +-

[Qemu-devel] [PATCH 35/57] target-i386: kill cpu_T3

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini It is almost unused, and it is simpler to pass a TCG value directly to gen_shiftd_rm_T1_T3. This value is then written to t2 without going through a temporary register. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 19

[Qemu-devel] [PATCH 49/57] target-i386: Implement BZHI

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/translate.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/target-i386/translate.c b/target-i386/translate.c index d68537c..46e7b24 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -4072,6 +407

[Qemu-devel] [PATCH 39/57] target-i386: optimize flags checking after sub using CC_SRC2

2013-01-23 Thread Richard Henderson
After a comparison or subtraction, the original value of the LHS will currently be reconstructed using an addition. However, in most cases it is already available: store it in a temp-local variable and save 1 or 2 TCG ops (2 if the result of the addition needs to be extended). The temp-local can

[Qemu-devel] [PATCH 36/57] target-i386: use gen_op for cmps/scas

2013-01-23 Thread Richard Henderson
Replace low-level ops with a higher-level "cmp %al, (A0)" in the case of scas, and "cmp T0, (A0)" in the case of cmps. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --gi

[Qemu-devel] [PATCH 48/57] target-i386: Implement BLSR, BLSMSK, BLSI

2013-01-23 Thread Richard Henderson
Do all of group 17 at one time for ease. Signed-off-by: Richard Henderson --- target-i386/cc_helper.c | 9 + target-i386/cc_helper_template.h | 14 ++ target-i386/cpu.h| 5 + target-i386/helper.c | 7 ++- target-i386/translate.c

[Qemu-devel] [PATCH 46/57] target-i386: Implement ANDN

2013-01-23 Thread Richard Henderson
As this is the first of the BMI insns to be implemented, this carries quite a bit more baggage than normal. Signed-off-by: Richard Henderson --- target-i386/cpu.c | 10 +- target-i386/translate.c | 19 +-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --gi

[Qemu-devel] [PATCH 51/57] target-i386: Implement PDEP, PEXT

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/helper.h | 3 +++ target-i386/int_helper.c | 32 target-i386/translate.c | 36 3 files changed, 71 insertions(+) diff --git a/target-i386/helper.h b/target-i386/helper.h i

[Qemu-devel] [PATCH 38/57] target-i386: Update cc_op before TCG branches

2013-01-23 Thread Richard Henderson
Placing the CC_OP_DYNAMIC at the join is less effective than before the branch, as the branch will have forced global registers to their home locations. This way we have a chance to discard CC_SRC2 before it gets stored. Signed-off-by: Richard Henderson --- target-i386/translate.c | 8

[Qemu-devel] [PATCH 50/57] target-i386: Implement MULX

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/helper.h | 1 + target-i386/int_helper.c | 7 +++ target-i386/translate.c | 36 3 files changed, 44 insertions(+) diff --git a/target-i386/helper.h b/target-i386/helper.h index aa313bd..b1bae6c 10064

[Qemu-devel] [PATCH 45/57] target-i386: Implement MOVBE

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/cpu.c | 16 +-- target-i386/translate.c | 122 ++-- 2 files changed, 110 insertions(+), 28 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 376d4c8..776b670 100644 --- a/t

[Qemu-devel] [PATCH 32/57] target-i386: cleanup temporary macros for CCPrepare

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 86 ++--- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index df2cb3d.

[Qemu-devel] [PATCH 52/57] target-i386: Implement SHLX, SARX, SHRX

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/translate.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/target-i386/translate.c b/target-i386/translate.c index 5e1ee03..1519566 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -4171,6

[Qemu-devel] [PATCH 25/57] target-i386: optimize setbe

2013-01-23 Thread Richard Henderson
This is looking at EFLAGS, but it can do so more efficiently with setcond. Reviewed-by: Blue Swirl Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target-i386/translate.c b/targ

[Qemu-devel] [PATCH 42/57] target-i386: Make helper_cc_compute_all const

2013-01-23 Thread Richard Henderson
Pass the data in explicitly, rather than indirectly via env. Signed-off-by: Richard Henderson --- target-i386/cc_helper.c | 16 +--- target-i386/helper.h| 2 +- target-i386/translate.c | 32 ++-- 3 files changed, 36 insertions(+), 14 deletions(-) dif

[Qemu-devel] [PATCH 20/57] target-i386: Move CC discards to set_cc_op

2013-01-23 Thread Richard Henderson
This gets us universal coverage, rather than scattering discards around at various places. As a bonus, we do not emit redundant discards e.g. between sequential logic insns. Signed-off-by: Richard Henderson --- target-i386/translate.c | 48 +++- 1 fil

[Qemu-devel] [PATCH 21/57] target-i386: do not call helper to compute ZF/SF

2013-01-23 Thread Richard Henderson
ZF, SF and PF can always be computed from CC_DST except in the CC_OP_EFLAGS case (and CC_OP_DYNAMIC, which just resolves to CC_OP_EFLAGS in gen_compute_eflags). Use setcond to compute ZF and SF. We could also use a table lookup to compute PF. Reviewed-by: Blue Swirl Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 03/57] target-i386: use OT_* consistently

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Reviewed-by: Blue Swirl Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 88 +++-- 1 file changed, 49 insertions(+), 39 deletions(-) diff --git a/target-i386/translate.c b/target-i386/t

[Qemu-devel] [PATCH 26/57] target-i386: optimize setle

2013-01-23 Thread Richard Henderson
And allow gen_setcc_slow to operate on cpu_cc_src. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 2cf668b..44cdf

[Qemu-devel] [PATCH 22/57] target-i386: use inverted setcond when computing NS or NZ

2013-01-23 Thread Richard Henderson
Make gen_compute_eflags_z and gen_compute_eflags_s able to compute the inverted condition, and use this in gen_setcc_slow_T0. We cannot do it yet in gen_compute_eflags_c, but prepare the code for it anyway. It is not worthwhile for PF, as usual. shr+and+xor could be replaced by and+setcond. I'm

[Qemu-devel] [PATCH 30/57] target-i386: use CCPrepare to generate conditional jumps

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini This simplifies all the jump generation code. CCPrepare allows the code to create an efficient brcond always, so there is no need to duplicate the setcc and jcc code. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 119 -

[Qemu-devel] [PATCH 24/57] target-i386: change gen_setcc_slow_T0 to gen_setcc_slow

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Do not hard code the destination register. Reviewed-by: Blue Swirl Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 39 --- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/targe

[Qemu-devel] [PATCH 02/57] test-i386: make it compile with a recent gcc

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- tests/tcg/test-i386.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tcg/test-i386.c b/tests/tcg/test-i386.c index b18fe20..b05572b 100644 --- a/tests/tcg/test-i386.c +++ b/test

[Qemu-devel] [PATCH 29/57] target-i386: introduce gen_prepare_cc

2013-01-23 Thread Richard Henderson
This makes the i386 front-end able to create CCPrepare structs for all condition, not just those that come from a single flag. In particular, JCC_L and JCC_LE can be optimized because gen_prepare_cc is not forced to return a result in bit 0 (unlike gen_setcc_slow). However, for now the slow jcc o

[Qemu-devel] [PATCH 3/3] accel: change {xen, kvm, tcg, qtest}_allowed from int to bool

2013-01-23 Thread liguang
Signed-off-by: liguang --- hw/xen.h |4 ++-- include/sysemu/kvm.h |2 +- include/sysemu/qtest.h |2 +- qtest.c|2 +- vl.c | 12 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/xen.h b/hw/xen.h ind

[Qemu-devel] [PATCH 54/57] target-i386: Implement ADX extension

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/cc_helper.c | 25 +++ target-i386/cpu.c | 4 +- target-i386/cpu.h | 4 ++ target-i386/helper.c| 4 ++ target-i386/translate.c | 107 ++-- 5 files changed, 139 insertions(+),

[Qemu-devel] [PATCH 27/57] target-i386: optimize setcc instructions

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Reconstruct the arguments for complex conditions involving CC_OP_SUBx (BE, L, LE). In the others do it via setcond and gen_setcc_slow (which is not that slow in many cases). Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 95 +++

[Qemu-devel] [PATCH 04/57] target-i386: introduce gen_ext_tl

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Introduce a function that abstracts extracting an 8, 16, 32 or 64-bit value with or without sign, generalizing gen_extu and gen_exts. Reviewed-by: Blue Swirl Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 146 --

[Qemu-devel] [PATCH 15/57] target-i386: Don't clobber s->cc_op in gen_update_cc_op

2013-01-23 Thread Richard Henderson
Use a dirty flag to know whether env->cc_op is up to date, rather than forcing s->cc_op to DYNAMIC and losing info. Signed-off-by: Richard Henderson --- target-i386/translate.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/target-i386

[Qemu-devel] [PATCH 14/57] target-i386: Introduce set_cc_op

2013-01-23 Thread Richard Henderson
This will provide a good hook into which we can consolidate all of the cc variable discards. Signed-off-by: Richard Henderson --- target-i386/translate.c | 134 +--- 1 file changed, 69 insertions(+), 65 deletions(-) diff --git a/target-i386/translate.

[Qemu-devel] [PATCH 06/57] target-i386: drop cc_op argument of gen_jcc1

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini As in the gen_repz_scas/gen_repz_cmps case, delay setting CC_OP_DYNAMIC in gen_jcc until after code generation. All of gen_jcc1/is_fast_jcc/gen_setcc_slow_T0 now work on s->cc_op, which makes things a bit easier to follow and to patch. Signed-off-by: Paolo Bonzini Signed-of

[Qemu-devel] [PATCH 47/57] target-i386: Implement BEXTR

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/translate.c | 40 1 file changed, 40 insertions(+) diff --git a/target-i386/translate.c b/target-i386/translate.c index 8e75cba..bb9cdcf 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@

[Qemu-devel] [PATCH 28/57] target-i386: introduce CCPrepare

2013-01-23 Thread Richard Henderson
Introduce a struct that describes how to build a *cond operation that checks for a given x86 condition code. For now, just change gen_compute_eflags_* to return the new struct, generate code for the CCPrepare struct, and go on as before. [rth: Use ctz with the proper width rather than ffs.] Sign

[Qemu-devel] [PATCH 09/57] target-i386: compute eflags outside rcl/rcr helper

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Always compute EFLAGS first since it is needed whenever the shift is non-zero, i.e. most of the time. This makes it possible to remove some writes of CC_OP_EFLAGS to cpu_cc_op and more importantly removes cases where s->cc_op becomes CC_OP_DYNAMIC. Also, we can remove cc_tmp

[Qemu-devel] [PATCH 12/57] target-i386: factor gen_op_set_cc_op/tcg_gen_discard_tl around computing flags

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Before computing flags we need to store the cc_op to memory. Move this to gen_compute_eflags_c and gen_compute_eflags rather than doing it all over the place. Alo, after computing the flags in cpu_cc_src we are in EFLAGS mode. Set s->cc_op and discard cpu_cc_dst in gen_compu

[Qemu-devel] [PATCH 17/57] target-i386: add helper functions to get other flags

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Introduce new functions to extract PF, SF, OF, ZF in addition to CF. These provide single entry points for optimizing accesses to a single flag. Reviewed-by: Blue Swirl Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 48

[Qemu-devel] [PATCH 07/57] target-i386: move carry computation for inc/dec closer to gen_op_set_cc_op

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini This ensures the invariant that cpu_cc_op matches s->cc_op when calling the helpers. The next patches need this because gen_compute_eflags and gen_compute_eflags_c will take care of setting cpu_cc_op. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- targe

[Qemu-devel] [PATCH 41/57] target-i386: Don't reference ENV through most of cc helpers

2013-01-23 Thread Richard Henderson
In preparation for making this a const helper. By using the proper types in the parameters to the helper functions, we get to avoid quite a lot of subsequent casting. Signed-off-by: Richard Henderson --- target-i386/cc_helper.c | 97 +++ target-i386/cc_helper_templ

[Qemu-devel] [PATCH 34/57] target-i386: expand cmov via movcond

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/translate.c | 52 ++--- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 2a220c1..9752c16 100644 --- a/target-i386/translate.c +++ b/

[Qemu-devel] [PATCH 19/57] target-i386: no need to flush out cc_op before gen_eob

2013-01-23 Thread Richard Henderson
This makes code more similar to the other callers of gen_eob, especially loopz/loopnz/jcxz. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target-i386/translate.c b/target-i386/tran

[Qemu-devel] [PATCH 10/57] target-i386: clean up sahf

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Discard CC_DST and set s->cc_op immediately after computing EFLAGS. Signed-off-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target-i386/translate.c b/target-i386/transl

Re: [Qemu-devel] [RFC] qemu snapshot enchancement

2013-01-23 Thread Dietmar Maurer
> > * Like Case 2, the benefit isn't clear to me. In a scenario where you > > use both QEMU and LVM snapshots there is now an extra management > > overhead of cleaning up 2 snapshots instead of just 1 when the user > > wants to delete a snapshot. I think this will be a headache. > >

[Qemu-devel] [PATCH 37/57] target-i386: introduce gen_jcc1_noeob

2013-01-23 Thread Richard Henderson
A jump that ends a basic block or otherwise falls back to CC_OP_DYNAMIC will always have to call gen_op_set_cc_op. However, not all jumps end a basic block, so introduce a variant that does not do this. This was partially undone earlier (i386: drop cc_op argument of gen_jcc1), redo it now also to

[Qemu-devel] [PATCH 33/57] target-i386: introduce gen_cmovcc1

2013-01-23 Thread Richard Henderson
From: Paolo Bonzini Signed-off-by: Richard Henderson --- target-i386/translate.c | 70 + 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 9b57fb4..2a220c1 100644 --- a/target-i

[Qemu-devel] [PATCH 1/3] vl: skip init accelerator if it's not available

2013-01-23 Thread liguang
Signed-off-by: liguang --- vl.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vl.c b/vl.c index 4ee1302..25aa8e8 100644 --- a/vl.c +++ b/vl.c @@ -2540,18 +2540,18 @@ static int configure_accelerator(void) p = get_opt_name(buf, sizeof (buf), p, ':

[Qemu-devel] [PATCH 2/3] vl: correct error message when fail to init kvm

2013-01-23 Thread liguang
command: qemu-system-x86_64 -hda disk.img -smp 32 --enable-kvm error: Number of SMP cpus requested (32) exceeds max cpus supported by KVM (16) failed to initialize KVM: Invalid argument No accelerator found! well, it did find kvm, but failed to init, so message "No accelerator found!" is confusing

[Qemu-devel] [PATCH 13/57] target-i386: Name the cc_op enumeration

2013-01-23 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target-i386/cpu.h | 4 ++-- target-i386/translate.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index fe50698..04ac339 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -582,7 +582,

[Qemu-devel] [PATCH 0/3] accel:some cleanup work for vm accelerator

2013-01-23 Thread liguang
do some cleanup work fo vm accelerator patch 1/3: skip init accelerator if it's not available patch 2/3: correct error message when fail to init kvm patch 3/3: change {xen,kvm,tcg,qtest}_allowed from int to bool hw/xen.h |4 +- include/sysemu/kvm.h |2 +- include/sysemu/q

Re: [Qemu-devel] [PATCH] gdbstub: Do not kill target in system emulation mode

2013-01-23 Thread Joel Brobecker
> qAttached is not supported in Qemu yet, this explains why Gdb sends > "kill" at the end of debug session. I will implement it and revert your > patch. Gdb will automatically detach instead of kill at the end of > debugging session. I would make it configurable by the command-line, to allow for b

[Qemu-devel] [RFC] Virtio-desktop: Virtio-based virtual desktop

2013-01-23 Thread Anup Patel
Hi All, How about having a generic Virtio-based machine for emulating a virtual desktop ? I know folks have already thought about this and probably also tried something or other on this front but, it will be good to know the downsides. Virtio-desktop can be a separate specification describing a

Re: [Qemu-devel] [RESEND PATCH for 1.4 v10 0/3] char: Add CirMemCharDriver and provide QMP interface

2013-01-23 Thread Lei Li
On 01/23/2013 11:47 PM, Luiz Capitulino wrote: On Wed, 23 Jan 2013 17:06:09 +0800 Lei Li wrote: Hi Anthony, Resubmit this series with your comments squashed in and Luiz's new comments fixed up. I will push console command part in another thread. There are two bugs in this series. QEMU starte

Re: [Qemu-devel] [PATCH] aio-posix: Fix return value of aio_poll()

2013-01-23 Thread Dietmar Maurer
> > But when I use a thread it triggers the bug in bdrv_drain_all(). So > > how can I fix bdrv_drain_all() if I use a separate thread to write data? > > The bug is, in all likelihood, in your own code. Sorry. :) yes. I still not fully understand that aio code. If I detect a incomplete write, I

Re: [Qemu-devel] [PATCH 1/3] qemu-char: Add new char backend CirMemCharDriver

2013-01-23 Thread Lei Li
On 01/23/2013 11:31 PM, Luiz Capitulino wrote: On Wed, 23 Jan 2013 11:15:40 +0800 Lei Li wrote: +static int cirmem_chr_write(CharDriverState *chr, const uint8_t *buf, int len) +{ +CirMemCharDriver *d = chr->opaque; +int i; + +if (!buf || (len < 0)) { +return -1; +} Is

[Qemu-devel] [PATCH v12 rebased 5/8] add a new qevent: QEVENT_GUEST_PANICKED

2013-01-23 Thread Hu Tao
This event will be emited when the guest is panicked. Signed-off-by: Wen Congyang --- include/monitor/monitor.h | 1 + monitor.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 87fb49c..4006905 100644 --- a/include

Re: [Qemu-devel] [QEMU PATCH v5 0/3] virtio-net: fix of ctrl commands

2013-01-23 Thread Stefan Hajnoczi
On Tue, Jan 22, 2013 at 11:44:43PM +0800, Amos Kong wrote: > Currently virtio-net code relys on the layout of descriptor, > this patchset removed the assumptions and introduced a control > command to set mac address. Last patch is a trivial renaming. > > V2: check guest's iov_len > V3: fix of migr

Re: [Qemu-devel] [Qemu-trivial] [PATCH v3 11/11] qemu-ga: Fix unchecked strdup() by converting to g_strdup()

2013-01-23 Thread Stefan Hajnoczi
On Tue, Jan 22, 2013 at 02:54:21PM -0200, Luiz Capitulino wrote: > On Tue, 22 Jan 2013 11:08:06 +0100 > Markus Armbruster wrote: > > > I figure it's freed somewhere deep down in QAPI, with g_free(). > > It is, by qapi_dealloc_type_str(). > > > Signed-off-by: Markus Armbruster > > Reviewed-by:

[Qemu-devel] [PATCH v12 rebased 1/8] preserve cpu runstate

2013-01-23 Thread Hu Tao
This patch enables preservation of cpu runstate during save/load vm. So when a vm is restored from snapshot, the cpu runstate is restored, too. See following example: # save two vms: one is running, the other is paused (qemu) info status VM status: running (qemu) savevm running (qemu) stop (qemu)

[Qemu-devel] [PATCH v12 rebased 8/8] pv event: add document to describe the usage

2013-01-23 Thread Hu Tao
Signed-off-by: Hu Tao --- docs/pv-event.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 docs/pv-event.txt diff --git a/docs/pv-event.txt b/docs/pv-event.txt new file mode 100644 index 000..ac9e7fa --- /dev/null +++ b/docs/pv-event.txt @@ -0,0 +1,17 @@ +KVM PV

Re: [Qemu-devel] [PULL 00/13] thread queue

2013-01-23 Thread Orit Wasserman
On 01/17/2013 03:39 PM, Juan Quintela wrote: > This is the intersect of the paolo & me patches for migration thread, > > Changes from 2 days ago: > - spelling check from Eric > - put the commit that patch refered from (Eric) > - drop the buffered rename at paolo request. > > Please, pull. > > Th

Re: [Qemu-devel] [PATCH v2] PIIX3: reset the VM when the Reset Control Register's RCPU bit gets set

2013-01-23 Thread Stefan Hajnoczi
On Wed, Jan 16, 2013 at 07:40:19PM +0100, Laszlo Ersek wrote: > static int piix3_post_load(void *opaque, int version_id) > { > PIIX3State *piix3 = opaque; > piix3_update_irq_levels(piix3); > +piix3->rcr &= 2; /* keep System Reset type only */ > return 0; > } Is this necessary

Re: [Qemu-devel] [PATCH 0/6] arm devices: mark or remove implicit fallthroughs

2013-01-23 Thread Markus Armbruster
Peter Maydell writes: > On 21 January 2013 20:03, Blue Swirl wrote: >> On Mon, Jan 21, 2013 at 12:50 PM, Peter Maydell >> wrote: >>> These patches either mark implicit fallthroughs in case statements >>> or (in a few cases) remove them by putting in an explicit 'break' >>> or 'return' rather th

Re: [Qemu-devel] [PATCH v2] netmap backend (revised)

2013-01-23 Thread Luigi Rizzo
On Tue, Jan 22, 2013 at 2:50 PM, Anthony Liguori wrote: > Hi, > > Thank you for submitting your patch series. checkpatch.pl has > detected that one or more of the patches in this series violate > the QEMU coding style. > > If you believe this message was sent in error, please ignore it > or respo

Re: [Qemu-devel] [PATCH] aio-posix: Fix return value of aio_poll()

2013-01-23 Thread Dietmar Maurer
> > > > Are you using timers in any way? > > > > > > Yes, I call co_sleep_ns(rt_clock, delay) to limit rate to output > > > stream. > > > > Use block_job_sleep_ns instead, and only call it when no I/O is pending. > > Thanks, that works! I currently use qemu_aio_set_fd_handler() to implement async

[Qemu-devel] [PATCH 1/3] qemu-char: Add new char backend CirMemCharDriver

2013-01-23 Thread Lei Li
Signed-off-by: Lei Li --- qemu-char.c | 114 +++ qemu-options.hx | 10 + 2 files changed, 124 insertions(+), 0 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 9ba0573..8045869 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -

[Qemu-devel] [PATCH 3/3] QAPI: Introduce memchar-read QMP command

2013-01-23 Thread Lei Li
Signed-off-by: Lei Li --- hmp-commands.hx | 21 + hmp.c| 17 + hmp.h|1 + qapi-schema.json | 36 qemu-char.c | 48 qmp-commands.hx |

[Qemu-devel] [PATCH 2/3] QAPI: Introduce memchar-write QMP command

2013-01-23 Thread Lei Li
Signed-off-by: Lei Li --- hmp-commands.hx | 18 ++ hmp.c| 13 + hmp.h|1 + qapi-schema.json | 38 ++ qemu-char.c | 42 ++ qmp-commands.hx | 33 +

[Qemu-devel] [RESEND PATCH for 1.4 v10 0/3] char: Add CirMemCharDriver and provide QMP interface

2013-01-23 Thread Lei Li
Hi Anthony, Resubmit this series with your comments squashed in and Luiz's new comments fixed up. I will push console command part in another thread. Thanks. This patch series attempts to add new char backend CirMemCharDriver with a circular buffer and expose it to users by introducing QMP in

[Qemu-devel] [PATCH for-1.4] s390-virtio: Check for NULL device in reset hypercall

2013-01-23 Thread Andreas Färber
s390_virtio_bus_find_mem() may return a NULL VirtIOS390Device. If called with, e.g., args[0] == 0, this leads to a segfault. Fix this by adding error handling as done for other hypercalls. Present since baf0b55a9e57b909b1f8b0f732c0b10242867418 (Implement virtio reset). Cc: qemu-sta...@nongnu.org

Re: [Qemu-devel] tap devices not receiving packets from a bridge

2013-01-23 Thread Michael S. Tsirkin
On Tue, Jan 22, 2013 at 10:04:07AM +0100, Peter Lieven wrote: > On 23.11.2012 12:01, Michael S. Tsirkin wrote: > >On Fri, Nov 23, 2012 at 10:41:21AM +0100, Peter Lieven wrote: > >> > >>Am 23.11.2012 um 08:02 schrieb Stefan Hajnoczi: > >> > >>>On Thu, Nov 22, 2012 at 03:29:52PM +0100, Peter Lieven w

[Qemu-devel] [FYI 3/3] qtest: Add virtio-ccw test case

2013-01-23 Thread Andreas Färber
Signed-off-by: Andreas Färber --- tests/Makefile |2 ++ tests/virtio-ccw-test.c | 38 ++ 2 Dateien geändert, 40 Zeilen hinzugefügt(+) create mode 100644 tests/virtio-ccw-test.c diff --git a/tests/Makefile b/tests/Makefile index d86e95a..6ab4610

[Qemu-devel] [RFC 1/3] qtest: Prepare hypercall support

2013-01-23 Thread Andreas Färber
Signed-off-by: Andreas Färber --- include/sysemu/qtest.h |2 ++ qtest.c| 26 ++ stubs/Makefile.objs|1 + stubs/qtest.c | 12 tests/libqtest.c | 21 + tests/libqtest.h | 17 +++

[Qemu-devel] [RFC 0/3] qtest hypercall support (s390x for now)

2013-01-23 Thread Andreas Färber
Hello, Here's an initial throw at adding hypercall support to qtest. This aims at making s390 virtio (and soon virtio-ccw) easily testable during refactorings such as Fréderic's. Depending on progress it might also be a route to add qtest support for the individual virtio devices while waiting for

[Qemu-devel] [RFC 2/3] target-s390x: Prepare qtest hypercall support

2013-01-23 Thread Andreas Färber
Signed-off-by: Andreas Färber --- hw/s390x/s390-virtio-hcall.c | 17 + 1 Datei geändert, 17 Zeilen hinzugefügt(+) diff --git a/hw/s390x/s390-virtio-hcall.c b/hw/s390x/s390-virtio-hcall.c index d7938c0..6d044f8 100644 --- a/hw/s390x/s390-virtio-hcall.c +++ b/hw/s390x/s390-virtio

Re: [Qemu-devel] [PATCH] ich9: add support for pci assignment

2013-01-23 Thread Michael S. Tsirkin
On Tue, Jan 22, 2013 at 07:11:37PM -0700, Alex Williamson wrote: > Fills out support for the pci assignment API. Added: > > PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin) > > Add calls to pci_bus_fire_intx_routing_notifier() when routing changes > are made. > > From: Jason

Re: [Qemu-devel] [PATCH for-1.4 qom-cpu 1/9] kvm: Create kvm_arch_vcpu_id() function

2013-01-23 Thread Gleb Natapov
On Tue, Jan 22, 2013 at 06:25:01PM -0200, Eduardo Habkost wrote: > This will allow each architecture to define how the VCPU ID is set on > the KVM_CREATE_VCPU ioctl call. > > Signed-off-by: Eduardo Habkost Acked-by: Gleb Natapov > --- > Cc: k...@vger.kernel.org > Cc: Michael S. Tsirkin > Cc: G

Re: [Qemu-devel] [PATCH for-1.4 qom-cpu 2/9] target-i386: kvm: Set vcpu_id to APIC ID instead of CPU index

2013-01-23 Thread Gleb Natapov
On Tue, Jan 22, 2013 at 06:25:02PM -0200, Eduardo Habkost wrote: > The CPU ID in KVM is supposed to be the APIC ID, so change the > KVM_CREATE_VCPU call to match it. The current behavior didn't break > anything yet because today the APIC ID is assumed to be equal to the CPU > index, but this won't

Re: [Qemu-devel] [RFC] introduce a general query-config cmd (was: [Qemu PATCH v2] add a boot option to do strict boot)

2013-01-23 Thread Amos Kong
On Tue, Jan 22, 2013 at 12:26:03PM -0600, Anthony Liguori wrote: > Eric Blake writes: > > On 01/22/2013 08:52 AM, Amos Kong wrote: > > Libvirt will need to expose an attribute that lets the user control > whether to use this new option; how do we probe via QMP whether the > new

Re: [Qemu-devel] [PATCH v2] PIIX3: reset the VM when the Reset Control Register's RCPU bit gets set

2013-01-23 Thread Laszlo Ersek
On 01/23/13 09:36, Stefan Hajnoczi wrote: > On Wed, Jan 16, 2013 at 07:40:19PM +0100, Laszlo Ersek wrote: >> static int piix3_post_load(void *opaque, int version_id) >> { >> PIIX3State *piix3 = opaque; >> piix3_update_irq_levels(piix3); >> +piix3->rcr &= 2; /* keep System Reset type

Re: [Qemu-devel] Questions on the virtual disk's cache type

2013-01-23 Thread Liu Yuan
On 01/23/2013 06:14 PM, Daniel P. Berrange wrote: > On Wed, Jan 23, 2013 at 06:09:01PM +0800, Liu Yuan wrote: >> On 01/23/2013 05:30 PM, Daniel P. Berrange wrote: >>> FYI There is a patch proposed for customization >>> >>> https://review.openstack.org/#/c/18042/ >>> >> >> Seems that this patch is

Re: [Qemu-devel] Questions on the virtual disk's cache type

2013-01-23 Thread Liu Yuan
On 01/23/2013 06:47 PM, Liu Yuan wrote: > On 01/23/2013 06:14 PM, Daniel P. Berrange wrote: >> On Wed, Jan 23, 2013 at 06:09:01PM +0800, Liu Yuan wrote: >>> On 01/23/2013 05:30 PM, Daniel P. Berrange wrote: FYI There is a patch proposed for customization https://review.openstack.or

Re: [Qemu-devel] [PATCH 1.4 0/2] iscsi: add support for iovectors

2013-01-23 Thread Paolo Bonzini
Il 22/01/2013 23:55, Anthony Liguori ha scritto: >> > Thank you for submitting your patch series. This note is to inform >> > you that this patch series no longer applies against the latest >> > qemu.git tree. > FYI, I checked this before I let it send this. It definitely doesn't > apply either w

Re: [Qemu-devel] [PATCH v2] netmap backend (revised)

2013-01-23 Thread Stefan Hajnoczi
On Tue, Jan 22, 2013 at 08:12:15AM +0100, Luigi Rizzo wrote: > reposting a version without changes that implement bounded > queues in net/queue.c > > Hi, > the attached patch implements a qemu backend for the "netmap" API > thus allowing machines to attach to the VALE software switch as > well as

Re: [Qemu-devel] [PATCH] aio-posix: Fix return value of aio_poll()

2013-01-23 Thread Paolo Bonzini
Il 23/01/2013 09:58, Dietmar Maurer ha scritto: > Are you using timers in any way? Yes, I call co_sleep_ns(rt_clock, delay) to limit rate to output stream. >>> >>> Use block_job_sleep_ns instead, and only call it when no I/O is pending. >> >> Thanks, that works! > > I currently

[Qemu-devel] [PATCH V14 00/10] libqblock qemu block layer library

2013-01-23 Thread Wenchao Xia
These patches introduce libqblock API, make subdir-libqblock and make check-libqblock could build this library. Functionalities: 1 create a new image. 2 sync access of an image. 3 basic image information retrieving such as backing file. 4 detect if a sector is allocated in an image. Supported

[Qemu-devel] [PATCH V14 02/10] build: use check-clean in root Makefile

2013-01-23 Thread Wenchao Xia
Now root Makefile simply calls the command and do not care the details of it any more. $SUBDIR_CLEAN_RULES is used for the case that a sub-dir's Makefile is included by root Makefile, in which case 'clean' in subdir's Makefile will cause confict. So If sub-dir's Makefile want to be cleaned, it sh

[Qemu-devel] [PATCH V14 01/10] build: add command check-clean

2013-01-23 Thread Wenchao Xia
This command will package the clean operations in tests, to make it easy to be extended. Signed-off-by: Wenchao Xia --- tests/Makefile | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index d86e95a..9a759a1 100644 --- a/tests/

[Qemu-devel] [PATCH V14 10/10] libqblock: test: libqblock test example

2013-01-23 Thread Wenchao Xia
In this example, first it will create some qcow2 images, then try get information including backing file relationship, then it will do sync IO on the image. Signed-off-by: Wenchao Xia --- tests/check-libqblock-qcow2.c | 392 + 1 files changed, 392 inser

  1   2   3   >