Skip to content

Commit

Permalink
Merge tag 'pull-target-arm-20230502-1' of https://git.linaro.org/peop…
Browse files Browse the repository at this point in the history
…le/pmaydell/qemu-arm into staging

 * Support building Arm targets with CONFIG_TCG=no (ie KVM only)
 * hw/net: npcm7xx_emc: set MAC in register space
 * hw/arm/bcm2835_property: Implement "get command line" message
 * Deprecate the '-singlestep' command line option in favour of
   '-one-insn-per-tb' and '-accel one-insn-per-tb=on'
 * Deprecate 'singlestep' member of QMP StatusInfo struct
 * docs/about/deprecated.rst: Add "since 7.1" tag to dtb-kaslr-seed deprecation
 * hw/net/msf2-emac: Don't modify descriptor in-place in emac_store_desc()
 * raspi, aspeed: Write bootloader code correctly on big-endian hosts
 * hw/intc/allwinner-a10-pic: Fix bug on big-endian hosts
 * Fix bug in A32 ERET on big-endian hosts that caused guest crash
 * hw/sd/allwinner-sdhost: Correctly byteswap descriptor fields
 * hw/net/allwinner-sun8i-emac: Correctly byteswap descriptor fields

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmRQ/ewZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3ucGD/4/I5X6AxRVa597MAf9X6F5
# p19ZXpSP/1dRxH8USdCFEGH51H4/mPQjPkBuVzWlbYwLqc753mze55gBa7YaCRpz
# 91JHQ3HkvFSmtPUixv7CnPPpar9vCmaa1i6KEPp/9TLbHlIP/DnhyQp/SgwPHG/j
# TxoReqQ+VJ7MA0pBK6gWe/Jh0Wy2QaOW6lLp/bYTrkSnePMtSAQKRpL4EWrrSjuM
# Qr+MjlPfyx6WmU51LgHlKa+FZQ87PdIWIAwTC0lYl447QarwdxbZOtbezAT2Rcvw
# yGpnpY1QE1iTIW1rOL1+sL12ZEcZGm4oJsJs3or3e7iwjR3Bq1nBOYy3MYjuO3Gf
# fsbG5FrcZVhDWnA5sFiuaLkfwaNNjNoDbDFRSq3SSc9gaclkuV70xffQZx//eWlS
# kKUNkf1BTDyCXMSXXIwCjStkqfCWbetqGOqKWgWYsFr+vLhffFxv9r7o0Boei0V+
# 4mnEcQcAZFIhmjL8uFROkPt077dRcjtCLkyuT9ybOalVctHyCYFTzG6M1mqUJOqD
# /uaQ3UVdUlkJH0ImAE9fpApNrYMhh7oX/itDYjSYObUKO/sGoFTR81pNQu6muig2
# BBaW4+3jQx6XXwX49YHRHPdtHqJxrdTcyNenMeXqSMxBh6ppVxvuJAHZ2JD6PsRx
# +NejNWpvaakA+XU3I9D33w==
# =+QC7
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 02 May 2023 01:11:24 PM BST
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full]

* tag 'pull-target-arm-20230502-1' of https://git.linaro.org/people/pmaydell/qemu-arm: (35 commits)
  hw/net/allwinner-sun8i-emac: Correctly byteswap descriptor fields
  hw/sd/allwinner-sdhost: Correctly byteswap descriptor fields
  target/arm: Add compile time asserts to load/store_cpu_field macros
  target/arm: Define and use new load_cpu_field_low32()
  hw/intc/allwinner-a10-pic: Don't use set_bit()/clear_bit()
  hw/arm/raspi: Use arm_write_bootloader() to write boot code
  hw/arm/aspeed: Use arm_write_bootloader() to write the bootloader
  hw/arm/boot: Make write_bootloader() public as arm_write_bootloader()
  hw/net/msf2-emac: Don't modify descriptor in-place in emac_store_desc()
  docs/about/deprecated.rst: Add "since 7.1" tag to dtb-kaslr-seed deprecation
  qmp: Deprecate 'singlestep' member of StatusInfo
  qapi/run-state.json: Fix missing newline at end of file
  hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep'
  accel/tcg: Report one-insn-per-tb in 'info jit', not 'info status'
  Document that -singlestep command line option is deprecated
  bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep'
  linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep'
  accel/tcg: Use one_insn_per_tb global instead of old singlestep global
  softmmu: Don't use 'singlestep' global in QMP and HMP commands
  make one-insn-per-tb an accel option
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed May 2, 2023
2 parents b5f47ba + 0ab99e4 commit 1153be4
Show file tree
Hide file tree
Showing 56 changed files with 1,450 additions and 986 deletions.
11 changes: 11 additions & 0 deletions .gitlab-ci.d/crossbuilds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,14 @@ cross-arm64-xen-only:
IMAGE: debian-arm64-cross
ACCEL: xen
EXTRA_CONFIGURE_OPTS: --disable-tcg --disable-kvm

# Similar job is run by qemu-project's custom runner by default
cross-arm64-kvm-only:
extends: .cross_accel_build_job
needs:
job: arm64-debian-cross-container
variables:
QEMU_JOB_OPTIONAL: 1
IMAGE: debian-arm64-cross
ACCEL: kvm
EXTRA_CONFIGURE_OPTS: --disable-tcg --disable-xen --without-default-devices
4 changes: 0 additions & 4 deletions .gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ ubuntu-22.04-aarch64-notcg:
- aarch64
rules:
- if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
when: manual
allow_failure: true
- if: "$AARCH64_RUNNER_AVAILABLE"
when: manual
allow_failure: true
script:
- mkdir build
- cd build
Expand Down
2 changes: 1 addition & 1 deletion accel/tcg/cpu-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ uint32_t curr_cflags(CPUState *cpu)
*/
if (unlikely(cpu->singlestep_enabled)) {
cflags |= CF_NO_GOTO_TB | CF_NO_GOTO_PTR | CF_SINGLE_STEP | 1;
} else if (singlestep) {
} else if (qatomic_read(&one_insn_per_tb)) {
cflags |= CF_NO_GOTO_TB | 1;
} else if (qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
cflags |= CF_NO_GOTO_TB;
Expand Down
2 changes: 2 additions & 0 deletions accel/tcg/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ static inline target_ulong log_pc(CPUState *cpu, const TranslationBlock *tb)
extern int64_t max_delay;
extern int64_t max_advance;

extern bool one_insn_per_tb;

#endif /* ACCEL_TCG_INTERNAL_H */
14 changes: 14 additions & 0 deletions accel/tcg/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include "qemu/osdep.h"
#include "qemu/accel.h"
#include "qapi/error.h"
#include "qapi/type-helpers.h"
#include "qapi/qapi-commands-machine.h"
Expand Down Expand Up @@ -36,6 +37,18 @@ static void dump_drift_info(GString *buf)
}
}

static void dump_accel_info(GString *buf)
{
AccelState *accel = current_accel();
bool one_insn_per_tb = object_property_get_bool(OBJECT(accel),
"one-insn-per-tb",
&error_fatal);

g_string_append_printf(buf, "Accelerator settings:\n");
g_string_append_printf(buf, "one-insn-per-tb: %s\n\n",
one_insn_per_tb ? "on" : "off");
}

HumanReadableText *qmp_x_query_jit(Error **errp)
{
g_autoptr(GString) buf = g_string_new("");
Expand All @@ -45,6 +58,7 @@ HumanReadableText *qmp_x_query_jit(Error **errp)
return NULL;
}

dump_accel_info(buf);
dump_exec_info(buf);
dump_drift_info(buf);

Expand Down
23 changes: 23 additions & 0 deletions accel/tcg/tcg-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/accel.h"
#include "qemu/atomic.h"
#include "qapi/qapi-builtin-visit.h"
#include "qemu/units.h"
#if !defined(CONFIG_USER_ONLY)
Expand All @@ -42,6 +43,7 @@ struct TCGState {
AccelState parent_obj;

bool mttcg_enabled;
bool one_insn_per_tb;
int splitwx_enabled;
unsigned long tb_size;
};
Expand Down Expand Up @@ -109,6 +111,7 @@ static void tcg_accel_instance_init(Object *obj)
}

bool mttcg_enabled;
bool one_insn_per_tb;

static int tcg_init_machine(MachineState *ms)
{
Expand Down Expand Up @@ -208,6 +211,20 @@ static void tcg_set_splitwx(Object *obj, bool value, Error **errp)
s->splitwx_enabled = value;
}

static bool tcg_get_one_insn_per_tb(Object *obj, Error **errp)
{
TCGState *s = TCG_STATE(obj);
return s->one_insn_per_tb;
}

static void tcg_set_one_insn_per_tb(Object *obj, bool value, Error **errp)
{
TCGState *s = TCG_STATE(obj);
s->one_insn_per_tb = value;
/* Set the global also: this changes the behaviour */
qatomic_set(&one_insn_per_tb, value);
}

static int tcg_gdbstub_supported_sstep_flags(void)
{
/*
Expand Down Expand Up @@ -245,6 +262,12 @@ static void tcg_accel_class_init(ObjectClass *oc, void *data)
tcg_get_splitwx, tcg_set_splitwx);
object_class_property_set_description(oc, "split-wx",
"Map jit pages into separate RW and RX regions");

object_class_property_add_bool(oc, "one-insn-per-tb",
tcg_get_one_insn_per_tb,
tcg_set_one_insn_per_tb);
object_class_property_set_description(oc, "one-insn-per-tb",
"Only put one guest insn in each translation block");
}

static const TypeInfo tcg_accel_type = {
Expand Down
14 changes: 9 additions & 5 deletions bsd-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "host-os.h"
#include "target_arch_cpu.h"

int singlestep;
static bool opt_one_insn_per_tb;
uintptr_t guest_base;
bool have_guest_base;
/*
Expand Down Expand Up @@ -162,7 +162,8 @@ static void usage(void)
"-d item1[,...] enable logging of specified items\n"
" (use '-d help' for a list of log items)\n"
"-D logfile write logs to 'logfile' (default stderr)\n"
"-singlestep always run in singlestep mode\n"
"-one-insn-per-tb run with one guest instruction per emulated TB\n"
"-singlestep deprecated synonym for -one-insn-per-tb\n"
"-strace log system calls\n"
"-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
" specify tracing options\n"
Expand Down Expand Up @@ -385,8 +386,8 @@ int main(int argc, char **argv)
(void) envlist_unsetenv(envlist, "LD_PRELOAD");
} else if (!strcmp(r, "seed")) {
seed_optarg = optarg;
} else if (!strcmp(r, "singlestep")) {
singlestep = 1;
} else if (!strcmp(r, "singlestep") || !strcmp(r, "one-insn-per-tb")) {
opt_one_insn_per_tb = true;
} else if (!strcmp(r, "strace")) {
do_strace = 1;
} else if (!strcmp(r, "trace")) {
Expand Down Expand Up @@ -444,9 +445,12 @@ int main(int argc, char **argv)

/* init tcg before creating CPUs and to get qemu_host_page_size */
{
AccelClass *ac = ACCEL_GET_CLASS(current_accel());
AccelState *accel = current_accel();
AccelClass *ac = ACCEL_GET_CLASS(accel);

accel_init_interfaces(ac);
object_property_set_bool(OBJECT(accel), "one-insn-per-tb",
opt_one_insn_per_tb, &error_abort);
ac->init_machine(NULL);
}
cpu = cpu_create(cpu_type);
Expand Down
4 changes: 0 additions & 4 deletions configs/devices/aarch64-softmmu/default.mak
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@

# We support all the 32 bit boards so need all their config
include ../arm-softmmu/default.mak

CONFIG_XLNX_ZYNQMP_ARM=y
CONFIG_XLNX_VERSAL=y
CONFIG_SBSA_REF=y
39 changes: 0 additions & 39 deletions configs/devices/arm-softmmu/default.mak
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,3 @@
# CONFIG_TEST_DEVICES=n

CONFIG_ARM_VIRT=y
CONFIG_CUBIEBOARD=y
CONFIG_EXYNOS4=y
CONFIG_HIGHBANK=y
CONFIG_INTEGRATOR=y
CONFIG_FSL_IMX31=y
CONFIG_MUSICPAL=y
CONFIG_MUSCA=y
CONFIG_CHEETAH=y
CONFIG_SX1=y
CONFIG_NSERIES=y
CONFIG_STELLARIS=y
CONFIG_STM32VLDISCOVERY=y
CONFIG_REALVIEW=y
CONFIG_VERSATILE=y
CONFIG_VEXPRESS=y
CONFIG_ZYNQ=y
CONFIG_MAINSTONE=y
CONFIG_GUMSTIX=y
CONFIG_SPITZ=y
CONFIG_TOSA=y
CONFIG_Z2=y
CONFIG_NPCM7XX=y
CONFIG_COLLIE=y
CONFIG_ASPEED_SOC=y
CONFIG_NETDUINO2=y
CONFIG_NETDUINOPLUS2=y
CONFIG_OLIMEX_STM32_H405=y
CONFIG_MPS2=y
CONFIG_RASPI=y
CONFIG_DIGIC=y
CONFIG_SABRELITE=y
CONFIG_EMCRAFT_SF2=y
CONFIG_MICROBIT=y
CONFIG_FSL_IMX25=y
CONFIG_FSL_IMX7=y
CONFIG_FSL_IMX6UL=y
CONFIG_SEMIHOSTING=y
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
CONFIG_ALLWINNER_H3=y
43 changes: 41 additions & 2 deletions docs/about/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ Use ``-machine acpi=off`` instead.
The HAXM project has been retired (see https://github.com/intel/haxm#status).
Use "whpx" (on Windows) or "hvf" (on macOS) instead.

``-singlestep`` (since 8.1)
'''''''''''''''''''''''''''

The ``-singlestep`` option has been turned into an accelerator property,
and given a name that better reflects what it actually does.
Use ``-accel tcg,one-insn-per-tb=on`` instead.

User-mode emulator command line arguments
-----------------------------------------

``-singlestep`` (since 8.1)
'''''''''''''''''''''''''''

The ``-singlestep`` option has been given a name that better reflects
what it actually does. For both linux-user and bsd-user, use the
new ``-one-insn-per-tb`` option instead.

QEMU Machine Protocol (QMP) commands
------------------------------------
Expand Down Expand Up @@ -183,6 +199,29 @@ accepted incorrect commands will return an error. Users should make sure that
all arguments passed to ``device_add`` are consistent with the documented
property types.

``StatusInfo`` member ``singlestep`` (since 8.1)
''''''''''''''''''''''''''''''''''''''''''''''''

The ``singlestep`` member of the ``StatusInfo`` returned from the
``query-status`` command is deprecated. This member has a confusing
name and it never did what the documentation claimed or what its name
suggests. We do not believe that anybody is actually using the
information provided in this member.

The information it reports is whether the TCG JIT is in "one
instruction per translated block" mode (which can be set on the
command line or via the HMP, but not via QMP). The information remains
available via the HMP 'info jit' command.

Human Monitor Protocol (HMP) commands
-------------------------------------

``singlestep`` (since 8.1)
''''''''''''''''''''''''''

The ``singlestep`` command has been replaced by the ``one-insn-per-tb``
command, which has the same behaviour but a less misleading name.

Host Architectures
------------------

Expand Down Expand Up @@ -219,8 +258,8 @@ Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead.
System emulator machines
------------------------

Arm ``virt`` machine ``dtb-kaslr-seed`` property
''''''''''''''''''''''''''''''''''''''''''''''''
Arm ``virt`` machine ``dtb-kaslr-seed`` property (since 7.1)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

The ``dtb-kaslr-seed`` property on the ``virt`` board has been
deprecated; use the new name ``dtb-randomness`` instead. The new name
Expand Down
14 changes: 12 additions & 2 deletions docs/user/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,13 @@ Debug options:
``-g port``
Wait gdb connection to port

``-one-insn-per-tb``
Run the emulation with one guest instruction per translation block.
This slows down emulation a lot, but can be useful in some situations,
such as when trying to analyse the logs produced by the ``-d`` option.

``-singlestep``
Run the emulation in single step mode.
This is a deprecated synonym for the ``-one-insn-per-tb`` option.

Environment variables:

Expand Down Expand Up @@ -242,5 +247,10 @@ Debug options:
``-p pagesize``
Act as if the host page size was 'pagesize' bytes

``-one-insn-per-tb``
Run the emulation with one guest instruction per translation block.
This slows down emulation a lot, but can be useful in some situations,
such as when trying to analyse the logs produced by the ``-d`` option.

``-singlestep``
Run the emulation in single step mode.
This is a deprecated synonym for the ``-one-insn-per-tb`` option.
25 changes: 21 additions & 4 deletions hmp-commands.hx
Original file line number Diff line number Diff line change
Expand Up @@ -378,18 +378,35 @@ SRST
only *tag* as parameter.
ERST

{
.name = "one-insn-per-tb",
.args_type = "option:s?",
.params = "[on|off]",
.help = "run emulation with one guest instruction per translation block",
.cmd = hmp_one_insn_per_tb,
},

SRST
``one-insn-per-tb [off]``
Run the emulation with one guest instruction per translation block.
This slows down emulation a lot, but can be useful in some situations,
such as when trying to analyse the logs produced by the ``-d`` option.
This only has an effect when using TCG, not with KVM or other accelerators.

If called with option off, the emulation returns to normal mode.
ERST

{
.name = "singlestep",
.args_type = "option:s?",
.params = "[on|off]",
.help = "run emulation in singlestep mode or switch to normal mode",
.cmd = hmp_singlestep,
.help = "deprecated synonym for one-insn-per-tb",
.cmd = hmp_one_insn_per_tb,
},

SRST
``singlestep [off]``
Run the emulation in single step mode.
If called with option off, the emulation returns to normal mode.
This is a deprecated synonym for the one-insn-per-tb command.
ERST

{
Expand Down

0 comments on commit 1153be4

Please sign in to comment.