Commit Graph

83843 Commits

Author SHA1 Message Date
Keith Packard 095f8c0293 semihosting: Support SYS_HEAPINFO when env->boot_info is not set
env->boot_info is only set in some ARM startup paths, so we cannot
rely on it to support the SYS_HEAPINFO semihosting function. When not
available, fallback to finding a RAM memory region containing the
current stack and use the base of that.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210107170717.2098982-5-keithp@keithp.com>
Message-Id: <20210108224256.2321-16-alex.bennee@linaro.org>
2021-01-18 10:05:06 +00:00
Keith Packard 3c37cfe0b1 semihosting: Change internal common-semi interfaces to use CPUState *
This makes all of the internal interfaces architecture-independent and
renames the internal functions to use the 'common_semi' prefix instead
of 'arm' or 'arm_semi'.

To do this, some new architecture-specific internal helper functions
were created:

    static inline target_ulong
    common_semi_arg(CPUState *cs, int argno)

	Returns the argno'th semihosting argument, where argno can be
	either 0 or 1.

    static inline void
    common_semi_set_ret(CPUState *cs, target_ulong ret)

	Sets the semihosting return value.

    static inline bool
    common_semi_sys_exit_extended(CPUState *cs, int nr)

	This detects whether the specified semihosting call, which
	is either TARGET_SYS_EXIT or TARGET_SYS_EXIT_EXTENDED should
	be executed using the TARGET_SYS_EXIT_EXTENDED semantics.

    static inline target_ulong
    common_semi_rambase(CPUState *cs)

	Returns the base of RAM region used for heap and stack. This
	is used to construct plausible values for the SYS_HEAPINFO
	call.

In addition, several existing functions have been changed to flag
areas of code which are architecture specific:

    static target_ulong
    common_semi_flen_buf(CPUState *cs)

	Returns the current stack pointer minus 64, which is
	where a stat structure will be placed on the stack

    #define GET_ARG(n)

	This fetches arguments from the semihosting command's argument
	block. The address of this is available implicitly through the
	local 'args' variable. This is *mostly* architecture
	independent, but does depend on the current ABI's notion of
	the size of a 'long' parameter, which may need run-time checks
	(as it does on AARCH64)

    #define SET_ARG(n, val)

	This mirrors GET_ARG and stores data back into the argument
	block.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20210107170717.2098982-4-keithp@keithp.com>
Message-Id: <20210108224256.2321-15-alex.bennee@linaro.org>
2021-01-18 10:05:06 +00:00
Keith Packard 0bb446d8b0 semihosting: Change common-semi API to be architecture-independent
The public API is now defined in
hw/semihosting/common-semi.h. do_common_semihosting takes CPUState *
instead of CPUARMState *. All internal functions have been renamed
common_semi_ instead of arm_semi_ or arm_. Aside from the API change,
there are no functional changes in this patch.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20210107170717.2098982-3-keithp@keithp.com>
Message-Id: <20210108224256.2321-14-alex.bennee@linaro.org>
2021-01-18 10:05:06 +00:00
Keith Packard 56b5170c87 semihosting: Move ARM semihosting code to shared directories
This commit renames two files which provide ARM semihosting support so
that they can be shared by other architectures:

 1. target/arm/arm-semi.c     -> hw/semihosting/common-semi.c
 2. linux-user/arm/semihost.c -> linux-user/semihost.c

The build system was modified use a new config variable,
CONFIG_ARM_COMPATIBLE_SEMIHOSTING, which has been added to the ARM
softmmu and linux-user default configs. The contents of the source
files has not been changed in this patch.

Signed-off-by: Keith Packard <keithp@keithp.com>
[AJB: rename arm-compat-semi, select SEMIHOSTING]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210107170717.2098982-2-keithp@keithp.com>
Message-Id: <20210108224256.2321-13-alex.bennee@linaro.org>
2021-01-18 10:05:06 +00:00
Alex Bennée 797920b952 target/arm: use official org.gnu.gdb.aarch64.sve layout for registers
While GDB can work with any XML description given to it there is
special handling for SVE registers on the GDB side which makes the
users life a little better. The changes aren't that major and all the
registers save the $vg reported the same. All that changes is:

  - report org.gnu.gdb.aarch64.sve
  - use gdb nomenclature for names and types
  - minor re-ordering of the types to match reference
  - re-enable ieee_half (as we know gdb supports it now)
  - $vg is now a 64 bit int
  - check $vN and $zN aliasing in test

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Luis Machado <luis.machado@linaro.org>
Message-Id: <20210108224256.2321-11-alex.bennee@linaro.org>
2021-01-18 10:05:06 +00:00
Alex Bennée b9e10c6c75 gdbstub: ensure we clean-up when terminated
If you kill the inferior from GDB we end up leaving our socket lying
around. Fix this by calling gdb_exit() first.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210108224256.2321-10-alex.bennee@linaro.org>
2021-01-18 10:05:06 +00:00
Alex Bennée 5ef0317f58 gdbstub: drop gdbserver_cleanup in favour of gdb_exit
Despite it's name it didn't actually clean-up so let us document
gdb_exit() better and use that.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210108224256.2321-9-alex.bennee@linaro.org>
2021-01-18 10:05:06 +00:00
Alex Bennée ad9dcb207b gdbstub: drop CPUEnv from gdb_exit()
gdb_exit() has never needed anything from env and I doubt we are going
to start now.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210108224256.2321-8-alex.bennee@linaro.org>
2021-01-18 10:05:06 +00:00
Lirong Yuan 51c623b0de gdbstub: add support to Xfer:auxv:read: packet
This allows gdb to access the target’s auxiliary vector,
which can be helpful for telling system libraries important details
about the hardware, operating system, and process.

Signed-off-by: Lirong Yuan <yuanzi@google.com>
[AJB: minor tweaks to test case, update MAINTAINERS, restrict to Linux]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200730193932.3654677-1-yuanzi@google.com>
Message-Id: <20210108224256.2321-7-alex.bennee@linaro.org>
2021-01-18 10:04:48 +00:00
Alex Bennée c00506aa26 gdbstub: implement a softmmu based test
This adds a new tests that allows us to test softmmu only features
including watchpoints. To do achieve this we need to:

  - add _exit: labels to the boot codes
  - write a memory.py test case
  - plumb the test case into the build system
  - tweak the run_test script to:
    - re-direct output when asked
    - use socket based connection for all tests
    - add a small pause before connection

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210108224256.2321-6-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée 9559150e86 Revert "tests/tcg/multiarch/Makefile.target: Disable run-gdbstub-sha1 test"
We won't attempt to run the test now it's gated on a newer version of
gdb.

This reverts commit a930cadd83.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210108224256.2321-5-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée b1863ccc95 configure: gate our use of GDB to 8.3.1 or above
The support of socket based debugging which we need for linux-user
testing is only really stable as of 8.3.1 so lets gate our use of GDB
on having a relatively modern version.

For direct testing you can just point to a locally compiled version of
gdb via configure, e.g.:

  ../../configure --gdb=$HOME/src/binutils-gdb.git/builds/all/install/bin/gdb

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210108224256.2321-4-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée 5662ab11f6 test/guest-debug: echo QEMU command as well
This helps with debugging.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210108224256.2321-3-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée 9e5acb373d scripts/checkpatch.pl: fix git-show invocation to include diffstat
Without this checkpatch keeps complaining about new/changed files even
when MAINTAINERS has been updated. Normal invocations of checkpatch on
patch files rather than commit IDs are unaffected.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114165730.31607-13-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée 22250a6ecd gitlab: migrate the minimal tools and unit tests from Travis
These tests are good at shaking out missing stubs which otherwise work
if we have built targets. Rather than create a new job just add the
checks to the existing tools-and-docs build.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114165730.31607-12-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Lukas Straub 228e3ec4e2 Fix build with new yank feature by adding stubs
Fixes: 50186051f4 ("Introduce yank feature")
Signed-off-by: Lukas Straub <lukasstraub2@web.de>
[AJB: tweak MAINTAINERS]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114141918.5201cc9c@gecko.fritz.box>
Message-Id: <20210114165730.31607-11-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée a8a3abe0b3 gitlab: move docs and tools build across from Travis
While we are at it we might as well check the tag generation. For
bonus points we run GNU globals htags into the public pages directory
for publishing with the auto generated pages.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210114165730.31607-10-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée ec9d7c38ec docker: expand debian-amd64 image to include tag tools
This is going to be helpful when we want to both test the tool
integration and in the case of global generate a xref doc build.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114165730.31607-9-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée 3e6c147535 Makefile: wrap cscope in quiet-command calls
For prettier output.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114165730.31607-8-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée af5d5762f3 Makefile: wrap etags in quiet-command calls
For prettier output.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114165730.31607-7-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée f2c78150c3 Makefile: wrap ctags in quiet-command calls
For prettier output.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114165730.31607-6-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alessandro Di Federico e405a3ebf5 Add newline when generating Dockerfile
Signed-off-by: Alessandro Di Federico <ale@rev.ng>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <1610080146-14968-36-git-send-email-tsimpson@quicinc.com>
Message-Id: <20210114165730.31607-5-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Philippe Mathieu-Daudé 977cb99a15 shippable.yml: Remove jobs duplicated on Gitlab-CI
The following jobs are duplicated on Gitlab-CI since commit
6bcb5fc0f7 ("gitlab-ci: Add cross-compiling build tests"):

- IMAGE=debian-armel-cross

  TARGET_LIST=arm-softmmu               -> cross-armel-system
  TARGET_LIST=arm-linux-user            -> cross-armel-user
  TARGET_LIST=armeb-linux-user          -> cross-armel-user

- IMAGE=debian-armhf-cross

  TARGET_LIST=arm-softmmu               -> cross-armhf-system
  TARGET_LIST=arm-linux-user            -> cross-armhf-user
  TARGET_LIST=armeb-linux-user          -> cross-armhf-user

- IMAGE=debian-arm64-cross

  TARGET_LIST=aarch64-softmmu           -> cross-arm64-system
  TARGET_LIST=aarch64-linux-user        -> cross-arm64-user

- IMAGE=debian-s390x-cross

  TARGET_LIST=s390x-softmmu             -> cross-s390x-system
  TARGET_LIST=s390x-linux-user          -> cross-s390x-user

- IMAGE=debian-mips-cross

  TARGET_LIST=mipsel-linux-user         -> cross-mips-user

- IMAGE=debian-mips64el-cross

  TARGET_LIST=mips64el-softmmu          -> cross-mips64el-system
  TARGET_LIST=mips64el-linux-user       -> cross-mips64el-user

- IMAGE=debian-ppc64el-cross

  TARGET_LIST=ppc64-softmmu             -> cross-ppc64el-system
  TARGET_LIST=ppc64-linux-user          -> cross-ppc64el-user
  TARGET_LIST=ppc64abi32-linux-user     -> cross-ppc64el-user

Remove them from Shippable CI.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210108145103.269353-1-f4bug@amsat.org>
Message-Id: <20210114165730.31607-4-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Alex Bennée b8a322549b Makefile: add GNU global tags support
GNU Global is another tags engine which is more like cscope in being
able to support finding both references and definitions. You will be
un-surprised to know it also integrates well with Emacs.

The main benefit of integrating it into find-src-path is it takes less
time to rebuild the database from scratch when you have a lot of build
directories under your source tree.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210114165730.31607-3-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Philippe Mathieu-Daudé 8714e811a5 tests/docker: Remove Debian 9 remnant lines
Debian 9 base container has been removed in commits
e3755276d1 and c9d78b06c0. Remove the last remnants.

Fixes: e3755276d1 ("tests/docker: Remove old Debian 9 containers")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20210107072933.3828450-1-f4bug@amsat.org>
Message-Id: <20210114165730.31607-2-alex.bennee@linaro.org>
2021-01-18 10:04:31 +00:00
Peter Maydell 825a215c00 audio: improvements for sdl, pulse, fsound.
audio: cleanups & codestyle fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmABlrgACgkQTLbY7tPo
 cTiMOhAAxRVnh7jyf/A9i5lDkQ6QG26zdbFK/zmbicSWYXeRRu4hbxC0zEUQki88
 4YCMr/dmuG0Tkhyjwo4Zoaq56sE3EqQqzjPOT14zSfojHrLBTNLxWRzsWMaPdTeY
 jvwu/2C8tqibPWX/cyimoc05PIFL+CS2lasoqDXjmA5pP1KDBwFX9wQxu5cRF5f3
 203Pc2cDSgTnyDE38MM8+S3ocZDqmrnxmpF81q/ivv1vPx3gwWyHCguOHaOh1Dnx
 0SsQm4xn7p5bzOZ81+aZyL+sbBJIc/KsPx5K+984+mUZsOjN3rbq8bhHThMB1Cfk
 iWAt7+nUuaj9jcXKbwkusURVSjAVqXN7yQEi2fPZ1woAOlMq7mxEvn3UQgvUA1r6
 PyIVQtdrna8Td4PUih8x3Ooa6tIRe1oDYSuQkhrKnlX0lYY+r1nLveDrmCFyNyLz
 5Re56t0AcScEiTbOFSnjaxbcLa0d/zfOalilEt2+xjPAy0QPGxxRPd0fI1NW96gG
 JClUP8VTCPKkKY7qCqKvqTPzoAqeiG6FJ+Qv2YghnWuql3z19pumHh5eYKsZndOx
 1v1vJxzay4UgLAbp+p4fxytkQ8/de9hotnZAkVooEK1nF1YEAWCLK08mva4HGR4m
 oTXLBz18slX8ugfZ8Eg1viHzXdkUTWcpEoGUq4ryjS7bzSvO/oI=
 =hwBn
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/audio-20210115-pull-request' into staging

audio: improvements for sdl, pulse, fsound.
audio: cleanups & codestyle fixes.

# gpg: Signature made Fri 15 Jan 2021 13:20:56 GMT
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20210115-pull-request: (30 commits)
  audio: space prohibited between function name and parenthesis'('
  audio: Suspect code indent for conditional statements
  audio: Don't use '%#' in format strings
  audio: Fix lines over 90 characters
  audio: foo* bar" should be "foo *bar".
  audio: Add spaces around operator/delete redundant spaces
  audio: Add braces for statements/fix braces' position
  dsoundaudio: fix log message
  dsoundaudio: enable f32 audio sample format
  dsoundaudio: rename dsound_open()
  dsoundaudio: replace GetForegroundWindow()
  paaudio: send recorded data in smaller chunks
  paaudio: limit minreq to 75% of audio timer_rate
  paaudio: comment bugs in functions qpa_init_*
  paaudio: remove unneeded code
  paaudio: wait until the playback stream is ready
  paaudio: wait for PA_STREAM_READY in qpa_write()
  paaudio: avoid to clip samples multiple times
  audio: remove remaining unused plive code
  sdlaudio: enable (in|out).mixing-engine=off
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-01-15 22:21:21 +00:00
Peter Maydell 7cb6b97300 ui/gtk: refresh rate fixes.
ui/vnc: add support for desktop resize and power contol.
 ui/vnc: misc bugfixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmABbUoACgkQTLbY7tPo
 cTh2Hg//S+fQH9Lev/J17mFbwiu9PIY+D8bqAFBfEUvRG9I0xvou7L0gYMICdq9o
 lBwHpdqgppWaHlUAJ8lsf+JiPUQmiZkByuByuwH/Ao4h6FS28MuXTHLJVd1KRbAW
 Ouzxim+qNfP46jPZKy0xe7dZETAoGe5YQ0sCt3ru5F9dLE4V72bgxPzc1OTbWuiO
 Xt21/0y4qnesvw6qUB9nCnLJUkozgSoj5+WVYht2dZUttLqJGG7lV61LDZWEsnkW
 78pWxgk90r8ZGiy4eqpenVAX5JogmZLpAfXkhsw7kYGIgC6nRI5oXky89iAO5x62
 RBIDxWfmqngIM88csMScVU9eukz0kALWXipotaF9ntVzvi6KGYS7Nx1HpIH2r319
 DYyZaD3PBafD0FumKOKHWrRrShE5q3NAX5dbRNS3RbG7cX6ZE5wHMdD9nHm0AYIX
 3Ljv5DIfw+MC+ivXopRYiMigJQkjyPXWpeUVw7m14G986YyKCaJJDRSb1OD1Vc2Q
 BUP6uWlajj1y4ODz+GN61P8dE/5k8/tvn/3xlWvUqrWeA8NETy1z4i1F2V4mU9xM
 +42ifSUZFwDmcZ2Y3GqLfpjcZTXcOLL1dGjDRJbL9p9RKFDtpG5afOsCWg+fG0zM
 ni0qx0QS7AoJNQduvy9HVhFxT2AaYSKSMYfQN6fRZxBtZashAKQ=
 =IgLz
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/ui-20210115-pull-request' into staging

ui/gtk: refresh rate fixes.
ui/vnc: add support for desktop resize and power contol.
ui/vnc: misc bugfixes.

# gpg: Signature made Fri 15 Jan 2021 10:24:10 GMT
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20210115-pull-request:
  vnc: add support for extended desktop resize
  vnc: move initialization to framebuffer_update_request
  vnc: move check into vnc_cursor_define
  vnc: Fix a memleak in vnc_display_connect()
  ui: add support for remote power control to VNC server
  vnc: fix unfinalized tlscreds for VncDisplay
  ui/gtk: update monitor interval on egl displays
  ui/gtk: expose gd_monitor_update_interval
  ui/gtk: limit virtual console max update interval
  ui/gtk: rename variable window to widget
  ui/gtk: don't try to redefine SI prefixes

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-01-15 16:35:18 +00:00
Peter Maydell a968a38005 Fix for CVE-2021-20181
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEtIKLr5QxQM7yo0kQcdTV5YIvc9YFAmABV8MACgkQcdTV5YIv
 c9ZvoRAAhXHnUohiHaWPN5DnI+7QmE0QZnCg1nVqIj0SEg0Y8UF0hdYLc+IjPopn
 3GKGq3If9qthWmnJQNi2gMWsQwMmlLqwYz20yq1mLtIyrjCt3ltnBp3hxEZCOZDR
 9VoSXr7JevdXNwdQ0dn0EKAF9snaRCwq59aNJdJ/MWy+6c+x8OHTv/Rb9shKBbDA
 5cakEsWN0RLa4He97f7A6y5wBZ7RN6OaFM03x1XdBmXaqt+zzvHQXmlls/eU17eX
 AwfTXiBj2V3hWyRo6MY2asoSB2aBHSvP405Bqi4VBki0VkEwT84geMi2VMfDV7dV
 YI2AYxyWPyxLv07tMaiw4Py/5trZS1QHFJmVFR9AhE5wJolkREmXDgESbijqhxPy
 Z2G8+ohR1twdc2HbfVnAW8oHhAIhKD3QkdD/y4p/NW62wjGOWc4maCysFMvBvQyE
 hI+aK10mNsPaRh0pUs9NrQAUwdm2DUlVPGMn8mEEo9EskPlNYU/9ojzrv1nzCDC1
 eNY8w3UaYIFGHwqqceJ49tj3MtDEpEWcogWURTs/8u2OyTciA+ojHlmfJiCX1SnF
 KHGSXQn9SWrpY5+Q/Pdp3xIri0i79CX4ei3x4XBoD/PeB1hz5TGtfV9fhR5dl6SY
 mBgC4sP5+dDAva+ts+UfLzgT2lf/Rji9kr8R2hIhJ6gQTILMbSU=
 =/6sh
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/gkurz-gitlab/tags/9p-next-2021-01-15' into staging

Fix for CVE-2021-20181

# gpg: Signature made Fri 15 Jan 2021 08:52:19 GMT
# gpg:                using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <groug@kaod.org>" [full]
# gpg:                 aka "Gregory Kurz <gregory.kurz@free.fr>" [full]
# gpg:                 aka "[jpeg image of size 3330]" [full]
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6

* remotes/gkurz-gitlab/tags/9p-next-2021-01-15:
  9pfs: Fully restart unreclaim loop (CVE-2021-20181)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-01-15 15:32:05 +00:00
Peter Maydell 256af05f52 MIPS patches queue
- Simplify CPU/ISA definitions
 - Various maintenance code movements in translate.c
 - Convert part of the MSA ASE instructions to decodetree
 - Convert some instructions removed from Release 6 to decodetree
 - Remove deprecated 'fulong2e' machine alias
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmAAbl0ACgkQ4+MsLN6t
 wN7dng//V7XlbAwjRjuDXpQ22bZgMI6ZGGSVr9mp2JXvCABQnE0Mrc0Td6MtyixB
 IWfdds+1TwgD3IWQzceWFod7m9YZFicF3c/yfgTpdrm9KTHR16WM/sykkc1mdiBO
 coxgy1i8JhICNk684M6+o3zRVbC/xpBWAr8zewy2CGFT5xnPsv56sft47RTrw9Tr
 syg8sD38gkUdrj+qbRTfdABw44R/zYb8UcJ67Xx4HKYS8Yri/NmgetHz9I23l5bL
 meAQ2L7oJl+YSBPSoxzzuHi6gKnsbxTKko3/nlz3Obpv0rbtMAIB9yNOYykr6pet
 o4pwwY6wlQKAJeZ19w3cpom7ihUbhNcGeGfqgI32dJevhamO/fJAwDidF2VAIbIu
 76AWRDyfKp+k2D8/Wi/uCB0hzw0DJlbYMC1VtlkQzkRyl8bAdnm+ZhPl2vfx286R
 X3xULVg9HNcvX+fiF/vgWlMJl7e8r35ZABMf+H+zzsQGUHG7hNOKRUuFQtakJrws
 53jck243BTHqYyr5L4UvyWRMyWSTVllVcAP6/WqF6Sz/8mhzSAvGPwrj1QPOstef
 xGfR2B8KSJ7/Yi3S7CpYuHxyv/uZpro5A/lT4xpcun3QuPArjxUk9OYra5PomCqb
 h1vBd4yWdIaQOL+LIU0H+FxJ8AYM0aP1nmbc2YnDZvpexzjHYes=
 =lS4p
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-20210114' into staging

MIPS patches queue

- Simplify CPU/ISA definitions
- Various maintenance code movements in translate.c
- Convert part of the MSA ASE instructions to decodetree
- Convert some instructions removed from Release 6 to decodetree
- Remove deprecated 'fulong2e' machine alias

# gpg: Signature made Thu 14 Jan 2021 16:16:29 GMT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* remotes/philmd-gitlab/tags/mips-20210114: (69 commits)
  docs/system: Remove deprecated 'fulong2e' machine alias
  target/mips: Remove vendor specific CPU definitions
  target/mips: Remove CPU_NANOMIPS32 definition
  target/mips: Remove CPU_R5900 definition
  target/mips: Convert Rel6 LL/SC opcodes to decodetree
  target/mips: Convert Rel6 LLD/SCD opcodes to decodetree
  target/mips: Convert Rel6 LDL/LDR/SDL/SDR opcodes to decodetree
  target/mips: Convert Rel6 LWLE/LWRE/SWLE/SWRE opcodes to decodetree
  target/mips: Convert Rel6 LWL/LWR/SWL/SWR opcodes to decodetree
  target/mips: Convert Rel6 CACHE/PREF opcodes to decodetree
  target/mips: Convert Rel6 COP1X opcode to decodetree
  target/mips: Convert Rel6 Special2 opcode to decodetree
  target/mips: Remove now unreachable LSA/DLSA opcodes code
  target/mips: Introduce decodetree helpers for Release6 LSA/DLSA opcodes
  target/mips: Introduce decodetree helpers for MSA LSA/DLSA opcodes
  target/mips: Extract LSA/DLSA translation generators
  target/mips: Use decode_ase_msa() generated from decodetree
  target/mips: Introduce decode tree bindings for MSA ASE
  target/mips: Pass TCGCond argument to MSA gen_check_zero_element()
  target/mips: Extract MSA translation routines
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-01-15 13:22:54 +00:00
Zhang Han 8abf3feb4d audio: space prohibited between function name and parenthesis'('
Delete spaces between function name and open parenthesis'('

Signed-off-by: Zhang Han <zhanghan64@huawei.com>
Message-id: 20210115012431.79533-1-zhanghan64@huawei.com
Message-Id: <20210115012431.79533-8-zhanghan64@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:49:26 +01:00
Zhang Han 289db3c5a2 audio: Suspect code indent for conditional statements
Fix code indent.

Signed-off-by: Zhang Han <zhanghan64@huawei.com>
Message-id: 20210115012431.79533-1-zhanghan64@huawei.com
Message-Id: <20210115012431.79533-7-zhanghan64@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:49:26 +01:00
Zhang Han dea7d84fcf audio: Don't use '%#' in format strings
Use '0x' prefix instead of '%#'

Signed-off-by: Zhang Han <zhanghan64@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20210115012431.79533-1-zhanghan64@huawei.com
Message-Id: <20210115012431.79533-6-zhanghan64@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:49:26 +01:00
Zhang Han c60840c758 audio: Fix lines over 90 characters
Fix the line width of code.

Signed-off-by: Zhang Han <zhanghan64@huawei.com>
Message-id: 20210115012431.79533-1-zhanghan64@huawei.com
Message-Id: <20210115012431.79533-5-zhanghan64@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:49:26 +01:00
Zhang Han dcf10e4095 audio: foo* bar" should be "foo *bar".
transfer "foo* " to "foo *"

Signed-off-by: Zhang Han <zhanghan64@huawei.com>
Message-id: 20210115012431.79533-1-zhanghan64@huawei.com
Message-Id: <20210115012431.79533-4-zhanghan64@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:49:26 +01:00
Zhang Han 3c8de96c07 audio: Add spaces around operator/delete redundant spaces
Fix problems about spaces:
-operator needs spaces around it, add them.
-somespaces are redundant, remove them.

Signed-off-by: Zhang Han <zhanghan64@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20210115012431.79533-1-zhanghan64@huawei.com
Message-Id: <20210115012431.79533-3-zhanghan64@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:49:26 +01:00
Zhang Han 6c6886bd01 audio: Add braces for statements/fix braces' position
Fix problems about braces:
-braces are necessary for all arms of if/for/while statements
-else should follow close brace '}'

Signed-off-by: Zhang Han <zhanghan64@huawei.com>
Message-id: 20210115012431.79533-1-zhanghan64@huawei.com
Message-Id: <20210115012431.79533-2-zhanghan64@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:49:26 +01:00
Volker Rümelin 2d96a00587 dsoundaudio: fix log message
There is a mismatch between message and used argument. Change
the argument from frequency to format.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-23-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin 1157506161 dsoundaudio: enable f32 audio sample format
Enable the f32 audio sample format for the DirectSound backend.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-22-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin 3c18e43179 dsoundaudio: rename dsound_open()
Rename dsound_open() to dsound_set_cooperative_level(). The
only task of that function is to set the cooperative level for
DirectSound.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-21-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin 401dcf0540 dsoundaudio: replace GetForegroundWindow()
GetForegroundWindow() doesn't necessarily return the own window
handle. It just returns a handle to the currently active window
and can even return NULL. At the time dsound_open() gets called
the active window is most likely the shell window and not the
QEMU window.

Replace GetForegroundWindow() with GetDesktopWindow() which
always returns a valid window handle, and at the same time
replace the DirectSound buffer flag DSBCAPS_STICKYFOCUS with
DSBCAPS_GLOBALFOCUS where Windows only expects a valid window
handle for DirectSound function SetCooperativeLevel(). The
Microsoft online docs for IDirectSound::SetCooperativeLevel
recommend this in the remarks.

This fixes a bug where you can't hear sound from the guest.

To reproduce start qemu with -machine pcspk-audiodev=audio0
-device intel-hda -device hda-duplex,audiodev=audio0
-audiodev dsound,id=audio0,out.mixing-engine=off
from a shell and start audio playback with the hda device in the
guest. The guest will be silent. To hear guest audio you have to
activate the shell window once.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-20-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin d9a8b27a7e paaudio: send recorded data in smaller chunks
Tell PulseAudio to send recorded audio data in smaller chunks
than timer_period, so there's a good chance that qemu can read
recorded audio data every time it looks for new data.

PulseAudio tries to send buffer updates at a fragsize / 2 rate.
With fragsize = timer_period / 2 * 3 the update rate is 75% of
timer_period. The lower limit for the recording buffer size
maxlength is fragsize * 2.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-19-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin 00413ed9c2 paaudio: limit minreq to 75% of audio timer_rate
Currently with the playback buffer attribute minreq = -1 and flag
PA_STREAM_EARLY_REQUESTS PulseAudio uses minreq = tlength / 4.
To improve audio playback with larger PulseAudio server side
buffers, limit minreq to a maximum of 75% of audio timer_rate.
That way there is a good chance qemu receives a stream buffer
size update before it tries to write data to the playback stream.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-18-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin cffd2fdf2c paaudio: comment bugs in functions qpa_init_*
The audio buffer size in audio/paaudio.c is typically larger
than expected. Just comment the bugs in qpa_init_in() and
qpa_init_out() for now. Fixing these bugs may break glitch free
audio playback with fine tuned user audio settings.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-17-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin 521ce71425 paaudio: remove unneeded code
Commit baea032ec7 "audio/paaudio: fix ignored buffer_length setting"
added code to handle buffer_length defaults. This was unnecessary
because the audio_buffer_* functions in audio/audio.c already handle
this. Remove the unneeded code.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-16-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin 7007cd3fc8 paaudio: wait until the playback stream is ready
Don't call pa_stream_writable_size() in qpa_get_buffer_out()
before the playback stream is ready. This prevents a lot of the
following pulseaudio error messages.

pulseaudio: pa_stream_writable_size failed
pulseaudio: Reason: Bad state

To reproduce start qemu with
-parallel none -device gus,audiodev=audio0 -audiodev pa,id=audio0

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-15-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin e270c54826 paaudio: wait for PA_STREAM_READY in qpa_write()
Don't call pa_stream_writable_size() in qpa_write() before the
playback stream is ready. This prevents a lot of the following
pulseaudio error messages.

pulseaudio: pa_stream_writable_size failed
pulseaudio: Reason: Bad state

To reproduce start qemu with
-parallel none -device gus,audiodev=audio0
-audiodev pa,id=audio0,out.mixing-engine=off

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-14-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin bea29e9f2e paaudio: avoid to clip samples multiple times
The pulseaudio backend currently converts, clips and copies audio
playback samples in the mixing-engine sample buffer multiple
times.

In qpa_get_buffer_out() the function pa_stream_begin_write()
returns a rather large buffer and this allows audio_pcm_hw_run_out()
in audio/audio.c to copy all samples in the mixing-engine buffer
to the pulse audio buffer. Immediately after copying, qpa_write()
notices with a call to pa_stream_writable_size() that pulse audio
only needs a smaller part of the copied samples and ignores the
rest. This copy and ignore process happens several times for each
audio sample.

To fix this behaviour, call pa_stream_writable_size() in
qpa_get_buffer_out() to limit the number of samples
audio_pcm_hw_run_out() will convert. With this change the
pulseaudio pcm_ops functions put_buffer_out and write are no
longer identical and a separate qpa_put_buffer_out is needed.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-13-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin 6fb0cd5054 audio: remove remaining unused plive code
Commit 73ad33ef7b "audio: remove plive" forgot to remove this code.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-12-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin bd37ede4eb sdlaudio: enable (in|out).mixing-engine=off
Enable the SDL2 backend options -audiodev sdl,out.mixing-
engine=off,in.mixing-engine=off.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-11-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00
Volker Rümelin 1d8549ad5e audio: break generic buffer dependency on mixing-engine
Break the unnecessary dependency of the generic buffer management
code on mixing-engine. This is required for the next patch.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-10-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15 11:25:22 +01:00