[PATCH] target/i386: Remove obsolete TODO file

2020-06-11 Thread Thomas Huth
The last real change to this file is from 2012, so it is very likely that this file is completely out-of-date and ignored today. Let's simply remove it to avoid confusion if someone finds it by accident. Signed-off-by: Thomas Huth --- target/i386/TODO | 31 --- 1

pls consider this is [v3] Re: [PATCH 0/2] block: propagate discard alignment from format drivers to the guest

2020-06-11 Thread Denis V. Lunev
On 6/11/20 8:16 PM, Denis V. Lunev wrote: > Nowaday SCSI drivers in guests are able to align UNMAP requests before > sending to the device. Right now QEMU provides an ability to set > this via "discard_granularity" property of the block device which could > be used by management layer. > > Though,

Re: [PATCH v2 5/5] configure: Add -Wno-psabi

2020-06-11 Thread Alex Bennée
Richard Henderson writes: > On 6/11/20 9:44 AM, Alex Bennée wrote: >> >> Richard Henderson writes: >> >>> On aarch64, gcc 9.3 is generating >>> >>> qemu/exec.c: In function ‘address_space_translate_iommu’: >>> qemu/exec.c:431:28: note: parameter passing for argument of type \ >>>

[PATCH 2/2] iotests: fix 172 test

2020-06-11 Thread Denis V. Lunev
Default discard granularity is set to -2 now. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Max Reitz CC: Eduardo Habkost CC: Marcel Apfelbaum CC: John Snow CC: Paolo Bonzini CC: Fam Zheng --- tests/qemu-iotests/172.out | 106 ++--- 1 file changed, 53

[PATCH 1/2] block: propagate discard alignment from format drivers to the guest

2020-06-11 Thread Denis V. Lunev
Nowaday SCSI drivers in guests are able to align UNMAP requests before sending to the device. Right now QEMU provides an ability to set this via "discard_granularity" property of the block device which could be used by management layer. Though, in particular, from the point of QEMU, there is

[PATCH 0/2] block: propagate discard alignment from format drivers to the guest

2020-06-11 Thread Denis V. Lunev
Nowaday SCSI drivers in guests are able to align UNMAP requests before sending to the device. Right now QEMU provides an ability to set this via "discard_granularity" property of the block device which could be used by management layer. Though, in particular, from the point of QEMU, there is

[PATCH 3/4] block, migration: add bdrv_flush_vmstate helper

2020-06-11 Thread Denis V. Lunev
Right now bdrv_fclose() is just calling bdrv_flush(). The problem is that migration code is working inefficently from black layer terms and are frequently called for very small pieces of not properly aligned data. Block layer is capable to work this way, but this is very slow. This patch is a

[PATCH v3 0/4] block: seriously improve savevm performance

2020-06-11 Thread Denis V. Lunev
This series do standard basic things: - it creates intermediate buffer for all writes from QEMU migration code to QCOW2 image, - this buffer is sent to disk asynchronously, allowing several writes to run in parallel. In general, migration code is fantastically inefficent (by observation),

[PATCH 2/4] block/aio_task: allow start/wait task from any coroutine

2020-06-11 Thread Denis V. Lunev
From: Vladimir Sementsov-Ogievskiy Currently, aio task pool assumes that there is a main coroutine, which creates tasks and wait for them. Let's remove the restriction by using CoQueue. Code becomes clearer, interface more obvious. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by:

[PATCH 4/4] block/io: improve savevm performance

2020-06-11 Thread Denis V. Lunev
This patch does 2 standard basic things: - it creates intermediate buffer for all writes from QEMU migration code to block driver, - this buffer is sent to disk asynchronously, allowing several writes to run in parallel. Thus bdrv_vmstate_write() is becoming asynchronous. All pending

[PATCH 1/4] migration/savevm: respect qemu_fclose() error code in save_snapshot()

2020-06-11 Thread Denis V. Lunev
qemu_fclose() could return error, f.e. if bdrv_co_flush() will return the error. This validation will become more important once we will start waiting of asynchronous IO operations, started from bdrv_write_vmstate(), which are coming soon. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Max

Re: [PATCH v2 2/6] plugins: new lockstep plugin for debugging TCG changes

2020-06-11 Thread Robert Foley
Reviewed-by: Robert Foley Tested-by: Robert Foley The testing was mostly bringing up pairs of aarch64 VMs and either waiting for the divergence or exiting out before divergence with ctrl-a x at various stages of boot. When we exit from the VM before divergence, we observe the below: we seem to

Re: [PATCH 02/10] target/arm: Add missing TCG temp free in do_2shift_env_64()

2020-06-11 Thread Peter Maydell
On Thu, 11 Jun 2020 at 16:43, Richard Henderson wrote: > > On 6/11/20 7:45 AM, Peter Maydell wrote: > > In commit 37bfce81b10450071 we accidentally introduced a leak of a TCG > > temporary in do_2shift_env_64(); free it. > > > > Signed-off-by: Peter Maydell > > --- > > My test setup wasn't

Re: [PULL 00/15] bitmaps patches for 2020-06-09

2020-06-11 Thread Peter Maydell
On Tue, 9 Jun 2020 at 21:53, Eric Blake wrote: > > The following changes since commit 31d321c2b3574dcc74e9f6411af06bca6b5d10f4: > > Merge remote-tracking branch > 'remotes/philmd-gitlab/tags/sparc-next-20200609' into staging (2020-06-09 > 17:29:47 +0100) > > are available in the Git

[Bug 1594394] Re: Using setreuid / setegid crashes x86_64 user-mode target

2020-06-11 Thread Laurent Vivier
Steve, could you describe your problem with more details? What is the version of qemu you are using? ** Tags added: linux-user -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1594394 Title: Using

Re: [PATCH v2 5/5] configure: Add -Wno-psabi

2020-06-11 Thread Richard Henderson
On 6/11/20 9:44 AM, Alex Bennée wrote: > > Richard Henderson writes: > >> On aarch64, gcc 9.3 is generating >> >> qemu/exec.c: In function ‘address_space_translate_iommu’: >> qemu/exec.c:431:28: note: parameter passing for argument of type \ >> ‘MemTxAttrs’ {aka ‘struct MemTxAttrs’} changed

[PATCH] tests: disassemble-asm.sh: generate AML in readable format

2020-06-11 Thread Michael S. Tsirkin
On systems where the IASL tool exists, we can convert extected ACPI tables to ASL format, which is useful for debugging and documentation purposes. This script does this for all ACPI tables under tests/data/acpi/. Signed-off-by: Michael S. Tsirkin --- tests/data/acpi/disassemle-aml.sh | 52

Re: [PATCH 10/10] target/arm: Convert Neon VDUP (scalar) to decodetree

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > Convert the Neon VDUP (scalar) insn to decodetree. (Note that we > can't call this just "VDUP" as we used that already in vfp.decode for > the "VDUP (general purpose register" insn.) > > Signed-off-by: Peter Maydell > --- > target/arm/neon-dp.decode

Re: [PATCH 09/10] target/arm: Convert Neon VTBL, VTBX to decodetree

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > +static bool trans_VTBL(DisasContext *s, arg_VTBL *a) > +{ > +int n; > +TCGv_i32 tmp, tmp2, tmp3, tmp4; > +TCGv_ptr ptr1; > + > +if (!arm_dc_feature(s, ARM_FEATURE_NEON)) { > +return false; > +} > + > +/* UNDEF accesses to

Re: [PATCH 0/2] monitor openfd commands

2020-06-11 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > On 6/11/20 6:17 AM, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > The monitors currently have a 'getfd' command that lets you pass an fd > > via the monitor socket. 'openfd' is a new command that opens a file > > and

Re: [PATCH v2 5/5] configure: Add -Wno-psabi

2020-06-11 Thread Alex Bennée
Richard Henderson writes: > On aarch64, gcc 9.3 is generating > > qemu/exec.c: In function ‘address_space_translate_iommu’: > qemu/exec.c:431:28: note: parameter passing for argument of type \ > ‘MemTxAttrs’ {aka ‘struct MemTxAttrs’} changed in GCC 9.1 > > and many other reptitions. This

Re: [PATCH 09/10] target/arm: Convert Neon VTBL, VTBX to decodetree

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > Convert the Neon VTBL, VTBX instructions to decodetree. The actual > implementation of the insn is copied across to the new trans function > unchanged except for renaming 'tmp5' to 'tmp4'. > > Signed-off-by: Peter Maydell > --- >

[PATCH v4 4/4] block/io: auto-no-fallback for write-zeroes

2020-06-11 Thread Vladimir Sementsov-Ogievskiy
When BDRV_REQ_NO_FALLBACK is supported, the NBD driver supports a larger request size. Add code to try large zero requests with a NO_FALLBACK request prior to having to split a request into chunks according to max_pwrite_zeroes. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 19

Re: [PATCH 08/10] target/arm: Convert Neon VEXT to decodetree

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > Convert the Neon VEXT insn to decodetree. Rather than keeping the > old implementation which used fixed temporaries cpu_V0 and cpu_V1 > and did the extraction with by-hand shift and logic ops, we use > the TCG extract2 insn. > > We don't need to special

[PATCH v4 0/4] nbd: reduce max_block restrictions

2020-06-11 Thread Vladimir Sementsov-Ogievskiy
Recent changes in NBD protocol allowed to use some commands without max_block restriction. Let's drop the restrictions. NBD change is here: https://github.com/NetworkBlockDevice/nbd/commit/9f30fedb8699f151e7ef4ccc07e624330be3316b#diff-762fb7c670348da69cc9050ef58fe3ae v4: fix auto_no_fallback

[PATCH v4 1/4] block: add max_pwrite_zeroes_fast to BlockLimits

2020-06-11 Thread Vladimir Sementsov-Ogievskiy
The NBD spec was recently updated to clarify that max_block doesn't relate to NBD_CMD_WRITE_ZEROES with NBD_CMD_FLAG_FAST_ZERO (which mirrors Qemu flag BDRV_REQ_NO_FALLBACK). To drop the restriction we need new max_pwrite_zeroes_fast. Default value of new max_pwrite_zeroes_fast is zero and it

[PATCH v4 3/4] block/io: refactor bdrv_co_do_pwrite_zeroes head calculation

2020-06-11 Thread Vladimir Sementsov-Ogievskiy
It's wrong to update head using num in this place, as num may be reduced during the iteration (seems it doesn't, but it's not obvious), and we'll have wrong head value on next iteration. Instead update head at iteration end. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake

[PATCH RESEND 9/9] hw/arm/smmuv3: Advertise SMMUv3.2 range invalidation

2020-06-11 Thread Eric Auger
Expose the RIL bit so that the guest driver uses range invalidation. Signed-off-by: Eric Auger --- hw/arm/smmuv3-internal.h | 1 + hw/arm/smmuv3.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h index 5babf72f7d..4e7ec252ed

[PATCH v4 2/4] block/nbd: define new max_write_zero_fast limit

2020-06-11 Thread Vladimir Sementsov-Ogievskiy
The NBD spec was recently updated to clarify that max_block doesn't relate to NBD_CMD_WRITE_ZEROES with NBD_CMD_FLAG_FAST_ZERO (which mirrors Qemu flag BDRV_REQ_NO_FALLBACK). bs->bl.max_write_zero_fast is zero by default which means using max_pwrite_zeroes. Update nbd driver to allow larger

Re: [PATCH 07/10] target/arm: Convert Neon 2-reg-scalar long multiplies to decodetree

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > Convert the Neon 2-reg-scalar long multiplies to decodetree. > These are the last instructions in the group. > > Signed-off-by: Peter Maydell > --- > target/arm/neon-dp.decode | 18 > target/arm/translate-neon.inc.c | 163

Re: [PATCH v2 03/11] hw/tpm: Rename TPMDEV as TPM_BACKEND in Kconfig

2020-06-11 Thread Stefan Berger
On 6/11/20 12:02 PM, Philippe Mathieu-Daudé wrote: The TPMDEV describe TPM backends. Use the TPM_BACKEND config name which is self-explicit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Berger --- hw/tpm/Kconfig | 12 ++-- 1 file changed, 6 insertions(+), 6

Re: [PATCH 05/10] target/arm: Convert Neon 2-reg-scalar VQDMULH, VQRDMULH to decodetree

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > Convert the VQDMULH and VQRDMULH insns in the 2-reg-scalar group > to decodetree. > > Signed-off-by: Peter Maydell > --- > target/arm/neon-dp.decode | 3 +++ > target/arm/translate-neon.inc.c | 29 +++ >

Re: [PATCH v2 00/11] tpm: Split hw/ vs backends/

2020-06-11 Thread Stefan Berger
On 6/11/20 12:02 PM, Philippe Mathieu-Daudé wrote: Hi, Yesterday I started to review some vTPM patches and got very confused by the files under hw/tpm/. In particular after running: $ git grep TYPE_TPM_BACKEND backends/tpm.c:188:.name = TYPE_TPM_BACKEND, hw/tpm/tpm_emulator.c:985:

[PATCH RESEND 6/9] hw/arm/smmu-common: Manage IOTLB block entries

2020-06-11 Thread Eric Auger
At the moment each entry in the IOTLB corresponds to a page sized mapping (4K, 16K or 64K), even if the page belongs to a mapped block. In case of block mapping this unefficiently consume IOTLB entries. Change the value of the entry so that it reflects the actual mapping it belongs to (block or

Re: [PATCH v2 02/11] backends: Add TPM files into their own directory

2020-06-11 Thread Stefan Berger
On 6/11/20 12:02 PM, Philippe Mathieu-Daudé wrote: As we will have various TPM backend files, it is cleaner to use a single directory. Suggested-by: Stefan Berger Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Berger --- backends/{tpm.c => tpm/tpm_backend.c} | 0

Re: [RFC PATCH] logging: add a LOG_TCG_WARN for temp leaks

2020-06-11 Thread Alex Bennée
Peter Maydell writes: > On Thu, 11 Jun 2020 at 15:45, Alex Bennée wrote: >> >> Pretty much all calls to qemu_log are either wrapped in some other >> enabling check or only enabled with debug defines. Add a specific flag >> for TCG warnings and expand the documentation of the qemu_log >>

Re: [PATCH 06/10] target/arm: Convert Neon 2-reg-scalar VQRDMLAH, VQRDMLSH to decodetree

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > Convert the VQRDMLAH and VQRDMLSH insns in the 2-reg-scalar > group to decodetree. ... > +static bool do_vqrdmlah_2sc(DisasContext *s, arg_2scalar *a, > +NeonGenThreeOpEnvFn *opfn) > +{ > +/* > + * VQRDMLAH/VQRDMLSH:

Re: [PATCH v2 01/11] docs/specs/tpm: Correct header path name

2020-06-11 Thread Stefan Berger
On 6/11/20 12:02 PM, Philippe Mathieu-Daudé wrote: Commit 8dc6701722 introduce the documentation but an incorrect path name was used. Fix that. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Berger --- docs/specs/tpm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH RESEND 0/9] SMMUv3.2 Range-based TLB Invalidation Support

2020-06-11 Thread Eric Auger
SMMU3.2 brings the support of range-based TLB invalidation and level hint. When this feature is supported, the SMMUv3 driver is allowed to send TLB invalidations for a range of IOVAs instead of using page based invalidation. Implementing this feature in the virtual SMMUv3 device is mandated for

Re: [RFC v6 00/25] intel_iommu: expose Shared Virtual Addressing to VMs

2020-06-11 Thread no-reply
Patchew URL: https://patchew.org/QEMU/1591880064-30638-1-git-send-email-yi.l@intel.com/ Hi, This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST

[PATCH RESEND 8/9] hw/arm/smmuv3: Get prepared for range invalidation

2020-06-11 Thread Eric Auger
Enhance the smmu_iotlb_inv_iova() helper with range invalidation. This uses the new fields passed in the NH_VA and NH_VAA commands: the size of the range, the level and the granule. As NH_VA and NH_VAA both use those fields, their decoding and handling is factorized in a new

[PATCH RESEND 5/9] hw/arm/smmuv3: Store the starting level in SMMUTransTableInfo

2020-06-11 Thread Eric Auger
Compute the starting level on CD decoding and store it into SMMUTransTableInfo. We will need this information on IOTLB lookup so let's avoid to recompute it each time. Signed-off-by: Eric Auger --- include/hw/arm/smmu-common.h | 1 + hw/arm/smmu-common.c | 2 +- hw/arm/smmuv3.c

[PATCH RESEND 3/9] hw/arm/smmu: Simplify the IOTLB key format

2020-06-11 Thread Eric Auger
Instead of using a Jenkins hash function to generate the key let's just use a 64 bit unsigned integer that contains the asid and the 40 upper bits of the iova. A maximum of 52-bit IOVA is supported. This change in the key format also prepares for the addition of new fields in subsequent patches

[PATCH RESEND 7/9] hw/arm/smmuv3: Introduce smmuv3_s1_range_inval() helper

2020-06-11 Thread Eric Auger
Let's introduce an helper for S1 IOVA range invalidation. This will be used for NH_VA and NH_VAA commands. It decodes the same fields, trace, calls the UNMAP notifiers and invalidate the corresponding IOTLB entries. At the moment, we do not support 3.2 range invalidation yet. So it reduces to a

[PATCH RESEND 2/9] hw/arm/smmu-common: Add IOTLB helpers

2020-06-11 Thread Eric Auger
Add two helpers to lookup for a given IOTLB entry and an one. We also more the tracing there. Signed-off-by: Eric Auger --- include/hw/arm/smmu-common.h | 2 ++ hw/arm/smmu-common.c | 36 hw/arm/smmuv3.c | 26 ++

Re: [PATCH v4 1/5] acpi: Convert build_tpm2() to build_append* API

2020-06-11 Thread Auger Eric
Hi Stefan, On 6/11/20 5:19 PM, Stefan Berger wrote: > On 6/11/20 9:59 AM, Eric Auger wrote: >> In preparation of its move to the generic acpi code, >> let's convert build_tpm2() to use build_append API. This >> latter now is prefered in place of direct ACPI struct field >> settings with manual

[PATCH RESEND 4/9] hw/arm/smmu: Introduce SMMUTLBEntry for PTW and IOTLB value

2020-06-11 Thread Eric Auger
Introduce a specialized SMMUTLBEntry to store the result of the PTW and cache in the IOTLB. This structure extends the generic IOMMUTLBEntry struct with the level of the entry and the granule size. Those latter will be useful when implementing range invalidation. Signed-off-by: Eric Auger ---

[PATCH RESEND 1/9] hw/arm/smmu-common: Factorize some code in smmu_ptw_64()

2020-06-11 Thread Eric Auger
Page and block PTE decoding can share some code. Let's first handle table PTE and factorize some code shared by page and block PTEs. Signed-off-by: Eric Auger --- hw/arm/smmu-common.c | 51 1 file changed, 18 insertions(+), 33 deletions(-) diff

[PATCH v2 04/11] hw/tpm: Do not include 'qemu/osdep.h' in header

2020-06-11 Thread Philippe Mathieu-Daudé
>From CODING_STYLE.rst: Do not include "qemu/osdep.h" from header files since the .c file will have already included it. Remove "qemu/osdep.h" from "tpm_tis.h". Reviewed-by: Stefan Berger Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/tpm_tis.h | 1 - 1 file changed, 1 deletion(-)

Re: [PATCH 04/10] target/arm: Convert Neon 2-reg-scalar float multiplies to decodetree

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > Convert the float versions of VMLA, VMLS and VMUL in the Neon > 2-reg-scalar group to decodetree. > > Signed-off-by: Peter Maydell > --- > As noted in the comment on the WRAP_FP_FN macro, we could have > had a do_2scalar_fp() function, but for 3 insns

Re: [PATCH v2 1/4] riscv: Generalize CPU init routine for the base CPU

2020-06-11 Thread Alistair Francis
On Wed, Jun 10, 2020 at 6:09 PM Bin Meng wrote: > > From: Bin Meng > > There is no need to have two functions that have exactly the same > codes for 32-bit and 64-bit base CPUs. > > Signed-off-by: Bin Meng > Reviewed-by: Alistair Francis Applied to riscv-to-apply branch. Alistair > --- > >

[PATCH v2 03/11] hw/tpm: Rename TPMDEV as TPM_BACKEND in Kconfig

2020-06-11 Thread Philippe Mathieu-Daudé
The TPMDEV describe TPM backends. Use the TPM_BACKEND config name which is self-explicit. Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/Kconfig | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/tpm/Kconfig b/hw/tpm/Kconfig index 4794e7fe28..5028fd8880 100644

Re: [PATCH 03/10] target/arm: Convert Neon 2-reg-scalar integer multiplies to decodetree

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > Convert the VMLA, VMLS and VMUL insns in the Neon "2 registers and a > scalar" group to decodetree. These are 32x32->32 operations where > one of the inputs is the scalar, followed by a possible accumulate > operation of the 32-bit result. > > The

[PATCH v2 07/11] hw/tpm: Remove unnecessary 'tpm_int.h' header inclusion

2020-06-11 Thread Philippe Mathieu-Daudé
Remove unnecessary 'tpm_int.h' header inclusion. Reviewed-by: Stefan Berger Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/tpm_crb.c| 1 - hw/tpm/tpm_spapr.c | 1 - hw/tpm/tpm_tis_common.c | 1 - 3 files changed, 3 deletions(-) diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c

[PATCH v3 0/6] Add strace support for printing arguments of selected syscalls

2020-06-11 Thread Filip Bozuta
From: Filip Bozuta This series covers strace support for printing arguments of following syscalls: *acct() *lgetxattr() *removexattr() *lchown() *fsync() *fgetxattr() *lremovexattr() *fallocate() *fdatasync() *listxattr()

[PATCH v3 2/6] linux-user: Add strace support for a group of syscalls

2020-06-11 Thread Filip Bozuta
From: Filip Bozuta This patch implements strace argument printing functionality for following syscalls: *acct - switch process accounting on or off int acct(const char *filename) man page: https://www.man7.org/linux/man-pages/man2/acct.2.html *fsync, fdatasync -

[PATCH v2 09/11] hw/tpm: Move DEFINE_PROP_TPMBE() macro to 'tmp_prop.h' local header

2020-06-11 Thread Philippe Mathieu-Daudé
We are going to make "tpm_util.h" publicly accessible by moving it to the include/ directory in the next commit. The DEFINE_PROP_TPMBE() macro is only meaningful for the TPM hardware files (in hw/tpm/), so keep this macro in a local header. Reviewed-by: Stefan Berger Signed-off-by: Philippe

[PATCH v2 10/11] hw/tpm: Make 'tpm_util.h' publicly accessible as "sysemu/tpm_util.h"

2020-06-11 Thread Philippe Mathieu-Daudé
We are going to split the TPM backends from the TPM emulated hardware in the next commit. Make the TPM util helpers accessible by moving local "tpm_util.h" to global "sysemu/tpm_util.h". Reviewed-by: Stefan Berger Signed-off-by: Philippe Mathieu-Daudé --- docs/specs/tpm.rst

[PATCH v2 08/11] hw/tpm: Move few declarations from 'tpm_util.h' to 'tpm_int.h'

2020-06-11 Thread Philippe Mathieu-Daudé
We are going to make "tpm_util.h" publicly accessible by moving it to the include/ directory in a pair of commits. Keep declarations internals to hw/tpm/ in "tpm_int.h". Reviewed-by: Stefan Berger Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/tpm_int.h | 11 +++ hw/tpm/tpm_util.h |

[RFC PATCH v2 11/11] tpm: Move backend code under the 'backends/' directory

2020-06-11 Thread Philippe Mathieu-Daudé
TPM subsytem is split into backends (see commit f4ede81eed2) and frontends (see i.e. 3676bc69b35). Keep the emulated hardware 'frontends' under hw/tpm/, but move the backends in the backends/tpm/ directory. Suggested-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé --- RFC due to a

[PATCH v2 01/11] docs/specs/tpm: Correct header path name

2020-06-11 Thread Philippe Mathieu-Daudé
Commit 8dc6701722 introduce the documentation but an incorrect path name was used. Fix that. Signed-off-by: Philippe Mathieu-Daudé --- docs/specs/tpm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/specs/tpm.rst b/docs/specs/tpm.rst index 5e61238bc5..9e48e3b981

[PATCH v2 00/11] tpm: Split hw/ vs backends/

2020-06-11 Thread Philippe Mathieu-Daudé
Hi, Yesterday I started to review some vTPM patches and got very confused by the files under hw/tpm/. In particular after running: $ git grep TYPE_TPM_BACKEND backends/tpm.c:188:.name = TYPE_TPM_BACKEND, hw/tpm/tpm_emulator.c:985:.parent = TYPE_TPM_BACKEND,

[PATCH v2 06/11] hw/tpm: Move 'hw/acpi/tpm.h' inclusion from header to sources

2020-06-11 Thread Philippe Mathieu-Daudé
Nothing in "tpm_ppi.h" require declarations from "hw/acpi/tpm.h". Reduce dependencies and include it only in the files requiring it. Reviewed-by: Stefan Berger Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/tpm_ppi.h| 1 - hw/tpm/tpm_ppi.c| 1 + hw/tpm/tpm_tis_isa.c| 1 +

[PATCH v2 05/11] hw/tpm: Include missing 'qemu/option.h' header

2020-06-11 Thread Philippe Mathieu-Daudé
Files using the TPM_STANDARD_CMDLINE_OPTS macro declared in "tpm_int.h" will use QEMU_OPT_STRING definition declared in "qemu/option.h". Reviewed-by: Stefan Berger Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/tpm_int.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/tpm/tpm_int.h

[PATCH v2 02/11] backends: Add TPM files into their own directory

2020-06-11 Thread Philippe Mathieu-Daudé
As we will have various TPM backend files, it is cleaner to use a single directory. Suggested-by: Stefan Berger Signed-off-by: Philippe Mathieu-Daudé --- backends/{tpm.c => tpm/tpm_backend.c} | 0 MAINTAINERS | 2 +- backends/Makefile.objs| 2 +-

[PATCH v3 6/6] linux-user: Add strace support for printing arguments of fallocate()

2020-06-11 Thread Filip Bozuta
From: Filip Bozuta This patch implements strace argument printing functionality for following syscall: *fallocate - manipulate file space int fallocate(int fd, int mode, off_t offset, off_t len) man page: https://www.man7.org/linux/man-pages/man2/fallocate.2.html

[PATCH v3 4/6] linux-user: Add strace support for printing arguments of lseek()

2020-06-11 Thread Filip Bozuta
From: Filip Bozuta This patch implements strace argument printing functionality for syscall: *lseek - reposition read/write file offset off_t lseek(int fd, off_t offset, int whence) man page: https://www.man7.org/linux/man-pages/man2/lseek.2.html Implementation notes:

[PATCH v3 1/6] linux-user: Extend strace support to enable argument printing after syscall execution

2020-06-11 Thread Filip Bozuta
From: Filip Bozuta Structure "struct syscallname" in file "strace.c" is used for "-strace" to print arguments and return values of syscalls. The last field of this structure "result" represents the calling function that prints the return values. This field was extended in this

[PATCH v3 5/6] linux-user: Add strace support for printing arguments of chown()/lchown()

2020-06-11 Thread Filip Bozuta
From: Filip Bozuta This patch implements strace argument printing functionality for syscalls: *chown, lchown - change ownership of a file int chown(const char *pathname, uid_t owner, gid_t group) int lchown(const char *pathname, uid_t owner, gid_t group) man page:

[PATCH v3 3/6] linux-user: Add strace support for printing argument of syscalls used for extended attributes

2020-06-11 Thread Filip Bozuta
From: Filip Bozuta This patch implements strace argument printing functionality for following syscalls: *getxattr, lgetxattr, fgetxattr - retrieve an extended attribute value ssize_t getxattr(const char *path, const char *name, void *value, size_t size) ssize_t

Re: [PATCH 02/10] target/arm: Add missing TCG temp free in do_2shift_env_64()

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > In commit 37bfce81b10450071 we accidentally introduced a leak of a TCG > temporary in do_2shift_env_64(); free it. > > Signed-off-by: Peter Maydell > --- > My test setup wasn't looking for temporary-leak warnings (they are > not as easy to get at as

Re: [PATCH 01/10] target/arm: Add 'static' and 'const' annotations to VSHLL function arrays

2020-06-11 Thread Richard Henderson
On 6/11/20 7:45 AM, Peter Maydell wrote: > Mark the arrays of function pointers in trans_VSHLL_S_2sh() and > trans_VSHLL_U_2sh() as both 'static' and 'const'. > > Signed-off-by: Peter Maydell > --- > target/arm/translate-neon.inc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-)

Re: [PATCH v3 1/4] spapr: Simplify some warning printing paths in spapr_caps.c

2020-06-11 Thread Laurent Vivier
On 11/06/2020 15:40, Greg Kurz wrote: > We obviously only want to print a warning in these cases, but this is done > in a rather convoluted manner. Just use warn_report() instead. > > Signed-off-by: Greg Kurz > --- > hw/ppc/spapr_caps.c | 28 ++-- > 1 file changed, 6

[PATCH v2] rbd: Use RBD fast-diff for querying actual allocation

2020-06-11 Thread Yi Li
Since Ceph version Infernalis (9.2.0) the new fast-diff mechanism of RBD allows for querying actual rbd image usage. Prior to this version there was no easy and fast way to query how much allocation a RBD image had inside a Ceph cluster. To use the fast-diff feature it needs to be enabled per

Re: [PATCH v3 3/4] spapr: Use error_append_hint() in spapr_caps.c

2020-06-11 Thread Laurent Vivier
On 11/06/2020 15:40, Greg Kurz wrote: > We have a dedicated error API for hints. Use it instead of embedding > the hint in the error message, as recommanded in the "qapi/error.h" > header file. > > Since spapr_caps_apply() passes _fatal, all functions must > also call the ERRP_AUTO_PROPAGATE()

[Bug 1594394] Re: Using setreuid / setegid crashes x86_64 user-mode target

2020-06-11 Thread Steve Dodd
Did anything ever happen here? Trying to upgrade Ubuntu ARM container images using qemu-user on x86-64 from bionic to focal.. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1594394 Title: Using

Re: [PATCH v4 1/5] acpi: Convert build_tpm2() to build_append* API

2020-06-11 Thread Stefan Berger
On 6/11/20 9:59 AM, Eric Auger wrote: In preparation of its move to the generic acpi code, let's convert build_tpm2() to use build_append API. This latter now is prefered in place of direct ACPI struct field settings with manual endianness conversion. Signed-off-by: Eric Auger --- v3 ->

Re: [PATCH v8 0/4] vhost-user block device backend implementation

2020-06-11 Thread Stefan Hajnoczi
On Fri, Jun 05, 2020 at 07:35:34AM +0800, Coiby Xu wrote: > v8 > - re-try connecting to socket server to fix asan error > - fix license naming issue Great, thanks for posting these patches! I have posted feedback. I'd like to merge this soon. If you are busy I can send you patches that address

Re: [PATCH v8 3/4] vhost-user block device backend server

2020-06-11 Thread Stefan Hajnoczi
On Fri, Jun 05, 2020 at 07:35:37AM +0800, Coiby Xu wrote: > +static void coroutine_fn vu_block_virtio_process_req(void *opaque) > +{ > +struct req_data *data = opaque; > +VuServer *server = data->server; > +VuVirtq *vq = data->vq; > +VuVirtqElement *elem = data->elem; > +

Re: [PATCH v4 2/5] acpi: Move build_tpm2() in the generic part

2020-06-11 Thread Stefan Berger
On 6/11/20 9:59 AM, Eric Auger wrote: We plan to build the TPM2 table on ARM too. In order to reuse the generation code, let's move build_tpm2() to aml-build.c. No change in the implementation. Signed-off-by: Eric Auger Reviewed-by: Stefan Berger --- include/hw/acpi/aml-build.h | 2

[PATCH v3 5/5] hw/arm/virt: Let the virtio-iommu bypass MSIs

2020-06-11 Thread Eric Auger
At the moment the virtio-iommu translates MSI transactions. This behavior is inherited from ARM SMMU. The virt machine code knows where the guest MSI doorbells are so we can easily declare those regions as VIRTIO_IOMMU_RESV_MEM_T_MSI. With that setting the guest will not map MSIs through the IOMMU

[PATCH v3 3/5] virtio-iommu: Handle reserved regions in the translation process

2020-06-11 Thread Eric Auger
When translating an address we need to check if it belongs to a reserved virtual address range. If it does, there are 2 cases: - it belongs to a RESERVED region: the guest should neither use this address in a MAP not instruct the end-point to DMA on them. We report an error - It belongs to

[PATCH v3 4/5] virtio-iommu-pci: Add array of Interval properties

2020-06-11 Thread Eric Auger
The machine may need to pass reserved regions to the virtio-iommu-pci device (such as the MSI window on x86). So let's add an array of Interval properties. Signed-off-by: Eric Auger Reviewed-by: Jean-Philippe Brucker --- v12 -> v12: - added Jean's R-b --- hw/virtio/virtio-iommu-pci.c | 3 +++

Re: [RFC PATCH] logging: add a LOG_TCG_WARN for temp leaks

2020-06-11 Thread Philippe Mathieu-Daudé
On 6/11/20 4:45 PM, Alex Bennée wrote: > Pretty much all calls to qemu_log are either wrapped in some other > enabling check or only enabled with debug defines. Add a specific flag > for TCG warnings and expand the documentation of the qemu_log > function. > > Signed-off-by: Alex Bennée > Cc:

[PATCH v3 2/5] virtio-iommu: Implement RESV_MEM probe request

2020-06-11 Thread Eric Auger
This patch implements the PROBE request. At the moment, only THE RESV_MEM property is handled. The first goal is to report iommu wide reserved regions such as the MSI regions set by the machine code. On x86 this will be the IOAPIC MSI region, [0xFEE0 - 0xFEEF], on ARM this may be the ITS

[PATCH v3 1/5] qdev: Introduce DEFINE_PROP_RESERVED_REGION

2020-06-11 Thread Eric Auger
Introduce a new property defining a reserved region: , , . This will be used to encode reserved IOVA regions. For instance, in virtio-iommu use case, reserved IOVA regions will be passed by the machine code to the virtio-iommu-pci device (an array of those). The type of the reserved region will

[PATCH v3 0/5] VIRTIO-IOMMU probe request support and MSI bypass on ARM

2020-06-11 Thread Eric Auger
By default the virtio-iommu translates MSI transactions. This behavior is inherited from ARM SMMU. However the virt machine code knows where the MSI doorbells are, so we can easily declare those regions as VIRTIO_IOMMU_RESV_MEM_T_MSI. With that setting the guest iommu subsystem will not need to

Re: [PATCH 12/13] i386: hvf: Move mmio_buf into CPUX86State

2020-06-11 Thread Roman Bolshakov
On Thu, Jun 11, 2020 at 03:24:31PM +0200, Claudio Fontana wrote: > On 6/4/20 8:27 PM, Paolo Bonzini wrote: > > On 28/05/20 21:37, Roman Bolshakov wrote: > >> There's no similar field in CPUX86State, but it's needed for MMIO traps. > >> > >> Signed-off-by: Roman Bolshakov > >> --- > >>

[PATCH 08/10] target/arm: Convert Neon VEXT to decodetree

2020-06-11 Thread Peter Maydell
Convert the Neon VEXT insn to decodetree. Rather than keeping the old implementation which used fixed temporaries cpu_V0 and cpu_V1 and did the extraction with by-hand shift and logic ops, we use the TCG extract2 insn. We don't need to special case 0 or 8 immediates any more as the optimizer is

Re: [PATCH v4 1/5] acpi: Convert build_tpm2() to build_append* API

2020-06-11 Thread Auger Eric
Hi Stefan, On 6/11/20 4:25 PM, Stefan Berger wrote: > On 6/11/20 9:59 AM, Eric Auger wrote: >> In preparation of its move to the generic acpi code, >> let's convert build_tpm2() to use build_append API. This >> latter now is prefered in place of direct ACPI struct field >> settings with manual

[PATCH 03/10] target/arm: Convert Neon 2-reg-scalar integer multiplies to decodetree

2020-06-11 Thread Peter Maydell
Convert the VMLA, VMLS and VMUL insns in the Neon "2 registers and a scalar" group to decodetree. These are 32x32->32 operations where one of the inputs is the scalar, followed by a possible accumulate operation of the 32-bit result. The refactoring removes some of the oddities of the old

Re: [PATCH v4 1/5] acpi: Convert build_tpm2() to build_append* API

2020-06-11 Thread Auger Eric
Hi Stefan, On 6/11/20 4:25 PM, Stefan Berger wrote: > On 6/11/20 9:59 AM, Eric Auger wrote: >> In preparation of its move to the generic acpi code, >> let's convert build_tpm2() to use build_append API. This >> latter now is prefered in place of direct ACPI struct field >> settings with manual

[PATCH 05/10] target/arm: Convert Neon 2-reg-scalar VQDMULH, VQRDMULH to decodetree

2020-06-11 Thread Peter Maydell
Convert the VQDMULH and VQRDMULH insns in the 2-reg-scalar group to decodetree. Signed-off-by: Peter Maydell --- target/arm/neon-dp.decode | 3 +++ target/arm/translate-neon.inc.c | 29 +++ target/arm/translate.c | 42 ++--- 3

Re: [RFC PATCH] logging: add a LOG_TCG_WARN for temp leaks

2020-06-11 Thread Peter Maydell
On Thu, 11 Jun 2020 at 15:45, Alex Bennée wrote: > > Pretty much all calls to qemu_log are either wrapped in some other > enabling check or only enabled with debug defines. Add a specific flag > for TCG warnings and expand the documentation of the qemu_log > function. > > Signed-off-by: Alex

[RFC PATCH] logging: add a LOG_TCG_WARN for temp leaks

2020-06-11 Thread Alex Bennée
Pretty much all calls to qemu_log are either wrapped in some other enabling check or only enabled with debug defines. Add a specific flag for TCG warnings and expand the documentation of the qemu_log function. Signed-off-by: Alex Bennée Cc: Peter Maydell --- include/qemu/log-for-trace.h | 9

[PATCH 10/10] target/arm: Convert Neon VDUP (scalar) to decodetree

2020-06-11 Thread Peter Maydell
Convert the Neon VDUP (scalar) insn to decodetree. (Note that we can't call this just "VDUP" as we used that already in vfp.decode for the "VDUP (general purpose register" insn.) Signed-off-by: Peter Maydell --- target/arm/neon-dp.decode | 7 +++ target/arm/translate-neon.inc.c | 26

[PATCH 00/10] target/arm: Convert 2-reg-scalar to decodetree

2020-06-11 Thread Peter Maydell
This patchset converts the whole 2-reg-scalar group to decodetree, together with the VEXT, VTBL, VTBX, VDUP insns which don't fall into any particular group. The only remaining unconverted Neon insns are now the "2 registers misc" group. Based-on: 20200609160209.29960-1-peter.mayd...@linaro.org

[PATCH 06/10] target/arm: Convert Neon 2-reg-scalar VQRDMLAH, VQRDMLSH to decodetree

2020-06-11 Thread Peter Maydell
Convert the VQRDMLAH and VQRDMLSH insns in the 2-reg-scalar group to decodetree. Signed-off-by: Peter Maydell --- target/arm/neon-dp.decode | 3 ++ target/arm/translate-neon.inc.c | 74 + target/arm/translate.c | 38 + 3 files

[PATCH 04/10] target/arm: Convert Neon 2-reg-scalar float multiplies to decodetree

2020-06-11 Thread Peter Maydell
Convert the float versions of VMLA, VMLS and VMUL in the Neon 2-reg-scalar group to decodetree. Signed-off-by: Peter Maydell --- As noted in the comment on the WRAP_FP_FN macro, we could have had a do_2scalar_fp() function, but for 3 insns it seemed simpler to just do the wrapping to get hold of

[PATCH 01/10] target/arm: Add 'static' and 'const' annotations to VSHLL function arrays

2020-06-11 Thread Peter Maydell
Mark the arrays of function pointers in trans_VSHLL_S_2sh() and trans_VSHLL_U_2sh() as both 'static' and 'const'. Signed-off-by: Peter Maydell --- target/arm/translate-neon.inc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/translate-neon.inc.c

<    1   2   3   4   5   >