]> Git Repo - qemu.git/log
qemu.git
2 years agotarget/i386: Create cur_insn_len, cur_insn_len_i32
Richard Henderson [Sat, 1 Oct 2022 14:09:20 +0000 (07:09 -0700)]
target/i386: Create cur_insn_len, cur_insn_len_i32

Create common routines for computing the length of the insn.
Use tcg_constant_i32 in the new function, while we're at it.

Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: USe DISAS_EOB_ONLY
Richard Henderson [Sat, 1 Oct 2022 14:09:19 +0000 (07:09 -0700)]
target/i386: USe DISAS_EOB_ONLY

Replace lone calls to gen_eob() with the new enumerator.

Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: Use DISAS_EOB_NEXT
Richard Henderson [Sat, 1 Oct 2022 14:09:18 +0000 (07:09 -0700)]
target/i386: Use DISAS_EOB_NEXT

Replace sequences of gen_update_cc_op, gen_update_eip_next,
and gen_eob with the new is_jmp enumerator.

Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: Use DISAS_EOB* in gen_movl_seg_T0
Richard Henderson [Sat, 1 Oct 2022 14:09:17 +0000 (07:09 -0700)]
target/i386: Use DISAS_EOB* in gen_movl_seg_T0

Set is_jmp properly in gen_movl_seg_T0, so that the callers
need to nothing special.

Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: Introduce DISAS_EOB*
Richard Henderson [Sat, 1 Oct 2022 14:09:16 +0000 (07:09 -0700)]
target/i386: Introduce DISAS_EOB*

Add a few DISAS_TARGET_* aliases to reduce the number of
calls to gen_eob() and gen_eob_inhibit_irq().  So far,
only update i386_tr_translate_insn for exiting the block
because of single-step or previous inhibit irq.

Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: Create gen_update_eip_next
Richard Henderson [Sat, 1 Oct 2022 14:09:15 +0000 (07:09 -0700)]
target/i386: Create gen_update_eip_next

Sync EIP before exiting a translation block.
Replace all gen_jmp_im that use s->pc.

Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: Create gen_update_eip_cur
Richard Henderson [Sat, 1 Oct 2022 14:09:14 +0000 (07:09 -0700)]
target/i386: Create gen_update_eip_cur

Like gen_update_cc_op, sync EIP before doing something
that could raise an exception.  Replace all gen_jmp_im
that use s->base.pc_next.

Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: Remove cur_eip, next_eip arguments to gen_interrupt
Richard Henderson [Sat, 1 Oct 2022 14:09:13 +0000 (07:09 -0700)]
target/i386: Remove cur_eip, next_eip arguments to gen_interrupt

All callers pass s->base.pc_next and s->pc, which we can just as
well compute within the function.  Adjust to use tcg_constant_i32
while we're at it.

Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: Remove cur_eip argument to gen_exception
Richard Henderson [Sat, 1 Oct 2022 14:09:12 +0000 (07:09 -0700)]
target/i386: Remove cur_eip argument to gen_exception

All callers pass s->base.pc_next - s->cs_base, which we can just
as well compute within the function.  Note the special case of
EXCP_VSYSCALL in which s->cs_base wasn't subtracted, but cs_base
is always zero in 64-bit mode, when vsyscall is used.

Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: Return bool from disas_insn
Richard Henderson [Sat, 1 Oct 2022 14:09:11 +0000 (07:09 -0700)]
target/i386: Return bool from disas_insn

Instead of returning the new pc, which is present in
DisasContext, return true if an insn was translated.
This is false when we detect a page crossing and must
undo the insn under translation.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agotarget/i386: Remove pc_start
Richard Henderson [Sat, 1 Oct 2022 14:09:10 +0000 (07:09 -0700)]
target/i386: Remove pc_start

The DisasContext member and the disas_insn local variable of
the same name are identical to DisasContextBase.pc_next.

Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20221001140935[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agoi386: add notify VM exit support
Chenyi Qiang [Thu, 29 Sep 2022 07:20:14 +0000 (15:20 +0800)]
i386: add notify VM exit support

There are cases that malicious virtual machine can cause CPU stuck (due
to event windows don't open up), e.g., infinite loop in microcode when
nested #AC (CVE-2015-5307). No event window means no event (NMI, SMI and
IRQ) can be delivered. It leads the CPU to be unavailable to host or
other VMs. Notify VM exit is introduced to mitigate such kind of
attacks, which will generate a VM exit if no event window occurs in VM
non-root mode for a specified amount of time (notify window).

A new KVM capability KVM_CAP_X86_NOTIFY_VMEXIT is exposed to user space
so that the user can query the capability and set the expected notify
window when creating VMs. The format of the argument when enabling this
capability is as follows:
  Bit 63:32 - notify window specified in qemu command
  Bit 31:0  - some flags (e.g. KVM_X86_NOTIFY_VMEXIT_ENABLED is set to
              enable the feature.)

Users can configure the feature by a new (x86 only) accel property:
    qemu -accel kvm,notify-vmexit=run|internal-error|disable,notify-window=n

The default option of notify-vmexit is run, which will enable the
capability and do nothing if the exit happens. The internal-error option
raises a KVM internal error if it happens. The disable option does not
enable the capability. The default value of notify-window is 0. It is valid
only when notify-vmexit is not disabled. The valid range of notify-window
is non-negative. It is even safe to set it to zero since there's an
internal hardware threshold to be added to ensure no false positive.

Because a notify VM exit may happen with VM_CONTEXT_INVALID set in exit
qualification (no cases are anticipated that would set this bit), which
means VM context is corrupted. It would be reflected in the flags of
KVM_EXIT_NOTIFY exit. If KVM_NOTIFY_CONTEXT_INVALID bit is set, raise a KVM
internal error unconditionally.

Acked-by: Peter Xu <[email protected]>
Signed-off-by: Chenyi Qiang <[email protected]>
Message-Id: <20220929072014[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agokvm: expose struct KVMState
Chenyi Qiang [Thu, 29 Sep 2022 07:20:13 +0000 (15:20 +0800)]
kvm: expose struct KVMState

Expose struct KVMState out of kvm-all.c so that the field of struct
KVMState can be accessed when defining target-specific accelerator
properties.

Signed-off-by: Chenyi Qiang <[email protected]>
Message-Id: <20220929072014[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agokvm: allow target-specific accelerator properties
Paolo Bonzini [Thu, 29 Sep 2022 07:20:12 +0000 (15:20 +0800)]
kvm: allow target-specific accelerator properties

Several hypervisor capabilities in KVM are target-specific.  When exposed
to QEMU users as accelerator properties (i.e. -accel kvm,prop=value), they
should not be available for all targets.

Add a hook for targets to add their own properties to -accel kvm, for
now no such property is defined.

Signed-off-by: Paolo Bonzini <[email protected]>
Message-Id: <20220929072014[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agoi386: kvm: extend kvm_{get, put}_vcpu_events to support pending triple fault
Chenyi Qiang [Thu, 29 Sep 2022 07:20:11 +0000 (15:20 +0800)]
i386: kvm: extend kvm_{get, put}_vcpu_events to support pending triple fault

For the direct triple faults, i.e. hardware detected and KVM morphed
to VM-Exit, KVM will never lose them. But for triple faults sythesized
by KVM, e.g. the RSM path, if KVM exits to userspace before the request
is serviced, userspace could migrate the VM and lose the triple fault.

A new flag KVM_VCPUEVENT_VALID_TRIPLE_FAULT is defined to signal that
the event.triple_fault_pending field contains a valid state if the
KVM_CAP_X86_TRIPLE_FAULT_EVENT capability is enabled.

Acked-by: Peter Xu <[email protected]>
Signed-off-by: Chenyi Qiang <[email protected]>
Message-Id: <20220929072014[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agoscsi-disk: support setting CD-ROM block size via device options
John Millikin [Thu, 4 Aug 2022 12:29:51 +0000 (21:29 +0900)]
scsi-disk: support setting CD-ROM block size via device options

SunOS expects CD-ROM devices to have a block size of 512, and will
fail to mount or install using QEMU's default block size of 2048.

When initializing the SCSI device, allow the `physical_block_size'
block device option to override the default block size.

Signed-off-by: John Millikin <[email protected]>
Message-Id: <20220804122950.1577012[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
2 years agoMerge tag 'pull-testing-gdbstub-plugins-gitdm-061022-3' of https://github.com/stsquad...
Stefan Hajnoczi [Thu, 6 Oct 2022 11:11:56 +0000 (07:11 -0400)]
Merge tag 'pull-testing-gdbstub-plugins-gitdm-061022-3' of https://github.com/stsquad/qemu into staging

testing, gdbstub, plugin and gitdm updates

  - cleanup scripts/ci/setup in advance of ppc64 runner
  - ensure detected gdb reported to TCG tests
  - update hexagon container with build deps
  - move alpine container to tagged release
  - fix overflow during qos-test test tree iteration
  - allow bios blobs to be built with test cross compilers
  - introduce monitor_puts for plain strings
  - share disas code between monitor and plugins
  - fix bug in execlog plugin
  - add more tcg plugin documentation, reorg
  - fix link to semihosting spec
  - re-factor gdbstub to use AccelClass/Ops
  - many gitdm updates
  - fix race with plugin mutex lock and linux-user fork()

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmM+s+YACgkQ+9DbCVqe
# KkSDwgf/Qj0OScOr5Bfw3/KAV0/SFL1vHISb2r5qZVG4DvdY/c/sitPBHPJ8N5jQ
# 918M8AiI3+4Mb/GwkdYBEyWgVZ5ELOkJTObypa5pwmF1K/xDUlG7ZRmJ9+xkJ44Q
# TmrVLQyw6d907B2u+DfqX68AYYnto1yQT/eUo6TiLdIJ5NXIYRn5u34snG9qWHja
# b/Dp7DxnoJMS1EhlMhukekCHGGNUeYn4ewIKbsG1EouH5PndzrvP8LRAcWyxv0m4
# tD2bEAHCMKqTqefkNgG7GCO3HND1JBfWdckx3OD4hBnMnuNtsZBL23QN7MDytgnv
# 0JnYSwkWZCuMIt7oKCOXLUbCjQG97Q==
# =1vZ4
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 06 Oct 2022 06:54:30 EDT
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <[email protected]>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* tag 'pull-testing-gdbstub-plugins-gitdm-061022-3' of https://github.com/stsquad/qemu: (52 commits)
  plugins: add [pre|post]fork helpers to linux-user
  contrib/gitdm: add Université Grenoble Alpes
  contrib/gitdm: add Simon to individual contributors
  contrib/gitdm: add China Telecom to the domain map
  contrib/gitdm: add ISCAS to the academics group
  contrib/gitdm: add WANG Xuerui to individual contributers
  contrib/gitdm: add Paul to individual contributors
  contrib/gitdm: add mapping for Loongson Technology
  accel/kvm: move kvm_update_guest_debug to inline stub
  gdbstub: move guest debug support check to ops
  gdbstub: move breakpoint logic to accel ops
  gdbstub: move sstep flags probing into AccelClass
  gdbstub: move into its own sub directory
  semihosting: update link to spec
  docs/devel: document the test plugins
  contrib/plugins: reset skip when matching in execlog
  docs/devel: move API to end of tcg-plugins.rst
  docs/devel: clean-up qemu invocations in tcg-plugins
  plugins: Assert mmu_idx in range before use in qemu_plugin_get_hwaddr
  plugins: extend execlog to filter matches
  ...

Signed-off-by: Stefan Hajnoczi <[email protected]>
2 years agoplugins: add [pre|post]fork helpers to linux-user
Alex Bennée [Tue, 4 Oct 2022 11:52:21 +0000 (12:52 +0100)]
plugins: add [pre|post]fork helpers to linux-user

Special care needs to be taken in ensuring locks are in a consistent
state across fork events. Add helpers so the plugin system can ensure
that.

Signed-off-by: Alex Bennée <[email protected]>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/358
Reviewed-by: Daniel P. Berrangé <[email protected]>
Tested-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20221004115221.2174499[email protected]>

2 years agocontrib/gitdm: add Université Grenoble Alpes
Alex Bennée [Mon, 26 Sep 2022 13:46:08 +0000 (14:46 +0100)]
contrib/gitdm: add Université Grenoble Alpes

again to the academic group map.

Signed-off-by: Alex Bennée <[email protected]>
Cc: Frédéric Pétrot <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220926134609.3301945[email protected]>

2 years agocontrib/gitdm: add Simon to individual contributors
Alex Bennée [Mon, 26 Sep 2022 13:46:03 +0000 (14:46 +0100)]
contrib/gitdm: add Simon to individual contributors

Please confirm this is the correct mapping for you.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Simon Safar <[email protected]>
Message-Id: <20220926134609.3301945[email protected]>

2 years agocontrib/gitdm: add China Telecom to the domain map
Alex Bennée [Thu, 29 Sep 2022 11:42:31 +0000 (12:42 +0100)]
contrib/gitdm: add China Telecom to the domain map

Signed-off-by: Alex Bennée <[email protected]>
Acked-by: Hyman Huang(黄勇) <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agocontrib/gitdm: add ISCAS to the academics group
Alex Bennée [Thu, 29 Sep 2022 11:42:30 +0000 (12:42 +0100)]
contrib/gitdm: add ISCAS to the academics group

The English website (http://english.is.cas.cn/) in on a slightly
different domain but has the same logo as http://www.iscas.ac.cn/.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Weiwei Li <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agocontrib/gitdm: add WANG Xuerui to individual contributers
Alex Bennée [Thu, 29 Sep 2022 11:42:29 +0000 (12:42 +0100)]
contrib/gitdm: add WANG Xuerui to individual contributers

His blog confirms he is not affiliated with Loongson.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: WANG Xuerui <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agocontrib/gitdm: add Paul to individual contributors
Alex Bennée [Thu, 29 Sep 2022 11:42:28 +0000 (12:42 +0100)]
contrib/gitdm: add Paul to individual contributors

Also map his old codesourcery address to his canonical address.

Signed-off-by: Alex Bennée <[email protected]>
Cc: Paul Brook <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agocontrib/gitdm: add mapping for Loongson Technology
Alex Bennée [Thu, 29 Sep 2022 11:42:27 +0000 (12:42 +0100)]
contrib/gitdm: add mapping for Loongson Technology

Please confirm you are happy with this mapping.

Signed-off-by: Alex Bennée <[email protected]>
Acked-by: Song Gao <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoaccel/kvm: move kvm_update_guest_debug to inline stub
Alex Bennée [Thu, 29 Sep 2022 11:42:26 +0000 (12:42 +0100)]
accel/kvm: move kvm_update_guest_debug to inline stub

Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agogdbstub: move guest debug support check to ops
Alex Bennée [Thu, 29 Sep 2022 11:42:25 +0000 (12:42 +0100)]
gdbstub: move guest debug support check to ops

This removes the final hard coding of kvm_enabled() in gdbstub and
moves the check to an AccelOps.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Mads Ynddal <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agogdbstub: move breakpoint logic to accel ops
Alex Bennée [Thu, 29 Sep 2022 11:42:24 +0000 (12:42 +0100)]
gdbstub: move breakpoint logic to accel ops

As HW virtualization requires specific support to handle breakpoints
lets push out special casing out of the core gdbstub code and into
AccelOpsClass. This will make it easier to add other accelerator
support and reduces some of the stub shenanigans.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Mads Ynddal <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agogdbstub: move sstep flags probing into AccelClass
Alex Bennée [Thu, 29 Sep 2022 11:42:23 +0000 (12:42 +0100)]
gdbstub: move sstep flags probing into AccelClass

The support of single-stepping is very much dependent on support from
the accelerator we are using. To avoid special casing in gdbstub move
the probing out to an AccelClass function so future accelerators can
put their code there.

Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Mads Ynddal <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agogdbstub: move into its own sub directory
Alex Bennée [Thu, 29 Sep 2022 11:42:22 +0000 (12:42 +0100)]
gdbstub: move into its own sub directory

This is in preparation of future refactoring as well as cleaning up
the source tree. Aside from the minor tweaks to meson and trace.h this
is pure code motion.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agosemihosting: update link to spec
Alex Bennée [Thu, 29 Sep 2022 11:42:21 +0000 (12:42 +0100)]
semihosting: update link to spec

The old link has moved but it seems the document is now hosted on
Arm's github along with a license update to CC-BY-SA-4.0.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agodocs/devel: document the test plugins
Alex Bennée [Thu, 29 Sep 2022 11:42:20 +0000 (12:42 +0100)]
docs/devel: document the test plugins

Although the test plugins are fairly basic they are still useful for
some things so we should document their existence.

Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agocontrib/plugins: reset skip when matching in execlog
Alex Bennée [Thu, 29 Sep 2022 11:42:19 +0000 (12:42 +0100)]
contrib/plugins: reset skip when matching in execlog

The purpose of the matches was to only track the execution of
instructions we care about. Without resetting skip to the value at the
start of the block we end up dumping all instructions after the match
with the consequent load on the instrumentation.

Signed-off-by: Alex Bennée <[email protected]>
Cc: Alexandre Iooss <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agodocs/devel: move API to end of tcg-plugins.rst
Alex Bennée [Thu, 29 Sep 2022 11:42:18 +0000 (12:42 +0100)]
docs/devel: move API to end of tcg-plugins.rst

The API documentation is quite dry and doesn't flow nicely with the
rest of the document. Move it to its own section at the bottom along
with a little leader text to remind people to update it.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agodocs/devel: clean-up qemu invocations in tcg-plugins
Alex Bennée [Thu, 29 Sep 2022 11:42:17 +0000 (12:42 +0100)]
docs/devel: clean-up qemu invocations in tcg-plugins

We currently have the final binaries in the root of the build dir so
the build prefix is superfluous. Additionally add a shell prompt to be
more in line with the rest of the code.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoplugins: Assert mmu_idx in range before use in qemu_plugin_get_hwaddr
Richard Henderson [Thu, 29 Sep 2022 11:42:16 +0000 (12:42 +0100)]
plugins: Assert mmu_idx in range before use in qemu_plugin_get_hwaddr

Coverity reports out-of-bound accesses here.  This should be a
false positive due to how the index is decoded from MemOpIdx.

Fixes: Coverity CID 1487201
Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Damien Hedde <[email protected]>
Message-Id: <20220401190233[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoplugins: extend execlog to filter matches
Alex Bennée [Thu, 29 Sep 2022 11:42:15 +0000 (12:42 +0100)]
plugins: extend execlog to filter matches

Sometimes the whole execlog is just two much so add the ability to
filter by instruction opcode or address.

[AJB: this shows for example

 qemu-system-aarch64 -display none -serial mon:stdio \
   -M virt -cpu max \
   -semihosting-config enable=on \
   -kernel ./tests/tcg/aarch64-softmmu/memory-sve \
   -plugin ./contrib/plugins/libexeclog.so,ifilter=st1w,afilter=0x40001808 -d plugin -D plugin.out

the st1w SVE instruction is not instrumenting its stores.]

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Alexandre Iooss <[email protected]>
Cc: Robert Henry <[email protected]>
Cc: Aaron Lindsay <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agodisas: use result of ->read_memory_func
Alex Bennée [Thu, 29 Sep 2022 11:42:14 +0000 (12:42 +0100)]
disas: use result of ->read_memory_func

This gets especially confusing if you start plugging in host addresses
from a trace and you wonder why the output keeps changing. Report when
read_memory_func fails instead of blindly disassembling the buffer
contents.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agodisas: generalise plugin_printf and use for monitor_disas
Alex Bennée [Thu, 29 Sep 2022 11:42:13 +0000 (12:42 +0100)]
disas: generalise plugin_printf and use for monitor_disas

Rather than assembling our output piecemeal lets use the same approach
as the plugin disas interface to build the disassembly string before
printing it.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agomonitor: expose monitor_puts to rest of code
Alex Bennée [Thu, 29 Sep 2022 11:42:12 +0000 (12:42 +0100)]
monitor: expose monitor_puts to rest of code

This helps us construct strings elsewhere before echoing to the
monitor. It avoids having to jump through hoops like:

  monitor_printf(mon, "%s", s->str);

It will be useful in following patches but for now convert all
existing plain "%s" printfs to use the _puts api.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agopc-bios/vof: Adopt meson style Make output
Paolo Bonzini [Thu, 29 Sep 2022 11:42:11 +0000 (12:42 +0100)]
pc-bios/vof: Adopt meson style Make output

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agopc-bios/s390-ccw: Adopt meson style Make output
Paolo Bonzini [Thu, 29 Sep 2022 11:42:10 +0000 (12:42 +0100)]
pc-bios/s390-ccw: Adopt meson style Make output

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agopc-bios/optionrom: Adopt meson style Make output
Paolo Bonzini [Thu, 29 Sep 2022 11:42:09 +0000 (12:42 +0100)]
pc-bios/optionrom: Adopt meson style Make output

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoconfigure: build ROMs with container-based cross compilers
Paolo Bonzini [Thu, 29 Sep 2022 11:42:08 +0000 (12:42 +0100)]
configure: build ROMs with container-based cross compilers

s390-ccw remains a bit more complex, because the -march=z900 test is done
only for the native cross compiler.  Otherwise, all that is needed is
to pass the (now mandatory) target argument to write_target_makefile.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoconfigure: cleanup creation of tests/tcg target config
Paolo Bonzini [Thu, 29 Sep 2022 11:42:07 +0000 (12:42 +0100)]
configure: cleanup creation of tests/tcg target config

Remove the symlink to tests/tcg/config-*.mak, which is possible now
that unused target config files are not created either.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoconfigure: unify creation of cross-compilation Makefiles
Paolo Bonzini [Thu, 29 Sep 2022 11:42:06 +0000 (12:42 +0100)]
configure: unify creation of cross-compilation Makefiles

Let write_target_makefile handle both host and container cross compilers.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoconfigure: move tests/tcg/Makefile.prereqs to root build directory
Paolo Bonzini [Thu, 29 Sep 2022 11:42:05 +0000 (12:42 +0100)]
configure: move tests/tcg/Makefile.prereqs to root build directory

It will not be specific to tests/tcg anymore, since it will be possible to
build firmware using container-based cross compilers too.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotests/tcg: move compiler tests to Makefiles
Paolo Bonzini [Thu, 29 Sep 2022 11:42:04 +0000 (12:42 +0100)]
tests/tcg: move compiler tests to Makefiles

Further decoupling of tests/tcg from the main QEMU Makefile, and making
the build more similar between the cross compiler case and the vetted
container images.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotests/tcg: clean up calls to run-test
Paolo Bonzini [Thu, 29 Sep 2022 11:42:03 +0000 (12:42 +0100)]
tests/tcg: clean up calls to run-test

Almost all invocations of run-test have either "$* on $(TARGET_NAME)"
or "$< on $(TARGET_NAME)" as the last argument.  So provide a default
test name, while allowing an escape hatch for custom names.

As an additional simplification, remove the need to do shell quoting.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotests/tcg: unify ppc64 and ppc64le Makefiles
Paolo Bonzini [Thu, 29 Sep 2022 11:42:02 +0000 (12:42 +0100)]
tests/tcg: unify ppc64 and ppc64le Makefiles

Make tests/tcg/ppc64le include tests/tcg/ppc64 instead of duplicating
the rules.  Because the ppc64le vpath includes tests/tcg/ppc64 but
not vice versa, the tests have to be moved from tests/tcg/ppc64le/
to tests/tcg/ppc64.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotests/tcg: add distclean rule
Paolo Bonzini [Thu, 29 Sep 2022 11:42:01 +0000 (12:42 +0100)]
tests/tcg: add distclean rule

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotests/tcg: remove -f from Makefile invocation
Paolo Bonzini [Thu, 29 Sep 2022 11:42:00 +0000 (12:42 +0100)]
tests/tcg: remove -f from Makefile invocation

Instead of linking tests/tcg/Makefile.target into the build tree, name
the symbolic link "Makefile" and create it in every target subdirectory.
This makes it possible to just invoke "make" in tests/tcg subdirectories.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotests: simplify Makefile invocation for tests/tcg
Paolo Bonzini [Thu, 29 Sep 2022 11:41:59 +0000 (12:41 +0100)]
tests: simplify Makefile invocation for tests/tcg

Remove the DOCKER_SCRIPT and TARGET variable from the Makefile invocation
for tests/tcg.  For DOCKER_SCRIPT, resolve the path to docker.py in configure;
for TARGET, move it to config-$(TARGET).mak and use a symbolic link to break
the cycle.

The symbolic link is still needed because tests/tcg includes dummy config files
for targets that are not buildable.  Once that is cleaned up, the symbolic link
will go away too.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoconfigure: store container engine in config-host.mak
Paolo Bonzini [Thu, 29 Sep 2022 11:41:58 +0000 (12:41 +0100)]
configure: store container engine in config-host.mak

In preparation for removing $(DOCKER_SCRIPT) from the tests/tcg configuration
files, have Make use the same container engine that had been probed at
configure time.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoconfigure: return status code from probe_target_compiler
Paolo Bonzini [Thu, 29 Sep 2022 11:41:57 +0000 (12:41 +0100)]
configure: return status code from probe_target_compiler

For now, return 1 for container-based compilers.  This will change as
soon as ROMs will be buildable with them.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agobuild: add recursive distclean rules
Paolo Bonzini [Thu, 29 Sep 2022 11:41:56 +0000 (12:41 +0100)]
build: add recursive distclean rules

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agovof: add distclean target
Paolo Bonzini [Thu, 29 Sep 2022 11:41:55 +0000 (12:41 +0100)]
vof: add distclean target

Signed-off-by: Paolo Bonzini <[email protected]>
[AJB: add clean dep to distclean]
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agopc-bios/s390-ccw: detect CC options just once
Paolo Bonzini [Thu, 29 Sep 2022 11:41:54 +0000 (12:41 +0100)]
pc-bios/s390-ccw: detect CC options just once

In preparation for adding Docker container support, detect compiler options
just once rather than once per Make run; container startup overhead is
substantial and doing the detection just once makes things faster.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agopc-bios/optionrom: detect CC options just once
Paolo Bonzini [Thu, 29 Sep 2022 11:41:53 +0000 (12:41 +0100)]
pc-bios/optionrom: detect CC options just once

In preparation for adding Docker container support, detect compiler options
just once rather than once per Make run; container startup overhead is
substantial and doing the detection just once makes things faster.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotests/qtest: bump up QOS_PATH_MAX_ELEMENT_SIZE
Alex Bennée [Thu, 29 Sep 2022 11:41:51 +0000 (12:41 +0100)]
tests/qtest: bump up QOS_PATH_MAX_ELEMENT_SIZE

It seems the depth of stack we need to support can vary depending on
the order of the init constructors getting called. It seems
--enable-lto shuffles things around just enough to push you over the
limit.

Signed-off-by: Alex Bennée <[email protected]>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1186
Acked-by: Thomas Huth <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotests/docker: move alpine from edge to tagged release
Alex Bennée [Thu, 29 Sep 2022 11:41:50 +0000 (12:41 +0100)]
tests/docker: move alpine from edge to tagged release

Tracking alpine-edge like debian-sid is a moving target. Usually such
rolling releases are marked as "allow_failure: true" in our CI.
However as alpine presents a musl based distro and provides useful
extra coverage lets track a release branch instead to avoid random
breakages.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotarget/hexagon: manually add flex/bison/glib2 to remaining containers
Anton Johansson [Thu, 29 Sep 2022 11:41:48 +0000 (12:41 +0100)]
target/hexagon: manually add flex/bison/glib2 to remaining containers

Adds our build-time dependencies to containers which build qemu-hexagon,
but aren't covered by libvirt-ci.

Signed-off-by: Anton Johansson <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220804115548[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotarget/hexagon: regenerate docker/cirrus files
Anton Johansson [Thu, 29 Sep 2022 11:41:47 +0000 (12:41 +0100)]
target/hexagon: regenerate docker/cirrus files

This patch updates the docker and cirrus files with the new packages by
running tests/lcitool/refresh

Signed-off-by: Anton Johansson <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220804115548[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotarget/hexagon: add flex/bison/glib2 to qemu.yml
Anton Johansson [Thu, 29 Sep 2022 11:41:46 +0000 (12:41 +0100)]
target/hexagon: add flex/bison/glib2 to qemu.yml

Note, the glib2-native mapping exists separately from the normal glib2
mapping. The latter uses a `foreign` cross-policy-default, and
libvirt-ci is not able to support package mappings for multiple
cross-compilation policies.

This will probably change in the future.

Signed-off-by: Alessandro Di Federico <[email protected]>
Signed-off-by: Paolo Montesel <[email protected]>
Signed-off-by: Anton Johansson <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220804115548[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoconfigure: move detected gdb to TCG's config-host.mak
Alex Bennée [Thu, 29 Sep 2022 11:41:45 +0000 (12:41 +0100)]
configure: move detected gdb to TCG's config-host.mak

When tests/tcg gained it's own config-host.mak we forgot to move the
GDB detection.

Fixes: 544f4a2578 (tests/tcg: isolate from QEMU's config-host.mak)
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agotests/docker: run script use realpath instead of readlink
Lucas Mateus Castro (alqotel) [Thu, 29 Sep 2022 11:41:44 +0000 (12:41 +0100)]
tests/docker: run script use realpath instead of readlink

The alpine docker image only comes with busybox, which doesn't have the
'-e' option on its readlink, so change it to 'realpath' to avoid that
problem.

Suggested-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Lucas Mateus Castro (alqotel) <[email protected]>
Message-Id: <20220922135516[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoscripts/ci/setup: spice-server only on x86 aarch64
Lucas Mateus Castro (alqotel) [Thu, 29 Sep 2022 11:41:43 +0000 (12:41 +0100)]
scripts/ci/setup: spice-server only on x86 aarch64

Changed build-environment.yml to only install spice-server on x86_64 and
aarch64 as this package is only available on those architectures.

Signed-off-by: Lucas Mateus Castro (alqotel) <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220922135516[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoscripts/ci/setup: Fix libxen requirements
Lucas Mateus Castro (alqotel) [Thu, 29 Sep 2022 11:41:42 +0000 (12:41 +0100)]
scripts/ci/setup: Fix libxen requirements

XEN hypervisor is only available in ARM and x86, but the yaml only
checked if the architecture is different from s390x, changed it to
a more accurate test.
Tested this change on a Ubuntu 20.04 ppc64le.

Signed-off-by: Lucas Mateus Castro (alqotel) <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220922135516[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoscripts/ci/setup: ninja missing from build-environment
Lucas Mateus Castro (alqotel) [Thu, 29 Sep 2022 11:41:41 +0000 (12:41 +0100)]
scripts/ci/setup: ninja missing from build-environment

ninja-build is missing from the RHEL environment, so a system prepared
with that script would still fail to compile QEMU.
Tested on a Fedora 36

Signed-off-by: Lucas Mateus Castro (alqotel) <[email protected]>
Message-Id: <20220922135516[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20220929114231[email protected]>

2 years agoMerge tag 'pull-hex-20221003' of https://github.com/quic/qemu into staging
Stefan Hajnoczi [Wed, 5 Oct 2022 14:17:32 +0000 (10:17 -0400)]
Merge tag 'pull-hex-20221003' of https://github.com/quic/qemu into staging

Make store handling faster and more robust
Bug fix in gen_tcg_funcs.py

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEENjXHiM5iuR/UxZq0ewJE+xLeRCIFAmM7JS4ACgkQewJE+xLe
# RCJXxQf9ESfI6LVoB1VBsMs69WOHqhy1HUEVzM4Ku+CgDCNaFRRz7xFoy/sv4FOX
# D7h5aYVuCLrX/KfttV6V+1GXX/XIyjMN81uZZ8/eiCvjt7D/9fkrUxp9E1Gh6KlV
# Dci21OYjh4aStd4tXin0vPHN5wG+IuuYuSzj0Xvu8SzRjFYKsFkjfxPrVsm1zWvN
# G1FfiUJ6AveRf9SJVuMTmLHY7jo9hg0/tpm7YpnxlIgzDVZbZDa1yDwaLEg/m6AT
# GFHli/nOEsL1c6mbYmvVnGoSupjEj0+MfNIeOUrn8D5Gd66OgvU+FVVFBJQ4ZKi6
# ZuckxBjBE3d5XKyxCVryRA3at+WLYA==
# =ron6
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 03 Oct 2022 14:08:46 EDT
# gpg:                using RSA key 3635C788CE62B91FD4C59AB47B0244FB12DE4422
# gpg: Good signature from "Taylor Simpson (Rock on) <[email protected]>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 3635 C788 CE62 B91F D4C5  9AB4 7B02 44FB 12DE 4422

* tag 'pull-hex-20221003' of https://github.com/quic/qemu:
  Hexagon (gen_tcg_funcs.py): avoid duplicated tcg code on A_CVI_NEW
  Hexagon (target/hexagon) move store size tracking to translation
  Hexagon (target/hexagon) Change decision to set pkt_has_store_s[01]
  Hexagon (target/hexagon) add instruction attributes from archlib

Signed-off-by: Stefan Hajnoczi <[email protected]>
2 years agoMerge tag 'pull-tcg-20221004' of https://gitlab.com/rth7680/qemu into staging
Stefan Hajnoczi [Wed, 5 Oct 2022 14:17:02 +0000 (10:17 -0400)]
Merge tag 'pull-tcg-20221004' of https://gitlab.com/rth7680/qemu into staging

Cache CPUClass for use in hot code paths.
Add CPUTLBEntryFull, probe_access_full, tlb_set_page_full.
Add generic support for TARGET_TB_PCREL.
tcg/ppc: Optimize 26-bit jumps using STQ for POWER 2.07
target/sh4: Fix TB_FLAG_UNALIGN

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmM8jXEdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV/oEggArAHK8FtydfQ4ZwnF
# SjXfpdP50OC0SZn3uBN93FZOrxz9UYG9t1oDHs39J/+b/u2nwJYch//EH2k+NtOW
# hc3iIgS9bWgs/UWZESkViKQccw7gpYlc21Br38WWwFNEFyecX0p+e9pJgld5rSv1
# mRGvCs5J2svH2tcXl/Sb/JWgcumOJoG7qy2aLyJGolR6UOfwcfFMzQXzq8qjpRKH
# Jh84qusE/rLbzBsdN6snJY4+dyvUo03lT5IJ4d+FQg2tUip+Qqt7pnMbsqq6qF6H
# R6fWU1JTbsh7GxXJwQJ83jLBnUsi8cy6FKrZ3jyiBq76+DIpR0PqoEe+PN/weInU
# TN0z4g==
# =RfXJ
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 04 Oct 2022 15:45:53 EDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Richard Henderson <[email protected]>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* tag 'pull-tcg-20221004' of https://gitlab.com/rth7680/qemu:
  target/sh4: Fix TB_FLAG_UNALIGN
  tcg/ppc: Optimize 26-bit jumps
  accel/tcg: Introduce TARGET_TB_PCREL
  accel/tcg: Introduce tb_pc and log_pc
  hw/core: Add CPUClass.get_pc
  include/hw/core: Create struct CPUJumpCache
  accel/tcg: Inline tb_flush_jmp_cache
  accel/tcg: Do not align tb->page_addr[0]
  accel/tcg: Use DisasContextBase in plugin_gen_tb_start
  accel/tcg: Use bool for page_find_alloc
  accel/tcg: Remove PageDesc code_bitmap
  include/exec: Introduce TARGET_PAGE_ENTRY_EXTRA
  accel/tcg: Introduce tlb_set_page_full
  accel/tcg: Introduce probe_access_full
  accel/tcg: Suppress auto-invalidate in probe_access_internal
  accel/tcg: Drop addr member from SavedIOTLB
  accel/tcg: Rename CPUIOTLBEntry to CPUTLBEntryFull
  cputlb: used cached CPUClass in our hot-paths
  hw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs
  cpu: cache CPUClass in CPUState for hot code paths

Signed-off-by: Stefan Hajnoczi <[email protected]>
2 years agotarget/sh4: Fix TB_FLAG_UNALIGN
Richard Henderson [Mon, 29 Aug 2022 01:58:20 +0000 (18:58 -0700)]
target/sh4: Fix TB_FLAG_UNALIGN

The value previously chosen overlaps GUSA_MASK.

Rename all DELAY_SLOT_* and GUSA_* defines to emphasize
that they are included in TB_FLAGs.  Add aliases for the
FPSCR and SR bits that are included in TB_FLAGS, so that
we don't accidentally reassign those bits.

Fixes: 4da06fb3062 ("target/sh4: Implement prctl_unalign_sigbus")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/856
Reviewed-by: Yoshinori Sato <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agotcg/ppc: Optimize 26-bit jumps
Leandro Lupori [Mon, 19 Sep 2022 17:56:14 +0000 (14:56 -0300)]
tcg/ppc: Optimize 26-bit jumps

PowerPC64 processors handle direct branches better than indirect
ones, resulting in less stalled cycles and branch misses.

However, PPC's tb_target_set_jmp_target() was only using direct
branches for 16-bit jumps, while PowerPC64's unconditional branch
instructions are able to handle displacements of up to 26 bits.
To take advantage of this, now jumps whose displacements fit in
between 17 and 26 bits are also converted to direct branches.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Leandro Lupori <[email protected]>
[rth: Expanded some commentary.]
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Introduce TARGET_TB_PCREL
Richard Henderson [Fri, 12 Aug 2022 16:53:53 +0000 (09:53 -0700)]
accel/tcg: Introduce TARGET_TB_PCREL

Prepare for targets to be able to produce TBs that can
run in more than one virtual context.

Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Introduce tb_pc and log_pc
Richard Henderson [Mon, 15 Aug 2022 20:16:06 +0000 (15:16 -0500)]
accel/tcg: Introduce tb_pc and log_pc

The availability of tb->pc will shortly be conditional.
Introduce accessor functions to minimize ifdefs.

Pass around a known pc to places like tcg_gen_code,
where the caller must already have the value.

Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agohw/core: Add CPUClass.get_pc
Richard Henderson [Fri, 30 Sep 2022 17:31:21 +0000 (10:31 -0700)]
hw/core: Add CPUClass.get_pc

Populate this new method for all targets.  Always match
the result that would be given by cpu_get_tb_cpu_state,
as we will want these values to correspond in the logs.

Reviewed-by: Taylor Simpson <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Mark Cave-Ayland <[email protected]> (target/sparc)
Signed-off-by: Richard Henderson <[email protected]>
---
Cc: Eduardo Habkost <[email protected]> (supporter:Machine core)
Cc: Marcel Apfelbaum <[email protected]> (supporter:Machine core)
Cc: "Philippe Mathieu-Daudé" <[email protected]> (reviewer:Machine core)
Cc: Yanan Wang <[email protected]> (reviewer:Machine core)
Cc: Michael Rolnik <[email protected]> (maintainer:AVR TCG CPUs)
Cc: "Edgar E. Iglesias" <[email protected]> (maintainer:CRIS TCG CPUs)
Cc: Taylor Simpson <[email protected]> (supporter:Hexagon TCG CPUs)
Cc: Song Gao <[email protected]> (maintainer:LoongArch TCG CPUs)
Cc: Xiaojuan Yang <[email protected]> (maintainer:LoongArch TCG CPUs)
Cc: Laurent Vivier <[email protected]> (maintainer:M68K TCG CPUs)
Cc: Jiaxun Yang <[email protected]> (reviewer:MIPS TCG CPUs)
Cc: Aleksandar Rikalo <[email protected]> (reviewer:MIPS TCG CPUs)
Cc: Chris Wulff <[email protected]> (maintainer:NiosII TCG CPUs)
Cc: Marek Vasut <[email protected]> (maintainer:NiosII TCG CPUs)
Cc: Stafford Horne <[email protected]> (odd fixer:OpenRISC TCG CPUs)
Cc: Yoshinori Sato <[email protected]> (reviewer:RENESAS RX CPUs)
Cc: Mark Cave-Ayland <[email protected]> (maintainer:SPARC TCG CPUs)
Cc: Bastian Koppelmann <[email protected]> (maintainer:TriCore TCG CPUs)
Cc: Max Filippov <[email protected]> (maintainer:Xtensa TCG CPUs)
Cc: [email protected] (open list:ARM TCG CPUs)
Cc: [email protected] (open list:PowerPC TCG CPUs)
Cc: [email protected] (open list:RISC-V TCG CPUs)
Cc: [email protected] (open list:S390 TCG CPUs)
2 years agoinclude/hw/core: Create struct CPUJumpCache
Richard Henderson [Mon, 15 Aug 2022 20:13:05 +0000 (15:13 -0500)]
include/hw/core: Create struct CPUJumpCache

Wrap the bare TranslationBlock pointer into a structure.

Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Inline tb_flush_jmp_cache
Richard Henderson [Thu, 29 Sep 2022 17:51:21 +0000 (10:51 -0700)]
accel/tcg: Inline tb_flush_jmp_cache

This function has two users, who use it incompatibly.
In tlb_flush_page_by_mmuidx_async_0, when flushing a
single page, we need to flush exactly two pages.
In tlb_flush_range_by_mmuidx_async_0, when flushing a
range of pages, we need to flush N+1 pages.

This avoids double-flushing of jmp cache pages in a range.

Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Do not align tb->page_addr[0]
Richard Henderson [Mon, 15 Aug 2022 20:00:57 +0000 (15:00 -0500)]
accel/tcg: Do not align tb->page_addr[0]

Let tb->page_addr[0] contain the address of the first byte of the
translated block, rather than the address of the page containing the
start of the translated block.  We need to recover this value anyway
at various points, and it is easier to discard a page offset when it
is not needed, which happens naturally via the existing find_page shift.

Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoMerge tag 'trivial-branch-for-7.2-pull-request' of https://gitlab.com/laurent_vivier...
Stefan Hajnoczi [Tue, 4 Oct 2022 18:04:18 +0000 (14:04 -0400)]
Merge tag 'trivial-branch-for-7.2-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging

Pull request trivial patches branch 20220930-v2

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmM7XoISHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L748D/0QAKbYtTWjhFPeapjZVoTv13YrTvczWrcF
# omL6IZivVq0t7hun4iem0DwmvXJELMGexEOTvEJOzM19IIlvvwvOsI8xnxpcMnEY
# 6GKVbs53Ba0bg2yh7Dll2W9jkou9eX27DwUHMVF8KX7qqsbU+WyD/vdGZitgGt+T
# 8yna7kzVvNVsdB3+DbIatI5RzzHeu4OqeuH/WCtAyzCaLB64UYTcHprskxIp4+wp
# dR+EUSoDEr9Qx4PC+uVEsTFK1zZjyAYNoNIkh6fhlkRvDJ1uA75m3EJ57P8xPPqe
# VbVkPMKi0d4c52m6XvLsQhyYryLx/qLLUAkJWVpY66aHcapYbZAEAfZmNGTQLrOJ
# qIOJzIkOdU6l3pRgXVdVCgkHRc2HETwET2LyVbNkUz/vBlW2wOZQbZFbezComael
# bQ/gNBYqP+eOGnZzeWbKBGHr/9QDBClNufidIMC+sOiUw0iSifzjkFwvH7IElx6K
# EQCOSV6pOhKVlinTpmBbk1XD3xDkQ7ZidiLT9g+P1c8dExrXBhWOnfUHueISb8+s
# KKMozuxQ/6/3c/DP5hwI9cKPEWEbqJfq1kMuxIvEivKGwUIqX2yq4VJ+hSlYJ+CW
# nGjXZldtf4KwH+cTsxyPmdZRR5Q7+ODr5Xo7GNvEKBuDsHs7uUl1c3vvOykQgje9
# +dyJR6TfbQWn
# =aK29
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 03 Oct 2022 18:13:22 EDT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <[email protected]>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* tag 'trivial-branch-for-7.2-pull-request' of https://gitlab.com/laurent_vivier/qemu:
  docs: Update TPM documentation for usage of a TPM 2
  Use g_new() & friends where that makes obvious sense
  Drop superfluous conditionals around g_free()
  block/qcow2-bitmap: Add missing cast to silent GCC error
  checkpatch: ignore target/hexagon/imported/* files
  mem/cxl_type3: fix GPF DVSEC
  .gitignore: add .cache/ to .gitignore
  hw/virtio/vhost-shadow-virtqueue: Silence GCC error "maybe-uninitialized"

Signed-off-by: Stefan Hajnoczi <[email protected]>
2 years agoMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Stefan Hajnoczi [Tue, 4 Oct 2022 18:03:21 +0000 (14:03 -0400)]
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* x86: re-enable rng seeding via SetupData
* x86: reinitialize RNG seed on system reboot and after kernel load
* qboot: rebuild based on latest commit
* watchdog: remove -watchdog option
* update Meson to 0.61.5, move more configure tests

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmM4kiAUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroNfbgf+IHhIHVxtBVWqayVRkwpQC+oAFV/V
# 4bvJI90rHmTNPA36n1ocUmQmXyNVTQFW/t7mlln5BhOwNzxnQycVe2idfMa6ntkb
# hHpe2NbICF9Crzb9BkK4wnaBLwEWA/X3WlnCqPYtxlxEhjmxu+HPtF7vm12OTkOV
# JevH3EN1gMiAfMo+gcRBlrwb5kntLm3nGZTCd218Ope22PoU6MVvxb9ivieJG8kD
# xDUGPQNU0mB9pypwLYZAqmu34xJ8Stly9UuJ1M2iQoawIs7W2Qy7svpOrsKZ3W/7
# D7J18QLAjI7Hq6rUWPgK5ugnUvVMdaTXM7MZSuIDIxRJuj5YryIsHRPybQ==
# =HEmX
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat 01 Oct 2022 15:16:48 EDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Paolo Bonzini <[email protected]>" [full]
# gpg:                 aka "Paolo Bonzini <[email protected]>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
  x86: re-initialize RNG seed when selecting kernel
  target/i386/kvm: fix kvmclock_current_nsec: Assertion `time.tsc_timestamp <= migration_tsc' failed
  configure, meson: move linker flag detection to meson
  configure, meson: move C++ compiler detection to meson.build
  meson: multiple names can be passed to dependency()
  meson: require 0.61.3
  meson: -display dbus and CFI are incompatible
  ui: fix path to dbus-display1.h
  watchdog: remove -watchdog option
  configure: do not invoke as/ld directly for pc-bios/optionrom
  qboot: rebuild based on latest commit
  x86: re-enable rng seeding via SetupData
  x86: reinitialize RNG seed on system reboot
  x86: use typedef for SetupData struct
  x86: return modified setup_data only if read as memory, not as file

Signed-off-by: Stefan Hajnoczi <[email protected]>
2 years agoaccel/tcg: Use DisasContextBase in plugin_gen_tb_start
Richard Henderson [Fri, 12 Aug 2022 16:15:15 +0000 (09:15 -0700)]
accel/tcg: Use DisasContextBase in plugin_gen_tb_start

Use the pc coming from db->pc_first rather than the TB.

Use the cached host_addr rather than re-computing for the
first page.  We still need a separate lookup for the second
page because it won't be computed for DisasContextBase until
the translator actually performs a read from the page.

Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Use bool for page_find_alloc
Richard Henderson [Wed, 10 Aug 2022 22:27:46 +0000 (15:27 -0700)]
accel/tcg: Use bool for page_find_alloc

Bool is more appropriate type for the alloc parameter.

Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Remove PageDesc code_bitmap
Richard Henderson [Mon, 22 Aug 2022 23:23:22 +0000 (16:23 -0700)]
accel/tcg: Remove PageDesc code_bitmap

This bitmap is created and discarded immediately.
We gain nothing by its existence.

Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <20220822232338.1727934[email protected]>

2 years agoinclude/exec: Introduce TARGET_PAGE_ENTRY_EXTRA
Richard Henderson [Sat, 20 Aug 2022 00:02:36 +0000 (17:02 -0700)]
include/exec: Introduce TARGET_PAGE_ENTRY_EXTRA

Allow the target to cache items from the guest page tables.

Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Introduce tlb_set_page_full
Richard Henderson [Fri, 19 Aug 2022 23:33:23 +0000 (16:33 -0700)]
accel/tcg: Introduce tlb_set_page_full

Now that we have collected all of the page data into
CPUTLBEntryFull, provide an interface to record that
all in one go, instead of using 4 arguments.  This interface
allows CPUTLBEntryFull to be extended without having to
change the number of arguments.

Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Introduce probe_access_full
Richard Henderson [Fri, 19 Aug 2022 22:49:41 +0000 (15:49 -0700)]
accel/tcg: Introduce probe_access_full

Add an interface to return the CPUTLBEntryFull struct
that goes with the lookup.  The result is not intended
to be valid across multiple lookups, so the user must
use the results immediately.

Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Suppress auto-invalidate in probe_access_internal
Richard Henderson [Fri, 19 Aug 2022 22:28:05 +0000 (15:28 -0700)]
accel/tcg: Suppress auto-invalidate in probe_access_internal

When PAGE_WRITE_INV is set when calling tlb_set_page,
we immediately set TLB_INVALID_MASK in order to force
tlb_fill to be called on the next lookup.  Here in
probe_access_internal, we have just called tlb_fill
and eliminated true misses, thus the lookup must be valid.

This allows us to remove a warning comment from s390x.
There doesn't seem to be a reason to change the code though.

Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Drop addr member from SavedIOTLB
Richard Henderson [Fri, 19 Aug 2022 21:24:34 +0000 (14:24 -0700)]
accel/tcg: Drop addr member from SavedIOTLB

This field is only written, not read; remove it.

Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agoaccel/tcg: Rename CPUIOTLBEntry to CPUTLBEntryFull
Richard Henderson [Fri, 19 Aug 2022 21:20:37 +0000 (14:20 -0700)]
accel/tcg: Rename CPUIOTLBEntry to CPUTLBEntryFull

This structure will shortly contain more than just
data for accessing MMIO.  Rename the 'addr' member
to 'xlat_section' to more clearly indicate its purpose.

Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agocputlb: used cached CPUClass in our hot-paths
Alex Bennée [Fri, 23 Sep 2022 08:48:01 +0000 (10:48 +0200)]
cputlb: used cached CPUClass in our hot-paths

Before: 35.912 s ±  0.168 s
  After: 35.565 s ±  0.087 s

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20220811151413.3350684[email protected]>
Signed-off-by: Cédric Le Goater <[email protected]>
Message-Id: <20220923084803[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agohw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs
Alex Bennée [Fri, 23 Sep 2022 08:48:00 +0000 (10:48 +0200)]
hw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs

This is a heavily used function so lets avoid the cost of
CPU_GET_CLASS. On the romulus-bmc run it has a modest effect:

  Before: 36.812 s ±  0.506 s
  After:  35.912 s ±  0.168 s

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20220811151413.3350684[email protected]>
Signed-off-by: Cédric Le Goater <[email protected]>
Message-Id: <20220923084803[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agocpu: cache CPUClass in CPUState for hot code paths
Alex Bennée [Fri, 23 Sep 2022 08:47:59 +0000 (10:47 +0200)]
cpu: cache CPUClass in CPUState for hot code paths

The class cast checkers are quite expensive and always on (unlike the
dynamic case who's checks are gated by CONFIG_QOM_CAST_DEBUG). To
avoid the overhead of repeatedly checking something which should never
change we cache the CPUClass reference for use in the hot code paths.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20220811151413.3350684[email protected]>
Signed-off-by: Cédric Le Goater <[email protected]>
Message-Id: <20220923084803[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
2 years agodocs: Update TPM documentation for usage of a TPM 2
Stefan Berger [Tue, 27 Sep 2022 12:21:46 +0000 (08:21 -0400)]
docs: Update TPM documentation for usage of a TPM 2

Update the TPM documentation for usage of a TPM 2 rather than a TPM 1.2.
Adjust the command lines and expected outputs inside the VM accordingly.
Update the command line to start a TPM 2 with swtpm.

Signed-off-by: Stefan Berger <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-Id: <20220927122146.2787854[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
2 years agoUse g_new() & friends where that makes obvious sense
Markus Armbruster [Fri, 23 Sep 2022 08:42:54 +0000 (10:42 +0200)]
Use g_new() & friends where that makes obvious sense

g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
for two reasons.  One, it catches multiplication overflowing size_t.
Two, it returns T * rather than void *, which lets the compiler catch
more type errors.

This commit only touches allocations with size arguments of the form
sizeof(T).

Patch created mechanically with:

    $ spatch --in-place --sp-file scripts/coccinelle/use-g_new-etc.cocci \
     --macro-file scripts/cocci-macro-file.h FILES...

The previous iteration was commit a95942b50c.

Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Message-Id: <20220923084254.4173111[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
2 years agoDrop superfluous conditionals around g_free()
Markus Armbruster [Fri, 23 Sep 2022 09:04:28 +0000 (11:04 +0200)]
Drop superfluous conditionals around g_free()

There is no need to guard g_free(P) with if (P): g_free(NULL) is safe.

Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20220923090428[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
2 years agoblock/qcow2-bitmap: Add missing cast to silent GCC error
Philippe Mathieu-Daudé [Mon, 19 Sep 2022 18:27:55 +0000 (20:27 +0200)]
block/qcow2-bitmap: Add missing cast to silent GCC error

Commit d1258dd0c8 ("qcow2: autoloading dirty bitmaps") added the
set_readonly_helper() GFunc handler, correctly casting the gpointer
user_data in both the g_slist_foreach() caller and the handler.
Few commits later (commit 1b6b0562db), the handler is reused in
qcow2_reopen_bitmaps_rw() but missing the gpointer cast, resulting
in the following error when using Homebrew GCC 12.2.0:

  [2/658] Compiling C object libblock.fa.p/block_qcow2-bitmap.c.o
  ../../block/qcow2-bitmap.c: In function 'qcow2_reopen_bitmaps_rw':
  ../../block/qcow2-bitmap.c:1211:60: error: incompatible type for argument 3 of 'g_slist_foreach'
   1211 |     g_slist_foreach(ro_dirty_bitmaps, set_readonly_helper, false);
        |                                                            ^~~~~
        |                                                            |
        |                                                            _Bool
  In file included from /opt/homebrew/Cellar/glib/2.72.3_1/include/glib-2.0/glib/gmain.h:26,
                   from /opt/homebrew/Cellar/glib/2.72.3_1/include/glib-2.0/glib/giochannel.h:33,
                   from /opt/homebrew/Cellar/glib/2.72.3_1/include/glib-2.0/glib.h:54,
                   from /Users/philmd/source/qemu/include/glib-compat.h:32,
                   from /Users/philmd/source/qemu/include/qemu/osdep.h:144,
                   from ../../block/qcow2-bitmap.c:28:
  /opt/homebrew/Cellar/glib/2.72.3_1/include/glib-2.0/glib/gslist.h:127:61: note: expected 'gpointer' {aka 'void *'} but argument is of type '_Bool'
    127 |                                           gpointer          user_data);
        |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~
  At top level:
  FAILED: libblock.fa.p/block_qcow2-bitmap.c.o

Fix by adding the missing gpointer cast.

Fixes: 1b6b0562db ("qcow2: support .bdrv_reopen_bitmaps_rw")
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20220919182755[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
2 years agoMerge tag 'for-upstream' of git://repo.or.cz/qemu/kevin into staging
Stefan Hajnoczi [Mon, 3 Oct 2022 19:06:07 +0000 (15:06 -0400)]
Merge tag 'for-upstream' of git://repo.or.cz/qemu/kevin into staging

Block layer patches

- Fix missing block_acct_setup() with -blockdev
- Keep auto_backing_file post-migration
- file-posix: Fixed O_DIRECT memory alignment
- ide: Fix state after EXECUTE DEVICE DIAGNOSTIC and implement
  INITIALIZE DEVICE PARAMETERS
- qemu-img: Wean documentation and help output off '?' for help
- qcow2: fix memory leak and compiler warning
- Code cleanups

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmM3Hm4RHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9ZhqA//WGN9tlx3Pf1D6SG3PtIG6/2DOJ6/gVNw
# R17BwoGTw36Nmt9xDzrHih753dcguLS19Kd6EySTg6j8mPogmFszquORMgGmcYcW
# 0KtneRR7Y9XsamIGgentek1zsWajsP5muvZQF+hFJyZ24MZtWB+5Ucw2VuUTWnRl
# YaKP/tGMP5sC8nK3Npste/o7yh9Wgv4cv/mdKuyKoxjZhELeTTpHoTC2IZK9bV5I
# Bh19zjPRUPodm37nzONruUVzn53xKK3Qn26ZT5Hgx39HOdccPEu9N8wawQyqLr/x
# 2whcn8kFfpFBLLxVbMYjwcWNo41SCn1itRcgV38PilBvG2UInUFK2QCmVgYxWluB
# 9I5sRasfD3/BPPmw3n+j2TRJ+uvrLkkwXqIhAg+mAeiS0MccWUnLhJLW2S1Yai5L
# nkjkLmuV7KCLQTY39WvKBq0TPgj3QR0WJtEYHuUDtduvzKxAWd47Ff1tEPvFm5Ys
# RpmLSUQdPZiOkiwnV1qVg6a3gbIjUcT0Pai/Knc3iYrwCWLdNSCGoPkVemOg5wvN
# GxsQcKnfayQqIdZU6lBQehUjPamm3ffAEELeqLQXCbZe9lsbhNBXLJjVnA3cOu3f
# 1PX6w+4MNeTg5ZekUJGS1fnYlq9CDOWGSv37+csB8dBhi6vQTc6YjABWU1IrB0S5
# 1ihOYtc8fOo=
# =IIJz
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 30 Sep 2022 12:50:54 EDT
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Kevin Wolf <[email protected]>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* tag 'for-upstream' of git://repo.or.cz/qemu/kevin:
  hw/ide/core.c: Implement ATA INITIALIZE_DEVICE_PARAMETERS command
  tests/qtest/ide-test: Verify that DIAGNOSTIC clears DEV to zero
  hw/ide/core: Clear LBA and drive bits for EXECUTE DEVICE DIAGNOSTIC
  tests/qtest/ide-test.c: Create disk image for use as a secondary
  piix_ide_reset: Use pci_set_* functions instead of direct access
  block: use the request length for iov alignment
  block: move bdrv_qiov_is_aligned to file-posix
  iotests/backing-file-invalidation: Add new test
  block/qed: Keep auto_backing_file if possible
  block/qcow2: Keep auto_backing_file if possible
  gluster: stop using .bdrv_needs_filename
  block: make serializing requests functions 'void'
  block: use bdrv_is_sg() helper instead of raw bs->sg reading
  block: add missed block_acct_setup with new block device init procedure
  block: pass OnOffAuto instead of bool to block_acct_setup()
  qemu-img: Wean documentation and help output off '?' for help
  block/qcow2-bitmap: Add missing cast to silent GCC error
  qcow2: fix memory leak in qcow2_read_extensions

Signed-off-by: Stefan Hajnoczi <[email protected]>
2 years agoMerge tag 'pull-target-arm-20220930' of https://git.linaro.org/people/pmaydell/qemu...
Stefan Hajnoczi [Mon, 3 Oct 2022 19:00:36 +0000 (15:00 -0400)]
Merge tag 'pull-target-arm-20220930' of https://git.linaro.org/people/pmaydell/qemu-arm into staging

target-arm queue:
 * Fix breakage of icount mode when guest touches MDCR_EL3, MDCR_EL2,
   PMCNTENSET_EL0 or PMCNTENCLR_EL0
 * Make writes to MDCR_EL3 use PMU start/finish calls
 * Let AArch32 write to SDCR.SCCD
 * Rearrange cpu64.c so all the CPU initfns are together
 * hw/arm/xlnx-zynqmp: Connect ZynqMP's USB controllers
 * hw/arm/virt: fix some minor issues with generated device tree
 * Fix regression where EL3 could not write to SP_EL1 if there is no EL2

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmM28EYZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3mw9D/44e72KHZdfr3F/Cmd0Jku2
# g5NQ4ooKV90rY4Y4+/VR9Z2k7a72lWFgFl7/54AKXSZsZSmNomeh2WxWJAs1lA2W
# 4rmGPlLwxZYMQumYcMOArYxJQgRK5exVtE6ECKM/JERjhKSbnL1lyLWGUyLtFJfq
# SjxoTWEigPHu+0fX/nk04rFzrA6Bo1qKQqZZTuN9zcT6JXyQMjZNF89Fxy9OlV4s
# dlOXsZILV8oREnGdDFPYLgwSTMn+1rrD8xfjK/DTQrlUVX/9zhlIeKg5O4JadxCy
# 8ThIFCyODUanlRvyjHiwvcvStHn8wwyCp4uJrxmZGyyp4t4u3etG0hpsZaPtiN9O
# NKtad4Aoc6lSmIDhYYZA1LIIdSIeyUPD/LyWTd+qKK7A7mxH6ORr0uyjhb01jWs3
# ceyne1i0n66oRLbHxPyjQEkLqwLl2CsqWr41BNM5RVoYjCU8HYSvEwlh7t+EZCL5
# IRkfAWJkA9bdXL30ZmYSzJ7hfvVkWhDsHD+eOzAcsxoApgzI5Mfi7gCIZ+LNY20P
# W0akGbA6l0InsmIcBpyXEztPOi6tOD/J55qeOCrzHjgfhoJWCoa/mS8bVqN0mKIA
# yJ7QbiK/JY6+G1v2oM8aARLn8/C7oLnMYiKntXNBMj67Ry5GwjDt+A37MUHgQbZb
# yUzUjr3O2N1qJRKi+Dd7eA==
# =edYy
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 30 Sep 2022 09:33:58 EDT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Peter Maydell <[email protected]>" [full]
# gpg:                 aka "Peter Maydell <[email protected]>" [full]
# gpg:                 aka "Peter Maydell <[email protected]>" [full]
# gpg:                 aka "Peter Maydell <[email protected]>" [unknown]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* tag 'pull-target-arm-20220930' of https://git.linaro.org/people/pmaydell/qemu-arm:
  target/arm: mark SP_EL1 with ARM_CP_EL3_NO_EL2_KEEP
  hw/arm/virt: Fix devicetree warning about the SMMU node
  hw/arm/virt: Use "msi-map" devicetree property for PCI
  hw/arm/virt: Fix devicetree warning about the GIC node
  hw/arm/virt: Fix devicetree warning about the root node
  hw/arm/xlnx-zynqmp: Connect ZynqMP's USB controllers
  target/arm: Rearrange cpu64.c so all the CPU initfns are together
  target/arm: Update SDCR_VALID_MASK to include SCCD
  target/arm: Make writes to MDCR_EL3 use PMU start/finish calls
  target/arm: Mark registers which call pmu_op_start() as ARM_CP_IO

Signed-off-by: Stefan Hajnoczi <[email protected]>
2 years agoHexagon (gen_tcg_funcs.py): avoid duplicated tcg code on A_CVI_NEW
Matheus Tavares Bernardino [Fri, 30 Sep 2022 20:08:23 +0000 (17:08 -0300)]
Hexagon (gen_tcg_funcs.py): avoid duplicated tcg code on A_CVI_NEW

Hexagon instructions with the A_CVI_NEW attribute produce a vector value
that can be used in the same packet. The python function responsible for
generating code for such instructions has a typo ("if" instead of
"elif"), which makes genptr_dst_write_ext() be executed twice, thus also
generating the same tcg code twice. Fortunately, this doesn't cause any
problems for correctness, but it is less efficient than it could be. Fix
it by using an "elif" and avoiding the unnecessary extra code gen.

Signed-off-by: Matheus Tavares Bernardino <[email protected]>
Signed-off-by: Taylor Simpson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Taylor Simpson <[email protected]>
Message-Id: <fa706b192b2a3a0ffbd399fa8dbf0d5b2c5b82d9.1664568492[email protected]>

This page took 0.093655 seconds and 4 git commands to generate.