Re: [Qemu-devel] Cross-posted : Odd QXL/KVM performance issue with a Windows 7 Guest

2019-09-06 Thread Brad Campbell
On 7/9/19 03:03, Dr. David Alan Gilbert wrote: * Brad Campbell (lists2...@fnarfbargle.com) wrote: On 2/9/19 6:23 pm, Brad Campbell wrote: Here is the holdup : 11725@1567416625.003504:qxl_ring_command_check 0 native 11725@1567416625.102653:qxl_io_write 0 native addr=0 (QXL_IO_NOTIFY_CMD)

[Qemu-devel] [PATCH v3 2/5] s390: PCI: Creation a header dedicated to PCI CLP

2019-09-06 Thread Matthew Rosato
From: Pierre Morel To have a clean separation between s390-pci-bus.h and s390-pci-inst.h headers we export the PCI CLP instructions in a dedicated header. Signed-off-by: Pierre Morel Reviewed-by: Collin Walling --- hw/s390x/s390-pci-bus.h | 1 + hw/s390x/s390-pci-clp.h | 211

[Qemu-devel] [PATCH v3 5/5] s390: vfio_pci: Get zPCI function info from host

2019-09-06 Thread Matthew Rosato
From: Pierre Morel We use the VFIO_REGION_SUBTYPE_ZDEV_CLP subregion of PCI_VENDOR_ID_IBM to retrieve the CLP information the kernel exports. To be compatible with previous kernel versions we fall back on previous predefined values, same as the emulation values, when the region is not found or

[Qemu-devel] [PATCH v3 4/5] s390: vfio_pci: Use a PCI Function structure

2019-09-06 Thread Matthew Rosato
From: Pierre Morel We use a ClpRspQueryPci structure to hold the information related to zPCI Function. This allows us to be ready to support different zPCI functions and to retrieve the zPCI function information from the host. Signed-off-by: Pierre Morel --- hw/s390x/s390-pci-bus.c | 22

[Qemu-devel] [PATCH v3 0/5] Retrieving zPCI specific info from QEMU

2019-09-06 Thread Matthew Rosato
Note: These patches by Pierre got lost in the ether a few months back as he has been unavailable to carry them forward. I've made changes based upon comments received on the kernel part of his last version. This patch implement the QEMU part to retrieve ZPCI specific information from the host.

[Qemu-devel] [PATCH v3 3/5] s390: vfio_pci: Use a PCI Group structure

2019-09-06 Thread Matthew Rosato
From: Pierre Morel We use a S390PCIGroup structure to hold the information related to zPCI Function group. This allows us to be ready to support multiple groups and to retrieve the group information from the host. Signed-off-by: Pierre Morel --- hw/s390x/s390-pci-bus.c | 42

[Qemu-devel] [PATCH v3 1/5] vfio: vfio_iommu_type1: linux header place holder

2019-09-06 Thread Matthew Rosato
From: Pierre Morel This should be copied from Linux kernel UAPI includes. The version used here is Linux 5.3.0 We define a new device region in vfio.h to be able to get the ZPCI CLP information by reading this region from userland. We create a new file, vfio_zdev.h to define the structure of

Re: [Qemu-devel] [RFC PATCH 03/20] vl: Add "sgx-epc" option to expose SGX EPC sections to guest

2019-09-06 Thread Larry Dewey
I was playing with the new objects, etc, and found if the user specifies -sgx-epc, and a memory device, but does not specify -cpu host, +sgx, the vm runs without any warnings, while obviously not doing anything to the memory. Perhaps some warnings if not everything which is required is provided?

[Qemu-devel] [Bug 1805256] Re: qemu-img hangs on high core count ARM system

2019-09-06 Thread Rafael David Tinoco
Alright, I couldn't reproduce this yet, I'm running same test case in a 24 cores box and causing lots of context switches and CPU migrations in parallel (trying to exhaust the logic). Will let this running for sometime to check. Unfortunately this can be related QEMU AIO BH locking/primitives

Re: [Qemu-devel] [PATCH v8 01/32] riscv: hw: Remove duplicated "hw/hw.h" inclusion

2019-09-06 Thread Alistair Francis
On Fri, Sep 6, 2019 at 9:20 AM Bin Meng wrote: > > Commit a27bd6c779ba ("Include hw/qdev-properties.h less") wrongly > added "hw/hw.h" to sifive_prci.c and sifive_test.c. > > Another inclusion of "hw/hw.h" was later added via > commit 650d103d3ea9 ("Include hw/hw.h exactly where needed"), that >

Re: [Qemu-devel] [PATCH v6 1/4] block: Add zoned device model property

2019-09-06 Thread Dmitry Fomichev
On Fri, 2019-09-06 at 23:10 +0200, Stefano Garzarella wrote: > On Fri, Sep 06, 2019 at 04:17:12PM +, Dmitry Fomichev wrote: > > On Fri, 2019-09-06 at 10:11 +0200, Stefano Garzarella wrote: > > > On Wed, Sep 04, 2019 at 05:00:57PM -0400, Dmitry Fomichev wrote: > > > > This commit adds Zoned

Re: [Qemu-devel] [PATCH v6 1/4] block: Add zoned device model property

2019-09-06 Thread Stefano Garzarella
On Fri, Sep 06, 2019 at 04:17:12PM +, Dmitry Fomichev wrote: > On Fri, 2019-09-06 at 10:11 +0200, Stefano Garzarella wrote: > > On Wed, Sep 04, 2019 at 05:00:57PM -0400, Dmitry Fomichev wrote: > > > This commit adds Zoned Device Model (as defined in T10 ZBC and > > > T13 ZAC standards) as a

Re: [Qemu-devel] [PATCH] linux-user: drop redundant handling of environment variables

2019-09-06 Thread Laurent Vivier
Le 06/09/2019 à 18:57, Max Filippov a écrit : > QEMU_STRACE and QEMU_RAND_SEED are handled by the parse_args, no need to > do it again in main. > > Signed-off-by: Max Filippov > --- > linux-user/main.c | 7 --- > 1 file changed, 7 deletions(-) > > diff --git a/linux-user/main.c

[Qemu-devel] [PATCH v4 3/4] target/arm: remove run time semihosting checks

2019-09-06 Thread Alex Bennée
Now we do all our checking and use a common EXCP_SEMIHOST for semihosting operations we can make helper code a lot simpler. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - fix re-base conflicts - hoist EXCP_SEMIHOST check - comment cleanups v5 - move CONFIG_TCG ifdefs

[Qemu-devel] [PATCH v4 0/4] semihosting at translate time fixes

2019-09-06 Thread Alex Bennée
Hi Peter, Hopefully this is the final version of the semihosting at translate time patches. I've applied Richard's IS_USER changes and gated the SVN for !M profile. Alex Bennée (3): target/arm: handle M-profile semihosting at translate time target/arm: handle A-profile semihosting at

[Qemu-devel] [PATCH v4 4/4] atomic_template: fix indentation in GEN_ATOMIC_HELPER

2019-09-06 Thread Alex Bennée
From: "Emilio G. Cota" Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- accel/tcg/atomic_template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/atomic_template.h

[Qemu-devel] [PATCH v4 2/4] target/arm: handle A-profile semihosting at translate time

2019-09-06 Thread Alex Bennée
As for the other semihosting calls we can resolve this at translate time. Signed-off-by: Alex Bennée --- v2 - update for change to gen_exception_internal_insn API v3 - update for decode tree, merge T32 & A32 commits - dropped r-b due to changes v4 - !IS_USER and !arm_dc_feature(s,

[Qemu-devel] [PATCH v4 1/4] target/arm: handle M-profile semihosting at translate time

2019-09-06 Thread Alex Bennée
We do this for other semihosting calls so we might as well do it for M-profile as well. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - update for change to gen_exception_internal_insn API v3 - update for decode tree v4 - use !IS_USER --- target/arm/m_helper.c | 18

[Qemu-devel] [PATCH v2 3/3] qemu-iotests: Add test for bz #1745922

2019-09-06 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- tests/qemu-iotests/263 | 75 ++ tests/qemu-iotests/263.out | 19 ++ tests/qemu-iotests/group | 1 + 3 files changed, 95 insertions(+) create mode 100755 tests/qemu-iotests/263 create mode 100644

[Qemu-devel] [PATCH v2 0/3] Fix qcow2+luks corruption introduced by commit 8ac0f15f335

2019-09-06 Thread Maxim Levitsky
Commit 8ac0f15f335 accidently broke the COW of non changed areas of newly allocated clusters, when the write spans multiple clusters, and needs COW both prior and after the write. This results in 'after' COW area being encrypted with wrong sector address, which render it corrupted. Bugzilla:

[Qemu-devel] [PATCH v2 1/3] block/qcow2: refactoring of threaded encryption code

2019-09-06 Thread Maxim Levitsky
This commit tries to clarify few function arguments, and add comments describing the encrypt/decrypt interface Signed-off-by: Maxim Levitsky --- block/qcow2-cluster.c | 10 +++ block/qcow2-threads.c | 61 ++- 2 files changed, 53 insertions(+), 18

[Qemu-devel] [PATCH v2 2/3] block/qcow2: fix the corruption when rebasing luks encrypted files

2019-09-06 Thread Maxim Levitsky
This fixes subtle corruption introduced by luks threaded encryption in commit 8ac0f15f335 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1745922 The corruption happens when we do a write that * writes to two or more unallocated clusters at once * doesn't fully cover the first sector

Re: [Qemu-devel] [PATCH v4 00/54] plugins for TCG

2019-09-06 Thread Alex Bennée
Markus Armbruster writes: > Alex Bennée writes: > >> Hi, >> >> This is the latest iteration of the plugins series. The main changes >> from the last version are: >> >> - dropped passing of haddr to plugins >> >> This makes the code for handling the plugins less invasive in the >> softmmu

Re: [Qemu-devel] [PATCH 2/3] block/qcow2: fix the corruption when rebasing luks encrypted files

2019-09-06 Thread Maxim Levitsky
On Fri, 2019-09-06 at 14:17 -0500, Eric Blake wrote: > On 9/6/19 12:32 PM, Maxim Levitsky wrote: > > This fixes subltle corruption introduced by luks threaded encryption > > subtle I usually put the commit messages to a spellchecker, but this time I forgot to do this. I will try not to in the

Re: [Qemu-devel] [PATCH v4 13/54] plugin: add user-facing API

2019-09-06 Thread Alex Bennée
Aaron Lindsay OS writes: > One thing I would find useful is the ability to access register values > during an execution-time callback. I think the easiest way to do that > generically would be to expose them via the gdb functionality (like > Pavel's earlier patchset did [1]), though that

Re: [Qemu-devel] [RFC 2 PATCH 06/16] hw/core: Add core complex id in X86CPU topology

2019-09-06 Thread Moger, Babu
On 9/6/19 2:20 PM, Eric Blake wrote: > On 9/6/19 2:12 PM, Moger, Babu wrote: >> Introduce cpu core complex id(ccx_id) in x86CPU topology. >> Each CCX can have upto 4 cores and share same L3 cache. >> This information is required to build the topology in >> new apyc mode. >> >> Signed-off-by:

[Qemu-devel] [RFC 2 PATCH 15/16] i386: Fix pkg_id offset for epyc mode

2019-09-06 Thread Moger, Babu
Signed-off-by: Babu Moger --- target/i386/cpu.c | 24 +++- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f25491a029..f8b1fc5c07 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4094,9 +4094,10 @@ void

[Qemu-devel] [RFC 2 PATCH 13/16] machine: Add new epyc property in PCMachineState

2019-09-06 Thread Moger, Babu
Adds new epyc property in PCMachineState and also in MachineState. This property will be used to initialize the mode specific handlers to generate apic ids. Signed-off-by: Babu Moger --- hw/i386/pc.c | 23 +++ include/hw/boards.h |2 ++ include/hw/i386/pc.h |

[Qemu-devel] [RFC 2 PATCH 14/16] hw/i386: Introduce epyc mode function handlers

2019-09-06 Thread Moger, Babu
Introduce following handlers for new epyc mode. x86_apicid_from_cpu_idx_epyc: Generate apicid from cpu index. x86_topo_ids_from_apicid_epyc: Generate topo ids from apic id. x86_apicid_from_topo_ids_epyci: Generate apicid from topo ids. Signed-off-by: Babu Moger --- hw/i386/pc.c |5 + 1

Re: [Qemu-devel] [RFC 2 PATCH 06/16] hw/core: Add core complex id in X86CPU topology

2019-09-06 Thread Eric Blake
On 9/6/19 2:12 PM, Moger, Babu wrote: > Introduce cpu core complex id(ccx_id) in x86CPU topology. > Each CCX can have upto 4 cores and share same L3 cache. > This information is required to build the topology in > new apyc mode. > > Signed-off-by: Babu Moger > --- > +++ b/qapi/machine.json > @@

[Qemu-devel] [RFC 2 PATCH 16/16] hw/core: Fix up the machine_set_cpu_numa_node for epyc

2019-09-06 Thread Moger, Babu
Current topology id match will not work for epyc mode when setting the node id. In epyc mode, ids like smt_id, thread_id, core_id, ccx_id, socket_id can be same for more than one CPUs with across two numa nodes. For example, we can have two CPUs with following ids on two different node. 1.

[Qemu-devel] [RFC 2 PATCH 11/16] Introduce-topo_ids_from_apicid-handler

2019-09-06 Thread Moger, Babu
hw/i386: Introduce topo_ids_from_apicid handler PCMachineState Add function pointer topo_ids_from_apicid in PCMachineState. Initialize with correct handler based on mode selected. x86_apicid_from_cpu_idx will be the default handler. Signed-off-by: Babu Moger --- hw/i386/pc.c | 13

[Qemu-devel] [RFC 2 PATCH 10/16] hw/i386: Introduce apicid_from_cpu_idx in PCMachineState

2019-09-06 Thread Moger, Babu
Add function pointers in PCMachineState to handle apic id specific functionalities. This will be used to initialize with correct handlers based on mode selected. x86_apicid_from_cpu_idx will be default handler. Signed-off-by: Babu Moger --- hw/i386/pc.c |5 -

Re: [Qemu-devel] [PATCH 2/3] block/qcow2: fix the corruption when rebasing luks encrypted files

2019-09-06 Thread Eric Blake
On 9/6/19 12:32 PM, Maxim Levitsky wrote: > This fixes subltle corruption introduced by luks threaded encryption subtle > in commit 8ac0f15f335 > > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1745922 > > The corruption happens when we do >* write to two or more unallocated

[Qemu-devel] [RFC 2 PATCH 09/16] hw/i386: Introduce initialize_topo_info function

2019-09-06 Thread Moger, Babu
Introduce initialize_topo_info to initialize X86CPUTopoInfo data structure to build the topology. No functional change. Signed-off-by: Babu Moger --- hw/i386/pc.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c

[Qemu-devel] [RFC 2 PATCH 08/16] i386: Cleanup and use the new epyc mode topology functions

2019-09-06 Thread Moger, Babu
Use the new epyc mode functions and delete the unused code. Signed-off-by: Babu Moger --- target/i386/cpu.c | 171 +++-- 1 file changed, 48 insertions(+), 123 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index

[Qemu-devel] [RFC 2 PATCH 06/16] hw/core: Add core complex id in X86CPU topology

2019-09-06 Thread Moger, Babu
Introduce cpu core complex id(ccx_id) in x86CPU topology. Each CCX can have upto 4 cores and share same L3 cache. This information is required to build the topology in new apyc mode. Signed-off-by: Babu Moger --- hw/core/machine-hmp-cmds.c |3 +++ hw/core/machine.c | 13

[Qemu-devel] [RFC 2 PATCH 12/16] hw/i386: Introduce apic_id_from_topo_ids handler in PCMachineState

2019-09-06 Thread Moger, Babu
Add function pointer apic_id_from_topo_ids in PCMachineState. Initialize with correct handler based on the mode selected. Also rename the handler apicid_from_topo_ids to x86_apicid_from_topo_ids for consistency. x86_apicid_from_topo_ids will be the default handler. Signed-off-by: Babu Moger ---

[Qemu-devel] [RFC 2 PATCH 05/16] hw/i386: Simplify topology Offset/width Calculation

2019-09-06 Thread Moger, Babu
Some parameters are unnecessarily passed for offset/width calculation. Remove those parameters from function prototypes. No functional change. Signed-off-by: Babu Moger --- include/hw/i386/topology.h | 45 ++-- target/i386/cpu.c | 12

[Qemu-devel] [RFC 2 PATCH 03/16] hw/i386: Introduce X86CPUTopoInfo to contain topology info

2019-09-06 Thread Moger, Babu
This is an effort to re-arrange few data structure for better readability. Add X86CPUTopoInfo which will have all the topology informations required to build the cpu topology. There is no functional changes. Signed-off-by: Babu Moger --- hw/i386/pc.c | 40

[Qemu-devel] [RFC 2 PATCH 07/16] hw/386: Add new epyc mode topology decoding functions

2019-09-06 Thread Moger, Babu
These functions add support for building new epyc mode topology given smp details like numa nodes, cores, threads and sockets. Subsequent patches will use these functions to build the topology. The topology details are available in Processor Programming Reference (PPR) for AMD Family 17h Model

[Qemu-devel] [RFC 2 PATCH 04/16] machine: Add SMP Sockets in CpuTopology

2019-09-06 Thread Moger, Babu
Store the smp Sockets in CpuTopology. Socket information is required to build the cpu topology in new epyc mode. Signed-off-by: Babu Moger --- hw/core/machine.c |1 + hw/i386/pc.c|1 + include/hw/boards.h |2 ++ vl.c|1 + 4 files changed, 5

[Qemu-devel] [RFC 2 PATCH 02/16] hw/i386: Rename X86CPUTopoInfo structure to X86CPUTopoIDs

2019-09-06 Thread Moger, Babu
Rename few data structures related to X86 topology. X86CPUTopoIDs will have individual arch ids. Next patch introduces X86CPUTopoInfo which will have all topology information(like cores, threads etc..). Adds node_id and ccx_id. This will be required to support new epyc mode mode. There is no

[Qemu-devel] [RFC 2 PATCH 01/16] numa: Split the numa functionality

2019-09-06 Thread Moger, Babu
To support new epyc mode, we need to know the number of numa nodes in advance to generate apic id correctly. So, split the numa initialization into two. The function parse_numa initializes numa_info and updates nb_numa_nodes. And then parse_numa_node does the numa node initialization.

[Qemu-devel] [RFC 2 PATCH 00/16] APIC ID fixes for AMD EPYC CPU models

2019-09-06 Thread Moger, Babu
These series fixes the problems encoding APIC ID for AMD EPYC cpu models. https://bugzilla.redhat.com/show_bug.cgi?id=1728166 This is the second pass to give an idea of the changes required to address the issue. First pass is availabe at https://patchwork.kernel.org/cover/11069785/ Currently,

Re: [Qemu-devel] [PATCH v1 18/42] tests/docker: move our mips64 cross compile to Buster

2019-09-06 Thread Aleksandar Markovic
04.09.2019. 23.59, "Alex Bennée" је написао/ла: > > Now Buster is released we can stop relying on the movable feast that > is Sid for our cross-compiler for building tests. > > Signed-off-by: Alex Bennée > --- Reviewed-by: Aleksandar Markovic > tests/docker/Makefile.include

Re: [Qemu-devel] Cross-posted : Odd QXL/KVM performance issue with a Windows 7 Guest

2019-09-06 Thread Dr. David Alan Gilbert
* Brad Campbell (lists2...@fnarfbargle.com) wrote: > On 2/9/19 6:23 pm, Brad Campbell wrote: > > > > > Here is the holdup : > > > > 11725@1567416625.003504:qxl_ring_command_check 0 native > > 11725@1567416625.102653:qxl_io_write 0 native addr=0 (QXL_IO_NOTIFY_CMD) > > val=0 size=1 async=0 > >

Re: [Qemu-devel] [PATCH 1/3] block/qcow2: refactoring of threaded encryption code

2019-09-06 Thread Maxim Levitsky
On Fri, 2019-09-06 at 14:00 -0500, Eric Blake wrote: > On 9/6/19 1:55 PM, Maxim Levitsky wrote: > > > > > +/* > > > > + * qcow2_co_encrypt() > > > > + * > > > > + * Encrypts a sector size aligned contiguous area > > > > + * > > > > + * @host_cluster_offset - on disk offset of the cluster in which

Re: [Qemu-devel] [PATCH 1/3] block/qcow2: refactoring of threaded encryption code

2019-09-06 Thread Eric Blake
On 9/6/19 1:55 PM, Maxim Levitsky wrote: >>> +/* >>> + * qcow2_co_encrypt() >>> + * >>> + * Encrypts a sector size aligned contiguous area >>> + * >>> + * @host_cluster_offset - on disk offset of the cluster in which >>> + *the buffer resides >>> + * >>> + * @guest_offset

Re: [Qemu-devel] [PATCH] linux-user: hijack open() for thread directories

2019-09-06 Thread mailer
Hi Shu-Chun Weng via Qemu-devel! We received your email, but were unable to deliver it because it contains content which has been blacklisted by the list admin. Please remove your application/pkcs7-signature attachments and send again. You are also advised to configure your email client to send

Re: [Qemu-devel] [PATCH 1/3] block/qcow2: refactoring of threaded encryption code

2019-09-06 Thread Maxim Levitsky
On Fri, 2019-09-06 at 13:00 -0500, Eric Blake wrote: > On 9/6/19 12:31 PM, Maxim Levitsky wrote: > > This commit tries to clarify few function arguments, > > and add comments describing the encrypt/decrypt interface > > > > Signed-off-by: Maxim Levitsky > > --- > > block/qcow2-cluster.c | 8

Re: [Qemu-devel] [PATCH 0/2] Adding some setsockopt() options

2019-09-06 Thread mailer
Hi Shu-Chun Weng via Qemu-devel! We received your email, but were unable to deliver it because it contains content which has been blacklisted by the list admin. Please remove your application/pkcs7-signature attachments and send again. You are also advised to configure your email client to send

Re: [Qemu-devel] [PATCH 0/2] Adding some setsockopt() options

2019-09-06 Thread Shu-Chun Weng via Qemu-devel
Ping. Patchwork links: http://patchwork.ozlabs.org/patch/1151884/ http://patchwork.ozlabs.org/patch/1151883/ On Thu, Aug 22, 2019 at 4:14 PM Shu-Chun Weng wrote: > Shu-Chun Weng (2): > linux-user: add missing UDP and IPv6 setsockopt options > linux-user: time stamping options for

Re: [Qemu-devel] [PATCH] linux-user: hijack open() for thread directories

2019-09-06 Thread Shu-Chun Weng via Qemu-devel
Ping. Any comments on this? Patchwork: http://patchwork.ozlabs.org/patch/1151167/ On Wed, Aug 21, 2019 at 1:19 PM Shu-Chun Weng wrote: > Besides /proc/self|, files under /proc/thread-self and > /proc/self|/task/ also expose host information to the guest > program. This patch adds them to the

Re: [Qemu-devel] [PATCH 1/3] block/qcow2: refactoring of threaded encryption code

2019-09-06 Thread Eric Blake
On 9/6/19 12:31 PM, Maxim Levitsky wrote: > This commit tries to clarify few function arguments, > and add comments describing the encrypt/decrypt interface > > Signed-off-by: Maxim Levitsky > --- > block/qcow2-cluster.c | 8 +++ > block/qcow2-threads.c | 53

Re: [Qemu-devel] [PATCH 0/3] Fix qcow2+luks corruption introduced by commit 8ac0f15f335

2019-09-06 Thread Maxim Levitsky
On Fri, 2019-09-06 at 20:31 +0300, Maxim Levitsky wrote: > Commit 8ac0f15f335 accidently broke the COW of non changed areas > of newly allocated clusters, when the write spans multiple clusters, > and needs COW both prior and after the write. > This results in 'after' COW area beeing encrypted

[Qemu-devel] [PATCH 2/3] block/qcow2: fix the corruption when rebasing luks encrypted files

2019-09-06 Thread Maxim Levitsky
This fixes subltle corruption introduced by luks threaded encryption in commit 8ac0f15f335 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1745922 The corruption happens when we do * write to two or more unallocated clusters at once * write doesn't fully cover nether first nor last

[Qemu-devel] [PATCH 1/3] block/qcow2: refactoring of threaded encryption code

2019-09-06 Thread Maxim Levitsky
This commit tries to clarify few function arguments, and add comments describing the encrypt/decrypt interface Signed-off-by: Maxim Levitsky --- block/qcow2-cluster.c | 8 +++ block/qcow2-threads.c | 53 ++- 2 files changed, 46 insertions(+), 15

[Qemu-devel] [PATCH 0/3] Fix qcow2+luks corruption introduced by commit 8ac0f15f335

2019-09-06 Thread Maxim Levitsky
Commit 8ac0f15f335 accidently broke the COW of non changed areas of newly allocated clusters, when the write spans multiple clusters, and needs COW both prior and after the write. This results in 'after' COW area beeing encrypted with wrong sector address, which render it corrupted. Bugzilla:

[Qemu-devel] [PATCH 3/3] qemu-iotests: test for bz #1745922

2019-09-06 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- tests/qemu-iotests/263 | 76 ++ tests/qemu-iotests/263.out | 19 ++ tests/qemu-iotests/group | 1 + 3 files changed, 96 insertions(+) create mode 100755 tests/qemu-iotests/263 create mode 100644

[Qemu-devel] IOTEST 162

2019-09-06 Thread Maxim Levitsky
Hi! I just had a very fun rabbit hole dive, and I want to share it with you. I notice for some time that iotest 162 fails with that: -qemu-img: Could not open 'json:{"driver": "nbd", "host": 42}': Failed to connect socket: Invalid argument +qemu-img: Could not open 'json:{"driver": "nbd",

Re: [Qemu-devel] [PATCH v3] target/xtensa: linux-user: add call0 ABI support

2019-09-06 Thread Laurent Vivier
Le 06/09/2019 à 18:55, Max Filippov a écrit : > On Fri, Sep 6, 2019 at 2:33 AM Laurent Vivier wrote: >> Le 26/08/2019 à 21:58, Max Filippov a écrit : >>> +#if defined(TARGET_XTENSA) >>> +if (getenv("QEMU_XTENSA_ABI_CALL0")) { >>> +xtensa_set_abi_call0(); >>> +} >> >> Not needed,

[Qemu-devel] [PATCH] linux-user: drop redundant handling of environment variables

2019-09-06 Thread Max Filippov
QEMU_STRACE and QEMU_RAND_SEED are handled by the parse_args, no need to do it again in main. Signed-off-by: Max Filippov --- linux-user/main.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index c9d97d2b1fc6..22ae2b3e65d1 100644 ---

[Qemu-devel] [PATCH v4] target/xtensa: linux-user: add call0 ABI support

2019-09-06 Thread Max Filippov
Xtensa binaries built for call0 ABI don't rotate register window on function calls and returns. Invocation of signal handlers from the kernel is therefore different in windowed and call0 ABIs. There's currently no way to determine xtensa ELF binary ABI from the binary itself. Add handler for the

Re: [Qemu-devel] [PATCH v3] target/xtensa: linux-user: add call0 ABI support

2019-09-06 Thread Max Filippov
On Fri, Sep 6, 2019 at 2:33 AM Laurent Vivier wrote: > Le 26/08/2019 à 21:58, Max Filippov a écrit : > > +#if defined(TARGET_XTENSA) > > +if (getenv("QEMU_XTENSA_ABI_CALL0")) { > > +xtensa_set_abi_call0(); > > +} > > Not needed, this is done by parse_args() that checks >

[Qemu-devel] [PATCH v8 27/32] riscv: roms: Update default bios for sifive_u machine

2019-09-06 Thread Bin Meng
With the support of heterogeneous harts and PRCI model, it's now possible to use the OpenSBI image (PLATFORM=sifive/fu540) built for the real hardware. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None

[Qemu-devel] [PATCH v8 26/32] riscv: sifive_u: Change UART node name in device tree

2019-09-06 Thread Bin Meng
OpenSBI for fu540 does DT fix up (see fu540_modify_dt()) by updating chosen "stdout-path" to point to "/soc/serial@...", and U-Boot will use this information to locate the serial node and probe its driver. However currently we generate the UART node name as "/soc/uart@...", causing U-Boot fail to

[Qemu-devel] [PATCH v8 22/32] riscv: sifive_u: Generate hfclk and rtcclk nodes

2019-09-06 Thread Bin Meng
To keep in sync with Linux kernel device tree, generate hfclk and rtcclk nodes in the device tree, to be referenced by PRCI node. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None

[Qemu-devel] [Bug 1843073] Re: Network loose connection for long time under light load guest winxp64 with virtio on i5-8350U

2019-09-06 Thread uvi
Ping at the load moment: ping 192.168.152.25 PING 192.168.152.25 (192.168.152.25) 56(84) bytes of data. 64 bytes from 192.168.152.25: icmp_seq=1 ttl=128 time=0.300 ms 64 bytes from 192.168.152.25: icmp_seq=2 ttl=128 time=0.495 ms 64 bytes from 192.168.152.25: icmp_seq=3 ttl=128 time=0.442 ms 64

[Qemu-devel] [PATCH v8 20/32] riscv: sifive_u: Update PLIC hart topology configuration string

2019-09-06 Thread Bin Meng
With heterogeneous harts config, the PLIC hart topology configuration string are "M,MS,.." because of the monitor hart #0. Suggested-by: Fabien Chouteau Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None

[Qemu-devel] [PATCH v8 30/32] riscv: sifive_u: Fix broken GEM support

2019-09-06 Thread Bin Meng
At present the GEM support in sifive_u machine is seriously broken. The GEM block register base was set to a weird number (0x100900FC), which for no way could work with the cadence_gem model in QEMU. Not like other GEM variants, the FU540-specific GEM has a management block to control

Re: [Qemu-devel] [PATCH] riscv: hw: Remove duplicated "hw/hw.h" inclusion

2019-09-06 Thread Bin Meng
Hello, On Fri, Sep 6, 2019 at 11:22 PM Bin Meng wrote: > > On Fri, Sep 6, 2019 at 11:09 PM Bin Meng wrote: > > > > Commit a27bd6c779ba ("Include hw/qdev-properties.h less") wrongly > > added "hw/hw.h" to sifive_prci.c and sifive_test.c. > > > > Another inclusion of "hw/hw.h" was later added via

[Qemu-devel] [PATCH v8 17/32] riscv: hart: Add a "hartid-base" property to RISC-V hart array

2019-09-06 Thread Bin Meng
At present each hart's hartid in a RISC-V hart array is assigned the same value of its index in the hart array. But for a system that has multiple hart arrays, this is not the case any more. Add a new "hartid-base" property so that hartid number can be assigned based on the property value.

[Qemu-devel] [Bug 1843073] [NEW] Network loose connection for long time under light load guest winxp64 with virtio on i5-8350U

2019-09-06 Thread uvi
Public bug reported: I have issue with qemu and winxp guest on i5-8350U. First of all, if i run same vm with same config on i5 9660k i do not see such issue. Both pc have ubuntu 19.04 x86_64. Guest is winxp64, tried: 1) stable guest drivers, latest drivers 2) all virtio, only network r18169,

[Qemu-devel] [PATCH v8 31/32] riscv: sifive_u: Remove handcrafted clock nodes for UART and ethernet

2019-09-06 Thread Bin Meng
In the past we did not have a model for PRCI, hence two handcrafted clock nodes ("/soc/ethclk" and "/soc/uartclk") were created for the purpose of supplying hard-coded clock frequencies. But now since we have added the PRCI support in QEMU, we don't need them any more. Signed-off-by: Bin Meng

[Qemu-devel] [PATCH v8 11/32] riscv: sifive: Rename sifive_prci.{c, h} to sifive_e_prci.{c, h}

2019-09-06 Thread Bin Meng
Current SiFive PRCI model only works with sifive_e machine, as it only emulates registers or PRCI block in the FE310 SoC. Rename the file name to make it clear that it is for sifive_e. This also prefix "sifive_e"/"SIFIVE_E" for all macros, variables and functions. Signed-off-by: Bin Meng

[Qemu-devel] [PATCH v8 28/32] riscv: sifive: Implement a model for SiFive FU540 OTP

2019-09-06 Thread Bin Meng
This implements a simple model for SiFive FU540 OTP (One-Time Programmable) Memory interface, primarily for reading out the stored serial number from the first 1 KiB of the 16 KiB OTP memory reserved by SiFive for internal use. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes

[Qemu-devel] [PATCH v8 32/32] riscv: sifive_u: Update model and compatible strings in device tree

2019-09-06 Thread Bin Meng
This updates model and compatible strings to use the same strings as used in the Linux kernel device tree (hifive-unleashed-a00.dts). Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None

Re: [Qemu-devel] [PATCH v8 09/32] riscv: roms: Remove executable attribute of opensbi images

2019-09-06 Thread Philippe Mathieu-Daudé
On 9/6/19 6:19 PM, Bin Meng wrote: > Like other binary files, the executable attribute of opensbi images > should not be set. Ideally we'd have checkpatch warning for incorrect permissions when adding blobs under pc-bios/. > > Signed-off-by: Bin Meng > Reviewed-by: Alistair Francis

[Qemu-devel] [PATCH v8 12/32] riscv: sifive_e: prci: Fix a typo of hfxosccfg register programming

2019-09-06 Thread Bin Meng
For hfxosccfg register programming, SIFIVE_E_PRCI_HFXOSCCFG_RDY and SIFIVE_E_PRCI_HFXOSCCFG_EN should be used. Signed-off-by: Bin Meng Acked-by: Alistair Francis Reviewed-by: Chih-Min Chao Reviewed-by: Philippe Mathieu-Daudé --- Changes in v8: None Changes in v7: None Changes in v6: None

[Qemu-devel] [PATCH v8 29/32] riscv: sifive_u: Instantiate OTP memory with a serial number

2019-09-06 Thread Bin Meng
This adds an OTP memory with a given serial number to the sifive_u machine. With such support, the upstream U-Boot for sifive_fu540 boots out of the box on the sifive_u machine. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6:

[Qemu-devel] [PATCH v8 25/32] riscv: sifive_u: Update UART base addresses and IRQs

2019-09-06 Thread Bin Meng
This updates the UART base address and IRQs to match the hardware. Signed-off-by: Bin Meng Reviewed-by: Jonathan Behrens Acked-by: Alistair Francis Reviewed-by: Chih-Min Chao --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in

[Qemu-devel] [PATCH v8 21/32] riscv: sifive: Implement PRCI model for FU540

2019-09-06 Thread Bin Meng
This adds a simple PRCI model for FU540 (sifive_u). It has different register layout from the existing PRCI model for FE310 (sifive_e). Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: - fix incorrectly indented comment lines -

[Qemu-devel] [PATCH v8 24/32] riscv: sifive_u: Reference PRCI clocks in UART and ethernet nodes

2019-09-06 Thread Bin Meng
Now that we have added a PRCI node, update existing UART and ethernet nodes to reference PRCI as their clock sources, to keep in sync with the Linux kernel device tree. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes

[Qemu-devel] [PATCH v8 19/32] riscv: sifive_u: Update hart configuration to reflect the real FU540 SoC

2019-09-06 Thread Bin Meng
The FU540-C000 includes a 64-bit E51 RISC-V core and four 64-bit U54 RISC-V cores. Currently the sifive_u machine only populates 4 U54 cores. Update the max cpu number to 5 to reflect the real hardware, by creating 2 CPU clusters as containers for RISC-V hart arrays to populate heterogeneous

[Qemu-devel] [PATCH v8 08/32] riscv: hw: Remove the unnecessary include of target/riscv/cpu.h

2019-09-06 Thread Bin Meng
The inclusion of "target/riscv/cpu.h" is unnecessary in various sifive model drivers. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: - new patch to remove the unnecessary include of target/riscv/cpu.h

[Qemu-devel] [PATCH v8 16/32] riscv: hart: Extract hart realize to a separate routine

2019-09-06 Thread Bin Meng
Currently riscv_harts_realize() creates all harts based on the same cpu type given in the hart array property. With current implementation it can only create homogeneous harts. Exact the hart realize to a separate routine in preparation for supporting multiple hart arrays. Note the file header

[Qemu-devel] [PATCH v8 18/32] riscv: sifive_u: Set the minimum number of cpus to 2

2019-09-06 Thread Bin Meng
It is not useful if we only have one management CPU. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: - use management cpu count + 1 for the min_cpus Changes in v2: -

[Qemu-devel] [PATCH v8 23/32] riscv: sifive_u: Add PRCI block to the SoC

2019-09-06 Thread Bin Meng
Add PRCI mmio base address and size mappings to sifive_u machine, and generate the corresponding device tree node. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: - create sifive_u_prci block directly in the

[Qemu-devel] [PATCH v8 07/32] riscv: hw: Change to use qemu_log_mask(LOG_GUEST_ERROR, ...) instead

2019-09-06 Thread Bin Meng
Replace the call to hw_error() with qemu_log_mask(LOG_GUEST_ERROR,...) in various sifive models. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: - new patch to change to use qemu_log_mask(LOG_GUEST_ERROR,...)

[Qemu-devel] [PATCH v8 14/32] riscv: sifive_e: Drop sifive_mmio_emulate()

2019-09-06 Thread Bin Meng
Use create_unimplemented_device() instead. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: - select UNIMP in sifive_e Kconfig due to applied commit "hw/misc: Add a config switch for the "unimplemented" device" in latest qemu/master Changes in v7: None Changes in

[Qemu-devel] [PATCH v8 15/32] riscv: Add a sifive_cpu.h to include both E and U cpu type defines

2019-09-06 Thread Bin Meng
Group SiFive E and U cpu type defines into one header file. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None

[Qemu-devel] [PATCH v8 00/32] riscv: sifive_u: Improve the emulation fidelity of sifive_u machine

2019-09-06 Thread Bin Meng
As of today, the QEMU 'sifive_u' machine is a special target that does not boot the upstream OpenSBI/U-Boot firmware images built for the real SiFive HiFive Unleashed board. Hence OpenSBI supports a special platform "qemu/sifive_u". For U-Boot, the sifive_fu540_defconfig is referenced in the

[Qemu-devel] [PATCH v8 10/32] riscv: sifive_u: Remove the unnecessary include of prci header

2019-09-06 Thread Bin Meng
sifive_u machine does not use PRCI as of today. Remove the prci header inclusion. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None

[Qemu-devel] [PATCH v8 04/32] riscv: hw: Use qemu_fdt_setprop_cell() for property with only 1 cell

2019-09-06 Thread Bin Meng
Some of the properties only have 1 cell so we should use qemu_fdt_setprop_cell() instead of qemu_fdt_setprop_cells(). Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3:

[Qemu-devel] [PATCH v8 13/32] riscv: sifive_e: prci: Update the PRCI register block size

2019-09-06 Thread Bin Meng
Currently the PRCI register block size is set to 0x8000, but in fact 0x1000 is enough, which is also what the manual says. Signed-off-by: Bin Meng Reviewed-by: Chih-Min Chao Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None

[Qemu-devel] [PATCH v8 05/32] riscv: hw: Remove not needed PLIC properties in device tree

2019-09-06 Thread Bin Meng
This removes "reg-names" and "riscv,max-priority" properties of the PLIC node from device tree. Signed-off-by: Bin Meng Reviewed-by: Jonathan Behrens Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes

[Qemu-devel] [PATCH v8 03/32] riscv: hw: Remove superfluous "linux, phandle" property

2019-09-06 Thread Bin Meng
"linux,phandle" property is optional. Remove all instances in the sifive_u, virt and spike machine device trees. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: - remove 2 more

[Qemu-devel] [PATCH v8 06/32] riscv: hw: Change create_fdt() to return void

2019-09-06 Thread Bin Meng
There is no need to return fdt at the end of create_fdt() because it's already saved in s->fdt. Signed-off-by: Bin Meng Reviewed-by: Chih-Min Chao Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5:

[Qemu-devel] [PATCH v8 02/32] riscv: sifive_test: Add reset functionality

2019-09-06 Thread Bin Meng
This adds a reset opcode for sifive_test device to trigger a system reset for testing purpose. Signed-off-by: Bin Meng Reviewed-by: Palmer Dabbelt --- Changes in v8: - newly included in v8 to ease patch inter dependencies hw/riscv/sifive_test.c | 4

  1   2   3   >