[PULL 6/8] fuzz: unblock SIGALRM so the timeout works

2021-08-25 Thread Alexander Bulekov
The timeout mechanism won't work if SIGALRM is blocked. This changes unmasks SIGALRM when the timer is installed. This doesn't completely solve the problem, as the fuzzer could trigger some device activity that re-masks SIGALRM. However, there are currently no inputs on OSS-Fuzz that re-mask SIGALR

[PULL 1/8] fuzz: fix sparse memory access in the DMA callback

2021-08-25 Thread Alexander Bulekov
The code mistakenly relied on address_space_translate to store the length remaining until the next memory-region. We care about this because when there is RAM or sparse-memory neighboring on an MMIO region, we should only write up to the border, to prevent inadvertently invoking MMIO handlers withi

[PULL 7/8] MAINTAINERS: Add myself as a reviewer for Device Fuzzing

2021-08-25 Thread Alexander Bulekov
From: Darren Kenny Should have done this much sooner given the amount of reviewing I'm already doing in this area. Signed-off-by: Darren Kenny Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alexander Bulekov --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/

Re: [PATCH v5 07/14] target/riscv: Add instructions of the Zbc-extension

2021-08-25 Thread Richard Henderson
On 8/23/21 11:42 AM, Philipp Tomsich wrote: +static bool trans_clmul(DisasContext *ctx, arg_clmul *a) +{ +REQUIRE_ZBC(ctx); +return gen_arith(ctx, a, gen_helper_clmul); +} + + +static bool trans_clmulh(DisasContext *ctx, arg_clmulr *a) +{ +REQUIRE_ZBC(ctx); +return gen_arith(ctx,

[PULL v2 1/8] fuzz: fix sparse memory access in the DMA callback

2021-08-25 Thread Alexander Bulekov
The code mistakenly relied on address_space_translate to store the length remaining until the next memory-region. We care about this because when there is RAM or sparse-memory neighboring on an MMIO region, we should only write up to the border, to prevent inadvertently invoking MMIO handlers withi

[PULL v2 0/8] Fuzzing Patches for 2021-08-25

2021-08-25 Thread Alexander Bulekov
Hi Paolo, (Resending, since I didn't send the original PR cover-letter to qemu-devel) The following changes since commit d42685765653ec155fdf60910662f8830bdb2cef: Open 6.2 development tree (2021-08-25 10:25:12 +0100) are available in the Git repository at: https://gitlab.com/a1xndr/qemu/ f

[PULL v2 5/8] fuzz: use ITIMER_REAL for timeouts

2021-08-25 Thread Alexander Bulekov
Using ITIMER_VIRTUAL is a bad idea, if the fuzzer hits a blocking syscall - e.g. ppoll with a NULL timespec. This causes timeout issues while fuzzing some block-device code. Fix that by using wall-clock time. This might cause inputs to timeout sometimes due to scheduling effects/ambient load, but i

[PULL v2 3/8] fuzz: make object-name matching case-insensitive

2021-08-25 Thread Alexander Bulekov
We have some configs for devices such as the AC97 and ES1370 that were not matching memory-regions correctly, because the configs provided lowercase names. To resolve these problems and prevent them from occurring again in the future, convert both the pattern and names to lower-case, prior to check

[PULL v2 2/8] fuzz: adjust timeout to allow for longer inputs

2021-08-25 Thread Alexander Bulekov
Using a custom timeout is useful to continue fuzzing complex devices, even after we run into some slow code-path. However, simply adding a fixed timeout to each input effectively caps the maximum input length/number of operations at some artificial value. There are two major problems with this: 1.

[PULL v2 6/8] fuzz: unblock SIGALRM so the timeout works

2021-08-25 Thread Alexander Bulekov
The timeout mechanism won't work if SIGALRM is blocked. This changes unmasks SIGALRM when the timer is installed. This doesn't completely solve the problem, as the fuzzer could trigger some device activity that re-masks SIGALRM. However, there are currently no inputs on OSS-Fuzz that re-mask SIGALR

[PULL v2 4/8] fuzz: add an instrumentation filter

2021-08-25 Thread Alexander Bulekov
By default, -fsanitize=fuzzer instruments all code with coverage information. However, this means that libfuzzer will track coverage over hundreds of source files that are unrelated to virtual-devices. This means that libfuzzer will optimize inputs for coverage observed in timer code, memory APIs e

[PULL v2 7/8] MAINTAINERS: Add myself as a reviewer for Device Fuzzing

2021-08-25 Thread Alexander Bulekov
From: Darren Kenny Should have done this much sooner given the amount of reviewing I'm already doing in this area. Signed-off-by: Darren Kenny Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alexander Bulekov --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/

[PULL v2 8/8] MAINTAINERS: add fuzzing reviewer

2021-08-25 Thread Alexander Bulekov
From: Qiuhao Li To keep me cc-ed when something changes. Suggested by Alexander. https://lists.gnu.org/archive/html/qemu-devel/2021-08/msg03631.html Signed-off-by: Qiuhao Li Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alexander Bulekov Reviewed-by: Darren Kenny --- MAINTAINERS | 1 +

Re: [PATCH v7 2/7] spapr.c: handle dev->id in spapr_memory_unplug_rollback()

2021-08-25 Thread Greg Kurz
On Tue, 24 Aug 2021 21:48:30 -0300 Daniel Henrique Barboza wrote: > As done in hw/acpi/memory_hotplug.c, pass an empty string if dev->id > is NULL to qapi_event_send_mem_unplug_error() to avoid relying on > a behavior that can be changed in the future. > > Suggested-by: Markus Armbruster > Sign

Re: [PATCH v7 1/7] memory_hotplug.c: handle dev->id = NULL in acpi_memory_hotplug_write()

2021-08-25 Thread Greg Kurz
On Tue, 24 Aug 2021 21:48:29 -0300 Daniel Henrique Barboza wrote: > qapi_event_send_mem_unplug_error() deals with @device being NULL by > replacing it with an empty string ("") when emitting the event. Aside > from the fact that this behavior (qapi visitor mapping NULL pointer to > "") can be pat

Re: [PULL SUBSYSTEM v2 0/8] Fuzzing Patches for 2021-08-25

2021-08-25 Thread Alexander Bulekov
Sorry, Peter - I forgot to indicate that this is a SUBSYSTEM PR. -Alex On 210825 0942, Alexander Bulekov wrote: > Hi Paolo, > > (Resending, since I didn't send the original PR cover-letter to > qemu-devel) > > The following changes since commit d42685765653ec155fdf60910662f8830bdb2cef: > > Op

Re: [PATCH v7 5/7] qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event

2021-08-25 Thread Greg Kurz
On Tue, 24 Aug 2021 21:48:33 -0300 Daniel Henrique Barboza wrote: > At this moment we only provide one event to report a hotunplug error, > MEM_UNPLUG_ERROR. As of Linux kernel 5.12 and QEMU 6.0.0, the pseries > machine is now able to report unplug errors for other device types, such > as CPUs. >

Re: [PATCH] sun4m: fix setting CPU id when more than one CPU is present

2021-08-25 Thread Philippe Mathieu-Daudé
On 8/25/21 2:27 PM, Mark Cave-Ayland wrote: > On 25/08/2021 11:43, Philippe Mathieu-Daudé wrote: > >> +Leon3 maintainers > > Note that despite its presence in CPUSPARCState MXCC isn't part of the > SPARC CPU but defined as part of the sun4m architecture, so I'm not sure > it even exists in LEON3

Re: [PATCH v2 03/16] target/ppc: add exclusive user write function for MMCR0

2021-08-25 Thread Daniel Henrique Barboza
On 8/25/21 1:37 AM, David Gibson wrote: On Tue, Aug 24, 2021 at 01:30:19PM -0300, Daniel Henrique Barboza wrote: From: Gustavo Romero Similar to the previous patch, user write on some PowerPC PMU regs, in this case, MMCR0, is limited. Create a new function to handle that. Ok.. ok, this fi

Re: [PATCH v2 04/16] target/ppc: PMU basic cycle count for pseries TCG

2021-08-25 Thread Daniel Henrique Barboza
On 8/25/21 2:19 AM, David Gibson wrote: On Tue, Aug 24, 2021 at 01:30:20PM -0300, Daniel Henrique Barboza wrote: This patch adds the barebones of the PMU logic by enabling cycle counting, done via the performance monitor counter 6. The overall logic goes as follows: - a helper is added to co

Re: [PATCH v2 06/16] target/ppc: PMU: add instruction counting

2021-08-25 Thread Daniel Henrique Barboza
On 8/25/21 2:31 AM, David Gibson wrote: On Tue, Aug 24, 2021 at 01:30:22PM -0300, Daniel Henrique Barboza wrote: The PMU is already counting cycles by calculating time elapsed in nanoseconds. Counting instructions is a different matter and requires another approach. This patch adds the capab

Re: [PATCH v2 3/3] qcow2: handle_dependencies(): relax conflict detection

2021-08-25 Thread Eric Blake
On Tue, Aug 24, 2021 at 01:15:17PM +0300, Vladimir Sementsov-Ogievskiy wrote: > There is no conflict and no dependency if we have parallel writes to > different subclusters of one cluster when the cluster itself is already > allocated. So, relax extra dependency. > ... > So small writes are more i

[PATCH] scripts: Remove the "show-fixed-bugs.sh" file

2021-08-25 Thread Thomas Huth
Since we are not using Launchpad anymore, there is no more need for this script. Signed-off-by: Thomas Huth --- scripts/show-fixed-bugs.sh | 91 -- 1 file changed, 91 deletions(-) delete mode 100755 scripts/show-fixed-bugs.sh diff --git a/scripts/show-fixed-

Re: [PATCH] scripts: Remove the "show-fixed-bugs.sh" file

2021-08-25 Thread Philippe Mathieu-Daudé
On 8/25/21 4:21 PM, Thomas Huth wrote: > Since we are not using Launchpad anymore, there is no more need for > this script. > > Signed-off-by: Thomas Huth > --- > scripts/show-fixed-bugs.sh | 91 -- > 1 file changed, 91 deletions(-) > delete mode 100755 scrip

[RESEND PATCH v3 0/5] pSeries FORM2 affinity support

2021-08-25 Thread Daniel Henrique Barboza
Hi, This is a repost of RFCv3 [1] rebased using current David's ppc-for-6.2. The reason of this repost is that the kernel side changes got accepted in the maintainer's tree [2], meaning that this series is now an implementation of the future FORM2 kernel support in the pseries kernel. In a POWER

[RESEND PATCH v3 2/5] spapr: move NUMA data init to post-CAS

2021-08-25 Thread Daniel Henrique Barboza
The pSeries machine will support a new NUMA affinity form, FORM2. This new FORM will be negotiated via ibm,architecture-vec5 during CAS. All artifacts and assumptions that are currently on use for FORM1 affinity will be deprecated in a guest that chooses to use FORM2. This means that we're going to

[RESEND PATCH v3 1/5] spapr_numa.c: split FORM1 code into helpers

2021-08-25 Thread Daniel Henrique Barboza
The upcoming FORM2 NUMA affinity will support asymmetric NUMA topologies and doesn't need be concerned with all the legacy support for older pseries FORM1 guests. We're also not going to calculate associativity domains based on numa distance (via spapr_numa_define_associativity_domains) since the

[RESEND PATCH v3 3/5] spapr_numa.c: base FORM2 NUMA affinity support

2021-08-25 Thread Daniel Henrique Barboza
The main feature of FORM2 affinity support is the separation of NUMA distances from ibm,associativity information. This allows for a more flexible and straightforward NUMA distance assignment without relying on complex associations between several levels of NUMA via ibm,associativity matches. Anoth

[RESEND PATCH v3 4/5] spapr: simplify spapr_numa_associativity_init params

2021-08-25 Thread Daniel Henrique Barboza
When spapr_numa_associativity_init() was introduced it was being called from spapr_machine_init(), where we have pointers to a SpaprMachineState and a MachineState. Having both being passed as params spared us from calling a macro to get the MachineState. Previous patches moved the function away f

[RESEND PATCH v3 5/5] spapr: move memory/cpu less check to spapr_numa_FORM1_affinity_init()

2021-08-25 Thread Daniel Henrique Barboza
FORM2 NUMA affinity is prepared to deal with memory/cpu less NUMA nodes. This is used by the DAX KMEM driver to locate a PAPR SCM device that has a different latency than the original NUMA node from the regular memory. Move this verification to FORM1 affinity code. Signed-off-by: Daniel Henrique

Re: [PATCH 7/9] util/vfio-helpers: Have qemu_vfio_dma_map() propagate Error

2021-08-25 Thread Klaus Jensen
On Aug 25 15:08, Philippe Mathieu-Daudé wrote: > On 8/25/21 1:34 PM, Klaus Jensen wrote: > > On Aug 24 16:11, Philippe Mathieu-Daudé wrote: > >> Now that all qemu_vfio_dma_map() callers provide an Error* argument, > >> fill it with relevant / more descriptive message. Reduce 'ret' > >> (returned va

Re: [RFC PATCH v2 1/8] qdev: add an Error parameter to the DeviceListener hide_device() function

2021-08-25 Thread Juan Quintela
Laurent Vivier wrote: D> This allows an error to be reported to the caller of qdev_device_add() > > Signed-off-by: Laurent Vivier Reviewed-by: Juan Quintela

Re: [RFC PATCH v2 2/8] qdev/qbus: remove failover specific code

2021-08-25 Thread Juan Quintela
Laurent Vivier wrote: > Commit f3a850565693 ("qdev/qbus: add hidden device support") has > introduced a generic way to hide a device but it has modified > qdev_device_add() to check a specific option of the failover device, > "failover_pair_id", before calling the generic mechanism. > > It's not n

Re: [RFC PATCH v2 3/8] failover: virtio-net: remove failover_primary_hidden flag

2021-08-25 Thread Juan Quintela
Laurent Vivier wrote: > We dont't need a flag to know if the primary device must be hidden, we > can rely on the machine state: > Device is hidden if the machine is in prelaunch state (src) or > in inmigrate state with migration status set to none (dst). > We don't need to check the flag in virtio

Re: [RFC PATCH v2 6/8] failover: pci: unregister ROM on unplug

2021-08-25 Thread Juan Quintela
Laurent Vivier wrote: > The intend of failover is to allow a VM with a VFIO networking card to > be migrated without disrupting the network operation by switching > to a virtio-net device during the migration. > > This simple change allows a simulated device like e1000e to be tested > rather than

Re: [PATCH] dbus-vmstate: replace g_return with error handling

2021-08-25 Thread Marc-André Lureau
Hi On Wed, Nov 18, 2020 at 8:33 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Since g_input_stream_read_all() may return less than requested when the > > stream is malformed, we should treat this condition as a runtime user > > error (g_

Re: [RESEND PATCH v3 1/5] spapr_numa.c: split FORM1 code into helpers

2021-08-25 Thread Greg Kurz
On Wed, 25 Aug 2021 11:39:39 -0300 Daniel Henrique Barboza wrote: > The upcoming FORM2 NUMA affinity will support asymmetric NUMA topologies > and doesn't need be concerned with all the legacy support for older > pseries FORM1 guests. > > We're also not going to calculate associativity domains b

Re: [PATCH] monitor/qmp: fix race with clients disconnecting early

2021-08-25 Thread Markus Armbruster
Stefan Reiter writes: > From: Stefan Reiter > > The following sequence can produce a race condition that results in > responses meant for different clients being sent to the wrong one: > > (QMP, no OOB) > 1) client A connects > 2) client A sends 'qmp_capabilities' > 3) 'qmp_dispatch' runs in cor

[qemu-web PATCH] Fix link to Windows page in Wiki

2021-08-25 Thread Helge Konetzka
The appended patch fixes the link to Wiki Windows page on Website Download Sources page. Furthermore I would like to propose to change the instructions for Native builds with MSYS2 on Wiki Windows page. Please remove the section which copies system binaries to match the expected file names!

Re: [RESEND PATCH v3 2/5] spapr: move NUMA data init to post-CAS

2021-08-25 Thread Greg Kurz
On Wed, 25 Aug 2021 11:39:40 -0300 Daniel Henrique Barboza wrote: > The pSeries machine will support a new NUMA affinity form, FORM2. > This new FORM will be negotiated via ibm,architecture-vec5 during > CAS. All artifacts and assumptions that are currently on use for > FORM1 affinity will be dep

[PATCH v5 00/14] target/riscv: Update QEmu for Zb[abcs] 1.0.0

2021-08-25 Thread Philipp Tomsich
The Zb[abcs] extensions have complete public review and are nearing ratifications. These individual extensions are one part of what was previously though of as the "BitManip" (B) extension, leaving the final details of future Zb* extensions open as they will undergo further public discourse. Thi

[PATCH v5 03/14] target/riscv: slli.uw is only a valid encoding if shamt first in 64 bits

2021-08-25 Thread Philipp Tomsich
For RV64, the shamt field in slli.uw is 6 bits wide. While the encoding space currently reserves a wider shamt-field (for use is a future RV128 ISA), setting the additional bit to 1 will not map to slli.uw for RV64 and needs to be treated as an illegal instruction. Note that this encoding being re

[PATCH v5 06/14] target/riscv: Reassign instructions to the Zbs-extension

2021-08-25 Thread Philipp Tomsich
The following instructions are part of Zbs: - b{set,clr,ext,inv} - b{set,clr,ext,inv}i Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) Changes in v3: - The changes to the Zbs instructions (i.e. the REQUIRE_ZBS macro) and its use for qualifying the Zb

[PATCH v5 01/14] target/riscv: Add x-zba, x-zbb, x-zbc and x-zbs properties

2021-08-25 Thread Philipp Tomsich
The bitmanipulation ISA extensions will be ratified as individual small extension packages instead of a large B-extension. The first new instructions through the door (these have completed public review) are Zb[abcs]. This adds new 'x-zba', 'x-zbb', 'x-zbc' and 'x-zbs' properties for these in tar

[PATCH v5 02/14] target/riscv: Reassign instructions to the Zba-extension

2021-08-25 Thread Philipp Tomsich
The following instructions are part of Zba: - add.uw (RV64 only) - sh[123]add (RV32 and RV64) - sh[123]add.uw (RV64-only) - slli.uw (RV64-only) Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) Changes in v3: - The changes to the Zba instructions (i.e.

[PATCH v5 04/14] target/riscv: Remove the W-form instructions from Zbs

2021-08-25 Thread Philipp Tomsich
Zbs 1.0.0 (just as the 0.93 draft-B before) does no provide for W-form instructions for Zbs (single-bit instructions). Remove them. Note that these instructions had already been removed for the 0.93 version of the draft-B extenstion and have not been present in the binutils patches circulating in

[PATCH v5 07/14] target/riscv: Add instructions of the Zbc-extension

2021-08-25 Thread Philipp Tomsich
The following instructions are part of Zbc: - clmul - clmulh - clmulr Note that these instructions were already defined in the pre-0.93 and the 0.93 draft-B proposals, but had not been omitted in the earlier addition of draft-B to QEmu. Signed-off-by: Philipp Tomsich Reviewed-by: Richard Hend

[PATCH v5 12/14] target/riscv: Add zext.h instructions to Zbb, removing pack/packu/packh

2021-08-25 Thread Philipp Tomsich
The 1.0.0 version of Zbb does not contain pack/packu/packh. However, a zext.h instruction is provided (built on pack/packh from pre-0.93 draft-B) is available. This commit adds zext.h and removes the pack* instructions. Note that the encodings for zext.h are different between RV32 and RV64, which

[PATCH v5 05/14] target/riscv: Remove shift-one instructions (proposed Zbo in pre-0.93 draft-B)

2021-08-25 Thread Philipp Tomsich
The Zb[abcs] ratification package does not include the proposed shift-one instructions. There currently is no clear plan to whether these (or variants of them) will be ratified as Zbo (or a different extension) or what the timeframe for such a decision could be. Signed-off-by: Philipp Tomsich Rev

[PATCH v5 08/14] target/riscv: Reassign instructions to the Zbb-extension

2021-08-25 Thread Philipp Tomsich
This reassigns the instructions that are part of Zbb into it, with the notable exceptions of the instructions (rev8, zext.w and orc.b) that changed due to gorci, grevi and pack not being part of Zb[abcs]. Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) C

[PATCH v5 13/14] target/riscv: Remove RVB (replaced by Zb[abcs]

2021-08-25 Thread Philipp Tomsich
With everything classified as Zb[abcs] and pre-0.93 draft-B instructions that are not part of Zb[abcs] removed, we can remove the remaining support code for RVB. Note that RVB has been retired for good and misa.B will neither mean 'some' or 'all of' Zb*: https://lists.riscv.org/g/tech-bitmanip/m

[PATCH v6 01/14] target/riscv: Add x-zba, x-zbb, x-zbc and x-zbs properties

2021-08-25 Thread Philipp Tomsich
The bitmanipulation ISA extensions will be ratified as individual small extension packages instead of a large B-extension. The first new instructions through the door (these have completed public review) are Zb[abcs]. This adds new 'x-zba', 'x-zbb', 'x-zbc' and 'x-zbs' properties for these in tar

[PATCH v5 14/14] disas/riscv: Add Zb[abcs] instructions

2021-08-25 Thread Philipp Tomsich
With the addition of Zb[abcs], we also need to add disassembler support for these new instructions. Signed-off-by: Philipp Tomsich --- (no changes since v2) Changes in v2: - Fix missing ';' from last-minute whitespace cleanups. disas/riscv.c | 157

[PATCH v5 10/14] target/riscv: Add a REQUIRE_32BIT macro

2021-08-25 Thread Philipp Tomsich
With the changes to Zb[abcs], there's some encodings that are different in RV64 and RV32 (e.g., for rev8 and zext.h). For these, we'll need a helper macro allowing us to select on RV32, as well. Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) Changes in

[PATCH v6 06/14] target/riscv: Reassign instructions to the Zbs-extension

2021-08-25 Thread Philipp Tomsich
The following instructions are part of Zbs: - b{set,clr,ext,inv} - b{set,clr,ext,inv}i Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) Changes in v3: - The changes to the Zbs instructions (i.e. the REQUIRE_ZBS macro) and its use for qualifying the Zb

[PATCH v6 04/14] target/riscv: Remove the W-form instructions from Zbs

2021-08-25 Thread Philipp Tomsich
Zbs 1.0.0 (just as the 0.93 draft-B before) does no provide for W-form instructions for Zbs (single-bit instructions). Remove them. Note that these instructions had already been removed for the 0.93 version of the draft-B extenstion and have not been present in the binutils patches circulating in

[PATCH v5 11/14] target/riscv: Add rev8 instruction, removing grev/grevi

2021-08-25 Thread Philipp Tomsich
The 1.0.0 version of Zbb does not contain grev/grevi. Instead, a rev8 instruction (equivalent to the rev8 pseudo-instruction built on grevi from pre-0.93 draft-B) is available. This commit adds the new rev8 instruction and removes grev/grevi. Note that there is no W-form of this instruction (bot

[PATCH v6 07/14] target/riscv: Add instructions of the Zbc-extension

2021-08-25 Thread Philipp Tomsich
The following instructions are part of Zbc: - clmul - clmulh - clmulr Note that these instructions were already defined in the pre-0.93 and the 0.93 draft-B proposals, but had not been omitted in the earlier addition of draft-B to QEmu. Signed-off-by: Philipp Tomsich Reviewed-by: Richard Hend

[PATCH v6 02/14] target/riscv: Reassign instructions to the Zba-extension

2021-08-25 Thread Philipp Tomsich
The following instructions are part of Zba: - add.uw (RV64 only) - sh[123]add (RV32 and RV64) - sh[123]add.uw (RV64-only) - slli.uw (RV64-only) Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) Changes in v3: - The changes to the Zba instructions (i.e.

Re: [PATCH v5 07/14] target/riscv: Add instructions of the Zbc-extension

2021-08-25 Thread Philipp Tomsich
Resent as a v6 with this change and a bug-fix for orc.b. This now again passes all of SPEC 2017 w/ a compiler that makes good use of the Zb[abcs] instructions, including orc.b for string-functions. On Wed, 25 Aug 2021 at 15:40, Richard Henderson < richard.hender...@linaro.org> wrote: > On 8/23/21

[PATCH v6 03/14] target/riscv: slli.uw is only a valid encoding if shamt first in 64 bits

2021-08-25 Thread Philipp Tomsich
For RV64, the shamt field in slli.uw is 6 bits wide. While the encoding space currently reserves a wider shamt-field (for use is a future RV128 ISA), setting the additional bit to 1 will not map to slli.uw for RV64 and needs to be treated as an illegal instruction. Note that this encoding being re

[PATCH v5 09/14] target/riscv: Add orc.b instruction for Zbb, removing gorc/gorci

2021-08-25 Thread Philipp Tomsich
The 1.0.0 version of Zbb does not contain gorc/gorci. Instead, a orc.b instruction (equivalent to the orc.b pseudo-instruction built on gorci from pre-0.93 draft-B) is available, mainly targeting string-processing workloads. This commit adds the new orc.b instruction and removed gorc/gorci. Sign

[PATCH v6 08/14] target/riscv: Reassign instructions to the Zbb-extension

2021-08-25 Thread Philipp Tomsich
This reassigns the instructions that are part of Zbb into it, with the notable exceptions of the instructions (rev8, zext.w and orc.b) that changed due to gorci, grevi and pack not being part of Zb[abcs]. Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) C

[PATCH v6 00/14] target/riscv: Update QEmu for Zb[abcs] 1.0.0

2021-08-25 Thread Philipp Tomsich
The Zb[abcs] extensions have complete public review and are nearing ratifications. These individual extensions are one part of what was previously though of as the "BitManip" (B) extension, leaving the final details of future Zb* extensions open as they will undergo further public discourse. Thi

[PATCH v6 11/14] target/riscv: Add rev8 instruction, removing grev/grevi

2021-08-25 Thread Philipp Tomsich
The 1.0.0 version of Zbb does not contain grev/grevi. Instead, a rev8 instruction (equivalent to the rev8 pseudo-instruction built on grevi from pre-0.93 draft-B) is available. This commit adds the new rev8 instruction and removes grev/grevi. Note that there is no W-form of this instruction (bot

[PATCH v6 05/14] target/riscv: Remove shift-one instructions (proposed Zbo in pre-0.93 draft-B)

2021-08-25 Thread Philipp Tomsich
The Zb[abcs] ratification package does not include the proposed shift-one instructions. There currently is no clear plan to whether these (or variants of them) will be ratified as Zbo (or a different extension) or what the timeframe for such a decision could be. Signed-off-by: Philipp Tomsich Rev

[PATCH v6 12/14] target/riscv: Add zext.h instructions to Zbb, removing pack/packu/packh

2021-08-25 Thread Philipp Tomsich
The 1.0.0 version of Zbb does not contain pack/packu/packh. However, a zext.h instruction is provided (built on pack/packh from pre-0.93 draft-B) is available. This commit adds zext.h and removes the pack* instructions. Note that the encodings for zext.h are different between RV32 and RV64, which

[PATCH v6 10/14] target/riscv: Add a REQUIRE_32BIT macro

2021-08-25 Thread Philipp Tomsich
With the changes to Zb[abcs], there's some encodings that are different in RV64 and RV32 (e.g., for rev8 and zext.h). For these, we'll need a helper macro allowing us to select on RV32, as well. Signed-off-by: Philipp Tomsich Reviewed-by: Richard Henderson --- (no changes since v3) Changes in

[PATCH v6 13/14] target/riscv: Remove RVB (replaced by Zb[abcs]

2021-08-25 Thread Philipp Tomsich
With everything classified as Zb[abcs] and pre-0.93 draft-B instructions that are not part of Zb[abcs] removed, we can remove the remaining support code for RVB. Note that RVB has been retired for good and misa.B will neither mean 'some' or 'all of' Zb*: https://lists.riscv.org/g/tech-bitmanip/m

[PATCH v6 14/14] disas/riscv: Add Zb[abcs] instructions

2021-08-25 Thread Philipp Tomsich
With the addition of Zb[abcs], we also need to add disassembler support for these new instructions. Signed-off-by: Philipp Tomsich --- (no changes since v2) Changes in v2: - Fix missing ';' from last-minute whitespace cleanups. disas/riscv.c | 157

[PATCH v6 09/14] target/riscv: Add orc.b instruction for Zbb, removing gorc/gorci

2021-08-25 Thread Philipp Tomsich
The 1.0.0 version of Zbb does not contain gorc/gorci. Instead, a orc.b instruction (equivalent to the orc.b pseudo-instruction built on gorci from pre-0.93 draft-B) is available, mainly targeting string-processing workloads. This commit adds the new orc.b instruction and removed gorc/gorci. Sign

Re: [PATCH] scripts: Remove the "show-fixed-bugs.sh" file

2021-08-25 Thread Laurent Vivier
Le 25/08/2021 à 16:21, Thomas Huth a écrit : > Since we are not using Launchpad anymore, there is no more need for > this script. > > Signed-off-by: Thomas Huth > --- > scripts/show-fixed-bugs.sh | 91 -- > 1 file changed, 91 deletions(-) > delete mode 100755

[PATCH v5] block/file-win32: add reopen handlers

2021-08-25 Thread Viktor Prutyanov
Make 'qemu-img commit' work on Windows. Command 'commit' requires reopening backing file in RW mode. So, add reopen prepare/commit/abort handlers and change dwShareMode for CreateFile call in order to allow further read/write reopening. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/418

Re: [PULL 00/44] target-arm queue

2021-08-25 Thread Peter Maydell
(2021-08-25 10:25:12 +0100) > > are available in the Git repository at: > > https://git.linaro.org/people/pmaydell/qemu-arm.git > tags/pull-target-arm-20210825 > > for you to fetch changes up to 24b1a6aa43615be22c7ee66bd68ec5675f6a6a9a: > > docs: Document how t

Re: [PATCH] RFC: build-sys: drop dtc submodule

2021-08-25 Thread Peter Maydell
On Wed, 25 Aug 2021 at 14:28, Philippe Mathieu-Daudé wrote: > > On 8/25/21 2:43 PM, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > DTC is widely available, we could consider to stop bundling it. > > > > curl -s 'https://repology.org/api/v1/project/dtc' | \ > >jq -r 'g

Re: [PATCH 1/5] ebpf: Added eBPF initialization by fds and map update.

2021-08-25 Thread Andrew Melnichenko
Hi, Yes - to make the bpf() syscall capabilities are required, which libvirt have no intentions to give. Does it make any sense to leave syscall if mmap works? On Fri, Aug 20, 2021 at 6:34 AM Jason Wang wrote: > > 在 2021/7/13 下午11:37, Andrew Melnychenko 写道: > > -static bool ebpf_rss_set_indirect

Re: [PATCH 2/5] virtio-net: Added property to load eBPF RSS with fds.

2021-08-25 Thread Andrew Melnichenko
Hi, > I wonder if it's better to use separated properties instead of implying > an order here? > Not really, technically RSS BPF interface may be changed (it's already changed after RFC). And libvirt should use something unified, so it's better to use fd array. If any changes occur - those changes

Re: [PATCH 4/5] ebpf_rss_helper: Added helper for eBPF RSS.

2021-08-25 Thread Andrew Melnichenko
Hi, > I wonder if this can be done as helper for TAP/bridge. > Well, it does already, libvirt may create TAP device and pass it in command line or using getfd qmp command. E.g it's the qemu to launch those helper with set-uid. > Then libvirt won't even need to care about that? Yea, we may think

Re: [PATCH 5/5] qmp: Added qemu-ebpf-rss-path command.

2021-08-25 Thread Andrew Melnichenko
Hi, Yes, the stamp check was added. So the qemu emulator should return a suitable RSS BPF helper or nothing. Each qemu emulator may have a different helper that suits it. So, the idea is to ask for the helper from qemu. On Tue, Aug 24, 2021 at 9:41 AM Markus Armbruster wrote: > Andrew Melnichenk

Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation

2021-08-25 Thread Gautam Bhat
On Tue, Aug 24, 2021 at 1:52 PM Philippe Mathieu-Daudé wrote: > > > Aren't Nascent uC based on 8051? Because AFAIK QEMU doesn't emulate > this architecture. I am trying to emulate the TI MSP430 microcontroller. -Gautam.

Re: [PATCH 2/2] monitor: allow VNC related QMP and HMP commands to take a display ID

2021-08-25 Thread Eric Blake
On Wed, Aug 25, 2021 at 02:59:06PM +0400, Marc-André Lureau wrote: > > For HMP, this is a bit trickier, since at least 'set_password' already > > has the 'connected' parameter following the mandatory 'password' one, so > > we need to prefix the display ID with "id=" to allow correct parsing. > > >

Re: [PATCH 2/2] monitor: allow VNC related QMP and HMP commands to take a display ID

2021-08-25 Thread Eric Blake
On Wed, Aug 25, 2021 at 01:26:09PM +0200, Stefan Reiter wrote: > > It's not something done with other commands afaik, feels a bit awkward (the > > "connected = display"...). > > > > Indeed, if there is a better way I'd love to use it. > > One idea I had was making the parameter 'connected' OR 'd

Re: [PATCH v2] nbd/server: Add --selinux-label option

2021-08-25 Thread Eric Blake
On Fri, Jul 23, 2021 at 05:38:06PM +0100, Daniel P. Berrangé wrote: > On Fri, Jul 23, 2021 at 06:18:55PM +0200, Kevin Wolf wrote: > > Am 23.07.2021 um 12:33 hat Richard W.M. Jones geschrieben: > > > Under SELinux, Unix domain sockets have two labels. One is on the > > > disk and can be set with co

Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation

2021-08-25 Thread Peter Maydell
On Wed, 25 Aug 2021 at 20:03, Gautam Bhat wrote: > I am trying to emulate the TI MSP430 microcontroller. The MSP430 is a custom 16-bit architecture. We don't have an emulation of that kind of CPU. If you're mostly doing this to look at how QEMU's device emulation is implemented, you should probab

[PULL 0/2] x86 queue, 2021-08-25

2021-08-25 Thread Eduardo Habkost
The following changes since commit d42685765653ec155fdf60910662f8830bdb2cef: Open 6.2 development tree (2021-08-25 10:25:12 +0100) are available in the Git repository at: https://gitlab.com/ehabkost/qemu.git tags/x86-next-pull-request for you to fetch changes up to f429dbf8fc526a9cacf531176

[PULL 2/2] i386/cpu: Remove AVX_VNNI feature from Cooperlake cpu model

2021-08-25 Thread Eduardo Habkost
From: Yang Zhong The AVX_VNNI feature is not in Cooperlake platform, remove it from cpu model. Signed-off-by: Yang Zhong Message-Id: <20210820054611.84303-1-yang.zh...@intel.com> Fixes: c1826ea6a052 ("i386/cpu: Expose AVX_VNNI instruction to guest") Cc: qemu-sta...@nongnu.org Signed-off-by: Edu

[PULL 1/2] target/i386: Remove split lock detect in Snowridge CPU model

2021-08-25 Thread Eduardo Habkost
From: Chenyi Qiang At present, there's no mechanism intelligent enough to virtualize split lock detection correctly. Remove it in Snowridge CPU model to avoid the feature exposure. Signed-off-by: Chenyi Qiang Message-Id: <20210630012053.10098-1-chenyi.qi...@intel.com> Signed-off-by: Eduardo Hab

Re: [PATCH] RFC: build-sys: drop dtc submodule

2021-08-25 Thread Marc-André Lureau
Hi On Wed, Aug 25, 2021 at 10:13 PM Peter Maydell wrote: > On Wed, 25 Aug 2021 at 14:28, Philippe Mathieu-Daudé > wrote: > > > > On 8/25/21 2:43 PM, marcandre.lur...@redhat.com wrote: > > > From: Marc-André Lureau > > > > > > DTC is widely available, we could consider to stop bundling it. > >

Re: [PATCH] RFC: build-sys: drop dtc submodule

2021-08-25 Thread Peter Maydell
On Wed, 25 Aug 2021 at 20:55, Marc-André Lureau wrote: > fdt_check_full was added in 1.4.7: > https://git.kernel.org/pub/scm/utils/dtc/dtc.git/tag/?h=v1.4.7 > > Only ubuntu appears to be lagging a bit behind. I wonder if they would > consider an update. I doubt it. You would need to wait until t

Re: [PULL 0/6] documentation updates

2021-08-25 Thread Peter Maydell
On Wed, 25 Aug 2021 at 12:00, Thomas Huth wrote: > > Hi Peter! > > The following changes since commit f9baca549e44791be0dd98de15add3d8452a8af0: > > Update version for v6.1.0 release (2021-08-24 17:59:52 +0100) > > are available in the Git repository at: > > https://gitlab.com/thuth/qemu.git t

[RFC PATCH] hw/virtio: Do not access vring cache if queue is not ready

2021-08-25 Thread Philippe Mathieu-Daudé
Do not intent to access the vring MemoryRegion cache if the queue is not ready (no vring available). This fixes issue #301: qemu-system-i386: include/exec/memory_ldst_cached.h.inc:77: void address_space_stw_le_cached(MemoryRegionCache *, hwaddr, uint16_t, MemTxAttrs, MemTxResult *): Asserti

Re: [PATCH] RFC: build-sys: drop dtc submodule

2021-08-25 Thread Marc-André Lureau
Hi On Thu, Aug 26, 2021 at 12:00 AM Peter Maydell wrote: > On Wed, 25 Aug 2021 at 20:55, Marc-André Lureau > wrote: > > fdt_check_full was added in 1.4.7: > > https://git.kernel.org/pub/scm/utils/dtc/dtc.git/tag/?h=v1.4.7 > > > > Only ubuntu appears to be lagging a bit behind. I wonder if they

Re: [PATCH 02/19] host-utils: move abs64() to host-utils

2021-08-25 Thread Eduardo Habkost
On Wed, Aug 25, 2021 at 12:48:35PM +, Luis Fernando Fujita Pires wrote: > From: David Gibson > > Hrm.. I'm a bit concerned about mkaing this a more widespread function, > > because it has a nasty edge case... which is basically unavoidable in an > > abs64() > > implementation. Specifically:

Re: [RFC PATCH] hw/virtio: Do not access vring cache if queue is not ready

2021-08-25 Thread Philippe Mathieu-Daudé
On 8/25/21 10:09 PM, Philippe Mathieu-Daudé wrote: > Do not intent to access the vring MemoryRegion cache if > the queue is not ready (no vring available). > > This fixes issue #301: > > qemu-system-i386: include/exec/memory_ldst_cached.h.inc:77: void > address_space_stw_le_cached(MemoryRegion

RE: [PATCH 02/19] host-utils: move abs64() to host-utils

2021-08-25 Thread Luis Fernando Fujita Pires
From: Eduardo Habkost > > Right, that's true of any standard implementation of abs(). > > I thought about making it return uint64_t, but that could make it > > weird for other uses of abs64(), where callers wouldn't expect a type > > change from int64_t to uint64_t. Maybe create a separate uabs64

Re: Live migration regarding Intel PT

2021-08-25 Thread Eduardo Habkost
On Wed, Aug 25, 2021 at 02:59:37PM +0800, Xiaoyao Li wrote: > Hi Eduardo, > > I have some question regrading Intel PT live migration. > > Commit "e37a5c7fa459 (i386: Add Intel Processor Trace feature support)" > expose Intel PT with a fixed capabilities of CPUID 0x14 for live migration. > And the

Re: [PATCH 2/2] dump-guest-memory: Block live migration

2021-08-25 Thread Peter Xu
On Wed, Aug 25, 2021 at 11:36:08AM +0400, Marc-André Lureau wrote: > Shouldn't this be placed earlier in the function, before > runstate_is_running() and vm_stop() ? Good point... Will respin, thanks! -- Peter Xu

Re: [PATCH 02/19] host-utils: move abs64() to host-utils

2021-08-25 Thread Eduardo Habkost
On Wed, Aug 25, 2021 at 08:37:17PM +, Luis Fernando Fujita Pires wrote: > From: Eduardo Habkost > > > > Right, that's true of any standard implementation of abs(). > > > I thought about making it return uint64_t, but that could make it > > > weird for other uses of abs64(), where callers woul

Re: [PATCH 02/19] host-utils: move abs64() to host-utils

2021-08-25 Thread Philippe Mathieu-Daudé
On 8/25/21 11:18 PM, Eduardo Habkost wrote: > On Wed, Aug 25, 2021 at 08:37:17PM +, Luis Fernando Fujita Pires wrote: >> From: Eduardo Habkost >> Right, that's true of any standard implementation of abs(). I thought about making it return uint64_t, but that could make it weird f

Re: [PATCH 0/2] dump-guest-memory: Add blocker for migration

2021-08-25 Thread Peter Xu
Markus, On Wed, Aug 25, 2021 at 09:54:12AM +0200, Markus Armbruster wrote: > Peter Xu writes: > > > Both dump-guest-memory and live migration have vm state cached internally. > > Allowing them to happen together means the vm state can be messed up. > > Simply > > block live migration for dump-

<    1   2   3   4   >