sdk/emulator/qemu.git
11 years agotarget-i386: do not compute eflags multiple times consecutively
Richard Henderson [Wed, 23 Jan 2013 21:03:26 +0000 (13:03 -0800)]
target-i386: do not compute eflags multiple times consecutively

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 the callers.

Reviewed-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: add helper functions to get other flags
Paolo Bonzini [Fri, 5 Oct 2012 16:42:59 +0000 (18:42 +0200)]
target-i386: add helper functions to get other flags

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 <blauwirbel@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: Use gen_update_cc_op everywhere
Richard Henderson [Wed, 23 Jan 2013 20:43:12 +0000 (12:43 -0800)]
target-i386: Use gen_update_cc_op everywhere

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 <rth@twiddle.net>
11 years agotarget-i386: Don't clobber s->cc_op in gen_update_cc_op
Richard Henderson [Wed, 23 Jan 2013 20:34:26 +0000 (12:34 -0800)]
target-i386: Don't clobber s->cc_op in gen_update_cc_op

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 <rth@twiddle.net>
11 years agotarget-i386: Introduce set_cc_op
Richard Henderson [Wed, 23 Jan 2013 20:30:52 +0000 (12:30 -0800)]
target-i386: Introduce set_cc_op

This will provide a good hook into which we can consolidate
all of the cc variable discards.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: Name the cc_op enumeration
Richard Henderson [Thu, 17 Jan 2013 00:23:46 +0000 (16:23 -0800)]
target-i386: Name the cc_op enumeration

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: factor gen_op_set_cc_op/tcg_gen_discard_tl around computing flags
Paolo Bonzini [Fri, 5 Oct 2012 16:29:21 +0000 (18:29 +0200)]
target-i386: factor gen_op_set_cc_op/tcg_gen_discard_tl around computing flags

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_compute_eflags, rather than
doing it all over the place.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: use gen_jcc1 to compile loopz
Paolo Bonzini [Fri, 12 Oct 2012 11:35:40 +0000 (13:35 +0200)]
target-i386: use gen_jcc1 to compile loopz

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: clean up sahf
Paolo Bonzini [Fri, 5 Oct 2012 22:18:55 +0000 (00:18 +0200)]
target-i386: clean up sahf

Discard CC_DST and set s->cc_op immediately after computing EFLAGS.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: compute eflags outside rcl/rcr helper
Paolo Bonzini [Fri, 5 Oct 2012 22:18:55 +0000 (00:18 +0200)]
target-i386: compute eflags outside rcl/rcr helper

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 and just modify cc_src from within the helper.

Finally, always follow gen_compute_eflags(cpu_cc_src) by setting s->cc_op
and discarding cpu_cc_dst.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: move eflags computation closer to gen_op_set_cc_op
Paolo Bonzini [Fri, 5 Oct 2012 22:18:55 +0000 (00:18 +0200)]
target-i386: move eflags computation closer to gen_op_set_cc_op

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-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.  These are slow and we want to
avoid them: CC_OP_EFLAGS is quite efficient once we paid the initial
cost of computing the flags.

Finally, always follow gen_compute_eflags(cpu_cc_src) by setting s->cc_op
and discarding cpu_cc_dst.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: move carry computation for inc/dec closer to gen_op_set_cc_op
Paolo Bonzini [Fri, 5 Oct 2012 22:18:55 +0000 (00:18 +0200)]
target-i386: move carry computation for inc/dec closer to gen_op_set_cc_op

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 <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: drop cc_op argument of gen_jcc1
Paolo Bonzini [Fri, 5 Oct 2012 23:36:45 +0000 (01:36 +0200)]
target-i386: drop cc_op argument of gen_jcc1

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 <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: factor setting of s->cc_op handling for string functions
Paolo Bonzini [Fri, 5 Oct 2012 23:22:09 +0000 (01:22 +0200)]
target-i386: factor setting of s->cc_op handling for string functions

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 <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: introduce gen_ext_tl
Paolo Bonzini [Fri, 5 Oct 2012 16:02:41 +0000 (18:02 +0200)]
target-i386: introduce gen_ext_tl

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 <blauwirbel@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotarget-i386: use OT_* consistently
Paolo Bonzini [Fri, 5 Oct 2012 23:56:03 +0000 (01:56 +0200)]
target-i386: use OT_* consistently

Reviewed-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotest-i386: make it compile with a recent gcc
Paolo Bonzini [Fri, 12 Oct 2012 14:40:21 +0000 (16:40 +0200)]
test-i386: make it compile with a recent gcc

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotest-i386: QEMU_PACKED is not defined here
Paolo Bonzini [Fri, 12 Oct 2012 14:40:41 +0000 (16:40 +0200)]
test-i386: QEMU_PACKED is not defined here

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agovnc-tls: Fix compilation with newer versions of GNU-TLS
Andre Przywara [Thu, 18 Oct 2012 09:16:58 +0000 (11:16 +0200)]
vnc-tls: Fix compilation with newer versions of GNU-TLS

In my installation of GNU-TLS (v3.0.23) the type
gnutls_anon_server_credentials is marked deprecated, so -Werror
breaks compilation.
Simply replacing it with the newer ..._t version fixed the compilation
on my machine (Slackware 14.0). I cannot tell how far back this "new"
type goes, at least the header file in RHEL 5.0 (v1.4.1) seems to have
it already. If someone finds a broken distribution, tell me and I
insert some compat code.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Message-id: 1350551818-14717-1-git-send-email-andre.przywara@amd.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodoc help: Collect block device stuff under its own heading
Markus Armbruster [Wed, 13 Feb 2013 18:49:43 +0000 (19:49 +0100)]
doc help: Collect block device stuff under its own heading

Collect them from "Standard options", "File system options", "Virtual
File system pass-through options", "Debug/Expert options".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1360781383-28635-8-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodoc help: A few options are under inappropriate headings, fix
Markus Armbruster [Wed, 13 Feb 2013 18:49:42 +0000 (19:49 +0100)]
doc help: A few options are under inappropriate headings, fix

--device is under heading "USB options".  --name and --uuid are under
"Virtual File system pass-through options".  Move all three to
"Standard options".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1360781383-28635-7-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agohelp: Fix markup of heading "USB options" so it appears in -help
Markus Armbruster [Wed, 13 Feb 2013 18:49:41 +0000 (19:49 +0100)]
help: Fix markup of heading "USB options" so it appears in -help

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1360781383-28635-6-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodoc: Fix texinfo @table markup in qemu-options.hx
Markus Armbruster [Wed, 13 Feb 2013 18:49:40 +0000 (19:49 +0100)]
doc: Fix texinfo @table markup in qemu-options.hx

End tables before headings, start new ones afterwards.  Fixes
incorrect indentation of headings "File system options" and "Virtual
File system pass-through options" in manual page and qemu-doc.

Normalize markup some to increase chances it survives future edits.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1360781383-28635-5-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodoc: Fill some option doc gaps in manual page and qemu-doc
Markus Armbruster [Wed, 13 Feb 2013 18:49:39 +0000 (19:49 +0100)]
doc: Fill some option doc gaps in manual page and qemu-doc

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1360781383-28635-4-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodoc: Fix some option entries in qemu-doc's function index
Markus Armbruster [Wed, 13 Feb 2013 18:49:38 +0000 (19:49 +0100)]
doc: Fix some option entries in qemu-doc's function index

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1360781383-28635-3-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agohelp: Drop bogus help on -qtest and -qtest-log
Markus Armbruster [Wed, 13 Feb 2013 18:49:37 +0000 (19:49 +0100)]
help: Drop bogus help on -qtest and -qtest-log

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1360781383-28635-2-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoisa: Split off instance_init for ISADevice
Andreas Färber [Sat, 16 Feb 2013 10:27:26 +0000 (11:27 +0100)]
isa: Split off instance_init for ISADevice

Prepares for assigning IRQs before QOM realize.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1361010446-1427-1-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqtest: Add MMIO support
Andreas Färber [Sat, 16 Feb 2013 21:44:03 +0000 (22:44 +0100)]
qtest: Add MMIO support

Introduce [qtest_]{read,write}[bwlq]() libqtest functions and
corresponding QTest protocol commands to replace local versions in
libi2c-omap.c.

Also convert m48t59-test's cmos_{read,write}_mmio() to {read,write}b().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1361051043-27944-4-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolibqtest: Introduce qtest_qmpv() and convert remaining macro
Andreas Färber [Sat, 16 Feb 2013 21:44:02 +0000 (22:44 +0100)]
libqtest: Introduce qtest_qmpv() and convert remaining macro

In order to convert qmp() macro to an inline function, expose a
qtest_qmpv() function, reused by qtest_qmp().

We can't apply GCC_FMT_ATTR() since fdc-test is using zero-length format
strings, which would result in warnings treated as errors.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1361051043-27944-3-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolibqtest: Convert macros to functions and clean up documentation
Andreas Färber [Sat, 16 Feb 2013 21:44:01 +0000 (22:44 +0100)]
libqtest: Convert macros to functions and clean up documentation

libqtest.h provides a number of shortcut macros to avoid tests feeding
it the QTestState they operate on. Most of these can easily be turned
into static inline functions, so let's do that for clarity.
This avoids getting off-by-one error messages when passing wrong args.

Some macros had a val argument but documented @value argument. Fix this.

While touching things, enforce gtk-doc markup for return values and for
referencing types.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1361051043-27944-2-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'afaerber/qom-cpu' into staging
Anthony Liguori [Mon, 18 Feb 2013 14:37:29 +0000 (08:37 -0600)]
Merge remote-tracking branch 'afaerber/qom-cpu' into staging

# By Andreas Färber
# Via Andreas Färber
* afaerber/qom-cpu: (47 commits)
  target-i386: Split command line parsing out of cpu_x86_register()
  target-i386: Move cpu_x86_init()
  target-lm32: Drop unused cpu_lm32_close() prototype
  target-s390x: Drop unused cpu_s390x_close() prototype
  spapr_hcall: Replace open-coded CPU loop with qemu_get_cpu()
  ppce500_spin: Replace open-coded CPU loop with qemu_get_cpu()
  e500: Replace open-coded loop with qemu_get_cpu()
  cpu: Add CPUArchState pointer to CPUState
  cputlb: Pass CPUState to cpu_unlink_tb()
  cpu: Move current_tb field to CPUState
  cpu: Move exit_request field to CPUState
  cpu: Move running field to CPUState
  cpu: Move host_tid field to CPUState
  target-cris: Introduce CRISCPU subclasses
  target-m68k: Pass M68kCPU to m68k_set_irq_level()
  mcf_intc: Pass M68kCPU to mcf_intc_init()
  mcf5206: Pass M68kCPU to mcf5206_init()
  target-m68k: Return M68kCPU from cpu_m68k_init()
  ppc405_uc: Pass PowerPCCPU to ppc40x_{core,chip,system}_reset()
  target-xtensa: Move TCG initialization to XtensaCPU initfn
  ...

11 years agotests: Add unit tests for mulu64 and muls64
Richard Henderson [Sat, 16 Feb 2013 20:47:01 +0000 (12:47 -0800)]
tests: Add unit tests for mulu64 and muls64

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agohost-utils: Improve mulu64 and muls64
Richard Henderson [Sat, 16 Feb 2013 20:47:00 +0000 (12:47 -0800)]
host-utils: Improve mulu64 and muls64

The new formulation makes better use of add-with-carry type insns
that the host may have.  Use gcc's sign adjustment trick to avoid
having to perform a 128-bit negation.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agohost-utils: Use __int128_t for mul[us]64
Richard Henderson [Sat, 16 Feb 2013 20:46:59 +0000 (12:46 -0800)]
host-utils: Use __int128_t for mul[us]64

Replace some x86_64 specific inline assembly with something that
all 64-bit hosts ought to optimize well.  At worst this becomes
a call to the gcc __multi3 routine, which is no worse than our
implementation in util/host-utils.c.

With gcc 4.7, we get identical code generation for x86_64.  We
now get native multiplication on ia64 and s390x hosts.  With minor
improvements to gcc we can get it for ppc64 as well.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotcg/ppc: Fix build of tcg_qemu_tb_exec()
Andreas Färber [Sat, 16 Feb 2013 22:21:24 +0000 (23:21 +0100)]
tcg/ppc: Fix build of tcg_qemu_tb_exec()

Commit 0b0d3320db74cde233ee7855ad32a9c121d20eb4 (TCG: Final globals
clean-up) moved code_gen_prologue but forgot to update ppc code.
This broke the build on 32-bit ppc. ppc64 is unaffected.

Cc: Evgeny Voevodin <evgenyvoevodin@gmail.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Fix debug output for DEBUG_MMU
Andreas Färber [Sun, 27 Jan 2013 13:32:05 +0000 (14:32 +0100)]
target-sparc: Fix debug output for DEBUG_MMU

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-i386: Split command line parsing out of cpu_x86_register()
Andreas Färber [Fri, 15 Feb 2013 13:06:56 +0000 (14:06 +0100)]
target-i386: Split command line parsing out of cpu_x86_register()

In order to instantiate a CPU subtype we will need to know which type,
so move the cpu_model splitting into cpu_x86_init().

Parameters need to be set on the X86CPU instance, so move
cpu_x86_parse_featurestr() into cpu_x86_init() as well.

This leaves cpu_x86_register() operating on the model name only.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Move cpu_x86_init()
Andreas Färber [Fri, 1 Feb 2013 14:12:13 +0000 (15:12 +0100)]
target-i386: Move cpu_x86_init()

Consolidate CPU functions in cpu.c.
Allows to make cpu_x86_register() static.

No functional changes.

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-lm32: Drop unused cpu_lm32_close() prototype
Andreas Färber [Sat, 2 Feb 2013 11:13:15 +0000 (12:13 +0100)]
target-lm32: Drop unused cpu_lm32_close() prototype

It was never implemented.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-s390x: Drop unused cpu_s390x_close() prototype
Andreas Färber [Sat, 2 Feb 2013 11:10:37 +0000 (12:10 +0100)]
target-s390x: Drop unused cpu_s390x_close() prototype

It was never implemented.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agospapr_hcall: Replace open-coded CPU loop with qemu_get_cpu()
Andreas Färber [Fri, 15 Feb 2013 15:43:08 +0000 (16:43 +0100)]
spapr_hcall: Replace open-coded CPU loop with qemu_get_cpu()

The helper functions all access ppc-specific fields only so don't bother
to change arguments to PowerPCCPU and use env_ptr instead.

No functional change.

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoppce500_spin: Replace open-coded CPU loop with qemu_get_cpu()
Andreas Färber [Fri, 15 Feb 2013 14:56:27 +0000 (15:56 +0100)]
ppce500_spin: Replace open-coded CPU loop with qemu_get_cpu()

Potentially env could be NULL whereas cpu would still be valid and
correspond to a previous env.

Wrapping this in qemu_get_cpu(), env is no longer needed, so simplify
code that existed before 55e5c2850293547203874098f7cec148ffd12dfa.

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoe500: Replace open-coded loop with qemu_get_cpu()
Andreas Färber [Fri, 15 Feb 2013 14:21:13 +0000 (15:21 +0100)]
e500: Replace open-coded loop with qemu_get_cpu()

Since we still need env for ppc-specific fields, obtain it via the new
env_ptr fields to avoid "cpu" name conflicts between CPUState and
PowerPCCPU for now.

This fixes a potential issue with env being NULL at the end of the loop
but cpu still being a valid pointer corresponding to a previous env.

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Add CPUArchState pointer to CPUState
Andreas Färber [Thu, 17 Jan 2013 11:13:41 +0000 (12:13 +0100)]
cpu: Add CPUArchState pointer to CPUState

The target-specific ENV_GET_CPU() macros have allowed us to navigate
from CPUArchState to CPUState. The reverse direction was not supported.
Avoid introducing CPU_GET_ENV() macros by initializing an untyped
pointer that is initialized in derived instance_init functions.

The field may not be called "env" due to it being poisoned.

Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocputlb: Pass CPUState to cpu_unlink_tb()
Andreas Färber [Thu, 17 Jan 2013 08:16:15 +0000 (09:16 +0100)]
cputlb: Pass CPUState to cpu_unlink_tb()

CPUArchState is no longer needed.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Move current_tb field to CPUState
Andreas Färber [Wed, 16 Jan 2013 18:29:31 +0000 (19:29 +0100)]
cpu: Move current_tb field to CPUState

Explictly NULL it on CPU reset since it was located before breakpoints.

Change vapic_report_tpr_access() argument to CPUState. This also
resolves the use of void* for cpu.h independence.
Change vAPIC patch_instruction() argument to X86CPU.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Move exit_request field to CPUState
Andreas Färber [Mon, 17 Dec 2012 07:02:44 +0000 (08:02 +0100)]
cpu: Move exit_request field to CPUState

Since it was located before breakpoints field, it needs to be reset.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Move running field to CPUState
Andreas Färber [Mon, 17 Dec 2012 06:34:52 +0000 (07:34 +0100)]
cpu: Move running field to CPUState

Pass CPUState to cpu_exec_{start,end}() functions.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Move host_tid field to CPUState
Andreas Färber [Mon, 17 Dec 2012 06:12:13 +0000 (07:12 +0100)]
cpu: Move host_tid field to CPUState

Change gdbstub's cpu_index() argument to CPUState now that CPUArchState
is no longer used.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-cris: Introduce CRISCPU subclasses
Andreas Färber [Wed, 6 Feb 2013 16:18:12 +0000 (17:18 +0100)]
target-cris: Introduce CRISCPU subclasses

Use class_init functions to initialize the VR in preparation for
overriding v32+ behavior there.

Move cpu_cris_init() to cpu.c and hook up a class_by_name callback.

This change leads to unknown -cpu model names no longer falling back
to a CPU with VR 32 but instead returning NULL.

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-m68k: Pass M68kCPU to m68k_set_irq_level()
Andreas Färber [Fri, 18 Jan 2013 13:20:52 +0000 (14:20 +0100)]
target-m68k: Pass M68kCPU to m68k_set_irq_level()

Simplifies use of cpu_reset_interrupt() et al.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomcf_intc: Pass M68kCPU to mcf_intc_init()
Andreas Färber [Fri, 18 Jan 2013 13:15:09 +0000 (14:15 +0100)]
mcf_intc: Pass M68kCPU to mcf_intc_init()

Store it in mcf_intc_state.
Prepares for passing it to m68k_set_irq_level().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomcf5206: Pass M68kCPU to mcf5206_init()
Andreas Färber [Fri, 18 Jan 2013 13:10:34 +0000 (14:10 +0100)]
mcf5206: Pass M68kCPU to mcf5206_init()

Store it in m5206_mbar_state. Prepares for passing M68kCPU to
m68k_set_irq_level().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-m68k: Return M68kCPU from cpu_m68k_init()
Andreas Färber [Fri, 18 Jan 2013 13:03:58 +0000 (14:03 +0100)]
target-m68k: Return M68kCPU from cpu_m68k_init()

Turn cpu_init() into a static inline function for backwards
compatibility.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoppc405_uc: Pass PowerPCCPU to ppc40x_{core,chip,system}_reset()
Andreas Färber [Fri, 18 Jan 2013 14:57:51 +0000 (15:57 +0100)]
ppc405_uc: Pass PowerPCCPU to ppc40x_{core,chip,system}_reset()

Prepares for changing cpu_interrupt() argument to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Alexander Graf <agraf@suse.de>
11 years agotarget-xtensa: Move TCG initialization to XtensaCPU initfn
Andreas Färber [Sun, 20 Jan 2013 00:46:45 +0000 (01:46 +0100)]
target-xtensa: Move TCG initialization to XtensaCPU initfn

Combine this with breakpoint handler registration, guarding both with
tcg_enabled() to suppress also TCG init for qtest. Rename the handler to
xtensa_breakpoint_handler() since it needs to become global.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-unicore32: Move TCG initialization to UniCore32CPU initfn
Andreas Färber [Sun, 20 Jan 2013 00:36:47 +0000 (01:36 +0100)]
target-unicore32: Move TCG initialization to UniCore32CPU initfn

Normalize the "inited" logic and add a tcg_enabled() check to suppress
it for qtest.

Ensures that a QOM-created UniCore32CPU is usable.

Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-sparc: Move TCG initialization to SPARCCPU initfn
Andreas Färber [Sun, 20 Jan 2013 00:34:18 +0000 (01:34 +0100)]
target-sparc: Move TCG initialization to SPARCCPU initfn

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-sh4: Move TCG initialization to SuperHCPU initfn
Andreas Färber [Sun, 20 Jan 2013 00:30:32 +0000 (01:30 +0100)]
target-sh4: Move TCG initialization to SuperHCPU initfn

Add a tcg_enabled() check to suppress it for qtest.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-s390x: Move TCG initialization to S390CPU initfn
Andreas Färber [Sat, 19 Jan 2013 21:43:32 +0000 (22:43 +0100)]
target-s390x: Move TCG initialization to S390CPU initfn

Ensures that a QOM-created S390CPU is usable.

Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-ppc: Move TCG initialization to PowerPCCPU initfn
Andreas Färber [Sun, 20 Jan 2013 00:26:37 +0000 (01:26 +0100)]
target-ppc: Move TCG initialization to PowerPCCPU initfn

Ensures that a QOM-created PowerPCCPU is usable.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-mips: Move TCG initialization to MIPSCPU initfn
Andreas Färber [Sun, 20 Jan 2013 00:22:25 +0000 (01:22 +0100)]
target-mips: Move TCG initialization to MIPSCPU initfn

Make mips_tcg_init() non-static and add tcg_enabled() check to suppress
it for qtest.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-microblaze: Move TCG initialization to MicroBlazeCPU initfn
Andreas Färber [Sun, 20 Jan 2013 00:10:52 +0000 (01:10 +0100)]
target-microblaze: Move TCG initialization to MicroBlazeCPU initfn

Split off TCG initialization from cpu_mb_init() into mb_tcg_init() to
call it from the initfn.

Ensures that a QOM-created MicroBlazeCPU is usable.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-m68k: Move TCG initialization to M68kCPU initfn
Andreas Färber [Sat, 19 Jan 2013 23:48:29 +0000 (00:48 +0100)]
target-m68k: Move TCG initialization to M68kCPU initfn

Add a tcg_enabled() check to suppress it for qtest.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-lm32: Move TCG initialization to LM32CPU initfn
Andreas Färber [Sat, 19 Jan 2013 23:05:12 +0000 (00:05 +0100)]
target-lm32: Move TCG initialization to LM32CPU initfn

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-cris: Move TCG initialization to CRISCPU initfn
Andreas Färber [Sat, 19 Jan 2013 22:55:42 +0000 (23:55 +0100)]
target-cris: Move TCG initialization to CRISCPU initfn

Split out TCG initialization from cpu_cris_init(). Avoid CPUCRISState
dependency for v10-specific initialization and for non-v10 by inlining
the decision into the initfn as well.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-arm: Move TCG initialization to ARMCPU initfn
Andreas Färber [Sat, 19 Jan 2013 06:37:45 +0000 (07:37 +0100)]
target-arm: Move TCG initialization to ARMCPU initfn

Ensures that a QOM-created ARMCPU is usable.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-xtensa: Introduce QOM realizefn for XtensaCPU
Andreas Färber [Wed, 16 Jan 2013 03:19:35 +0000 (04:19 +0100)]
target-xtensa: Introduce QOM realizefn for XtensaCPU

Introduce realizefn and set realized = true in cpu_xtensa_init().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-unicore32: Introduce QOM realizefn for UniCore32CPU
Andreas Färber [Sat, 5 Jan 2013 13:38:30 +0000 (14:38 +0100)]
target-unicore32: Introduce QOM realizefn for UniCore32CPU

Introduce a realizefn and set realized = true in uc32_cpu_init().

Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
[AF: Invoke the parent's realizefn]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-sparc: Introduce QOM realizefn for SPARCCPU
Andreas Färber [Wed, 16 Jan 2013 03:13:19 +0000 (04:13 +0100)]
target-sparc: Introduce QOM realizefn for SPARCCPU

Introduce realizefn and set realized = true in cpu_sparc_init().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-sh4: Introduce QOM realizefn for SuperHCPU
Andreas Färber [Mon, 23 Apr 2012 16:16:02 +0000 (18:16 +0200)]
target-sh4: Introduce QOM realizefn for SuperHCPU

Introduce a realizefn and set realized = true in cpu_sh4_init().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-s390x: Introduce QOM realizefn for S390CPU
Andreas Färber [Wed, 16 Jan 2013 03:00:41 +0000 (04:00 +0100)]
target-s390x: Introduce QOM realizefn for S390CPU

Introduce realizefn and set realized = true in cpu_s390x_init().

Defer CPU reset from initfn to realizefn.

Acked-by: Richard Henderson <rth@twiddle.net>
[AF: Invoke parent's realizefn]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-mips: Introduce QOM realizefn for MIPSCPU
Andreas Färber [Wed, 16 Jan 2013 02:48:37 +0000 (03:48 +0100)]
target-mips: Introduce QOM realizefn for MIPSCPU

Introduce a realizefn and set realized = true from cpu_mips_init().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-microblaze: Introduce QOM realizefn for MicroBlazeCPU
Andreas Färber [Sat, 5 Jan 2013 14:27:31 +0000 (15:27 +0100)]
target-microblaze: Introduce QOM realizefn for MicroBlazeCPU

Introduce realizefn and set realized = true from cpu_mb_init().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-m68k: Introduce QOM realizefn for M68kCPU
Andreas Färber [Sat, 5 Jan 2013 14:15:30 +0000 (15:15 +0100)]
target-m68k: Introduce QOM realizefn for M68kCPU

Introduce realizefn and set realized = true in cpu_m68k_init().

Split off GDB registration to a new m68k_cpu_init_gdb() so that it can
be called from the realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-lm32: Introduce QOM realizefn for LM32CPU
Andreas Färber [Wed, 16 Jan 2013 02:31:27 +0000 (03:31 +0100)]
target-lm32: Introduce QOM realizefn for LM32CPU

Introduce a realizefn and set realized = true in cpu_lm32_init().

Also move cpu_reset() call from initfn to realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-cris: Introduce QOM realizefn for CRISCPU
Andreas Färber [Sat, 5 Jan 2013 14:41:21 +0000 (15:41 +0100)]
target-cris: Introduce QOM realizefn for CRISCPU

Introduce realizefn and set realized = true from cpu_cris_init().

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-ppc: Update PowerPCCPU to QOM realizefn
Andreas Färber [Wed, 16 Jan 2013 02:55:14 +0000 (03:55 +0100)]
target-ppc: Update PowerPCCPU to QOM realizefn

Adapt ppc_cpu_realize() signature, hook it up to DeviceClass and set
realized = true in cpu_ppc_init().

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-openrisc: Update OpenRISCCPU to QOM realizefn
Andreas Färber [Sat, 5 Jan 2013 13:11:07 +0000 (14:11 +0100)]
target-openrisc: Update OpenRISCCPU to QOM realizefn

Update the openrisc_cpu_realize() signature, hook it up to
DeviceClass::realize and set realized = true in cpu_openrisc_init().

qapi/error.h is now included through qdev and no longer needed.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Jia Liu <proljc@gmail.com>
11 years agotarget-i386: Update X86CPU to QOM realizefn
Andreas Färber [Wed, 16 Jan 2013 02:41:47 +0000 (03:41 +0100)]
target-i386: Update X86CPU to QOM realizefn

Adapt the signature of x86_cpu_realize(), hook up to
DeviceClass::realize and set realized = true in cpu_x86_init().

The QOM realizefn cannot depend on errp being non-NULL as in
cpu_x86_init(), so use a local Error to preserve error handling behavior
on APIC initialization errors.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
[AF: Invoke parent's realizefn]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-arm: Update ARMCPU to QOM realizefn
Andreas Färber [Sat, 5 Jan 2013 09:18:18 +0000 (10:18 +0100)]
target-arm: Update ARMCPU to QOM realizefn

Turn arm_cpu_realize() into a QOM realize function, no longer called
via cpu.h prototype. To maintain the semantics of cpu_init(), set
realized = true explicitly in cpu_arm_init().

Move GDB coprocessor registration, CPU reset and vCPU initialization
into the realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-alpha: Update AlphaCPU to QOM realizefn
Andreas Färber [Sat, 5 Jan 2013 13:01:30 +0000 (14:01 +0100)]
target-alpha: Update AlphaCPU to QOM realizefn

Update the alpha_cpu_realize() signature and hook up to
DeviceClass::realize. Set realized = true in cpu_alpha_init().

qapi/error.h is included through qdev now and no longer needed.

Acked-by: Richard Henderson <rth@twiddle.net>
[AF: Invoke parent's realizefn]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Prepare QOM realizefn
Andreas Färber [Sat, 19 Jan 2013 05:17:06 +0000 (06:17 +0100)]
cpu: Prepare QOM realizefn

Overwrite the default implementation with a no-op, no longer
attempting to call DeviceClass::init.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agobitops: Remove routines redundant with host-utils
Richard Henderson [Thu, 14 Feb 2013 01:47:43 +0000 (17:47 -0800)]
bitops: Remove routines redundant with host-utils

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agobitops: Replace bitops_ctol with ctzl
Richard Henderson [Thu, 14 Feb 2013 01:47:42 +0000 (17:47 -0800)]
bitops: Replace bitops_ctol with ctzl

The is the only remaining user.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agobitops: Inline bitops_flsl
Richard Henderson [Thu, 14 Feb 2013 01:47:41 +0000 (17:47 -0800)]
bitops: Inline bitops_flsl

This is the only remaining user.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-i386: Inline bitops_flsl
Richard Henderson [Thu, 14 Feb 2013 01:47:40 +0000 (17:47 -0800)]
target-i386: Inline bitops_flsl

Use clz32 directly.  Which makes slightly more sense given
that the input is type "int" and not type "long".

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agobitops: Write bitops_flsl in terms of clzl
Richard Henderson [Thu, 14 Feb 2013 01:47:39 +0000 (17:47 -0800)]
bitops: Write bitops_flsl in terms of clzl

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agomemory: Use non-bitops ctzl
Richard Henderson [Thu, 14 Feb 2013 01:47:38 +0000 (17:47 -0800)]
memory: Use non-bitops ctzl

A memory size of zero is invalid, and so that edge condition
does not occur.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agobitops: Use non-bitops ctzl
Richard Henderson [Thu, 14 Feb 2013 01:47:37 +0000 (17:47 -0800)]
bitops: Use non-bitops ctzl

The use of ctz has already eliminated zero, and thus the difference
in edge conditions between the two routines is irrelevant.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agohbitmap: Use non-bitops ctzl
Richard Henderson [Thu, 14 Feb 2013 01:47:36 +0000 (17:47 -0800)]
hbitmap: Use non-bitops ctzl

Both uses of ctz have already eliminated zero, and thus the difference
in edge conditions between the two routines is irrelevant.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agohost-utils: Fix coding style and add comments
Richard Henderson [Thu, 14 Feb 2013 01:47:35 +0000 (17:47 -0800)]
host-utils: Fix coding style and add comments

Add function comments to the routines, documenting the corner
cases upon which we are standardizing.  Fix the few instances
of non-standard coding style.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agohost-utils: Add host long specific aliases for clz, ctz, ctpop
Richard Henderson [Thu, 14 Feb 2013 01:47:34 +0000 (17:47 -0800)]
host-utils: Add host long specific aliases for clz, ctz, ctpop

We will standardize on these names, rather than the similar routines
currently residing in qemu/bitops.h.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoqemu-log: Rename CPULogItem, cpu_log_items to QEMULogItem, qemu_log_items
Peter Maydell [Mon, 11 Feb 2013 16:41:25 +0000 (16:41 +0000)]
qemu-log: Rename CPULogItem, cpu_log_items to QEMULogItem, qemu_log_items

Rename the typedef CPULogItem and the public array cpu_log_items
to names that better reflect the fact that the qemu_log functionality
isn't restricted to TCG CPU debug logs any more.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agocpus.c: Drop unnecessary set_cpu_log()
Peter Maydell [Mon, 11 Feb 2013 16:41:24 +0000 (16:41 +0000)]
cpus.c: Drop unnecessary set_cpu_log()

The set_cpu_log() function in cpus.c is a fairly simple wrapper
which is only called from one location. Just inline the code
into vl.c, since there is no need to indirect it via cpus.c
and the handling of the error case is more appropriate to vl.c.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoqemu-log: Rename the public-facing cpu_set_log function to qemu_set_log
Peter Maydell [Mon, 11 Feb 2013 16:41:23 +0000 (16:41 +0000)]
qemu-log: Rename the public-facing cpu_set_log function to qemu_set_log

Rename the public-facing function cpu_set_log to qemu_set_log. This
requires us to rename the internal-only qemu_set_log() to
do_qemu_set_log().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoqemu-log: Rename cpu_str_to_log_mask to qemu_str_to_log_mask
Peter Maydell [Mon, 11 Feb 2013 16:41:22 +0000 (16:41 +0000)]
qemu-log: Rename cpu_str_to_log_mask to qemu_str_to_log_mask

Rename cpu_str_to_log_mask() to qemu_str_to_log_mask(), since
the qemu_log functionality is no longer restricted to TCG CPU
debug logging.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoqemu-log: Abstract out "print usage message about valid log categories"
Peter Maydell [Mon, 11 Feb 2013 16:41:21 +0000 (16:41 +0000)]
qemu-log: Abstract out "print usage message about valid log categories"

Abstract out the "print a human readable list of all the
valid log categories" functionality which is currently duplicated
in three separate places. (We leave the monitor.c help_cmd()
implementation as-is since it wants to send the message to
the monitor and add its own information.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoqemu-log: Unify {cpu_set,set_cpu}_log_filename as qemu_set_log_filename
Peter Maydell [Mon, 11 Feb 2013 16:41:20 +0000 (16:41 +0000)]
qemu-log: Unify {cpu_set,set_cpu}_log_filename as qemu_set_log_filename

The qemu_log() functionality is no longer specific to TCG CPU debug logs.
Rename cpu_set_log_filename() to qemu_set_log_filename() and drop the
pointless wrapper set_cpu_log_filename().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoTCG: Move translation block variables to new context inside tcg_ctx: tb_ctx
Evgeny Voevodin [Thu, 31 Jan 2013 18:47:23 +0000 (01:47 +0700)]
TCG: Move translation block variables to new context inside tcg_ctx: tb_ctx

It's worth to clean-up translation blocks variables and move them
into one context as was suggested by Swirl.
Also if we use this context directly inside tcg_ctx, then it
speeds up code generation a bit.

Signed-off-by: Evgeny Voevodin <evgenyvoevodin@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>