Re: [RFC PATCH v2 5/6] hw/arm/virt-acpi-build: Add PPTT table

2021-05-12 Thread wangyanan (Y)
Hi Drew, I got a question below, and hope your reply. Thanks! On 2021/4/13 16:07, Yanan Wang wrote: Add the Processor Properties Topology Table (PPTT) to present CPU topology information to ACPI guests. Note, while a DT boot Linux guest with a non-flat CPU topology will see socket and core IDs

Re: [PATCH v4 05/31] target/ppc: Remove special case for POWERPC_EXCP_TRAP

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:15PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Richard Henderson > > Since POWERPC_EXCP_TRAP is raised by gen_exception_err, > we will have also set DISAS_NORETURN. > > Signed-off-by: Richard Henderson > Reviewed-by: Luis Pires > Signed-off-by: Matheus

Re: [PATCH v4 09/31] target/ppc: Remove unnecessary gen_io_end calls

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:19PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Richard Henderson > > Since ba3e7926691ed33, we switched the implementation of icount > to always reset can_do_io at the start of the following TB. > Most of them were removed in 9e9b10c64911, but some were

Re: [PATCH 06/11] target/ppc: updated vscr manipulation in machine.c

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 12:08:52PM -0500, Richard Henderson wrote: > On 5/12/21 9:08 AM, Bruno Larsen (billionai) wrote: > > Updated the code in machine.c to use the generic ppc_{store,get}_vscr > > instead of helper style functions, so it can build without TCG > > > > Signed-off-by: Bruno Larsen

Re: [PATCH v4 08/31] target/ppc: Replace POWERPC_EXCP_SYNC with DISAS_EXIT

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:18PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Richard Henderson > > Remove the synthetic "exception" after no more uses. > > Signed-off-by: Richard Henderson > Signed-off-by: Matheus Ferst Applied to ppc-for-6.1, thanks. > --- > target/ppc/cpu.h

Re: [PATCH v4 03/31] target/ppc: Move DISAS_NORETURN setting into gen_exception*

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:13PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Richard Henderson > > There are other valid settings for is_jmp besides > DISAS_NEXT and DISAS_NORETURN, so eliminating that > dichotomy from ppc_tr_translate_insn is helpful. > > Signed-off-by: Richard

Re: [PATCH v4 02/31] target/ppc: Split out decode_legacy

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:12PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Richard Henderson > > Signed-off-by: Richard Henderson > Reviewed-by: Luis Pires > Signed-off-by: Matheus Ferst Applied to ppc-for-6.1. > --- > target/ppc/translate.c | 115

Re: [PATCH v4 00/31] Base for adding PowerPC 64-bit instructions

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:10PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Matheus Ferst > > This series provides the basic infrastructure for adding the new 32/64-bit > instructions in Power ISA 3.1 to target/ppc. I've applied the first chunk of these. After that I get conflicts

Re: [PATCH v4 07/31] target/ppc: Introduce DISAS_{EXIT,CHAIN}{,_UPDATE}

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:17PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Richard Henderson > > Rewrite ppc_tr_tb_stop to handle these new codes. > > Convert ctx->exception into these new codes at the end of > ppc_tr_translate_insn, prior to pushing the change back > throughout

Re: [PATCH v4 01/31] target/ppc: Add cia field to DisasContext

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:11PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Richard Henderson > > Signed-off-by: Richard Henderson > Reviewed-by: Bruno Larsen (billionai) > Reviewed-by: Luis Pires > Signed-off-by: Matheus Ferst Applied to ppc-for-6.1, thanks. > --- >

Re: [PATCH v4 06/31] target/ppc: Simplify gen_debug_exception

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:16PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Richard Henderson > > Two of the call sites that use gen_debug_exception have already > updated NIP. Only ppc_tr_breakpoint_check requires the update. > > Signed-off-by: Richard Henderson > Signed-off-by:

Re: [PATCH v4 04/31] target/ppc: Remove special case for POWERPC_SYSCALL

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 03:54:14PM -0300, matheus.fe...@eldorado.org.br wrote: > From: Richard Henderson > > Since POWERPC_SYSCALL is raised by gen_exception_err, > we will have also set DISAS_NORETURN. > > Signed-off-by: Richard Henderson > Reviewed-by: Luis Pires > Signed-off-by: Matheus

Re: [PATCH v4 10/31] target/ppc: Introduce gen_icount_io_start

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 04:21:13PM -0300, Matheus K. Ferst wrote: > On 12/05/2021 15:54, matheus.fe...@eldorado.org.br wrote: > > From: Matheus Ferst > > > > Create a function to handle the details for interacting with icount. > > > > Force the exit from the tb via DISAS_TOO_MANY, which allows

Re: [RFC PATCH 10/11] target/ppc: created tcg-stub.c file

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 11:08:12AM -0300, Bruno Larsen (billionai) wrote: > Created a file with stubs needed to compile disabling TCG. > > We're not sure about keeping the softmmu stubs in this file. if there is > a better place to put them, please let us know. > > The other 3 functions have

Re: [PATCH 02/11] target/ppc: moved ppc_store_sdr1 to cpu.c

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 11:08:04AM -0300, Bruno Larsen (billionai) wrote: > Moved this function that is required in !TCG cases into a > common code file The reasons it's needed by !TCG are kind of bogus, related to weirdness in the way KVM PR works. But it's fair not to care about that right

Re: [PATCH 03/11] target/ppc: moved ppc_cpu_dump_state to cpu_init.c

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 11:08:05AM -0300, Bruno Larsen (billionai) wrote: > This function was forgotten in the cpu_init code motion series, but it > seems to be used regardless of TCG, and so needs to be moved to support > disabling TCG. > > Signed-off-by: Bruno Larsen (billionai) > Applied to

Re: [PATCH 04/11] target/ppc: moved ppc_store_msr into gdbstub.c

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 12:05:04PM -0500, Richard Henderson wrote: > On 5/12/21 9:08 AM, Bruno Larsen (billionai) wrote: > > This function is used by !TCG cases, so it was moved to a common code > > file. We chose gdbstub.c since it was the one giving us grief over it. > > > > Signed-off-by:

Re: [RFC PATCH v2] ppc/spapr: Add support for H_SCM_PERFORMANCE_STATS hcall

2021-05-12 Thread David Gibson
On Thu, May 06, 2021 at 08:19:24AM +0530, Vaibhav Jain wrote: > Add support for H_SCM_PERFORMANCE_STATS described at [1] for > spapr nvdimms. This enables guest to fetch performance stats[2] like > expected life of an nvdimm ('MemLife ') etc and display them to the > user. Linux kernel support for

Re: [RFC PATCH 3/5] hw/ppc: Have pSeries depends on libfdt (via host Kconfig FDT symbol)

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 10:01:20AM +0200, Paolo Bonzini wrote: > On 12/05/21 04:27, David Gibson wrote: > > On Tue, May 11, 2021 at 05:53:52PM +0200, Philippe Mathieu-Daudé wrote: > > > Since commit fea35ca4b8e ("ppc/spapr: Receive and store device > > > tree blob from SLOF") the pSeries machine

Re: [PATCH updated v2] spapr: Fix EEH capability issue on KVM guest for PCI passthru

2021-05-12 Thread David Gibson
On Wed, May 05, 2021 at 08:18:27PM +0530, Mahesh Salgaonkar wrote: > With upstream kernel, especially after commit 98ba956f6a389 > ("powerpc/pseries/eeh: Rework device EEH PE determination") we see that KVM > guest isn't able to enable EEH option for PCI pass-through devices anymore. > >

Re: [PATCH 01/11] target/ppc: created ppc_{store,get}_vscr for generic vscr usage

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 11:08:03AM -0300, Bruno Larsen (billionai) wrote: > Some functions unrelated to TCG use helper_m{t,f}vscr, so generic versions > of those functions were added to cpu.c, in preparation for compilation > without TCG > > Signed-off-by: Bruno Larsen (billionai) > Applied to

Re: [PATCH 05/11] target/ppc: moved ppc_store_lpcr to cpu.c

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 11:08:07AM -0300, Bruno Larsen (billionai) wrote: > This function is used in !TCG cases, so it has been moved into a file > that is compiled when --disable-tcg is selected. > > Signed-off-by: Bruno Larsen (billionai) > Reviewed-by: David Gibson > --- >

Re: [RFC PATCH 4/5] hw/ppc/fdt: Drop dependency on libfdt

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 09:59:00AM +0200, Paolo Bonzini wrote: > On 12/05/21 04:30, David Gibson wrote: > > On Tue, May 11, 2021 at 05:53:53PM +0200, Philippe Mathieu-Daudé wrote: > > > hw/ppc/fdt.c defines the ppc_create_page_sizes_prop() function, > > > which is unrelated to the libfdt. Remove

Re: [PATCH] target/riscv: Dump CSR mscratch/sscratch/satp

2021-05-12 Thread Alistair Francis
On Wed, Apr 28, 2021 at 10:29 PM Changbin Du wrote: > > This dumps the CSR mscratch/sscratch/satp and meanwhile aligns > the output of CSR mtval/stval. > > Signed-off-by: Changbin Du Reviewed-by: Alistair Francis Alistair > --- > target/riscv/cpu.c | 7 +-- > 1 file changed, 5

Re: [PATCH v2] target/riscv: fix VS interrupts forwarding to HS

2021-05-12 Thread Alistair Francis
On Tue, May 4, 2021 at 6:45 AM Jose Martins wrote: > > VS interrupts (2, 6, 10) were not correctly forwarded to hs-mode when > not delegated in hideleg (which was not being taken into account). This > was mainly because hs level sie was not always considered enabled when > it should. The spec

[Bug 1923629] Re: RISC-V Vector Instruction vssub.vv not saturating

2021-05-12 Thread Alistair Francis
This was fixed by commit: commit 65606f21243a796537bfe4708720a9bf4bb50169 Author: LIU Zhiwei Date: Fri Feb 12 23:02:21 2021 +0800 target/riscv: Fixup saturate subtract function The overflow predication ((a - b) ^ a) & (a ^ b) & INT64_MIN is right. However, when the

Re: [RFC PATCH 1/5] hw/mem/nvdimm: Use Kconfig 'imply' instead of 'depends on'

2021-05-12 Thread David Gibson
On Wed, May 12, 2021 at 06:53:22AM +0200, Thomas Huth wrote: > On 12/05/2021 05.57, Philippe Mathieu-Daudé wrote: > > On 5/12/21 4:24 AM, David Gibson wrote: > > > On Tue, May 11, 2021 at 05:53:50PM +0200, Philippe Mathieu-Daudé wrote: > > > > Per the kconfig.rst: > > > > > > > >A device

Re: [PATCH v3 9/9] docs: update the documentation about schema configuration

2021-05-12 Thread John Snow
On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Signed-off-by: Marc-André Lureau I see why the docs are here at the end now -- you change the AST first, and then the meaning of the conditional string second. You didn't wanna write two versions. I'm fine

Re: [PATCH v3 8/9] qapi: make 'if' condition strings simple identifiers

2021-05-12 Thread John Snow
On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Change the 'if' condition strings to be C-agnostic and be simple identifiers. Oh, the answer to my last question. We strip off the defined(...) stuff here and now. Seems fine to me, as I like removing

QEMU Memory Allocation Issue

2021-05-12 Thread re.mcclue
Inside of gdb, I'm getting 0xd6ad000 for memory allocations made with mmap() I run qemu with: qemu-system-x86_64 -enable-kvm -m 512M -s -S -drive format=raw,file=ker.img -kernel /boot/vmlinuz-5.8.0-50-generic -append "root=/dev/sda init=/sbin/x64-ker nokaslr" The mmap() call succeeds, yet the

Re: [PATCH v3 7/9] qapi: convert 'if' C-expressions to the new syntax tree

2021-05-12 Thread John Snow
On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- qapi/machine-target.json | 20 qapi/misc-target.json| 13 - 2 files changed, 28 insertions(+), 5 deletions(-) diff --git

Re: [PATCH v3 6/9] qapi: normalize 'if' condition to IfPredicate tree

2021-05-12 Thread John Snow
On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Modify check_if() to build an IfPredicate tree (the schema documentation is updated in a following patch). I'm wondering if check_if() is the right place to do this. It's certainly convenient, but we don't build

Re: [PATCH V2 1/2] Adding premliminary support for custom CSR handling mechanism

2021-05-12 Thread Alistair Francis
On Wed, May 12, 2021 at 4:16 PM Alistair Francis wrote: > > On Tue, May 11, 2021 at 8:07 PM Ruinland Chuan-Tzu Tsai > wrote: > > > > Introduce ax25 and custom CSR handling mechanism to RISC-V platform. > > This is just a POC in which we add Andes custom CSR table directly > > into the generic

Re: [PATCH V2 0/2] Proposing custom CSR handling logic

2021-05-12 Thread Alistair Francis
On Thu, May 13, 2021 at 12:47 AM Bin Meng wrote: > > On Wed, May 12, 2021 at 2:03 PM Alistair Francis wrote: > > > > On Tue, May 11, 2021 at 8:07 PM Ruinland Chuan-Tzu Tsai > > wrote: > > > > > > Hi all, > > > > > > My sincere apology that I missed the patch to include our own CSR table > > >

Re: [PATCH v3 5/9] qapi: add IfNot

2021-05-12 Thread John Snow
On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Introduce IfNot predicate class, for 'not' condition expressions. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 22 ++ 1 file changed, 22 insertions(+) diff --git

[PATCH v6 22/25] python: add Makefile for some common tasks

2021-05-12 Thread John Snow
Add "make venv" to create the pipenv-managed virtual environment that contains our explicitly pinned dependencies. Add "make check" to run the python linters [in the host execution environment]. Add "make venv-check" which combines the above two: create/update the venv, then run the linters in

Re: [PATCH v3 4/9] qapi: introduce IfPredicateList and IfAny

2021-05-12 Thread John Snow
On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Refactor IfAll class, to introduce a base class IfPredicateList and add IfAny for the 'any' conditions. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 32 +++- 1 file

[PATCH v6 24/25] gitlab: add python linters to CI

2021-05-12 Thread John Snow
Add python3.6 to the fedora container image: we need it to run the linters against that explicit version to make sure we don't break our minimum version promise. Add pipenv so that we can fetch precise versions of pip packages we need to guarantee test reproducability. Signed-off-by: John Snow

[PATCH v6 21/25] python: add avocado-framework and tests

2021-05-12 Thread John Snow
Try using avocado to manage our various tests; even though right now they're only invoking shell scripts and not really running any python-native code. Create tests/, and add shell scripts which call out to mypy, flake8, pylint and isort to enforce the standards in this directory. Add

[PATCH v6 16/25] python: add mypy to pipenv

2021-05-12 Thread John Snow
0.730 appears to be about the oldest version that works with the features we want, including nice human readable output (to make sure iotest 297 passes), and type-parameterized Popen generics. 0.770, however, supports adding 'strict' to the config file, so require at least 0.770. Now that we are

[PATCH v6 23/25] python: add .gitignore

2021-05-12 Thread John Snow
Ignore *Python* build and package output (build, dist, qemu.egg-info); these files are not created as part of a QEMU build. Ignore miscellaneous cached python confetti (__pycache__, *.pyc, .mypy_cache). Ignore .idea (pycharm) .vscode, and .venv (pipenv et al). Signed-off-by: John Snow ---

[PATCH v6 18/25] python/qemu: add isort to pipenv

2021-05-12 Thread John Snow
isort 5.0.0 through 5.0.4 has a bug that causes it to misinterpret certain "from ..." clauses that are not related to imports. isort < 5.1.1 has a bug where it does not handle comments near import statements correctly. Require 5.1.2 or greater. isort can be run with 'isort -c qemu' from the

[PATCH v6 25/25] python: add tox support

2021-05-12 Thread John Snow
This is intended to be a manually run, non-CI script. Use tox to test the linters against all python versions from 3.6 to 3.9. This will only work if you actually have those versions installed locally, but Fedora makes this easy: > sudo dnf install python36 python37 python38 python39 Unlike the

[PATCH v6 17/25] python: move .isort.cfg into setup.cfg

2021-05-12 Thread John Snow
Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/.isort.cfg | 7 --- python/setup.cfg | 8 2 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 python/.isort.cfg diff --git a/python/.isort.cfg b/python/.isort.cfg deleted file mode 100644 index

[PATCH v6 15/25] python: move mypy.ini into setup.cfg

2021-05-12 Thread John Snow
mypy supports reading its configuration values from a central project configuration file; do so. Signed-off-by: John Snow --- python/mypy.ini | 4 python/setup.cfg | 5 + 2 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 python/mypy.ini diff --git a/python/mypy.ini

[PATCH v6 20/25] python: add devel package requirements to setuptools

2021-05-12 Thread John Snow
setuptools doesn't have a formal understanding of development requires, but it has an optional feataures section. Fine; add a "devel" feature and add the requirements to it. To avoid duplication, we can modify pipenv to install qemu[devel] instead. This enables us to run invocations like "pip

[PATCH v6 19/25] python/qemu: add qemu package itself to pipenv

2021-05-12 Thread John Snow
This adds the python qemu packages themselves to the pipenv manifest. 'pipenv sync' will create a virtual environment sufficient to use the SDK. 'pipenv sync --dev' will create a virtual environment sufficient to use and test the SDK (with pylint, mypy, isort, flake8, etc.) The qemu packages are

[PATCH v6 14/25] python: Add flake8 to pipenv

2021-05-12 Thread John Snow
flake8 3.5.x does not support the --extend-ignore syntax used in the .flake8 file to gracefully extend default ignores, so 3.6.x is our minimum requirement. There is no known upper bound. flake8 can be run from the python/ directory with no arguments. Signed-off-by: John Snow Reviewed-by:

[PATCH v6 13/25] python: add excluded dirs to flake8 config

2021-05-12 Thread John Snow
Instruct flake8 to avoid certain well-known directories created by python tooling that it ought not check. Note that at-present, nothing actually creates a ".venv" directory; but it is in such widespread usage as a de-facto location for a developer's virtual environment that it should be excluded

[PATCH v6 12/25] python: move flake8 config to setup.cfg

2021-05-12 Thread John Snow
Update the comment concerning the flake8 exception to match commit 42c0dd12, whose commit message stated: A note on the flake8 exception: flake8 will warn on *any* bare except, but pylint's is context-aware and will suppress the warning if you re-raise the exception. Signed-off-by: John Snow

[PATCH v6 07/25] python: add MANIFEST.in

2021-05-12 Thread John Snow
When creating a source distribution via 'python3 setup.py sdist', the VERSION and PACKAGE.rst files aren't bundled by default. Create a MANIFEST.in file that instructs the build tools to include these so that installation from source dists won't fail. (This invocation is required by 'tox', as

[PATCH v6 06/25] python: add directory structure README.rst files

2021-05-12 Thread John Snow
Add short readmes to python/, python/qemu/, python/qemu/machine, python/qemu/qmp, and python/qemu/utils that explain the directory hierarchy. These readmes are visible when browsing the source on e.g. gitlab/github and are designed to help new developers/users quickly make sense of the source

[PATCH v6 09/25] python: add pylint import exceptions

2021-05-12 Thread John Snow
Pylint 2.5.x - 2.7.x have regressions that make import checking inconsistent, see: https://github.com/PyCQA/pylint/issues/3609 https://github.com/PyCQA/pylint/issues/3624 https://github.com/PyCQA/pylint/issues/3651 Pinning to 2.4.4 is worse, because it mandates versions of shared dependencies

[PATCH v6 11/25] python: add pylint to pipenv

2021-05-12 Thread John Snow
We are specifying >= pylint 2.7.x for several reasons: 1. For setup.cfg support, added in pylint 2.5.x 2. To specify a version that has incompatibly dropped bad-whitespace checks (2.6.x) 3. 2.7.x fixes "unsubscriptable" warnings in Python 3.9 Signed-off-by: John Snow --- python/Pipfile

[PATCH v6 05/25] python: add VERSION file

2021-05-12 Thread John Snow
Python infrastructure as it exists today is not capable reliably of single-sourcing a package version from a parent directory. The authors of pip are working to correct this, but as of today this is not possible. The problem is that when using pip to build and install a python package, it copies

[PATCH v6 08/25] python: Add pipenv support

2021-05-12 Thread John Snow
pipenv is a tool used for managing virtual environments with pinned, explicit dependencies. It is used for precisely recreating python virtual environments. pipenv uses two files to do this: (1) Pipfile, which is similar in purpose and scope to what setup.cfg lists. It specifies the requisite

[PATCH v6 10/25] python: move pylintrc into setup.cfg

2021-05-12 Thread John Snow
Delete the empty settings now that it's sharing a home with settings for other tools. pylint can now be run from this folder as "pylint qemu". Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/qemu/machine/pylintrc | 58

[PATCH v6 03/25] python: create utils sub-package

2021-05-12 Thread John Snow
Create a space for miscellaneous things that don't belong strictly in "qemu.machine" nor "qemu.qmp" packages. Signed-off-by: John Snow --- python/qemu/machine/__init__.py | 8 python/qemu/utils/__init__.py | 23 +++ python/qemu/{machine =>

[PATCH v6 04/25] python: add qemu package installer

2021-05-12 Thread John Snow
Add setup.cfg and setup.py, necessary for installing a package via pip. Add a ReST document (PACKAGE.rst) explaining the basics of what this package is for and who to contact for more information. This document will be used as the landing page for the package on PyPI. I am not yet using a

[PATCH v6 02/25] python: create qemu packages

2021-05-12 Thread John Snow
move python/qemu/*.py to python/qemu/[machine, qmp]/*.py and update import directives across the tree. This is done to create a PEP420 namespace package, in which we may create subpackages. To do this, the namespace directory ("qemu") should not have any modules in it. Those files will go into

[PATCH v6 00/25] python: create installable package

2021-05-12 Thread John Snow
Based-on: <20210512214642.2803189-1-js...@redhat.com> CI: https://gitlab.com/jsnow/qemu/-/pipelines/302010131 GitLab: https://gitlab.com/jsnow/qemu/-/tree/python-package-mk3 MR: https://gitlab.com/jsnow/qemu/-/merge_requests/4 I invite you to leave review comments on my mock merge request on

[PATCH v6 01/25] iotests/297: add --namespace-packages to mypy arguments

2021-05-12 Thread John Snow
mypy is kind of weird about how it handles imports. For legacy reasons, it won't load PEP 420 namespaces, because of logic implemented prior to that becoming a standard. So, if you plan on using any, you have to pass --namespace-packages. Alright, fine. Signed-off-by: John Snow Reviewed-by:

[RFC PATCH v2 3/7] migration/snapshot: Move RAM_SAVE_FLAG_xxx defines to migration/ram.h

2021-05-12 Thread Andrey Gruzdev
Move RAM_SAVE_FLAG_xxx defines from migration/ram.c to migration/ram.h Signed-off-by: Andrey Gruzdev --- migration/ram.c | 16 migration/ram.h | 16 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index

[RFC PATCH v2 5/7] migration/snapshot: Implementation of qemu-snapshot save path

2021-05-12 Thread Andrey Gruzdev
Includes code to parse incoming migration stream, dispatch data to section handlers and deal with complications of open-coded migration format without introducing strong dependencies on QEMU migration code. Signed-off-by: Andrey Gruzdev --- include/qemu-snapshot.h | 34 +- qemu-snapshot-vm.c

[RFC PATCH v2 7/7] migration/snapshot: Implementation of qemu-snapshot load path in postcopy mode

2021-05-12 Thread Andrey Gruzdev
The commit enables asynchronous snapshot loading using standard postcopy migration mechanism on destination VM. The point of switchover to postcopy is trivially selected based on percentage of non-zero pages loaded in precopy. Signed-off-by: Andrey Gruzdev --- include/qemu-snapshot.h | 12 +

[RFC PATCH v2 1/7] migration/snapshot: Introduce qemu-snapshot tool

2021-05-12 Thread Andrey Gruzdev
Execution environment, command-line argument parsing, usage/version info etc. Signed-off-by: Andrey Gruzdev --- include/qemu-snapshot.h | 59 ++ meson.build | 2 + qemu-snapshot-vm.c | 57 ++ qemu-snapshot.c | 439 4

[RFC PATCH v2 6/7] migration/snapshot: Implementation of qemu-snapshot load path

2021-05-12 Thread Andrey Gruzdev
This part implements snapshot loading in precopy mode. Signed-off-by: Andrey Gruzdev --- include/qemu-snapshot.h | 24 +- qemu-snapshot-vm.c | 588 +++- qemu-snapshot.c | 47 +++- 3 files changed, 654 insertions(+), 5 deletions(-) diff --git

[RFC PATCH v2 4/7] migration/snapshot: Block layer AIO support in qemu-snapshot

2021-05-12 Thread Andrey Gruzdev
This commit enables asynchronous block layer I/O for qemu-snapshot tool. Implementation provides in-order request completion delivery to simplify migration code. Several file utility routines are introduced as well. Signed-off-by: Andrey Gruzdev --- include/qemu-snapshot.h | 30 +

[RFC PATCH v2 0/7] migration/snapshot: External snapshot utility

2021-05-12 Thread Andrey Gruzdev
Changes v1 -> v2: * Fixed CI checks Changes v0 -> v1: * Changed command-line format, now use blockdev specification to define vmstate image. * Don't deal with image creation in the tool, create externally. * Better block layer AIO handling in the load path. * Reduced fragmentation of the

[RFC PATCH v2 2/7] migration/snapshot: Introduce qemu_ftell2() routine

2021-05-12 Thread Andrey Gruzdev
In qemu-snapshot it is needed to retrieve current QEMUFile offset as a number of bytes read by qemu_get_byte()/qemu_get_buffer(). The existing qemu_ftell() routine would give read position as a number of bytes fetched from underlying IOChannel which is not the same. Signed-off-by: Andrey Gruzdev

[PATCH 10/10] iotests: ensure that QemuIoInteractive definitely closes

2021-05-12 Thread John Snow
More on the lines of quieting pylint 2.8.x, though to make it obvious that we definitely handle the cleanup here, I elected to bolster the close() method here. 1. Check for the process having terminated early more rigorously by checking poll() directly. 2. Change the prompt read into an

[PATCH 08/10] iotests: use 'with open()' where applicable

2021-05-12 Thread John Snow
More pylint 2.8.x warning hushing: use open's context manager where it's applicable to do so to avoid a warning. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/iotests.py

[PATCH 09/10] iotests: silence spurious consider-using-with warnings

2021-05-12 Thread John Snow
In a few cases, we can't use 'with ...' because they belong to long-running classes that need those items to stay open at the end of the block. We're handling it, so tell pylint to shush. Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py| 2 +- tests/qemu-iotests/testrunner.py | 1

[PATCH 02/10] python/machine: use subprocess.DEVNULL instead of open(os.path.devnull)

2021-05-12 Thread John Snow
One less file resource to manage, and it helps quiet some pylint >= 2.8.0 warnings about not using a with-context manager for the open call. Signed-off-by: John Snow --- python/qemu/machine.py | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python/qemu/machine.py

[PATCH 03/10] python/machine: use subprocess.run instead of subprocess.Popen

2021-05-12 Thread John Snow
use run() instead of Popen() -- to assert to pylint that we are not forgetting to close a long-running program. Signed-off-by: John Snow --- python/qemu/machine.py | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py

[PATCH 05/10] python/machine: Disable pylint warning for open() in _pre_launch

2021-05-12 Thread John Snow
Shift the open() call later so that the pylint pragma applies *only* to that one open() call. Add a note that suggests why this is safe: the resource is unconditionally cleaned up in _post_shutdown(). _post_shutdown is called after failed launches (see launch()), and unconditionally after every

[PATCH 07/10] iotests: use subprocess.run where possible

2021-05-12 Thread John Snow
pylint 2.8.x adds warnings whenever we use Popen calls without using 'with', so it's desirable to convert synchronous calls to run() invocations where applicable. (Though, this trades one pylint warning for another due to a pylint bug, which I've silenced with a pragma and a link to the bug.)

[PATCH 06/10] python/machine: disable warning for Popen in _launch()

2021-05-12 Thread John Snow
We handle this resource rather meticulously in shutdown/kill/wait/__exit__ et al, through the laborious mechanisms in _do_shutdown(). Quiet this pylint warning here. Signed-off-by: John Snow --- python/qemu/machine.py | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 04/10] python/console_socket: Add a pylint ignore

2021-05-12 Thread John Snow
We manage cleaning up this resource ourselves. Pylint should shush. Signed-off-by: John Snow --- python/qemu/console_socket.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py index 87237bebef7..8c4ff598ad7 100644 ---

[PATCH 01/10] python/console_socket: avoid one-letter variable

2021-05-12 Thread John Snow
Fixes pylint warnings. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/qemu/console_socket.py | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py index ac21130e446..87237bebef7 100644 ---

[PATCH 00/10] Python: delint iotests, machine.py and console_socket.py

2021-05-12 Thread John Snow
gitlab CI: https://gitlab.com/jsnow/qemu/-/pipelines/301924893 branch: https://gitlab.com/jsnow/qemu/-/commits/python-package-pre-cleanup This series serves as a pre-requisite for packaging the python series and getting the linters running via CI. The first patch fixes a linter error we've had

Re: [PATCH v3 3/9] qapi: start building an 'if' predicate tree

2021-05-12 Thread John Snow
On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau The following patches are going to express schema 'if' conditions in a target language agnostic way. For that, let's start building a predicate tree of the configuration options. This intermediary steps still uses

Re: [PATCH v3 2/9] qapi: move gen_if/gen_endif to QAPISchemaIfCond

2021-05-12 Thread John Snow
On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Move the generating function to the QAPISchemaIfCond class. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 20 +--- scripts/qapi/gen.py| 6 ++

Re: [PATCH v3 1/9] qapi: replace List[str] by QAPISchemaIfCond

2021-05-12 Thread John Snow
On 4/29/21 9:40 AM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Wrap the 'if' condition in a higher-level object. Not only this allows more type safety but also further refactoring without too much churn. Would have done it myself if I had gotten to it first. I like having a

[Bug 1913969] Re: unable to migrate non shared storage when TLS is used

2021-05-12 Thread Vjaceslavs Klimovs
** Changed in: qemu Status: Incomplete => New -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1913969 Title: unable to migrate non shared storage when TLS is used Status in QEMU: New Bug

Re: [PATCH v2 6/6] gitlab-ci: Add FreeBSD jobs

2021-05-12 Thread Warner Losh
On Tue, May 11, 2021 at 11:37 PM Philippe Mathieu-Daudé wrote: > Add system/user emulation jobs on FreeBSD host. > > To build these jobs, you need to add a FreeBSD runner and > add 'freebsd' to the QEMU_CUSTOM_RUNNER variable in your > GitLab project. > > Signed-off-by: Philippe Mathieu-Daudé >

Re: [PULL 2/5] Remove the deprecated moxie target

2021-05-12 Thread Philippe Mathieu-Daudé
On 5/12/21 7:07 PM, Thomas Huth wrote: > On 12/05/2021 18.37, Philippe Mathieu-Daudé wrote: >> On 5/12/21 6:24 PM, Markus Armbruster wrote: >>> From: Thomas Huth >>> >>> There are no known users of this CPU anymore, and there are no >>> binaries available online which could be used for regression

Re: [PATCH 1/3] pc-bios/s390-ccw: Fix inline assembly for older versions of Clang

2021-05-12 Thread Philippe Mathieu-Daudé
On 5/12/21 7:15 PM, Thomas Huth wrote: > Clang versions before v11.0 insist on having the %rX or %cX register > names instead of just a number. Since our Travis-CI is currently > still using Clang v6.0, we have to fix this to avoid failing jobs. > > Signed-off-by: Thomas Huth > --- >

Re: [RFC PATCH v1 0/7] migration/snapshot: External snapshot utility

2021-05-12 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210512192619.537268-1-andrey.gruz...@virtuozzo.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210512192619.537268-1-andrey.gruz...@virtuozzo.com Subject: [RFC PATCH v1

Re: [PATCH v6 1/4] slirp: Advance libslirp submodule to add ipv6 host-forward support

2021-05-12 Thread Marc-André Lureau
Hi On Wed, May 12, 2021 at 11:51 PM Doug Evans wrote: > > Btw, can you elaborate on "should rather be a diff of the commits that are > new"? > Up until now I've been told to provide "git shortlog old..new" output. > The patch itself is just a one-liner to update the subproject sha1. > git

Re: [PATCH RFC] vfio-ccw: forward halt/clear errors

2021-05-12 Thread Eric Farman
On Tue, 2021-05-11 at 17:11 +0200, Cornelia Huck wrote: > hsch and csch basically have two parts: execute the command, > and perform the halt/clear function. For fully emulated > subchannels, it is pretty clear how it will work: check the > subchannel state, and actually 'perform the halt/clear

Re: [PATCH v9 0/3] target/arm: add support for FEAT_TLBIRANGE and FEAT_TLBIOS

2021-05-12 Thread Rebecca Cran
On 5/12/21 1:32 PM, Alex Bennée wrote: But it's needed right? It's perfectly fine to pull someone elses patch into your series if it's needed for the review. The alternative is to add a "Based-on" tag to your cover letter so it's easy to find the patch or series we need to apply before yours.

Re: [PATCH v4 17/31] target/ppc: Use translator_loop_temp_check

2021-05-12 Thread Bruno Piazera Larsen
On 12/05/2021 15:54, matheus.fe...@eldorado.org.br wrote: From: Richard Henderson The special logging is unnecessary. It will have been done immediately before in the log file. Signed-off-by: Richard Henderson Signed-off-by: Matheus Ferst --- target/ppc/translate.c | 6 +- 1 file

[RFC PATCH v1 5/7] migration/snapshot: Implementation of qemu-snapshot save path

2021-05-12 Thread Andrey Gruzdev
Includes code to parse incoming migration stream, dispatch data to section handlers and deal with complications of open-coded migration format without introducing strong dependencies on QEMU migration code. Signed-off-by: Andrey Gruzdev --- include/qemu-snapshot.h | 34 +- qemu-snapshot-vm.c

Re: [PATCH v4 08/31] target/ppc: Replace POWERPC_EXCP_SYNC with DISAS_EXIT

2021-05-12 Thread Bruno Piazera Larsen
On 12/05/2021 15:54, matheus.fe...@eldorado.org.br wrote: From: Richard Henderson Remove the synthetic "exception" after no more uses. Signed-off-by: Richard Henderson Signed-off-by: Matheus Ferst --- target/ppc/cpu.h | 1 - target/ppc/translate.c | 27 +--

[RFC PATCH v1 6/7] migration/snapshot: Implementation of qemu-snapshot load path

2021-05-12 Thread Andrey Gruzdev
This part implements snapshot loading in precopy mode. Signed-off-by: Andrey Gruzdev --- include/qemu-snapshot.h | 24 +- qemu-snapshot-vm.c | 588 +++- qemu-snapshot.c | 47 +++- 3 files changed, 654 insertions(+), 5 deletions(-) diff --git

[RFC PATCH v1 1/7] migration/snapshot: Introduce qemu-snapshot tool

2021-05-12 Thread Andrey Gruzdev
Execution environment, command-line argument parsing, usage/version info etc. Signed-off-by: Andrey Gruzdev --- include/qemu-snapshot.h | 59 ++ meson.build | 2 + qemu-snapshot-vm.c | 57 ++ qemu-snapshot.c | 439 4

[RFC PATCH v1 7/7] migration/snapshot: Implementation of qemu-snapshot load path in postcopy mode

2021-05-12 Thread Andrey Gruzdev
The commit enables asynchronous snapshot loading using standard postcopy migration mechanism on destination VM. The point of switchover to postcopy is trivially selected based on percentage of non-zero pages loaded in precopy. Signed-off-by: Andrey Gruzdev --- include/qemu-snapshot.h | 12 +

[RFC PATCH v1 0/7] migration/snapshot: External snapshot utility

2021-05-12 Thread Andrey Gruzdev
Changes v0 -> v1: * Changed command-line format, now use blockdev specification to define vmstate image. * Don't deal with image creation in the tool, create externally. * Better block layer AIO handling in the load path. * Reduced fragmentation of the image backing file by using

[RFC PATCH v1 2/7] migration/snapshot: Introduce qemu_ftell2() routine

2021-05-12 Thread Andrey Gruzdev
In qemu-snapshot it is needed to retrieve current QEMUFile offset as a number of bytes read by qemu_get_byte()/qemu_get_buffer(). The existing qemu_ftell() routine would give read position as a number of bytes fetched from underlying IOChannel which is not the same. Signed-off-by: Andrey Gruzdev

  1   2   3   4   5   >