[Qemu-devel] [PATCH v2 05/10] arm/nwfps: replace cpsr_write with set_condition_codes

2014-07-10 Thread Alex Bennée
This is a pre-cursor to removing the cpsr_write function completely from the code base. set_condition_codes() only affects the integer condition flags. Signed-off-by: Alex Bennée --- v2 - fix nwfpe set_condition_codes diff --git a/linux-user/arm/nwfpe/fpa11.h b/linux-user/arm/nwfpe/fpa11.h

[Qemu-devel] [PATCH v2 04/10] target-arm: replace cpsr/xpsr/pstate_read calls

2014-07-10 Thread Alex Bennée
Use the unified save_state_to_spsr. I've also updated the interrupt helpers to restore via the restore_state_from_spsr() functions. In the aarch32 case this also needs to call switch_mode() to do the appropriate fiddling. Signed-off-by: Alex Bennée -- v2 - include xpsr_read conver

[Qemu-devel] [PATCH v2 08/10] target-arm: remove final users of pstate_write

2014-07-10 Thread Alex Bennée
This converts all users of pstate_write to use the common state save/restore functionality. Signed-off-by: Alex Bennée diff --git a/linux-user/signal.c b/linux-user/signal.c index b6f9ef4..b1958a5 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -1274,7 +1274,7 @@ static int

Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions

2014-07-10 Thread Alex Bennée
he second host insn of instances of that code pattern generated by > tcg_gen_shr_i64", etc. > > No idea if anything of that sort exists - qemu is not the only possible user > for that; looks like it might be useful for any JIT profiling, so somebody > could've done that already... Handily our patch tracker has remembered what I couldn't find ;-) https://patches.linaro.org/27229/ As I mentioned previously I plan to clean these up over the next week. -- Alex Bennée

[Qemu-devel] [PATCH v2 09/10] target-arm/kvm.c: better error reporting

2014-07-10 Thread Alex Bennée
From: Alex Bennée When we have a problem syncing CP registers between kvm<->qemu it's a lot more useful to have the names of the registers in the log than just a random abort() and core dump. Signed-off-by: Alex Bennée --- v2 - less verbose log message - fix checkpatch war

[Qemu-devel] [PATCH v2 03/10] target-arm: Support save/load for 64 bit CPUs

2014-07-10 Thread Alex Bennée
This enables the saving and restoring of machine state by including the current program state (*psr) and xregs. The save_state_to_spsr hides the details of if the processor is in 32 or 64 bit mode at the time. Signed-off-by: Alex Bennée --- v2 (ajb) - use common state save functions - re

[Qemu-devel] [PATCH v2 10/10] target-arm/kvm: make reg sync code common between kvm32/64

2014-07-10 Thread Alex Bennée
=> exit). This list may well have more registers than are known by the TCG emulation which is not necessarily a problem but it does stop us from migrating between KVM and TCG hosted guests. I've added some additional checking to report those registers under -d unimp. Signed-off-by: Ale

[Qemu-devel] [PATCH v2 01/10] target-arm/cpu.h: document various program state functions

2014-07-10 Thread Alex Bennée
We have a number of program state saving functions (pstate, cpsr, xpsr) which are dependant on the mode the CPU is in. This commit adds a little documentation to each function and asserts to defend against incorrect use. Signed-off-by: Alex Bennée --- v2: - remove xpsr_state asserts diff

[Qemu-devel] [PATCH v2 00/10] aarch64 migration for TCG and KVM

2014-07-10 Thread Alex Bennée
ation - addition of final KVM patches Alex Bennée (10): target-arm/cpu.h: document various program state functions target-arm/cpu.h: common pstate save/restore target-arm: Support save/load for 64 bit CPUs target-arm: replace cpsr/xpsr/pstate_read calls arm/nwfps: replace cpsr_write

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

2014-07-11 Thread Alex Bennée
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. Signed-off-by: Alex Bennée --- v2: - hoist up into translate-all.c - don't use pointless

[Qemu-devel] RFC Multi-threaded TCG design document

2015-06-12 Thread Alex Bennée
riers.txt [2] http://thread.gmane.org/gmane.comp.emulators.qemu/334561 [3] http://thread.gmane.org/gmane.comp.emulators.qemu/335297 -- Alex Bennée

Re: [Qemu-devel] RFC Multi-threaded TCG design document

2015-06-15 Thread Alex Bennée
Frederic Konrad writes: > On 12/06/2015 18:37, Alex Bennée wrote: >> Hi, > > Hi Alex, > > I've completed some of the points below. We will also work on a design > decisions > document to add to this one. > > We probably want to merge that with what we d

Re: [Qemu-devel] RFC Multi-threaded TCG design document

2015-06-15 Thread Alex Bennée
; > Cheers > Mark. > > > >> On 15 Jun 2015, at 12:06, Alex Bennée wrote: >> >> >> Frederic Konrad writes: >> >>> On 12/06/2015 18:37, Alex Bennée wrote: >>>> Hi, >>> >>> Hi Alex, >>> >>>

Re: [Qemu-devel] RFC Multi-threaded TCG design document

2015-06-15 Thread Alex Bennée
At that point we can prefix the cmpxchg TCG ops with our new tcg_dmb barrier. Without the LOCK prefix we still guarantee an atomic update but without any explicit synchronisation between the cores. In practice Linux at least uses LOCK prefixed cmpxchg instructions in its synchronisation code. x86 code will still emit s/m/lfence instructions to ensure external devices see memory accesses in the right order. These should certainly cause memory barriers tcg ops to be emitted. > > Regards, > alvise > -- Alex Bennée

Re: [Qemu-devel] RFC Multi-threaded TCG design document

2015-06-15 Thread Alex Bennée
one conference. What are the details for that? > > Cheers > Mark. > > > >> On 15 Jun 2015, at 12:06, Alex Bennée wrote: >> >> >> Frederic Konrad writes: >> >>> On 12/06/2015 18:37, Alex Bennée wrote: >>>> Hi, >>>

Re: [Qemu-devel] RFC Multi-threaded TCG design document

2015-06-17 Thread Alex Bennée
Paolo Bonzini writes: > On 12/06/2015 18:37, Alex Bennée wrote: >> Emulated hardware state >> --- >> >> Currently the hardware emulation has no protection against >> multiple-accesses. However guest systems accessing emulated hardware &g

Re: [Qemu-devel] TCG baremetal tests repo

2015-06-22 Thread Alex Bennée
PU per 10 million > iterations (no errors with KVM). It is also very interesting to note, that > the current test finishes faster on upstream qemu than multithreaded > qemu. Interesting. Thanks for putting the tests online. > > Best regards. -- Alex Bennée

[Qemu-devel] [RFC PATCH] qemu_mutux: make the iothread recursive (MTTCG)

2015-06-23 Thread Alex Bennée
ory is still consistent all the way through. This seems neater than having to do a trylock each time. Tested-by: Alex Bennée --- cpus.c | 2 +- include/qemu/thread.h| 1 + util/qemu-thread-posix.c | 12 util/qemu-thread-win32.c | 5 + 4 files changed, 19 in

Re: [Qemu-devel] [RFC PATCH] qemu_mutux: make the iothread recursive (MTTCG)

2015-06-23 Thread Alex Bennée
Paolo Bonzini writes: > On 23/06/2015 14:21, Alex Bennée wrote: >> While I was testing multi-threaded TCG I discovered once consequence of >> using locking around memory_region_dispatch is that virt-io transactions >> could dead lock trying to grab the main mutex. This is

Re: [Qemu-devel] [PATCH v2 03/15] docker: Add images

2016-03-01 Thread Alex Bennée
Fam Zheng writes: > On Tue, 03/01 09:52, Alex Bennée wrote: >> >> Fam Zheng writes: >> >> > On Mon, 02/29 17:18, Alex Bennée wrote: >> >> >> >> Fam Zheng writes: >> >> >> >> > Signed-off-by: Fam Zheng &

Re: [Qemu-devel] [PATCH v7 5/9] qemu-log: new option -dfilter to limit output

2016-03-03 Thread Alex Bennée
Richard Henderson writes: > On 02/22/2016 07:59 AM, Alex Bennée wrote: >> +qemu_set_dfilter_ranges("0x1000+0x100"); >> + >> +g_assert_false(qemu_log_in_addr_range(0xfff)); >> +g_assert(qemu_log_in_addr_range(0x1000)); >> +g_assert(q

[Qemu-devel] [PATCH v8 7/9] target-arm: dfilter support for in_asm

2016-03-04 Thread Alex Bennée
Each individual architecture needs to use the qemu_log_in_addr_range() feature for enabling in_asm output as it is part of the frontend. Signed-off-by: Alex Bennée Reviewed-by: Aurelien Jarno Reviewed-by: Richard Henderson --- v5 - no longer wrapping tcg_gen_insn_start (was tcg_gen_debug

[Qemu-devel] [PATCH v8 1/9] tcg: pass down TranslationBlock to tcg_code_gen

2016-03-04 Thread Alex Bennée
My later debugging patches need access to the origin PC which is held in the TranslationBlock structure. Pass down the whole structure as it also holds the information about the code start point. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v1 - checkpatch fixes v5 - much

[Qemu-devel] [PATCH v8 2/9] qemu-log: correct help text for -d cpu

2016-03-04 Thread Alex Bennée
This doesn't just dump CPU state on translation but on every block entrance. Signed-off-by: Alex Bennée Reviewed-by: Andreas Färber Reviewed-by: Richard Henderson --- v4 - add r-b tag v5 - slightly tweak the wording now nochain exists v6 - add rth r-b tag --- util/log.c | 2 +- 1

[Qemu-devel] [PATCH v8 8/9] qemu-log: support simple pid substitution for logs

2016-03-04 Thread Alex Bennée
need g_test_trap_subprocess() support. As a result they are currently skipped on Travis builds due to the older glib involved. Signed-off-by: Alex Bennée Reviewed-by: Leandro Dorileo Reviewed-by: Aurelien Jarno Reviewed-by: Richard Henderson --- v5 - add another r-b v7 - simpler error che

[Qemu-devel] [PATCH v8 6/9] qemu-log: dfilter-ise exec, out_asm, op and opt_op

2016-03-04 Thread Alex Bennée
This ensures the code generation debug code will honour -dfilter if set. For the "exec" tracing I've added a new inline macro for efficiency's sake. Signed-off-by: Alex Bennée Reviewed-by: Aurelien Jarno Reviewed-by: Richard Henderson v2 - checkpa

[Qemu-devel] [PATCH v8 0/9] qemu-log, -dfilter and other logging tweaks

2016-03-04 Thread Alex Bennée
the series was first written. As usual the details are in the individual commits. Ready for merge now? Alex Bennée (7): tcg: pass down TranslationBlock to tcg_code_gen qemu-log: correct help text for -d cpu qemu-log: new option -dfilter to limit output qemu-log: dfilter-ise exec, out_asm

[Qemu-devel] [PATCH v8 9/9] cputlb: modernise the debug support

2016-03-04 Thread Alex Bennée
these debug statements haven't been considered for usefulness for user visible logging. I've also removed DEBUG_TLB_CHECK which wasn't used. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - ensure compiler checks format strings even if debug is optimised ou

[Qemu-devel] [PATCH v8 3/9] qemu-log: Avoid function call for disabled qemu_log_mask logging

2016-03-04 Thread Alex Bennée
From: Peter Maydell Make qemu_log_mask() a macro which only calls the function to do the actual work if the logging is enabled. This avoids making a function call in possible fast paths where logging is disabled. Signed-off-by: Peter Maydell Signed-off-by: Alex Bennée Reviewed-by: Andreas

[Qemu-devel] [PATCH v8 4/9] qemu-log: Improve the "exec" TB execution logging

2016-03-04 Thread Alex Bennée
dce70] Trace 0x7fb7cc8235d0 [ffcdce70] Stopped execution of TB chain before 0x7fb7cc8235d0 [ffcdce70] Trace 0x7fb7cc8235d0 [ffcdce70] Trace 0x7fb7cc822fd0 [ffcdd52c] Signed-off-by: Peter Maydell Signed-off-by: Alex Bennée [AJB: reword patch title, Abandoned->Stopped] Re

[Qemu-devel] [PATCH v8 5/9] qemu-log: new option -dfilter to limit output

2016-03-04 Thread Alex Bennée
x8fff,0xffc8+0x200,... Then logging code can use the new qemu_log_in_addr_range() function to decide if it will output logging information for the given range. Signed-off-by: Alex Bennée --- v2 - More clean-ups to the documentation v3 - re-base - use GArray instead of GList to

Re: [Qemu-devel] [PATCH] net.c: Moved large array in nc_sendv_compat from the stack to the heap

2016-03-05 Thread Alex Bennée
quot; vs "I have an allocated buffer"). In general you should know the various g_* functions tolerate NULLs well so maybe you can structure the code differently (skipping the details ;-): uint8_t *buffer, *dynbuf = NULL; if (iovcnt == 1) { buffer = ... } else { buffer = dynbuf = g_malloc(NET_BUFSIZE * sizeof(uint8_t)); ... } ... g_free(dynbuf) > + > +return ret; > } > > ssize_t qemu_deliver_packet_iov(NetClientState *sender, -- Alex Bennée

Re: [Qemu-devel] [PATCH][Outreachy]

2016-03-06 Thread Alex Bennée
; - free(entry); > + g_free((char *)entry->ev_var); > + g_free(entry); > > envlist->el_count--; > } > @@ -225,7 +225,7 @@ envlist_to_environ(const envlist_t *envlist, size_t > *count) > struct envlist_entry *entry; > char **env, **penv; > > - penv = env = malloc((envlist->el_count + 1) * sizeof (char *)); > + penv = env = g_malloc((envlist->el_count + 1) * sizeof (char *)); > if (env == NULL) > return (NULL); Same here. Thanks for you submission. Feel free to CC me on your next version. -- Alex Bennée

Re: [Qemu-devel] [PATCH] net.c: Moved large array in nc_sendv_compat from the stack to the heap

2016-03-06 Thread Alex Bennée
Nikos Filippakis writes: > Thank you for your comments! > > On Sun, Mar 6, 2016 at 9:47 AM, Alex Bennée wrote: >> >> >> Nikos Filippakis writes: >> >> > Hello everyone! I am interested in getting to know the codebase a little >> > be

Re: [Qemu-devel] [RFC v7 14/16] target-arm: translate: Use ld/st excl for atomic insns

2016-03-07 Thread Alex Bennée
alvise rigo writes: > On Thu, Feb 18, 2016 at 6:02 PM, Alex Bennée wrote: >> >> Alvise Rigo writes: >> >>> Use the new LL/SC runtime helpers to handle the ARM atomic instructions >>> in softmmu_llsc_template.h. >>> >>> In general,

Re: [Qemu-devel] [mttcg] cputlb: Use async tlb_flush_by_mmuidx

2016-03-07 Thread Alex Bennée
t; >> that the flush has been done before emulating the next guest >> >> instruction. Did I get it right? >> > >> > That risks getting deadlocks if CPU A asks B to flush the TLB and vice >> > versa. Using a halted state means that the VCPU thread goes through the >> > cpus.c loop and can for example service other CPUs' TLB flush requests. >> > >> > Paolo >> -- Alex Bennée

Re: [Qemu-devel] Multi-threaded TCG Projects [GSoC 2016]

2016-03-11 Thread Alex Bennée
ough CloudLab. > > > Cheers, > Subhashish Pradhan > > 1 - http://qemu-project.org/Features/tcg-multithread#Current_Code > > P.S. - I didn't get the time(GMT) when you usually hang out on the > IRC. I should be around on the #qemu-gsoc channel for the rest of the d

Re: [Qemu-devel] [PATCH v3 01/13] tests: Add utilities for docker testing

2016-03-11 Thread Alex Bennée
bj.run(args, argv) There are some niggles with help: 14:40 alex@zen/x86_64 [qemu.git/review/docker-v3]>./tests/docker/docker.py --help usage: docker.py [-h] {run,build,clean} ... positional arguments: {run,build,clean} Positional? Really. You can only have one command at a time. run Invoke docker run and take care of cleaning up buildBuild docker image out of a dockerfile cleanClean up docker instances optional arguments: -h, --help show this help message and exit OK that's useful, but do we have args for build? 14:43 alex@zen/x86_64 [qemu.git/review/docker-v3]>./tests/docker/docker.py --help build usage: docker.py [-h] {run,build,clean} ... positional arguments: {run,build,clean} run Invoke docker run and take care of cleaning up buildBuild docker image out of a dockerfile cleanClean up docker instances optional arguments: -h, --help show this help message and exit Hmm same result. We have to call like this: 14:43 alex@zen/x86_64 [qemu.git/review/docker-v3] >./tests/docker/docker.py build --help usage: docker.py build [-h] [--verbose] tag dockerfile positional arguments: tagImage Tag dockerfile Dockerfile name optional arguments: -h, --help show this help message and exit --verbose, -v Print verbose information Maybe there is someway to make this clearer. > + > +if __name__ == "__main__": > +sys.exit(main()) -- Alex Bennée

Re: [Qemu-devel] [PATCH v3 02/13] Makefile: Rules for docker testing

2016-03-11 Thread Alex Bennée
g to run on > them. > > Uncommitted changes known to files known by the git index will be > included in the snapshot if there are any. > > Signed-off-by: Fam Zheng > Signed-off-by: Alex Bennée fix the commit message and have a: Reviewed-by: Alex Bennée > --- > M

Re: [Qemu-devel] [PATCH v3 03/13] docker: Add images

2016-03-11 Thread Alex Bennée
Fam Zheng writes: > Signed-off-by: Fam Zheng Reviewed-by: Alex Bennée > --- > tests/docker/dockerfiles/centos6.docker | 6 ++ > tests/docker/dockerfiles/fedora.docker | 7 +++ > tests/docker/dockerfiles/ubuntu.docker | 11 +++ > 3 files chan

Re: [Qemu-devel] [PATCH v3 04/13] docker: Add test runner

2016-03-11 Thread Alex Bennée
Fam Zheng writes: > It's better to have a launcher for all tests, to make it easier to > initialize and manage the environment. > > If "DEBUG=1" a shell prompt will show up before the test runs. > > Signed-off-by: Fam Zheng Reviewed-by: Alex Bennée

Re: [Qemu-devel] [PATCH v3 05/13] docker: Add common.rc

2016-03-11 Thread Alex Bennée
Fam Zheng writes: > "requires" checks the "FEATURE" environment for specified prerequisits, > and skip the execution of test if not found. You also add a build_qemu function which you should mention. Otherwise have a: Reviewed-by: Alex Bennée > > Signed-o

Re: [Qemu-devel] [PATCH v3 06/13] docker: Add quick test

2016-03-11 Thread Alex Bennée
Fam Zheng > +# > +# This work is licensed under the terms of the GNU GPL, version 2 > +# or (at your option) any later version. See the COPYING file in > +# the top-level directory. > + > +. common.rc > + > +DEF_TARGET_LIST="$(echo {x86_64,aarch64}-softmmu)&q

Re: [Qemu-devel] [PATCH v3 07/13] docker: Add full test

2016-03-11 Thread Alex Bennée
ng > +# > +# This work is licensed under the terms of the GNU GPL, version 2 > +# or (at your option) any later version. See the COPYING file in > +# the top-level directory. > + > +. common.rc > + > +build_qemu If this is the full featured test how can we pass additional configure flags to the build? > +make check $MAKEFLAGS -- Alex Bennée

Re: [Qemu-devel] [PATCH v3 08/13] docker: Add clang test

2016-03-11 Thread Alex Bennée
Fam Zheng writes: > The (currently partially commented out) configure options are suggested > by John Snow . > > Signed-off-by: Fam Zheng Reviewed-by: Alex Bennée > --- > tests/docker/test-clang | 25 + > 1 file changed, 25 insertions(+) >

Re: [Qemu-devel] [PATCH v3 09/13] docker: Add mingw test

2016-03-11 Thread Alex Bennée
Fam Zheng writes: > Signed-off-by: Fam Zheng Reviewed-by: Alex Bennée > --- > tests/docker/test-mingw | 34 ++ > 1 file changed, 34 insertions(+) > create mode 100755 tests/docker/test-mingw > > diff --git a/tests/docker/test-mingw b/te

Re: [Qemu-devel] [PATCH v3 10/13] docker: Add travis tool

2016-03-11 Thread Alex Bennée
(sys.argv) < 2: > +sys.stderr.write("Usage: %s \n" % sys.argv[0]) > +return 1 > +conf = load_yaml(sys.argv[1]) > +for config in conf_iter(conf): > +print "(" > +print "\n".join(config["env"]) > +print "alias cc=" + config["compiler"] > +print "\n".join(conf["before_script"]) > +print "\n".join(conf["script"]) > +print ")" > +return 0 > + > +if __name__ == "__main__": > +sys.exit(main()) -- Alex Bennée

Re: [Qemu-devel] [PATCH v3 11/13] docs: Add text for tests/docker in build-system.txt

2016-03-11 Thread Alex Bennée
Fam Zheng writes: > Signed-off-by: Fam Zheng Reviewed-by: Alex Bennée > --- > docs/build-system.txt | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/docs/build-system.txt b/docs/build-system.txt > index 5ea..2af1e66 100644 > --- a/docs/build-syste

Re: [Qemu-devel] [PATCH v3 12/13] .gitignore: Ignore temporary dockerfile

2016-03-11 Thread Alex Bennée
> +++ b/.gitignore > @@ -109,3 +109,4 @@ cscope.* > tags > TAGS > *~ > +/tests/docker/*.docker.tmp -- Alex Bennée

Re: [Qemu-devel] [PATCH v3 00/13] tests: Introducing docker tests

2016-03-11 Thread Alex Bennée
reate mode 100644 tests/docker/dockerfiles/centos6.docker > create mode 100644 tests/docker/dockerfiles/fedora.docker > create mode 100644 tests/docker/dockerfiles/ubuntu.docker > create mode 100755 tests/docker/run > create mode 100755 tests/docker/test-clang > create mode 100755 tests/docker/test-full > create mode 100755 tests/docker/test-mingw > create mode 100755 tests/docker/test-quick > create mode 100755 tests/docker/travis > create mode 100755 tests/docker/travis.py -- Alex Bennée

Re: [Qemu-devel] BiteSizedPatch-LargeFrames

2016-03-11 Thread Alex Bennée
RRAY_SIZE(mhdr_sg), > @@ -1168,6 +1175,7 @@ static ssize_t virtio_net_receive(NetClientState *nc, > const uint8_t *buf, size_t > if (!n->mergeable_rx_bufs && offset < size) { > virtqueue_discard(q->rx_vq, elem, total); > g_free(elem); > +free(mhdr_sg); > return size; > } > > @@ -1186,6 +1194,7 @@ static ssize_t virtio_net_receive(NetClientState *nc, > const uint8_t *buf, size_t > virtqueue_flush(q->rx_vq, i); > virtio_notify(vdev, q->rx_vq); > > +free(mhdr_sg); > return size; > } -- Alex Bennée

Re: [Qemu-devel] Regarding TB retranslation code.

2016-03-13 Thread Alex Bennée
urn from fault ensures that guest PC [EIP ] is recovered. But, > How does tcg ensures that execution of TB from the restored PC ensures > that HOST registers contents have instruction 1 context also. > > Can somebody please share how this is done are there any assumption > when inserting TCG-Opcode INDEX_op_insn_start is done. -- Alex Bennée

Re: [Qemu-devel] [PATCH 1/1] Converted malloc calls to g_malloc and g_new

2016-03-13 Thread Alex Bennée
; return 0; } > +int main(void) { g_malloc(1); return 0; } > EOF > >if compile_prog "" "-ljemalloc" ; then > diff --git a/disas/ia64.c b/disas/ia64.c > index 140754c..b0733ed 100644 > --- a/disas/ia64.c > +++ b/disas/ia64.c > @@ -10268,7 +10268,7 @@ static struct ia64_opcode * > make_ia64_opcode (ia64_insn opcode, const char *name, int place, int depind) > { >struct ia64_opcode *res = > -(struct ia64_opcode *) malloc (sizeof (struct ia64_opcode)); > +g_new(sizeof(struct ia64_opcode)); >res->name = strdup (name); >res->type = main_table[place].opcode_type; >res->num_outputs = main_table[place].num_outputs; -- Alex Bennée

Re: [Qemu-devel] [PATCH 1/1] Converted malloc calls to g_malloc and g_new

2016-03-13 Thread Alex Bennée
prog "" "-ltcmalloc" ; then >> @@ -3528,7 +3528,7 @@ fi >> if test "$jemalloc" = "yes" ; then >> cat > $TMPC << EOF >> #include >> -int main(void) { malloc(1); return 0; } >> +int main(void) { g_malloc(1); return 0; } >> EOF >> >>if compile_prog "" "-ljemalloc" ; then >> diff --git a/disas/ia64.c b/disas/ia64.c >> index 140754c..b0733ed 100644 >> --- a/disas/ia64.c >> +++ b/disas/ia64.c >> @@ -10268,7 +10268,7 @@ static struct ia64_opcode * >> make_ia64_opcode (ia64_insn opcode, const char *name, int place, int depind) >> { >>struct ia64_opcode *res = >> -(struct ia64_opcode *) malloc (sizeof (struct ia64_opcode)); >> +g_new(sizeof(struct ia64_opcode)); >>res->name = strdup (name); >>res->type = main_table[place].opcode_type; >>res->num_outputs = main_table[place].num_outputs; >> -- >> 2.5.0 >> -- Alex Bennée

Re: [Qemu-devel] [PATCH 1/1] Converted malloc calls to g_malloc and g_new

2016-03-13 Thread Alex Bennée
uot;yes" ; then >> >cat > $TMPC << EOF >> > #include >> > -int main(void) { malloc(1); return 0; } >> > +int main(void) { g_malloc(1); return 0; } >> >> Similar case here, don't replace malloc for this test. >> >> > EOF >> > >> >if compile_prog "" "-ljemalloc" ; then >> > diff --git a/disas/ia64.c b/disas/ia64.c >> > index 140754c..b0733ed 100644 >> > --- a/disas/ia64.c >> > +++ b/disas/ia64.c >> > @@ -10268,7 +10268,7 @@ static struct ia64_opcode * >> > make_ia64_opcode (ia64_insn opcode, const char *name, int place, int >> depind) >> > { >> >struct ia64_opcode *res = >> > -(struct ia64_opcode *) malloc (sizeof (struct ia64_opcode)); >> > +g_new(sizeof(struct ia64_opcode)); >> >> Wrong number (and value) of parameters for g_new. >> >> >res->name = strdup (name); >> >res->type = main_table[place].opcode_type; >> >res->num_outputs = main_table[place].num_outputs; >> >> In general, for each replaced malloc there should >> normally be (at least) one replaced free (missing >> in your patch). Replacing malloc is a good thing in >> most cases (see file HACKING, section 3). >> >> I suggest to split your patch in smaller parts which only >> replace malloc / free for one file and remove any type casts >> or NULL checks which then are no longer needed. >> >> Those smaller parts can be sent fo qemu-trivial and >> will be accepted there after a successful review. >> >> Kind regards, >> Stefan W. >> >> -- Alex Bennée

Re: [Qemu-devel] [PATCH v8 5/9] qemu-log: new option -dfilter to limit output

2016-03-14 Thread Alex Bennée
Richard Henderson writes: > On 03/04/2016 03:18 AM, Alex Bennée wrote: >> +case '+': >> +{ >> +unsigned long len; >> +err |= qemu_strtoull(r2, NULL, 0, &

[Qemu-devel] [PATCH v9 7/9] target-arm: dfilter support for in_asm

2016-03-15 Thread Alex Bennée
Each individual architecture needs to use the qemu_log_in_addr_range() feature for enabling in_asm output as it is part of the frontend. Signed-off-by: Alex Bennée Reviewed-by: Aurelien Jarno Reviewed-by: Richard Henderson --- v5 - no longer wrapping tcg_gen_insn_start (was tcg_gen_debug

[Qemu-devel] [PATCH v9 2/9] qemu-log: correct help text for -d cpu

2016-03-15 Thread Alex Bennée
This doesn't just dump CPU state on translation but on every block entrance. Signed-off-by: Alex Bennée Reviewed-by: Andreas Färber Reviewed-by: Richard Henderson --- v4 - add r-b tag v5 - slightly tweak the wording now nochain exists v6 - add rth r-b tag --- util/log.c | 2 +- 1

[Qemu-devel] [PATCH v9 8/9] qemu-log: support simple pid substitution for logs

2016-03-15 Thread Alex Bennée
need g_test_trap_subprocess() support. As a result they are currently skipped on Travis builds due to the older glib involved. Signed-off-by: Alex Bennée Reviewed-by: Leandro Dorileo Reviewed-by: Aurelien Jarno Reviewed-by: Richard Henderson --- v5 - add another r-b v7 - simpler error che

[Qemu-devel] [PATCH v9 0/9] qemu-log, -dfilter and other logging tweaks

2016-03-15 Thread Alex Bennée
The only change since v8 is fixing the off-by-one in the dfilter - parsing case (the + case was fixed in v8). Ready for merge now? Alex Bennée (7): tcg: pass down TranslationBlock to tcg_code_gen qemu-log: correct help text for -d cpu qemu-log: new option -dfilter to limit output qemu

[Qemu-devel] [PATCH v9 4/9] qemu-log: Improve the "exec" TB execution logging

2016-03-15 Thread Alex Bennée
dce70] Trace 0x7fb7cc8235d0 [ffcdce70] Stopped execution of TB chain before 0x7fb7cc8235d0 [ffcdce70] Trace 0x7fb7cc8235d0 [ffcdce70] Trace 0x7fb7cc822fd0 [ffcdd52c] Signed-off-by: Peter Maydell Signed-off-by: Alex Bennée [AJB: reword patch title, Abandoned->Stopped] Re

[Qemu-devel] [PATCH v9 6/9] qemu-log: dfilter-ise exec, out_asm, op and opt_op

2016-03-15 Thread Alex Bennée
This ensures the code generation debug code will honour -dfilter if set. For the "exec" tracing I've added a new inline macro for efficiency's sake. Signed-off-by: Alex Bennée Reviewed-by: Aurelien Jarno Reviewed-by: Richard Henderson v2 - checkpa

[Qemu-devel] [PATCH v9 1/9] tcg: pass down TranslationBlock to tcg_code_gen

2016-03-15 Thread Alex Bennée
My later debugging patches need access to the origin PC which is held in the TranslationBlock structure. Pass down the whole structure as it also holds the information about the code start point. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v1 - checkpatch fixes v5 - much

[Qemu-devel] [PATCH v9] cputlb: modernise the debug support

2016-03-15 Thread Alex Bennée
these debug statements haven't been considered for usefulness for user visible logging. I've also removed DEBUG_TLB_CHECK which wasn't used. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - ensure compiler checks format strings even if debug is optimised ou

[Qemu-devel] [PATCH v9 9/9] cputlb: modernise the debug support

2016-03-15 Thread Alex Bennée
these debug statements haven't been considered for usefulness for user visible logging. I've also removed DEBUG_TLB_CHECK which wasn't used. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - ensure compiler checks format strings even if debug is optimised ou

[Qemu-devel] [PATCH v9 5/9] qemu-log: new option -dfilter to limit output

2016-03-15 Thread Alex Bennée
x8fff,0xffc8+0x200,... Then logging code can use the new qemu_log_in_addr_range() function to decide if it will output logging information for the given range. Signed-off-by: Alex Bennée --- v2 - More clean-ups to the documentation v3 - re-base - use GArray instead of GList to

[Qemu-devel] [PATCH v9 3/9] qemu-log: Avoid function call for disabled qemu_log_mask logging

2016-03-15 Thread Alex Bennée
From: Peter Maydell Make qemu_log_mask() a macro which only calls the function to do the actual work if the logging is enabled. This avoids making a function call in possible fast paths where logging is disabled. Signed-off-by: Peter Maydell Signed-off-by: Alex Bennée Reviewed-by: Andreas

Re: [Qemu-devel] [PATCH v9 0/9] qemu-log, -dfilter and other logging tweaks

2016-03-15 Thread Alex Bennée
Richard Henderson writes: > On 03/15/2016 07:30 AM, Alex Bennée wrote: >> The only change since v8 is fixing the off-by-one in the dfilter - >> parsing case (the + case was fixed in v8). >> >> Ready for merge now? > > Yep. Are you going to pull it in via

Re: [Qemu-devel] some error when compile qemu

2016-03-15 Thread Alex Bennée
.o] 错误 1 > > look at the source code,maybe some head file is lossed,anybody knows how to > deal with it? > > Thanks -- Alex Bennée

Re: [Qemu-devel] [PATCH v4 01/13] tests: Add utilities for docker testing

2016-03-31 Thread Alex Bennée
: docker rmi -f qemu:fedora while debugging. Anyway: Reviewed-by: Alex Bennée > > build: Compare an image from given dockerfile and rebuild it if they're > different. > > Signed-off-by: Fam Zheng > --- > tests/docker/docker.py | 191 > +

Re: [Qemu-devel] [PATCH v4 02/13] Makefile: Rules for docker testing

2016-03-31 Thread Alex Bennée
gt; > Instead of providing a live version of the source tree to the docker > container we snapshot it with git-archive. This ensures the tree is in a > pristine state for whatever operations the container is going to run on > them. > > Uncommitted changes known to files kn

Re: [Qemu-devel] [PATCH v4 02/13] Makefile: Rules for docker testing

2016-03-31 Thread Alex Bennée
source tree to the docker > container we snapshot it with git-archive. This ensures the tree is in a > pristine state for whatever operations the container is going to run on > them. > > Uncommitted changes known to files known by the git index will be > included in the snapshot if

Re: [Qemu-devel] tcg: reworking tb_invalidated_flag

2016-03-31 Thread Alex Bennée
there could be several options how to mark TB valid/invalid: > a dedicated flag could be introduced or some invalid value of > pc/cs_base/flags could be used. > > So the question is, what would be the most appropriate solution? > > [1] http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg06180.html > [2] http://lists.nongnu.org/archive/html/qemu-devel/2015-08/msg02582.html -- Alex Bennée

Re: [Qemu-devel] [PATCH v4 10/13] docker: Add travis tool

2016-03-31 Thread Alex Bennée
the matrix on other platforms? Tweak the docker files for dependencies or feed it via travis somehow? Anyway: Reviewed-by: Alex Bennée > > Signed-off-by: Fam Zheng > --- > tests/docker/travis| 21 + > tests/docker/travis.py | 48 +++

Re: [Qemu-devel] [PATCH v4 12/13] docker: Add EXTRA_CONFIGURE_OPTS

2016-03-31 Thread Alex Bennée
Fam Zheng writes: > Whatever passed in this variable will be appended to all > configure commands. Reviewed-by: Alex Bennée > > Signed-off-by: Fam Zheng > --- > tests/docker/Makefile.include | 3 +++ > tests/docker/common.rc| 1 + > 2 files changed, 4 insert

Re: [Qemu-devel] [PATCH v4 07/13] docker: Add full test

2016-03-31 Thread Alex Bennée
he targets. > +# > +# Copyright (c) 2016 Red Hat Inc. > +# > +# Authors: > +# Fam Zheng > +# > +# This work is licensed under the terms of the GNU GPL, version 2 > +# or (at your option) any later version. See the COPYING file in > +# the top-level directory. > + > +. common.rc > + > +build_qemu > +make check $MAKEFLAGS -- Alex Bennée

Re: [Qemu-devel] [PATCH v4 08/13] docker: Add clang test

2016-03-31 Thread Alex Bennée
Fam Zheng writes: > The (currently partially commented out) configure options are suggested > by John Snow . > > Reviewed-by: Alex Bennée > Signed-off-by: Fam Zheng > --- > tests/docker/test-clang | 25 + > 1 file changed, 25 insertions(+) >

Re: [Qemu-devel] tcg: reworking tb_invalidated_flag

2016-03-31 Thread Alex Bennée
ely flush TBs if no vCPUs are currently executing in those regions. But I suspect that is a much more complex future optimisation. Having said that is it safe to flush TBs from a given page if we know no vCPUs are currently executing in that page? As the execution loop has to exit the chained TBs as we cross page boundaries we could just keep account of which vCPUs are currently in which page. -- Alex Bennée

Re: [Qemu-devel] [PATCH v2 2/5] .travis.yml: enable OSX builds

2016-03-31 Thread Alex Bennée
Alex Bennée writes: > Travis has support for OSX builds. Making the setup work cleanly > involves a little hacking about with the .travis.yml file but rather > than make it too messy I've pushed all the "brew" install stuff into a > support script called ./scripts/ma

Re: [Qemu-devel] [PATCH v2 1/3] tcg: code_bitmap is not used by user-mode emulation

2016-03-31 Thread Alex Bennée
Sergey Fedorov writes: > From: Paolo Bonzini > > Signed-off-by: Paolo Bonzini > [Sergey Fedorov: eliminate the field entirely in user-mode] > Signed-off-by: Sergey Fedorov Reviewed-by: Alex Bennée > --- > > Notes: > Changes in v2: > * The field is el

Re: [Qemu-devel] tcg: reworking tb_invalidated_flag

2016-04-01 Thread Alex Bennée
Sergey Fedorov writes: > On 31/03/16 16:37, Alex Bennée wrote: >> Sergey Fedorov writes: >>> Looks like no matter which approach we use, it's ultimately necessary to >>> ensure all CPUs have exited from translated code before the translation >>> buff

Re: [Qemu-devel] [PATCH v1 2/2] include/qemu/atomic: add compile time asserts

2016-04-01 Thread Alex Bennée
Alex Bennée writes: > To be safely portable no atomic access should be trying to do more than > the natural word width of the host. The most common abuse is trying to > atomically access 64 bit values on a 32 bit host. > > This patch adds some QEMU_BUILD_BUG_ON to the __atomic i

Re: [Qemu-devel] [PATCH v1 3/5] include/qemu/atomic.h: default to __atomic functions

2016-04-01 Thread Alex Bennée
James Hogan writes: > Hi Alex, > > On Thu, Jan 28, 2016 at 10:15:17AM +0000, Alex Bennée wrote: >> The __atomic primitives have been available since GCC 4.7 and provide >> a richer interface for describing memory ordering requirements. As a >> bonus by using the

[Qemu-devel] Should we introduce a TranslationRegion with its own codegen buffer?

2016-04-04 Thread Alex Bennée
ring holes or others things to consider. Thoughts, objections? Discuss ;-) -- Alex Bennée

Re: [Qemu-devel] Should we introduce a TranslationRegion with its own codegen buffer?

2016-04-04 Thread Alex Bennée
Sergey Fedorov writes: > On 04/04/16 12:01, Paolo Bonzini wrote: >> On 04/04/2016 10:54, Alex Bennée wrote: >>> Thoughts, objections? Discuss ;-) >> I think we're putting a lot of carts before the horse. It is a very valid objection. I don't want to add

Re: [Qemu-devel] Should we introduce a TranslationRegion with its own codegen buffer?

2016-04-04 Thread Alex Bennée
Paolo Bonzini writes: > On 04/04/2016 13:24, Alex Bennée wrote: >> FWIW I've dropped the patch that moves tb_find_fast out of tb_lock in >> the upcoming base-patches-v2 series because it: >> - weirdly breaks the pxe tests > > I'm happy to take a look. Be

[Qemu-devel] [PATCH v2 0/2] Fix for compile on FreeBSD/i386 (and others?)

2016-04-04 Thread Alex Bennée
warnings being kicked out of the compiler though. On the VM "make check" fails at ... but as the build was broken beforehand I can't tell if this is a regression. It passes fine on my Linux box. Alex Bennée (2): cpus: don't use atomic_read for vm_clock_warp_start include/qemu

[Qemu-devel] [PATCH v2 1/2] cpus: don't use atomic_read for vm_clock_warp_start

2016-04-04 Thread Alex Bennée
As vm_clock_warp_start is a 64 bit value this causes problems for the compiler trying to come up with a suitable atomic operation on 32 bit hosts. Because the variable is protected by vm_clock_seqlock, we check its value inside a seqlock critical section. Signed-off-by: Alex Bennée --- v2

[Qemu-devel] [PATCH v2 2/2] include/qemu/atomic: add compile time asserts

2016-04-04 Thread Alex Bennée
(sizeof(*ptr) > sizeof(void *)). Signed-off-by: Alex Bennée --- include/qemu/atomic.h | 58 ++- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 8f1d8d9..5bc4d6c 100644 --- a/incl

[Qemu-devel] [PULL 3/3] .travis.yml: make -j3

2016-04-04 Thread Alex Bennée
an improvement. Signed-off-by: Alex Bennée Reviewed-by: David Gibson --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f02710d..50ac17f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,7 +60,7 @@ before_install: before_script

[Qemu-devel] [PULL 0/3] Travis updates

2016-04-04 Thread Alex Bennée
updates are deferred for later in the cycle. Alex Bennée (3): .travis.yml: collapse the test matrix .travis.yml: enable OSX builds .travis.yml: make -j3 .travis.yml | 82

[Qemu-devel] [PULL 2/3] .travis.yml: enable OSX builds

2016-04-04 Thread Alex Bennée
ult ./configure ${CONFIG} is built as I'm not sure what extra coverage would come from the other build stanzas. Signed-off-by: Alex Bennée Acked-by: Peter Maydell --- v2 - brew directly, use POSIX shell logic --- .travis.yml | 5 + 1 file changed, 5 insertions(+) diff --git a/.travis.yml

[Qemu-devel] [PULL 1/3] .travis.yml: collapse the test matrix

2016-04-04 Thread Alex Bennée
ned-off-by: Alex Bennée Reviewed-by: David Gibson --- .travis.yml | 75 +++-- 1 file changed, 18 insertions(+), 57 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e5873b..18c04af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42

Re: [Qemu-devel] [PATCH v2 0/2] Fix for compile on FreeBSD/i386 (and others?)

2016-04-04 Thread Alex Bennée
Ed Maste writes: > On 4 April 2016 at 10:35, Alex Bennée wrote: >> Only the first patch has actually changed. Instead of moving the read >> inside the write seqlock it is now done using the seqlock_read_* >> primitives. >> >> Build tested on a FreeBSB/i386 VM

Re: [Qemu-devel] [PULL 0/3] Travis updates

2016-04-05 Thread Alex Bennée
Peter Maydell writes: > On 4 April 2016 at 18:45, Alex Bennée wrote: >> The following changes since commit e31f0451876aa7ada74d60304aa241506a383797: >> >> net: fix missing include of qapi/error.h in netmap.c (2016-04-04 15:01:14 >> +0100) >> >>

Re: [Qemu-devel] [PATCH 00/10] tb hash improvements

2016-04-05 Thread Alex Bennée
\ > -name arm,debug-threads=on -smp 1 -tb-size 1024 > The image is taken from: > http://people.linaro.org/~alex.bennee/images/jessie-arm32.qcow2 > The image was modified to call `shutdown -h now` right after boot. > The kernel is taken from: > > http://people.linaro.org/~alex.bennee/images/aarch32-current-linux-kernel-only.img -- Alex Bennée

[Qemu-devel] [PULL v2 0/3] Travis updates (without changelog entries)

2016-04-05 Thread Alex Bennée
updates are deferred for later in the cycle. Alex Bennée (3): .travis.yml: collapse the test matrix .travis.yml: enable OSX builds .travis.yml: make -j3 .travis.yml | 82

[Qemu-devel] [RFC v2 00/11] Base enabling patches for MTTCG

2016-04-05 Thread Alex Bennée
e and Emilio with interest ;-) In the meantime any review comments gratefully received. Cheers, Alex Alex Bennée (5): cpus: make all_vcpus_paused() return bool docs: new design document multi-thread-tcg.txt (DRAFTING) target-arm/psci.c: wake up sleeping CPUs tcg: cpus rm tcg_exec_all

[Qemu-devel] [RFC v2 05/11] tcg: protect TBContext with tb_lock.

2016-04-05 Thread Alex Bennée
(). Signed-off-by: KONRAD Frederic Message-Id: <1439220437-23957-8-git-send-email-fred.kon...@greensocs.com> Signed-off-by: Emilio G. Cota Signed-off-by: Paolo Bonzini [AJB: moved into tree, clean-up history] Signed-off-by: Alex Bennée --- v2 (base-patches, ajb): - re-base fixes v7 (FK,

[Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG

2016-04-05 Thread Alex Bennée
rn it on for the sake of testing. Signed-off-by: KONRAD Frederic [AJB: move to -tcg mttcg=on/off, defaults] Signed-off-by: Alex Bennée --- v1: - merge with add mttcg option. - update commit message v2: - machine_init->opts_init --- cpus.c

<    5   6   7   8   9   10   11   12   13   14   >