All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 00/13] build, Python, target/i386 changes for 2023-02-27
@ 2023-02-27 17:55 Paolo Bonzini
  2023-02-27 17:55 ` [PULL 01/13] target/i386: Fix BZHI instruction Paolo Bonzini
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 1270a3f57c9221080f3205a15964814ff8359ca9:

  Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging (2023-02-24 15:09:39 +0000)

are available in the Git repository at:

  https://gitlab.com/bonzini/qemu.git tags/for-upstream-8.0

for you to fetch changes up to 7eb061b06e97af9a8da7f31b839d78997ae737fc:

  i386: Add new CPU model SapphireRapids (2023-02-27 18:53:00 +0100)

----------------------------------------------------------------
* New Sapphire Rapids model support
* x86 bugfixes
* Prepare to drop support for Python 3.6

----------------------------------------------------------------
John Snow (2):
      meson: stop looking for 'sphinx-build-3'
      configure: Look for auxiliary Python installations

Markus Armbruster (1):
      meson: Avoid duplicates in generated config-poison.h again

Paolo Bonzini (7):
      configure: protect against escaping venv when running Meson
      lcitool: update submodule
      docs/devel: update and clarify lcitool instructions
      ci, docker: update CentOS and OpenSUSE Python to non-EOL versions
      target/i386: add FSRM to TCG
      target/i386: add FZRM, FSRS, FSRC
      target/i386: KVM: allow fast string operations if host supports them

Philippe Mathieu-Daudé (1):
      MAINTAINERS: Cover RCU documentation

Richard Henderson (1):
      target/i386: Fix BZHI instruction

Wang, Lei (1):
      i386: Add new CPU model SapphireRapids

 MAINTAINERS                                        |   2 +
 configure                                          |  82 +++++++++---
 docs/devel/testing.rst                             |  76 ++++++-----
 docs/meson.build                                   |   9 +-
 meson_options.txt                                  |   2 +-
 scripts/make-config-poison.sh                      |   2 +-
 scripts/meson-buildoptions.sh                      |   1 +
 target/i386/cpu.c                                  | 142 ++++++++++++++++++++-
 target/i386/cpu.h                                  |  11 ++
 target/i386/kvm/kvm.c                              |  17 ++-
 target/i386/tcg/emit.c.inc                         |  14 +-
 tests/docker/dockerfiles/alpine.docker             |   2 +-
 tests/docker/dockerfiles/centos8.docker            |  22 ++--
 tests/docker/dockerfiles/fedora-win32-cross.docker |   1 +
 tests/docker/dockerfiles/fedora-win64-cross.docker |   1 +
 tests/docker/dockerfiles/opensuse-leap.docker      |  22 ++--
 tests/docker/dockerfiles/ubuntu2004.docker         |   2 +-
 tests/lcitool/libvirt-ci                           |   2 +-
 tests/lcitool/mappings.yml                         |  77 +++++++++++
 tests/lcitool/targets/centos-stream-8.yml          |   3 +
 tests/lcitool/targets/opensuse-leap-153.yml        |   3 +
 tests/tcg/i386/test-i386-bmi2.c                    |   3 +
 22 files changed, 398 insertions(+), 98 deletions(-)
 create mode 100644 tests/lcitool/mappings.yml
 create mode 100644 tests/lcitool/targets/centos-stream-8.yml
 create mode 100644 tests/lcitool/targets/opensuse-leap-153.yml
-- 
2.39.1



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PULL 01/13] target/i386: Fix BZHI instruction
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 02/13] meson: Avoid duplicates in generated config-poison.h again Paolo Bonzini
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson

From: Richard Henderson <richard.henderson@linaro.org>

We did not correctly handle N >= operand size.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1374
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230114233206.3118472-1-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/emit.c.inc      | 14 +++++++-------
 tests/tcg/i386/test-i386-bmi2.c |  3 +++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc
index e61ae9a2e92d..0d01e13002a6 100644
--- a/target/i386/tcg/emit.c.inc
+++ b/target/i386/tcg/emit.c.inc
@@ -1147,20 +1147,20 @@ static void gen_BLSR(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
 static void gen_BZHI(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
 {
     MemOp ot = decode->op[0].ot;
-    TCGv bound;
+    TCGv bound = tcg_constant_tl(ot == MO_64 ? 63 : 31);
+    TCGv zero = tcg_constant_tl(0);
+    TCGv mone = tcg_constant_tl(-1);
 
-    tcg_gen_ext8u_tl(s->T1, cpu_regs[s->vex_v]);
-    bound = tcg_constant_tl(ot == MO_64 ? 63 : 31);
+    tcg_gen_ext8u_tl(s->T1, s->T1);
 
     /*
      * Note that since we're using BMILG (in order to get O
      * cleared) we need to store the inverse into C.
      */
-    tcg_gen_setcond_tl(TCG_COND_LT, cpu_cc_src, s->T1, bound);
-    tcg_gen_movcond_tl(TCG_COND_GT, s->T1, s->T1, bound, bound, s->T1);
+    tcg_gen_setcond_tl(TCG_COND_LEU, cpu_cc_src, s->T1, bound);
 
-    tcg_gen_movi_tl(s->A0, -1);
-    tcg_gen_shl_tl(s->A0, s->A0, s->T1);
+    tcg_gen_shl_tl(s->A0, mone, s->T1);
+    tcg_gen_movcond_tl(TCG_COND_LEU, s->A0, s->T1, bound, s->A0, zero);
     tcg_gen_andc_tl(s->T0, s->T0, s->A0);
 
     gen_op_update1_cc(s);
diff --git a/tests/tcg/i386/test-i386-bmi2.c b/tests/tcg/i386/test-i386-bmi2.c
index 982d4abda455..0244df798778 100644
--- a/tests/tcg/i386/test-i386-bmi2.c
+++ b/tests/tcg/i386/test-i386-bmi2.c
@@ -123,6 +123,9 @@ int main(int argc, char *argv[]) {
     result = bzhiq(mask, 0x1f);
     assert(result == (mask & ~(-1 << 30)));
 
+    result = bzhiq(mask, 0x40);
+    assert(result == mask);
+
     result = rorxq(0x2132435465768798, 8);
     assert(result == 0x9821324354657687);
 
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 02/13] meson: Avoid duplicates in generated config-poison.h again
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
  2023-02-27 17:55 ` [PULL 01/13] target/i386: Fix BZHI instruction Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 03/13] meson: stop looking for 'sphinx-build-3' Paolo Bonzini
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Markus Armbruster, Alex Bennée, Marc-André Lureau,
	Philippe Mathieu-Daudé

From: Markus Armbruster <armbru@redhat.com>

Commit eed56e9a89f "configure, meson: move config-poison.h to meson"
lost a "| sort -u".  Restore it.  config-poison shrinks from ~4500 to
~700 lines when all targets are enabled.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230206102037.3621709-1-armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/make-config-poison.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/make-config-poison.sh b/scripts/make-config-poison.sh
index d222a0430435..18928542614f 100755
--- a/scripts/make-config-poison.sh
+++ b/scripts/make-config-poison.sh
@@ -13,4 +13,4 @@ exec sed -n \
   -e    's///' \
   -e    's/ .*//' \
   -e    's/^/#pragma GCC poison /p' \
-  -e '}' "$@"
+  -e '}' "$@" | sort -u
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 03/13] meson: stop looking for 'sphinx-build-3'
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
  2023-02-27 17:55 ` [PULL 01/13] target/i386: Fix BZHI instruction Paolo Bonzini
  2023-02-27 17:55 ` [PULL 02/13] meson: Avoid duplicates in generated config-poison.h again Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-03-02 16:54   ` Peter Maydell
  2023-02-27 17:55 ` [PULL 04/13] configure: protect against escaping venv when running Meson Paolo Bonzini
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow

From: John Snow <jsnow@redhat.com>

Once upon a time, "sphinx-build" on certain RPM platforms invoked
specifically a Python 2.x version, while "sphinx-build-3" was a distro
shim for the Python 3.x version.

These days, none of our supported platforms utilize a 2.x version, and
those that still have 'sphinx-build-3' make it a symbolic link to
'sphinx-build'.  Not searching for 'sphinx-build-3' will prefer
pip/venv installed versions of sphinx if they're available.

This adds an extremely convenient ability to test document building
ability in QEMU across multiple versions of Sphinx for the purposes of
compatibility testing.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20230221012456.2607692-6-jsnow@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/meson.build              | 9 ++-------
 meson_options.txt             | 2 +-
 scripts/meson-buildoptions.sh | 1 +
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/docs/meson.build b/docs/meson.build
index bbcdccce68a8..bb72c10ea8c5 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -1,10 +1,5 @@
-if get_option('sphinx_build') == ''
-  sphinx_build = find_program(['sphinx-build-3', 'sphinx-build'],
-                              required: get_option('docs'))
-else
-  sphinx_build = find_program(get_option('sphinx_build'),
-                              required: get_option('docs'))
-endif
+sphinx_build = find_program(get_option('sphinx_build'),
+                            required: get_option('docs'))
 
 # Check if tools are available to build documentation.
 build_docs = false
diff --git a/meson_options.txt b/meson_options.txt
index 6b0900205ea7..fc9447d267bf 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -12,7 +12,7 @@ option('pkgversion', type : 'string', value : '',
        description: 'use specified string as sub-version of the package')
 option('smbd', type : 'string', value : '',
        description: 'Path to smbd for slirp networking')
-option('sphinx_build', type : 'string', value : '',
+option('sphinx_build', type : 'string', value : 'sphinx-build',
        description: 'Use specified sphinx-build for building document')
 option('iasl', type : 'string', value : '',
        description: 'Path to ACPI disassembler')
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 5d969a94c08e..009fab151571 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -55,6 +55,7 @@ meson_options_help() {
   printf "%s\n" '  --localstatedir=VALUE    Localstate data directory [/var/local]'
   printf "%s\n" '  --mandir=VALUE           Manual page directory [share/man]'
   printf "%s\n" '  --sphinx-build=VALUE     Use specified sphinx-build for building document'
+  printf "%s\n" '                           [sphinx-build]'
   printf "%s\n" '  --sysconfdir=VALUE       Sysconf data directory [etc]'
   printf "%s\n" '  --tls-priority=VALUE     Default TLS protocol/cipher priority string'
   printf "%s\n" '                           [NORMAL]'
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 04/13] configure: protect against escaping venv when running Meson
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 03/13] meson: stop looking for 'sphinx-build-3' Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 05/13] configure: Look for auxiliary Python installations Paolo Bonzini
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow

If neither --python nor --meson are specified, Meson's generated
build.ninja will invoke Python script using the interpreter *that Meson
itself is running under*; not the one identified by configure.

This is only an issue if Meson's Python interpreter is not "the first
one in the path", which is the one that is used if --python is not
specified.  A common case where this happen is when the "python3" binary
comes from a virtual environment but Meson is not installed (with pip)
in the virtual environment.  In this case (presumably) whoever set up
the venv wanted to use the venv's Python interpreter to build QEMU,
while Meson might use a different one, for example an enterprise
distro's older runtime.

So, detect whether a virtual environment is setup, and if the virtual
environment does not have Meson, use the meson submodule.  Meson will
then run under the virtual environment's Python interpreter.

Reported-by: John Snow <jsnow@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index cf6db3d5518c..a1912463c94e 100755
--- a/configure
+++ b/configure
@@ -1044,11 +1044,24 @@ if ! $python -c 'import sys; sys.exit(sys.version_info < (3,6))'; then
       "Use --python=/path/to/python to specify a supported Python."
 fi
 
-# Suppress writing compiled files
-python="$python -B"
+# Resolve PATH + suppress writing compiled files
+python="$(command -v "$python") -B"
+
+has_meson() {
+  local python_dir=$(dirname "$python")
+  # PEP405: pyvenv.cfg is either adjacent to the Python executable
+  # or one directory above
+  if test -f $python_dir/pyvenv.cfg || test -f $python_dir/../pyvenv.cfg; then
+    # Ensure that Meson and Python come from the same virtual environment
+    test -x "$python_dir/meson" &&
+      test "$(command -v meson)" -ef "$python_dir/meson"
+  else
+    has meson
+  fi
+}
 
 if test -z "$meson"; then
-    if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.61.5; then
+    if test "$explicit_python" = no && has_meson && version_ge "$(meson --version)" 0.61.5; then
         meson=meson
     elif test "$git_submodules_action" != 'ignore' ; then
         meson=git
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 05/13] configure: Look for auxiliary Python installations
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (3 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 04/13] configure: protect against escaping venv when running Meson Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 06/13] lcitool: update submodule Paolo Bonzini
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Daniel P . Berrangé

From: John Snow <jsnow@redhat.com>

At the moment, we look for just "python3" and "python", which is good
enough almost all of the time. But ... if you are on a platform that
uses an older Python by default and only offers a newer Python as an
option, you'll have to specify --python=/usr/bin/foo every time.

We can be kind and instead make a cursory attempt to locate a suitable
Python binary ourselves, looking for the remaining well-known binaries.

This configure loop will prefer, in order:

1. Whatever is specified in $PYTHON
2. python3
3. python
4. python3.11 down through python3.6

Notes:

- Python virtual environment provides binaries for "python3", "python",
  and whichever version you used to create the venv,
  e.g. "python3.8". If configure is invoked from inside of a venv, this
  configure loop will not "break out" of that venv unless that venv is
  created using an explicitly non-suitable version of Python that we
  cannot use.

- In the event that no suitable python is found, the first python found
  is the version used to generate the human-readable error message.

- The error message isn't printed right away to allow later
  configuration code to pick up an explicitly configured python.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 63 ++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 46 insertions(+), 17 deletions(-)

diff --git a/configure b/configure
index a1912463c94e..0e41c5e36ce2 100755
--- a/configure
+++ b/configure
@@ -592,20 +592,43 @@ esac
 
 : ${make=${MAKE-make}}
 
-# We prefer python 3.x. A bare 'python' is traditionally
-# python 2.x, but some distros have it as python 3.x, so
-# we check that too
-python=
-explicit_python=no
-for binary in "${PYTHON-python3}" python
-do
-    if has "$binary"
-    then
-        python=$(command -v "$binary")
-        break
-    fi
-done
 
+check_py_version() {
+    # We require python >= 3.6.
+    # NB: a True python conditional creates a non-zero return code (Failure)
+    "$1" -c 'import sys; sys.exit(sys.version_info < (3,6))'
+}
+
+python=
+first_python=
+if test -z "${PYTHON}"; then
+    explicit_python=no
+    # A bare 'python' is traditionally python 2.x, but some distros
+    # have it as python 3.x, so check in both places.
+    for binary in python3 python python3.11 python3.10 python3.9 python3.8 python3.7 python3.6; do
+        if has "$binary"; then
+            python=$(command -v "$binary")
+            if check_py_version "$python"; then
+                # This one is good.
+                first_python=
+                break
+            else
+                first_python=$python
+            fi
+        fi
+    done
+else
+    # Same as above, but only check the environment variable.
+    has "${PYTHON}" || error_exit "The PYTHON environment variable does not point to an executable"
+    python=$(command -v "$PYTHON")
+    explicit_python=yes
+    if check_py_version "$python"; then
+        # This one is good.
+        first_python=
+    else
+        first_python=$first_python
+    fi
+fi
 
 # Check for ancillary tools used in testing
 genisoimage=
@@ -1030,16 +1053,22 @@ rm -f ./*/config-devices.mak.d
 
 if test -z "$python"
 then
-    error_exit "Python not found. Use --python=/path/to/python"
+    # If first_python is set, there was a binary somewhere even though
+    # it was not suitable.  Use it for the error message.
+    if test -n "$first_python"; then
+        error_exit "Cannot use '$first_python', Python >= 3.6 is required." \
+            "Use --python=/path/to/python to specify a supported Python."
+    else
+        error_exit "Python not found. Use --python=/path/to/python"
+    fi
 fi
+
 if ! has "$make"
 then
     error_exit "GNU make ($make) not found"
 fi
 
-# Note that if the Python conditional here evaluates True we will exit
-# with status 1 which is a shell 'false' value.
-if ! $python -c 'import sys; sys.exit(sys.version_info < (3,6))'; then
+if ! check_py_version "$python"; then
   error_exit "Cannot use '$python', Python >= 3.6 is required." \
       "Use --python=/path/to/python to specify a supported Python."
 fi
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 06/13] lcitool: update submodule
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (4 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 05/13] configure: Look for auxiliary Python installations Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 07/13] docs/devel: update and clarify lcitool instructions Paolo Bonzini
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P . Berrangé

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/docker/dockerfiles/alpine.docker             | 2 +-
 tests/docker/dockerfiles/fedora-win32-cross.docker | 1 +
 tests/docker/dockerfiles/fedora-win64-cross.docker | 1 +
 tests/lcitool/libvirt-ci                           | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker
index 4a569d82f64f..66c499c097ab 100644
--- a/tests/docker/dockerfiles/alpine.docker
+++ b/tests/docker/dockerfiles/alpine.docker
@@ -61,7 +61,7 @@ RUN apk update && \
         liburing-dev \
         libusb-dev \
         linux-pam-dev \
-        llvm11 \
+        llvm \
         lttng-ust-dev \
         lzo-dev \
         make \
diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/docker/dockerfiles/fedora-win32-cross.docker
index b659c0b8a89d..41769fc94a8e 100644
--- a/tests/docker/dockerfiles/fedora-win32-cross.docker
+++ b/tests/docker/dockerfiles/fedora-win32-cross.docker
@@ -79,6 +79,7 @@ RUN nosync dnf install -y \
                mingw32-glib2 \
                mingw32-gnutls \
                mingw32-gtk3 \
+               mingw32-libepoxy \
                mingw32-libgcrypt \
                mingw32-libjpeg-turbo \
                mingw32-libpng \
diff --git a/tests/docker/dockerfiles/fedora-win64-cross.docker b/tests/docker/dockerfiles/fedora-win64-cross.docker
index 0a404c15bfe4..46d5d05763a6 100644
--- a/tests/docker/dockerfiles/fedora-win64-cross.docker
+++ b/tests/docker/dockerfiles/fedora-win64-cross.docker
@@ -80,6 +80,7 @@ RUN nosync dnf install -y \
                mingw64-glib2 \
                mingw64-gnutls \
                mingw64-gtk3 \
+               mingw64-libepoxy \
                mingw64-libgcrypt \
                mingw64-libjpeg-turbo \
                mingw64-libpng \
diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci
index 319a534c220f..1c3e16cae384 160000
--- a/tests/lcitool/libvirt-ci
+++ b/tests/lcitool/libvirt-ci
@@ -1 +1 @@
-Subproject commit 319a534c220f53fc8670254cac25d6f662c82112
+Subproject commit 1c3e16cae38407d0782dc94080d1104106456fa4
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 07/13] docs/devel: update and clarify lcitool instructions
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (5 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 06/13] lcitool: update submodule Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 08/13] ci, docker: update CentOS and OpenSUSE Python to non-EOL versions Paolo Bonzini
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P . Berrangé

Shorten a bit the description of what libvirt-ci does, the name of the
data files is not relevant at that point.  However, the procedures to add
new build prerequisites are lacking some information, particularly with
respect to regenerating the output test files for lcitool's unit tests.
While at it, also update the paths in the libvirt-ci repository.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/devel/testing.rst | 70 +++++++++++++++++++++++-------------------
 1 file changed, 39 insertions(+), 31 deletions(-)

diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index e10c47b5a7ca..11c651ca0878 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -429,49 +429,55 @@ using the ``lcitool`` program provided by the ``libvirt-ci`` project:
 
   https://gitlab.com/libvirt/libvirt-ci
 
-In that project, there is a ``mappings.yml`` file defining the distro native
-package names for a wide variety of third party projects. This is processed
-in combination with a project defined list of build pre-requisites to determine
-the list of native packages to install on each distribution. This can be used
-to generate dockerfiles, VM package lists and Cirrus CI variables needed to
-setup build environments across OS distributions with a consistent set of
-packages present.
-
-When preparing a patch series that adds a new build pre-requisite to QEMU,
-updates to various lcitool data files may be required.
+``libvirt-ci`` contains an ``lcitool`` program as well as a list of
+mappings to distribution package names for a wide variety of third
+party projects.  ``lcitool`` applies the mappings to a list of build
+pre-requisites in ``tests/lcitool/projects/qemu.yml``, determines the
+list of native packages to install on each distribution, and uses them
+to generate build environments (dockerfiles and Cirrus CI variable files)
+that are consistent across OS distribution.
 
 
 Adding new build pre-requisites
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+When preparing a patch series that adds a new build
+pre-requisite to QEMU, the prerequisites should to be added to
+``tests/lcitool/projects/qemu.yml`` in order to make the dependency
+available in the CI build environments.
+
 In the simple case where the pre-requisite is already known to ``libvirt-ci``
-the following steps are needed
+the following steps are needed:
 
  * Edit ``tests/lcitool/projects/qemu.yml`` and add the pre-requisite
 
  * Run ``make lcitool-refresh`` to re-generate all relevant build environment
    manifests
 
-In some cases ``libvirt-ci`` will not know about the build pre-requisite and
-thus some extra preparation steps will be required first
+It may be that ``libvirt-ci`` does not know about the new pre-requisite.
+If that is the case, some extra preparation steps will be required
+first to contribute the mapping to the ``libvirt-ci`` project:
 
  * Fork the ``libvirt-ci`` project on gitlab
 
- * Edit the ``mappings.yml`` change to add an entry for the new build
-   prerequisite, listing its native package name on as many OS distros
-   as practical.
+ * Add an entry for the new build prerequisite to
+   ``lcitool/facts/mappings.yml``, listing its native package name on as
+   many OS distros as practical.  Run ``python -m pytest --regenerate-output``
+   and check that the changes are correct.
 
- * Commit the ``mappings.yml`` change and submit a merge request to
-   the ``libvirt-ci`` project, noting in the description that this
-   is a new build pre-requisite desired for use with QEMU
+ * Commit the ``mappings.yml`` change together with the regenerated test
+   files, and submit a merge request to the ``libvirt-ci`` project.
+   Please note in the description that this is a new build pre-requisite
+   desired for use with QEMU.
 
  * CI pipeline will run to validate that the changes to ``mappings.yml``
    are correct, by attempting to install the newly listed package on
    all OS distributions supported by ``libvirt-ci``.
 
  * Once the merge request is accepted, go back to QEMU and update
-   the ``libvirt-ci`` submodule to point to a commit that contains
-   the ``mappings.yml`` update.
+   the ``tests/lcitool/libvirt-ci`` submodule to point to a commit that
+   contains the ``mappings.yml`` update.  Then add the prerequisite and
+   run ``make lcitool-refresh``.
 
 
 Adding new OS distros
@@ -498,18 +504,20 @@ Assuming there is agreement to add a new OS distro then
 
  * Fork the ``libvirt-ci`` project on gitlab
 
- * Add metadata under ``guests/lcitool/lcitool/ansible/group_vars/``
-   for the new OS distro. There might be code changes required if
-   the OS distro uses a package format not currently known. The
-   ``libvirt-ci`` maintainers can advise on this when the issue
-   is file.
+ * Add metadata under ``lcitool/facts/targets/`` for the new OS
+   distro. There might be code changes required if the OS distro
+   uses a package format not currently known. The ``libvirt-ci``
+   maintainers can advise on this when the issue is filed.
 
- * Edit the ``mappings.yml`` change to update all the existing package
-   entries, providing details of the new OS distro
+ * Edit the ``lcitool/facts/mappings.yml`` change to add entries for
+   the new OS, listing the native package names for as many packages
+   as practical.  Run ``python -m pytest --regenerate-output`` and
+   check that the changes are correct.
 
- * Commit the ``mappings.yml`` change and submit a merge request to
-   the ``libvirt-ci`` project, noting in the description that this
-   is a new build pre-requisite desired for use with QEMU
+ * Commit the changes to ``lcitool/facts`` and the regenerated test
+   files, and submit a merge request to the ``libvirt-ci`` project.
+   Please note in the description that this is a new build pre-requisite
+   desired for use with QEMU
 
  * CI pipeline will run to validate that the changes to ``mappings.yml``
    are correct, by attempting to install the newly listed package on
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 08/13] ci, docker: update CentOS and OpenSUSE Python to non-EOL versions
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (6 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 07/13] docs/devel: update and clarify lcitool instructions Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 09/13] MAINTAINERS: Cover RCU documentation Paolo Bonzini
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P . Berrangé

Python 3.6 is at end-of-life.  Update the libvirt-ci module to a
version that supports overrides for targets and package mappings;
this way, QEMU can use the newer versions provided by CentOS 8 (Python
3.8) and OpenSUSE 15.3 (Python 3.9).

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/devel/testing.rst                        |  6 ++
 tests/docker/dockerfiles/centos8.docker       | 22 +++---
 tests/docker/dockerfiles/opensuse-leap.docker | 22 +++---
 tests/docker/dockerfiles/ubuntu2004.docker    |  2 +-
 tests/lcitool/mappings.yml                    | 77 +++++++++++++++++++
 tests/lcitool/targets/centos-stream-8.yml     |  3 +
 tests/lcitool/targets/opensuse-leap-153.yml   |  3 +
 7 files changed, 113 insertions(+), 22 deletions(-)
 create mode 100644 tests/lcitool/mappings.yml
 create mode 100644 tests/lcitool/targets/centos-stream-8.yml
 create mode 100644 tests/lcitool/targets/opensuse-leap-153.yml

diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 11c651ca0878..362a26698bcd 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -479,6 +479,12 @@ first to contribute the mapping to the ``libvirt-ci`` project:
    contains the ``mappings.yml`` update.  Then add the prerequisite and
    run ``make lcitool-refresh``.
 
+For enterprise distros that default to old, end-of-life versions of the
+Python runtime, QEMU uses a separate set of mappings that work with more
+recent versions.  These can be found in ``tests/lcitool/mappings.yml``.
+Modifying this file should not be necessary unless the new pre-requisite
+is a Python library or tool.
+
 
 Adding new OS distros
 ^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker
index fbc953c6dccc..3c74be09a693 100644
--- a/tests/docker/dockerfiles/centos8.docker
+++ b/tests/docker/dockerfiles/centos8.docker
@@ -82,7 +82,6 @@ RUN dnf distro-sync -y && \
         lzo-devel \
         make \
         mesa-libgbm-devel \
-        meson \
         ncurses-devel \
         nettle-devel \
         ninja-build \
@@ -94,13 +93,12 @@ RUN dnf distro-sync -y && \
         pixman-devel \
         pkgconfig \
         pulseaudio-libs-devel \
-        python3 \
-        python3-PyYAML \
-        python3-numpy \
-        python3-pillow \
-        python3-pip \
-        python3-sphinx \
-        python3-sphinx_rtd_theme \
+        python38 \
+        python38-PyYAML \
+        python38-numpy \
+        python38-pip \
+        python38-setuptools \
+        python38-wheel \
         rdma-core-devel \
         rpm \
         sed \
@@ -128,8 +126,14 @@ RUN dnf distro-sync -y && \
     ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
     ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
 
+RUN /usr/bin/pip3.8 install \
+                    meson==0.63.2 \
+                    pillow \
+                    sphinx \
+                    sphinx-rtd-theme
+
 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
 ENV LANG "en_US.UTF-8"
 ENV MAKE "/usr/bin/make"
 ENV NINJA "/usr/bin/ninja"
-ENV PYTHON "/usr/bin/python3"
+ENV PYTHON "/usr/bin/python3.8"
diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/dockerfiles/opensuse-leap.docker
index 4b2c02d6abfb..5b8dbf2b83dd 100644
--- a/tests/docker/dockerfiles/opensuse-leap.docker
+++ b/tests/docker/dockerfiles/opensuse-leap.docker
@@ -89,16 +89,9 @@ RUN zypper update -y && \
            pam-devel \
            pcre-devel-static \
            pkgconfig \
-           python3-Pillow \
-           python3-PyYAML \
-           python3-Sphinx \
-           python3-base \
-           python3-numpy \
-           python3-opencv \
-           python3-pip \
-           python3-setuptools \
-           python3-sphinx_rtd_theme \
-           python3-wheel \
+           python39-base \
+           python39-pip \
+           python39-setuptools \
            rdma-core-devel \
            rpm \
            sed \
@@ -129,10 +122,15 @@ RUN zypper update -y && \
     ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
     ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
 
-RUN /usr/bin/pip3 install meson==0.56.0
+RUN /usr/bin/pip3.9 install \
+                    PyYAML \
+                    meson==0.63.2 \
+                    pillow \
+                    sphinx \
+                    sphinx-rtd-theme
 
 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
 ENV LANG "en_US.UTF-8"
 ENV MAKE "/usr/bin/make"
 ENV NINJA "/usr/bin/ninja"
-ENV PYTHON "/usr/bin/python3"
+ENV PYTHON "/usr/bin/python3.9"
diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index 13ab0b688726..5b27b89f1c72 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -138,7 +138,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
     ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
     ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
 
-RUN /usr/bin/pip3 install meson==0.56.0
+RUN /usr/bin/pip3 install meson==0.63.2
 
 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
 ENV LANG "en_US.UTF-8"
diff --git a/tests/lcitool/mappings.yml b/tests/lcitool/mappings.yml
new file mode 100644
index 000000000000..e4719e45516c
--- /dev/null
+++ b/tests/lcitool/mappings.yml
@@ -0,0 +1,77 @@
+mappings:
+  flake8:
+    CentOSStream8:
+    OpenSUSELeap153:
+
+  meson:
+    CentOSStream8:
+    OpenSUSELeap153:
+
+  python3:
+    CentOSStream8: python38
+    OpenSUSELeap153: python39-base
+
+  python3-PyYAML:
+    CentOSStream8: python38-PyYAML
+    OpenSUSELeap153:
+
+  python3-devel:
+    CentOSStream8: python38-devel
+    OpenSUSELeap153: python39-devel
+
+  python3-docutils:
+    CentOSStream8:
+    OpenSUSELeap153:
+
+  python3-numpy:
+    CentOSStream8: python38-numpy
+    OpenSUSELeap153:
+
+  python3-opencv:
+    CentOSStream8:
+    OpenSUSELeap153:
+
+  python3-pillow:
+    CentOSStream8:
+    OpenSUSELeap153:
+
+  python3-pip:
+    CentOSStream8: python38-pip
+    OpenSUSELeap153: python39-pip
+
+  python3-pillow:
+    CentOSStream8:
+    OpenSUSELeap153:
+
+  python3-selinux:
+    CentOSStream8:
+    OpenSUSELeap153:
+
+  python3-setuptools:
+    CentOSStream8: python38-setuptools
+    OpenSUSELeap153: python39-setuptools
+
+  python3-sphinx:
+    CentOSStream8:
+    OpenSUSELeap153:
+
+  python3-sphinx-rtd-theme:
+    CentOSStream8:
+    OpenSUSELeap153:
+
+  python3-venv:
+    CentOSStream8: python38
+    OpenSUSELeap153: python39-base
+
+  python3-wheel:
+    CentOSStream8: python38-wheel
+    OpenSUSELeap153: python39-pip
+
+pypi_mappings:
+  # Request more recent version
+  meson:
+    default: meson==0.63.2
+
+  # Drop packages that need devel headers
+  python3-numpy:
+    OpenSUSELeap153:
diff --git a/tests/lcitool/targets/centos-stream-8.yml b/tests/lcitool/targets/centos-stream-8.yml
new file mode 100644
index 000000000000..6b11160fd1dc
--- /dev/null
+++ b/tests/lcitool/targets/centos-stream-8.yml
@@ -0,0 +1,3 @@
+paths:
+  pip3: /usr/bin/pip3.8
+  python: /usr/bin/python3.8
diff --git a/tests/lcitool/targets/opensuse-leap-153.yml b/tests/lcitool/targets/opensuse-leap-153.yml
new file mode 100644
index 000000000000..683016e0077a
--- /dev/null
+++ b/tests/lcitool/targets/opensuse-leap-153.yml
@@ -0,0 +1,3 @@
+paths:
+  pip3: /usr/bin/pip3.9
+  python: /usr/bin/python3.9
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 09/13] MAINTAINERS: Cover RCU documentation
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (7 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 08/13] ci, docker: update CentOS and OpenSUSE Python to non-EOL versions Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 10/13] target/i386: add FSRM to TCG Paolo Bonzini
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index eb917e48c0ab..896e411918c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2812,6 +2812,8 @@ F: qapi/run-state.json
 Read, Copy, Update (RCU)
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
+F: docs/devel/lockcnt.txt
+F: docs/devel/rcu.txt
 F: include/qemu/rcu*.h
 F: tests/unit/rcutorture.c
 F: tests/unit/test-rcu-*.c
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 10/13] target/i386: add FSRM to TCG
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (8 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 09/13] MAINTAINERS: Cover RCU documentation Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 11/13] target/i386: add FZRM, FSRS, FSRC Paolo Bonzini
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Xiaoyao Li

Fast short REP MOVS can be added to TCG, since a trivial translation
of string operation is a good option for short lengths.

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 4d2b8d0444df..34e2cead870e 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -661,7 +661,7 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1,
 #define TCG_7_0_ECX_FEATURES (CPUID_7_0_ECX_UMIP | CPUID_7_0_ECX_PKU | \
           /* CPUID_7_0_ECX_OSPKE is dynamic */ \
           CPUID_7_0_ECX_LA57 | CPUID_7_0_ECX_PKS | CPUID_7_0_ECX_VAES)
-#define TCG_7_0_EDX_FEATURES 0
+#define TCG_7_0_EDX_FEATURES CPUID_7_0_EDX_FSRM
 #define TCG_7_1_EAX_FEATURES 0
 #define TCG_APM_FEATURES 0
 #define TCG_6_EAX_FEATURES CPUID_6_EAX_ARAT
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 11/13] target/i386: add FZRM, FSRS, FSRC
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (9 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 10/13] target/i386: add FSRM to TCG Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-27 17:55 ` [PULL 12/13] target/i386: KVM: allow fast string operations if host supports them Paolo Bonzini
  2023-02-28 15:09 ` [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Peter Maydell
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Xiaoyao Li

These are three more markers for string operation optimizations.
They can all be added to TCG, whose string operations are more or
less as fast as they can be for short lengths.

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c | 7 ++++---
 target/i386/cpu.h | 7 +++++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 34e2cead870e..26ec6e9da754 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -662,7 +662,8 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1,
           /* CPUID_7_0_ECX_OSPKE is dynamic */ \
           CPUID_7_0_ECX_LA57 | CPUID_7_0_ECX_PKS | CPUID_7_0_ECX_VAES)
 #define TCG_7_0_EDX_FEATURES CPUID_7_0_EDX_FSRM
-#define TCG_7_1_EAX_FEATURES 0
+#define TCG_7_1_EAX_FEATURES (CPUID_7_1_EAX_FZRM | CPUID_7_1_EAX_FSRS | \
+          CPUID_7_1_EAX_FSRC)
 #define TCG_APM_FEATURES 0
 #define TCG_6_EAX_FEATURES CPUID_6_EAX_ARAT
 #define TCG_XSAVE_FEATURES (CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XGETBV1)
@@ -872,8 +873,8 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
         .feat_names = {
             NULL, NULL, NULL, NULL,
             "avx-vnni", "avx512-bf16", NULL, NULL,
-            NULL, NULL, NULL, NULL,
-            NULL, NULL, NULL, NULL,
+            NULL, NULL, "fzrm", "fsrs",
+            "fsrc", NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
             NULL, NULL, NULL, NULL,
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index d4bc19577a21..e0703feb5ed0 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -900,6 +900,13 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
 #define CPUID_7_1_EAX_AVX_VNNI          (1U << 4)
 /* AVX512 BFloat16 Instruction */
 #define CPUID_7_1_EAX_AVX512_BF16       (1U << 5)
+/* Fast Zero REP MOVS */
+#define CPUID_7_1_EAX_FZRM              (1U << 10)
+/* Fast Short REP STOS */
+#define CPUID_7_1_EAX_FSRS              (1U << 11)
+/* Fast Short REP CMPS/SCAS */
+#define CPUID_7_1_EAX_FSRC              (1U << 12)
+
 /* XFD Extend Feature Disabled */
 #define CPUID_D_1_EAX_XFD               (1U << 4)
 
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PULL 12/13] target/i386: KVM: allow fast string operations if host supports them
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (10 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 11/13] target/i386: add FZRM, FSRS, FSRC Paolo Bonzini
@ 2023-02-27 17:55 ` Paolo Bonzini
  2023-02-28 15:09 ` [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Peter Maydell
  12 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2023-02-27 17:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Xiaoyao Li

These are just a flag that documents the performance characteristic of
an instruction; it needs no hypervisor support.  So include them even
if KVM does not show them.  In particular, FZRM/FSRS/FSRC have only
been added very recently, but they are available on Sapphire Rapids
processors.

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/kvm/kvm.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 587030199192..d18bd2f3e889 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -352,7 +352,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
 {
     struct kvm_cpuid2 *cpuid;
     uint32_t ret = 0;
-    uint32_t cpuid_1_edx;
+    uint32_t cpuid_1_edx, unused;
     uint64_t bitmask;
 
     cpuid = get_supported_cpuid(s);
@@ -399,10 +399,20 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
     } else if (function == 6 && reg == R_EAX) {
         ret |= CPUID_6_EAX_ARAT; /* safe to allow because of emulated APIC */
     } else if (function == 7 && index == 0 && reg == R_EBX) {
+        /* Not new instructions, just an optimization.  */
+        uint32_t ebx;
+        host_cpuid(7, 0, &unused, &ebx, &unused, &unused);
+        ret |= ebx & CPUID_7_0_EBX_ERMS;
+
         if (host_tsx_broken()) {
             ret &= ~(CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_HLE);
         }
     } else if (function == 7 && index == 0 && reg == R_EDX) {
+        /* Not new instructions, just an optimization.  */
+        uint32_t edx;
+        host_cpuid(7, 0, &unused, &unused, &unused, &edx);
+        ret |= edx & CPUID_7_0_EDX_FSRM;
+
         /*
          * Linux v4.17-v4.20 incorrectly return ARCH_CAPABILITIES on SVM hosts.
          * We can detect the bug by checking if MSR_IA32_ARCH_CAPABILITIES is
@@ -411,6 +421,11 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
         if (!has_msr_arch_capabs) {
             ret &= ~CPUID_7_0_EDX_ARCH_CAPABILITIES;
         }
+    } else if (function == 7 && index == 1 && reg == R_EAX) {
+        /* Not new instructions, just an optimization.  */
+        uint32_t eax;
+        host_cpuid(7, 1, &eax, &unused, &unused, &unused);
+        ret |= eax & (CPUID_7_1_EAX_FZRM | CPUID_7_1_EAX_FSRS | CPUID_7_1_EAX_FSRC);
     } else if (function == 0xd && index == 0 &&
                (reg == R_EAX || reg == R_EDX)) {
         /*
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PULL 00/13] build, Python, target/i386 changes for 2023-02-27
  2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
                   ` (11 preceding siblings ...)
  2023-02-27 17:55 ` [PULL 12/13] target/i386: KVM: allow fast string operations if host supports them Paolo Bonzini
@ 2023-02-28 15:09 ` Peter Maydell
  12 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2023-02-28 15:09 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Mon, 27 Feb 2023 at 17:55, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The following changes since commit 1270a3f57c9221080f3205a15964814ff8359ca9:
>
>   Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging (2023-02-24 15:09:39 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/bonzini/qemu.git tags/for-upstream-8.0
>
> for you to fetch changes up to 7eb061b06e97af9a8da7f31b839d78997ae737fc:
>
>   i386: Add new CPU model SapphireRapids (2023-02-27 18:53:00 +0100)
>
> ----------------------------------------------------------------
> * New Sapphire Rapids model support
> * x86 bugfixes
> * Prepare to drop support for Python 3.6
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PULL 03/13] meson: stop looking for 'sphinx-build-3'
  2023-02-27 17:55 ` [PULL 03/13] meson: stop looking for 'sphinx-build-3' Paolo Bonzini
@ 2023-03-02 16:54   ` Peter Maydell
  0 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2023-03-02 16:54 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, John Snow

On Mon, 27 Feb 2023 at 17:58, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> From: John Snow <jsnow@redhat.com>
>
> Once upon a time, "sphinx-build" on certain RPM platforms invoked
> specifically a Python 2.x version, while "sphinx-build-3" was a distro
> shim for the Python 3.x version.
>
> These days, none of our supported platforms utilize a 2.x version, and
> those that still have 'sphinx-build-3' make it a symbolic link to
> 'sphinx-build'.  Not searching for 'sphinx-build-3' will prefer
> pip/venv installed versions of sphinx if they're available.
>
> This adds an extremely convenient ability to test document building
> ability in QEMU across multiple versions of Sphinx for the purposes of
> compatibility testing.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> Message-Id: <20230221012456.2607692-6-jsnow@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Hi. I've just noticed that this breaks incremental rebuilds:
meson.log says:


[Errno 21] Is a directory: '/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/docs/'
Unusable script '/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/docs/'
Program  found: NO

../../docs/meson.build:1:0: ERROR: Program '' not found or not executable

>  docs/meson.build              | 9 ++-------
>  meson_options.txt             | 2 +-
>  scripts/meson-buildoptions.sh | 1 +
>  3 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/docs/meson.build b/docs/meson.build
> index bbcdccce68a8..bb72c10ea8c5 100644
> --- a/docs/meson.build
> +++ b/docs/meson.build
> @@ -1,10 +1,5 @@
> -if get_option('sphinx_build') == ''
> -  sphinx_build = find_program(['sphinx-build-3', 'sphinx-build'],
> -                              required: get_option('docs'))
> -else
> -  sphinx_build = find_program(get_option('sphinx_build'),
> -                              required: get_option('docs'))
> -endif
> +sphinx_build = find_program(get_option('sphinx_build'),
> +                            required: get_option('docs'))
>
>  # Check if tools are available to build documentation.
>  build_docs = false
> diff --git a/meson_options.txt b/meson_options.txt
> index 6b0900205ea7..fc9447d267bf 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -12,7 +12,7 @@ option('pkgversion', type : 'string', value : '',
>         description: 'use specified string as sub-version of the package')
>  option('smbd', type : 'string', value : '',
>         description: 'Path to smbd for slirp networking')
> -option('sphinx_build', type : 'string', value : '',
> +option('sphinx_build', type : 'string', value : 'sphinx-build',
>         description: 'Use specified sphinx-build for building document')
>  option('iasl', type : 'string', value : '',
>         description: 'Path to ACPI disassembler')
> diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> index 5d969a94c08e..009fab151571 100644
> --- a/scripts/meson-buildoptions.sh
> +++ b/scripts/meson-buildoptions.sh
> @@ -55,6 +55,7 @@ meson_options_help() {
>    printf "%s\n" '  --localstatedir=VALUE    Localstate data directory [/var/local]'
>    printf "%s\n" '  --mandir=VALUE           Manual page directory [share/man]'
>    printf "%s\n" '  --sphinx-build=VALUE     Use specified sphinx-build for building document'
> +  printf "%s\n" '                           [sphinx-build]'
>    printf "%s\n" '  --sysconfdir=VALUE       Sysconf data directory [etc]'
>    printf "%s\n" '  --tls-priority=VALUE     Default TLS protocol/cipher priority string'
>    printf "%s\n" '                           [NORMAL]'

I think this happens because the commit has changed the
default value of the '--sphinx-build' option, but if you're
doing an incremental rebuild then meson will get run with
the old default value (which is the empty string) and the
new meson.build doesn't expect that and falls over.

Manually rerunning configure fixes this, but ideally
incremental rebuilds should Just Work.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-03-02 16:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 17:55 [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Paolo Bonzini
2023-02-27 17:55 ` [PULL 01/13] target/i386: Fix BZHI instruction Paolo Bonzini
2023-02-27 17:55 ` [PULL 02/13] meson: Avoid duplicates in generated config-poison.h again Paolo Bonzini
2023-02-27 17:55 ` [PULL 03/13] meson: stop looking for 'sphinx-build-3' Paolo Bonzini
2023-03-02 16:54   ` Peter Maydell
2023-02-27 17:55 ` [PULL 04/13] configure: protect against escaping venv when running Meson Paolo Bonzini
2023-02-27 17:55 ` [PULL 05/13] configure: Look for auxiliary Python installations Paolo Bonzini
2023-02-27 17:55 ` [PULL 06/13] lcitool: update submodule Paolo Bonzini
2023-02-27 17:55 ` [PULL 07/13] docs/devel: update and clarify lcitool instructions Paolo Bonzini
2023-02-27 17:55 ` [PULL 08/13] ci, docker: update CentOS and OpenSUSE Python to non-EOL versions Paolo Bonzini
2023-02-27 17:55 ` [PULL 09/13] MAINTAINERS: Cover RCU documentation Paolo Bonzini
2023-02-27 17:55 ` [PULL 10/13] target/i386: add FSRM to TCG Paolo Bonzini
2023-02-27 17:55 ` [PULL 11/13] target/i386: add FZRM, FSRS, FSRC Paolo Bonzini
2023-02-27 17:55 ` [PULL 12/13] target/i386: KVM: allow fast string operations if host supports them Paolo Bonzini
2023-02-28 15:09 ` [PULL 00/13] build, Python, target/i386 changes for 2023-02-27 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.