[Qemu-devel] [PATCH v2 2/3] numa: move numa global variable have_numa_distance into MachineState

2019-04-17 Thread Tao Xu
The aim of this patch is to move existing numa global have_numa_distance into NumaState. Suggested-by: Igor Mammedov Suggested-by: Eduardo Habkost Signed-off-by: Tao Xu --- hw/arm/virt-acpi-build.c | 2 +- hw/arm/virt.c| 1 + hw/i386/acpi-build.c | 2 +- include/hw/boards.h

[Qemu-devel] [PATCH v2 1/3] numa: move numa global variable nb_numa_nodes into MachineState

2019-04-17 Thread Tao Xu
The aim of this patch is to add struct NumaState in MachineState and move existing numa global nb_numa_nodes into NumaState. And add variable numa_support into MachineClass to decide which submachines support NUMA. Suggested-by: Igor Mammedov Suggested-by: Eduardo Habkost Signed-off-by: Tao Xu

[Qemu-devel] [PATCH v2 0/3] numa: move numa global variables into MachineState

2019-04-17 Thread Tao Xu
The aim of this patch is to add struct NumaState in MachineState and move existing numa global nb_numa_nodes into NumaState. And add variable numa_support into MachineClass to decide which submachines support NUMA. --- Changes in v2: - fix the mistake in numa_complete_configuration in numa.c

[Qemu-devel] [PATCH v2 3/3] numa: move numa global variable numa_info into MachineState

2019-04-17 Thread Tao Xu
The aim of this patch is to move existing numa global numa_info into NumaState. Suggested-by: Igor Mammedov Suggested-by: Eduardo Habkost Signed-off-by: Tao Xu --- exec.c | 2 +- hw/acpi/aml-build.c | 6 -- hw/arm/boot.c| 2 +- hw/arm/virt-acpi-build.c

Re: [Qemu-devel] [PATCH v5 1/6] libnvdimm: nd_region flush callback support

2019-04-17 Thread Pankaj Gupta
Hello, Thank you for the suggestions on this. > > > On Thu 11-04-19 07:51:48, Dan Williams wrote: > >> On Tue, Apr 9, 2019 at 9:09 PM Pankaj Gupta wrote: > >> > + } else { > >> > + if (nd_region->flush(nd_region)) > >> > + rc = -EIO; > >> > >> Given

Re: [Qemu-devel] [PATCH v2 15/17] monitor: Clean up how monitor_disas() funnels output to monitor

2019-04-17 Thread Markus Armbruster
Eric Blake writes: > On 4/17/19 2:18 PM, Markus Armbruster wrote: >> INIT_DISASSEMBLE_INFO() takes an fprintf()-like callback and a FILE * >> to pass to it. monitor_disas() passes monitor_fprintf() and the >> current monitor cast to FILE *. monitor_fprintf() casts it right >> back, and is other

Re: [Qemu-devel] [PATCH v3 07/15] vfio: Report warnings with warn_report(), not error_printf()

2019-04-17 Thread Markus Armbruster
Alex Williamson writes: > On Wed, 17 Apr 2019 21:06:33 +0200 > Markus Armbruster wrote: > >> Cc: Alex Williamson >> Signed-off-by: Markus Armbruster >> --- >> hw/vfio/pci.c | 19 +-- >> 1 file changed, 13 insertions(+), 6 deletions(-) >> >> diff --git a/hw/vfio/pci.c b/hw/vfi

[Qemu-devel] [Bug 639651] Re: DRIVER_IRQL_NOT_LESS_OR_EQUAL booting WIndows XP with Synaptics driver installed

2019-04-17 Thread Thomas Huth
** Changed in: qemu (Debian) Status: New => Incomplete -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/639651 Title: DRIVER_IRQL_NOT_LESS_OR_EQUAL booting WIndows XP with Synaptics driver in

Re: [Qemu-devel] curses.c: "We need a terminal output" ?

2019-04-17 Thread Joachim Durchholz
Am 17.04.19 um 20:27 schrieb Laszlo Ersek: So, let's look at your original question again (which was not a problem statement): So you need an explicit problem statement to know that somebody might have a problem? what's the reasoning behind "We need a terminal output" in curses.c? The rea

Re: [Qemu-devel] [PATCH v3 09/10] block/pflash_cfi02: Implement erase suspend/resume

2019-04-17 Thread Thomas Huth
On 18/04/2019 00.01, Stephen Checkoway wrote: > During a sector erase (but not a chip erase), the embeded erase program > can be suspended. Once suspended, the sectors not selected for erasure > may be read and programmed. Autoselect mode is allowed during erase > suspend mode. Presumably, CFI quer

Re: [Qemu-devel] [PATCH 3/5] linux-user: Use lookup_cpu_class()

2019-04-17 Thread Eduardo Habkost
On Tue, Apr 16, 2019 at 11:59:42PM -0300, Eduardo Habkost wrote: > The return value of cpu_get_model() is just a CPU model name and > never includes extra options. We don't need to call > parse_cpu_option(). Oops. I was wrong. linux-user also supports extra features in the "-cpu" option, so we

Re: [Qemu-devel] [PATCH v3 08/10] block/pflash_cfi02: Implement multi-sector erase

2019-04-17 Thread Thomas Huth
On 18/04/2019 00.01, Stephen Checkoway wrote: > After two unlock cycles and a sector erase command, the AMD flash chips > start a 50 us erase time out. Any additional sector erase commands add a > sector to be erased and restart the 50 us timeout. During the timeout, > status bit DQ3 is cleared. Af

Re: [Qemu-devel] [PATCH v3 01/10] block/pflash_cfi02: Add test for supported commands

2019-04-17 Thread Thomas Huth
On 18/04/2019 00.01, Stephen Checkoway wrote: > Test the AMD command set for parallel flash chips. This test uses an > ARM musicpal board with a pflash drive to test the following list of > currently-supported commands. > - Autoselect > - CFI > - Sector erase > - Chip erase > - Program > - Unlock b

Re: [Qemu-devel] [PATCH v3 2/2] exec: Introduce qemu_maxrampagesize() and rename qemu_getrampagesize()

2019-04-17 Thread David Gibson
On Wed, Apr 17, 2019 at 01:31:43PM +0200, David Hildenbrand wrote: > Rename qemu_getrampagesize() to qemu_minrampagesize(). While at it, > properly rename find_max_supported_pagesize() to > find_min_backend_pagesize(). > > s390x is actually interested into the maximum ram pagesize, so > introduce

Re: [Qemu-devel] [PATCH v3 06/10] block/pflash_cfi02: Fix CFI in autoselect mode

2019-04-17 Thread Thomas Huth
On 18/04/2019 00.01, Stephen Checkoway wrote: > After a flash device enters CFI mode from autoselect mode, the reset > command returns the device to autoselect mode. An additional reset > command is necessary to return to read array mode. > > Signed-off-by: Stephen Checkoway > --- [...] > diff --

Re: [Qemu-devel] [PATCH v3 05/10] block/pflash_cfi02: Implement nonuniform sector sizes

2019-04-17 Thread Thomas Huth
On 18/04/2019 00.01, Stephen Checkoway wrote: > Some flash chips support sectors of different sizes. For example, the > AMD AM29LV160DT has 31 64 kB sectors, one 32 kB sector, two 8 kB > sectors, and a 16 kB sector, in that order. The AM29LV160DB has those in > the reverse order. > > The `num-bloc

Re: [Qemu-devel] [PATCH v3 04/10] block/pflash_cfi02: Implement intereleaved flash devices

2019-04-17 Thread Thomas Huth
On 18/04/2019 00.01, Stephen Checkoway wrote: > It's common for multiple narrow flash chips to be hooked up in parallel > to support wider buses. For example, four 8-bit wide flash chips (x8) > may be combined in parallel to produce a 32-bit wide device. Similarly, > two 16-bit wide chips (x16) may

Re: [Qemu-devel] [PATCH v3 03/10] block/pflash_cfi02: Fix command address comparison

2019-04-17 Thread Thomas Huth
On 18/04/2019 00.01, Stephen Checkoway wrote: > Most AMD commands only examine 11 bits of the address. This masks the > addresses used in the comparison to 11 bits. The exceptions are word or > sector addresses which use offset directly rather than the shifted > offset, boff. > > Signed-off-by: St

[Qemu-devel] Live migration fails with all 8 memslots used

2019-04-17 Thread suresh gumpula
Hi, I was trying to migrate a VM(CentOS7) which started with 4G memory and hot plugged 5 memslots with 1G each. So the VM has total of 9G memory and trying to migrate fails in vhost_dev_init() on destination host if (used_memslots > hdev->vhost_ops->vhost_backend_memslots_limit(hdev)) {

[Qemu-devel] [PATCH v7 2/2] hw/arm: Add arm SBSA reference machine, devices part

2019-04-17 Thread Hongbo Zhang
Following the previous patch, this patch adds peripheral devices to the newly introduced SBSA-ref machine. Signed-off-by: Hongbo Zhang --- hw/arm/sbsa-ref.c | 451 ++ 1 file changed, 451 insertions(+) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sb

[Qemu-devel] [PATCH v7 1/2] hw/arm: Add arm SBSA reference machine, skeleton part

2019-04-17 Thread Hongbo Zhang
For the Aarch64, there is one machine 'virt', it is primarily meant to run on KVM and execute virtualization workloads, but we need an environment as faithful as possible to physical hardware, for supporting firmware and OS development for pysical Aarch64 machines. This patch introduces new machin

[Qemu-devel] [PATCH v7 0/2] Add Arm SBSA Reference Machine

2019-04-17 Thread Hongbo Zhang
For the Aarch64, there is one machine 'virt', it is primarily meant to run on KVM and execute virtualization workloads, but we need an environment as faithful as possible to physical hardware, to support firmware and OS development for pysical Aarch64 machines. This machine comes with: - Re-desi

[Qemu-devel] [PATCH] hppa: Delete unused hppa_cpu_list() function

2019-04-17 Thread Eduardo Habkost
hppa_cpu_list() is dead code and is never called. Delete it. Cc: Richard Henderson Signed-off-by: Eduardo Habkost --- target/hppa/cpu.c | 22 -- 1 file changed, 22 deletions(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 00bf444620..b3b1826209 100644 --- a/tar

[Qemu-devel] [PATCH] cpu: Fix crash with empty -cpu option

2019-04-17 Thread Eduardo Habkost
Fix the following crash: $ qemu-system-x86_64 -cpu '' qemu-system-x86_64: qom/cpu.c:291: cpu_class_by_name: \ Assertion `cpu_model && cc->class_by_name' failed. Regression test script included. Fixes: commit 99193d8f2ef5 ("cpu: drop unnecessary NULL check and cpu_common_class_by_name(

Re: [Qemu-devel] [PATCH 0/5] Remove qdev_get_machine() call from ppc_cpu_parse_featurestr()

2019-04-17 Thread Eduardo Habkost
On Wed, Apr 17, 2019 at 07:45:24AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > My initial goal was simple: removing the qdev_get_machine() call > > from ppc_cpu_parse_featurestr() because I want to make > > qdev_get_machine() available only to softmmu code. > > > > Before doin

Re: [Qemu-devel] Following up questions related to QEMU and I/O Thread

2019-04-17 Thread Wei Li
Sounds good, let's keep in touch. __ Thanks, Wei On 4/17/19, 5:17 AM, "Paolo Bonzini" wrote: On 17/04/19 03:38, Wei Li wrote: > Thanks Paolo for your response and clarification. > > Btw, is there any rough schedule about when are you planning to start > working on the mult

Re: [Qemu-devel] [Qemu-ppc] [PATCH v3] spapr: add splpar hcalls H_PROD, H_CONFER

2019-04-17 Thread Nicholas Piggin
David Gibson's on April 17, 2019 10:47 pm: > On Wed, Apr 17, 2019 at 02:01:29PM +0200, Greg Kurz wrote: >> On Wed, 17 Apr 2019 21:20:00 +1000 >> Nicholas Piggin wrote: >> > [...] >> > >> @@ -1860,6 +1928,9 @@ static void hypercall_register_types(void) >> > >> /* hcall-splpar */ >> > >> s

Re: [Qemu-devel] [Qemu-ppc] [PATCH v3] spapr: add splpar hcalls H_PROD, H_CONFER

2019-04-17 Thread Nicholas Piggin
Greg Kurz's on April 17, 2019 10:01 pm: > On Wed, 17 Apr 2019 21:20:00 +1000 > Nicholas Piggin wrote: >> [...] >> >> @@ -1860,6 +1928,9 @@ static void hypercall_register_types(void) >> >> /* hcall-splpar */ >> >> spapr_register_hypercall(H_REGISTER_VPA, h_register_vpa); >> >> spapr_

[Qemu-devel] [PATCH] docs/interop/bitmaps: rewrite and modernize doc

2019-04-17 Thread John Snow
This just about rewrites the entirety of the bitmaps.rst document to make it consistent with the 4.0 release. I have added new features seen in the 4.0 release, as well as tried to clarify some points that keep coming up when discussing this feature both in-house and upstream. Yes, it's a lot long

Re: [Qemu-devel] [PATCH v3 07/15] vfio: Report warnings with warn_report(), not error_printf()

2019-04-17 Thread Alex Williamson
On Wed, 17 Apr 2019 21:06:33 +0200 Markus Armbruster wrote: > Cc: Alex Williamson > Signed-off-by: Markus Armbruster > --- > hw/vfio/pci.c | 19 +-- > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c > index 504019c458..0142819ea6

[Qemu-devel] [PATCH v3 07/10] block/pflash_cfi02: Fix reset command not ignored during erase

2019-04-17 Thread Stephen Checkoway
When the flash device is performing a chip erase, all commands are ignored. When it is performing a sector erase, only the erase suspend command is valid, which is currently not supported. In particular, the reset command should not cause the device to reset to read array mode while programming is

[Qemu-devel] [PATCH v3 04/10] block/pflash_cfi02: Implement intereleaved flash devices

2019-04-17 Thread Stephen Checkoway
It's common for multiple narrow flash chips to be hooked up in parallel to support wider buses. For example, four 8-bit wide flash chips (x8) may be combined in parallel to produce a 32-bit wide device. Similarly, two 16-bit wide chips (x16) may be combined. This commit introduces `device-width` a

[Qemu-devel] [PATCH v3 03/10] block/pflash_cfi02: Fix command address comparison

2019-04-17 Thread Stephen Checkoway
Most AMD commands only examine 11 bits of the address. This masks the addresses used in the comparison to 11 bits. The exceptions are word or sector addresses which use offset directly rather than the shifted offset, boff. Signed-off-by: Stephen Checkoway --- hw/block/pflash_cfi02.c | 8 +

[Qemu-devel] [PATCH v3 08/10] block/pflash_cfi02: Implement multi-sector erase

2019-04-17 Thread Stephen Checkoway
After two unlock cycles and a sector erase command, the AMD flash chips start a 50 us erase time out. Any additional sector erase commands add a sector to be erased and restart the 50 us timeout. During the timeout, status bit DQ3 is cleared. After the time out, DQ3 is asserted during erasure. Sig

[Qemu-devel] [PATCH v3 09/10] block/pflash_cfi02: Implement erase suspend/resume

2019-04-17 Thread Stephen Checkoway
During a sector erase (but not a chip erase), the embeded erase program can be suspended. Once suspended, the sectors not selected for erasure may be read and programmed. Autoselect mode is allowed during erase suspend mode. Presumably, CFI queries are similarly allowed so this commit allows them a

[Qemu-devel] [PATCH v3 10/10] block/pflash_cfi02: Use the chip erase time specified in the CFI table

2019-04-17 Thread Stephen Checkoway
When erasing the chip, use the typical time specified in the CFI table rather than arbitrarily selecting 5 seconds. Since the currently unconfigurable value set in the table is 12, this means a chip erase takes 4096 ms so this isn't a big change in behavior. Signed-off-by: Stephen Checkoway ---

[Qemu-devel] [PATCH v3 01/10] block/pflash_cfi02: Add test for supported commands

2019-04-17 Thread Stephen Checkoway
Test the AMD command set for parallel flash chips. This test uses an ARM musicpal board with a pflash drive to test the following list of currently-supported commands. - Autoselect - CFI - Sector erase - Chip erase - Program - Unlock bypass - Reset Signed-off-by: Stephen Checkoway --- tests/Make

[Qemu-devel] [PATCH v3 05/10] block/pflash_cfi02: Implement nonuniform sector sizes

2019-04-17 Thread Stephen Checkoway
Some flash chips support sectors of different sizes. For example, the AMD AM29LV160DT has 31 64 kB sectors, one 32 kB sector, two 8 kB sectors, and a 16 kB sector, in that order. The AM29LV160DB has those in the reverse order. The `num-blocks` and `sector-length` properties work exactly as they di

[Qemu-devel] [PATCH v3 06/10] block/pflash_cfi02: Fix CFI in autoselect mode

2019-04-17 Thread Stephen Checkoway
After a flash device enters CFI mode from autoselect mode, the reset command returns the device to autoselect mode. An additional reset command is necessary to return to read array mode. Signed-off-by: Stephen Checkoway --- hw/block/pflash_cfi02.c | 21 + tests/pflash-cfi02

[Qemu-devel] [PATCH v3 00/10] block/pflash_cfi02: Implement missing AMD pflash functionality

2019-04-17 Thread Stephen Checkoway
The goal of this patch series implement the following AMD command-set parallel flash functionality: - flash interleaving; - nonuniform sector sizes; - erase suspend/resume commands; and - multi-sector erase. During refactoring and implementation, I discovered several bugs that are fixed here as we

[Qemu-devel] [PATCH v3 02/10] block/pflash_cfi02: Refactor, NFC intended

2019-04-17 Thread Stephen Checkoway
Simplify and refactor for upcoming commits. In particular, pull out all of the code to modify the status into simple helper functions. Status handling becomes more complex once multiple chips are interleaved to produce a single device. No change in functionality is intended with this commit. Sign

[Qemu-devel] [Bug 1825002] Re: "qemu: Unexpected FPU mode" since 0c1bbedc10e86ea9366b6af8c5520fafa3266b2f

2019-04-17 Thread Daniel Santos
Thanks Peter. I was just reading up on the CVE process and I agree. Obviously, it's dangerous to use uninitialized values, but that doesn't necessarily make it a vulnerability. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://

[Qemu-devel] [Bug 1825002] Re: "qemu: Unexpected FPU mode" since 0c1bbedc10e86ea9366b6af8c5520fafa3266b2f

2019-04-17 Thread Daniel Santos
And thank you Thomas for the instructions! -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1825002 Title: "qemu: Unexpected FPU mode" since 0c1bbedc10e86ea9366b6af8c5520fafa3266b2f Status in QEMU:

Re: [Qemu-devel] [PATCH v7 0/6] target/mips: Optimize MSA interleave instructions

2019-04-17 Thread Aleksandar Markovic
> From: Mateja Marjanovic > Subject: [PATCH v7 0/6] target/mips: Optimize MSA interleave instructions > > From: Mateja Marjanovic > > Optimize and refactor MSA instructions ILVEV., > ILVOD., ILVL. and ILVR.. Patch number 5/6 seems to be for some reason lost. Please resend the complete series.

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

[Qemu-devel] [Bug 1825002] Re: "qemu: Unexpected FPU mode" since 0c1bbedc10e86ea9366b6af8c5520fafa3266b2f

2019-04-17 Thread Peter Maydell
This is certainly a bug, but it's not a a CVE, ie not a security bug. The entire purpose of the linux-user mode is to run the guest ELF file and let it perform whatever syscalls it likes -- it doesn't need to exploit any kind of bug in the ELF loader to be able to control what the process is doing.

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

Re: [Qemu-devel] [PATCH] target/mips: Amend tests for MSA binary integer operations

2019-04-17 Thread Aleksandar Markovic
> From: Aleksandar Markovic > Subject: Re: [PATCH] target/mips: Amend tests for MSA binary integer > operations > > > From: Mateja Marjanovic > > Subject: [PATCH] target/mips: Amend tests for MSA binary integer operations > > > > Amend tests for certain MSA binary integer instructions > > (for e

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

Re: [Qemu-devel] [Qemu-block] [PATCH 0/5] Few fixes for userspace NVME driver

2019-04-17 Thread Maxim Levitsky
On Tue, 2019-04-16 at 15:50 +0200, Paolo Bonzini wrote: > On 15/04/19 15:57, Maxim Levitsky wrote: > > > > > > Hi! > > These are few assorted fixes and features for the userspace > > nvme driver. > > > > Tested that on my laptop with my Samsung X5 thunderbolt drive, which > > happens to have 4K

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

[Qemu-devel] [PATCH v2 3/5] block/nvme: support larger that 512 bytes sector devices

2019-04-17 Thread Maxim Levitsky
Currently the driver hardcodes the sector size to 512, and doesn't check the underlying device Also fail if underlying nvme device is formatted with metadata as this needs special support. Signed-off-by: Maxim Levitsky --- block/nvme.c | 40 +++- 1 file chang

[Qemu-devel] [PATCH v2 5/5] block/nvme: add support for discard

2019-04-17 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- block/nvme.c | 80 ++ block/trace-events | 2 ++ 2 files changed, 82 insertions(+) diff --git a/block/nvme.c b/block/nvme.c index 35b925899f..b83912c627 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -110,6 +11

[Qemu-devel] [PATCH v2 1/5] block/nvme: don't flip CQ phase bits

2019-04-17 Thread Maxim Levitsky
Phase bits are only set by the hardware to indicate new completions and not by the device driver. Signed-off-by: Maxim Levitsky --- block/nvme.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 0684bbd077..2d208000df 100644 --- a/block/nvme.c +++ b/block/nvm

[Qemu-devel] [PATCH v2 2/5] block/nvme: fix doorbell stride

2019-04-17 Thread Maxim Levitsky
Fix the math involving non standard doorbell stride Signed-off-by: Maxim Levitsky --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index 2d208000df..208242cf1f 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -216,7 +216,7 @@ static

[Qemu-devel] [PATCH v2 0/5] Few fixes for userspace NVME driver

2019-04-17 Thread Maxim Levitsky
Hi! These are few assorted fixes and features for the userspace nvme driver. Tested that on my laptop with my Samsung X5 thunderbolt drive, which happens to have 4K sectors, support for discard and write zeros. Also bunch of fixes sitting in my queue from the period when I developed the nvme-mdev

[Qemu-devel] [PATCH v2 4/5] block/nvme: add support for write zeros

2019-04-17 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- block/nvme.c | 69 +++- block/trace-events | 1 + include/block/nvme.h | 19 +++- 3 files changed, 87 insertions(+), 2 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 0b1da54574..35b925899f 1

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

[Qemu-devel] tsan: many race conditions involving mmio

2019-04-17 Thread Frank Yang via Qemu-devel
What's a quick fix for stuff like this? WARNING: ThreadSanitizer: data race (pid=168036) Write of size 8 at 0x7b900017a100 by thread T1 (mutexes: write M2141): #0 free /toolchain/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:715:3 (qemu-system-x86_64+0x484028) #1 phys_secti

[Qemu-devel] [PATCH] mips: Fix "Unexpected FPU mode"

2019-04-17 Thread Daniel Santos
In load_elf_binary, struct image_info interp_info is used without being properly initialized. One result is that when the ELF's program header doesn't contain an entry for the ABI flags, then the value of the struct image_info's fp_abi field is set to whatever happened to be in stack memory at the

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

Re: [Qemu-devel] [PATCH v2 15/17] monitor: Clean up how monitor_disas() funnels output to monitor

2019-04-17 Thread Eric Blake
On 4/17/19 2:18 PM, Markus Armbruster wrote: > INIT_DISASSEMBLE_INFO() takes an fprintf()-like callback and a FILE * > to pass to it. monitor_disas() passes monitor_fprintf() and the > current monitor cast to FILE *. monitor_fprintf() casts it right > back, and is otherwise identical to monitor_p

Re: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190417191805.28198-1-arm...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190417191805.28198-1-arm...@redhat.com Subject: [Qemu-devel] [PATCH v2 00/17] Clean up and simplify aro

Re: [Qemu-devel] [PATCH v7 2/6] target/mips: Optimize ILVEV. MSA instructions

2019-04-17 Thread Richard Henderson
On 4/17/19 5:33 AM, Mateja Marjanovic wrote: > From: Mateja Marjanovic > > Optimize set of MSA instructions ILVEV., using > directly tcg registers and performing logic on them > instead of using helpers. > > In the following table, the first column is the performance > before this patch. The sec

Re: [Qemu-devel] [PATCH v7 1/6] target/mips: Optimize ILVOD. MSA instructions

2019-04-17 Thread Richard Henderson
On 4/17/19 5:33 AM, Mateja Marjanovic wrote: > From: Mateja Marjanovic > > Optimize set of MSA instructions ILVOD., using > directly tcg registers and performing logic on them instead > of using helpers. > > In the following table, the first column is the performance > before this patch. The sec

Re: [Qemu-devel] [PATCH v3 14/15] char-pty: Print "char device redirected" message to stdout

2019-04-17 Thread Eric Blake
On 4/17/19 2:06 PM, Markus Armbruster wrote: > char_pty_open() prints a "char device redirected to PTY_NAME (label > LABEL)" message to the current monitor or else to stderr. This is not > an error, so it shouldn't go to stderr. Print it to stdout instead. > > Why is it even printed? No other C

[Qemu-devel] [PATCH v2 10/17] target: Clean up how the dump_mmu() print

2019-04-17 Thread Markus Armbruster
The various dump_mmu() take an fprintf()-like callback and a FILE * to pass to it, and so do their helper functions. Passing around callback and argument is rather tiresome. Most dump_mmu() are called only by the target's hmp_info_tlb(). These all pass monitor_printf() cast to fprintf_function a

Re: [Qemu-devel] [PATCH v3] i386: Add new Hygon 'Dhyana' CPU model

2019-04-17 Thread Pavel Hrdina
On Wed, Apr 17, 2019 at 10:53:04PM +0800, Pu Wen wrote: > On 2019/4/16 22:17, Pavel Hrdina wrote: > > On Tue, Apr 16, 2019 at 08:06:13PM +0800, Pu Wen wrote: > > > Add a new base CPU model called 'Dhyana' to model processors from Hygon > > > Dhyana(family 18h), which derived from AMD EPYC(family 17

[Qemu-devel] [PATCH v2 13/17] qemu-print: New qemu_fprintf(), qemu_vfprintf()

2019-04-17 Thread Markus Armbruster
Code that doesn't want to know about current monitor vs. stdout vs. stderr takes an fprintf_function callback and a FILE * argument to pass to it. Actual arguments are either fprintf() and stdout or stderr, or monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it rig

[Qemu-devel] [PATCH v2 07/17] block/qapi: Clean up how we print to monitor or stdout

2019-04-17 Thread Markus Armbruster
bdrv_snapshot_dump(), bdrv_image_info_specific_dump(), bdrv_image_info_dump() and their helpers take an fprintf()-like callback and a FILE * to pass to it. hmp.c passes monitor_printf() cast to fprintf_function and the current monitor cast to FILE *. qemu-img.c and qemu-io-cmds.c pass fprintf and

[Qemu-devel] [PATCH v2 14/17] qom/cpu: Simplify how CPUClass:cpu_dump_state() prints

2019-04-17 Thread Markus Armbruster
CPUClass method dump_statistics() takes an fprintf()-like callback and a FILE * to pass to it. Most callers pass fprintf() and stderr. log_cpu_state() passes fprintf() and qemu_log_file. hmp_info_registers() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts

[Qemu-devel] [PATCH v2 00/17] Clean up and simplify around fprintf_function

2019-04-17 Thread Markus Armbruster
We pass around fprintf_function callbacks together a FILE * argument. Three cases: * We pass fprintf() and stdout, stderr or qemu_log_file. Okay. * We pass monitor_fprintf() together with the current monitor cast to FILE *. The type-punning is ugly. * We pass monitor_printf() cast to fprintf

[Qemu-devel] [PATCH v2 15/17] monitor: Clean up how monitor_disas() funnels output to monitor

2019-04-17 Thread Markus Armbruster
INIT_DISASSEMBLE_INFO() takes an fprintf()-like callback and a FILE * to pass to it. monitor_disas() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-pinning is ugly. Pass qemu_fprint

[Qemu-devel] [PATCH v2 08/17] memory: Clean up how mtree_info() prints

2019-04-17 Thread Markus Armbruster
mtree_info() takes an fprintf()-like callback and a FILE * to pass to it, and so do its helper functions. Passing around callback and argument is rather tiresome. Its only caller hmp_info_mtree() passes monitor_printf() cast to fprintf_function and the current monitor cast to FILE *. The type-pu

[Qemu-devel] [PATCH v2 09/17] target: Simplify how the TARGET_cpu_list() print

2019-04-17 Thread Markus Armbruster
The various TARGET_cpu_list() take an fprintf()-like callback and a FILE * to pass to it. Their callers (vl.c's main() via list_cpus(), bsd-user/main.c's main(), linux-user/main.c's main()) all pass fprintf() and stdout. Thus, the flexibility provided by the (rather tiresome) indirection isn't ac

[Qemu-devel] [PATCH v2 03/17] tcg: Simplify how dump_opcount_info() prints

2019-04-17 Thread Markus Armbruster
dump_opcount_info() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_info_opcount() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. D

[Qemu-devel] [PATCH v2 12/17] qom/cpu: Simplify how CPUClass::dump_statistics() prints

2019-04-17 Thread Markus Armbruster
CPUClass method dump_statistics() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_info_cpustats() (via cpu_dump_statistics()) passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monit

[Qemu-devel] [PATCH v2 05/17] tcg: Simplify how dump_drift_info() prints

2019-04-17 Thread Markus Armbruster
dump_drift_info() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_info_jit() passes monitor_fprintf() and a Monitor * cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. Drop the callba

[Qemu-devel] [PATCH v2 16/17] disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h

2019-04-17 Thread Markus Armbruster
Commit dc99065b5f9 (v0.1.0) added dis-asm.h from binutils. Commit 43d4145a986 (v0.1.5) inlined bfd.h into dis-asm.h to remove the dependency on binutils. Commit 76cad71136b (v1.4.0) moved dis-asm.h to include/disas/bfd.h. The new name is confusing when you try to match against (pre GPLv3+) binuti

[Qemu-devel] [PATCH v2 01/17] include: Include fprintf-fn.h only where needed

2019-04-17 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Dr. David Alan Gilbert --- include/qemu-common.h | 2 -- include/qemu/cutils.h | 2 -- include/sysemu/cpus.h | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/qemu-common.h b/include/qemu-common.h index a102245519..f891e05e

[Qemu-devel] [PATCH v2 02/17] trace: Simplify how st_print_trace_file_status() prints

2019-04-17 Thread Markus Armbruster
st_print_trace_file_status() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_trace_file() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is u

[Qemu-devel] [PATCH v2 17/17] include: Move fprintf_function to disas/

2019-04-17 Thread Markus Armbruster
The previous commits have eliminated fprintf_function outside disassemblers, simplifying code and cleaning up the ugly type-punning fprintf_function seems to attract. Move fprintf_function to include/disas/dis-asm.h to reduce the temptation to abuse it. I considered renaming it to fprintf_ftype (

[Qemu-devel] [PATCH v2 11/17] target/i386: Simplify how x86_cpu_dump_local_apic_state() prints

2019-04-17 Thread Markus Armbruster
x86_cpu_dump_local_apic_state() takes an fprintf()-like callback and a FILE * to pass to it, and so do its helper functions. Its only caller hmp_info_local_apic() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to

[Qemu-devel] [PATCH v2 04/17] tcg: Simplify how dump_exec_info() prints

2019-04-17 Thread Markus Armbruster
dump_exec_info() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_info_jit() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. Drop the

[Qemu-devel] [PATCH v3 02/15] block/ssh: Do not report read/write/flush errors to the user

2019-04-17 Thread Markus Armbruster
Callbacks ssh_co_readv(), ssh_co_writev(), ssh_co_flush() report errors to the user with error_printf(). They shouldn't, it's their caller's job. Replace by a suitable trace point. While there, drop the unreachable !s->sftp case. Perhaps we should convert this part of the block driver interface

[Qemu-devel] [PATCH v2 06/17] qsp: Simplify how qsp_report() prints

2019-04-17 Thread Markus Armbruster
qsp_report() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_sync_profile() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. Drop the

[Qemu-devel] [PATCH v3 07/15] vfio: Report warnings with warn_report(), not error_printf()

2019-04-17 Thread Markus Armbruster
Cc: Alex Williamson Signed-off-by: Markus Armbruster --- hw/vfio/pci.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 504019c458..0142819ea6 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -947,8 +947,10 @@ static vo

[Qemu-devel] [PATCH v3 11/15] qemu-print: New qemu_printf(), qemu_vprintf() etc.

2019-04-17 Thread Markus Armbruster
We commonly want to print to the current monitor if we have one, else to stdout/stderr. For stderr, have error_printf(). For stdout, all we have is monitor_vfprintf(), which is rather unwieldy. We often print to stderr just because error_printf() is easier. New qemu_printf() and qemu_vprintf()

[Qemu-devel] [PATCH v3 10/15] monitor error: Make printf()-like functions return a value

2019-04-17 Thread Markus Armbruster
printf() & friends return the number of characters written on success, negative value on error. monitor_printf(), monitor_vfprintf(), monitor_vprintf(), error_printf(), error_printf_unless_qmp(), error_vprintf(), and error_vprintf_unless_qmp() return void. Some of them carry a TODO comment asking

[Qemu-devel] [PATCH v3 01/15] qemu-img: Use error_vreport() in error_exit()

2019-04-17 Thread Markus Armbruster
error_exit() uses low-level error_printf() to report errors. Modernize it to use error_vreport(). Cc: Kevin Wolf Cc: Max Reitz Cc: qemu-bl...@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- qemu-img.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --

[Qemu-devel] [PATCH v3 06/15] hpet: Report warnings with warn_report(), not error_printf()

2019-04-17 Thread Markus Armbruster
Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Signed-off-by: Markus Armbruster --- hw/timer/hpet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index d97436bc7b..41024f39fb 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -744,7 +744,7

[Qemu-devel] [PATCH v3 12/15] blockdev: Make -drive format=help print to stdout

2019-04-17 Thread Markus Armbruster
Command line help explicitly requested by the user should be printed to stdout, not stderr. We do elsewhere. Adjust -drive to match: use qemu_printf() instead of error_printf(). Plain printf() would be wrong because we need to print to the current monitor for "drive_add ... format=help". Cc: Ke

[Qemu-devel] [PATCH v3 05/15] pci: Report fatal errors with error_report(), not error_printf()

2019-04-17 Thread Markus Armbruster
Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Signed-off-by: Markus Armbruster Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 6d13ef877b..1808b242dd 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.

[Qemu-devel] [PATCH v3 08/15] s390x/kvm: Report warnings with warn_report(), not error_printf()

2019-04-17 Thread Markus Armbruster
kvm_s390_mem_op() can fail in two ways: when !cap_mem_op, it returns -ENOSYS, and when kvm_vcpu_ioctl() fails, it returns -errno set by ioctl(). Its caller s390_cpu_virt_mem_rw() recovers from both failures. kvm_s390_mem_op() prints "KVM_S390_MEM_OP failed" with error_printf() in the latter failu

[Qemu-devel] [PATCH v3 13/15] char: Make -chardev help print to stdout

2019-04-17 Thread Markus Armbruster
Command line help explicitly requested by the user should be printed to stdout, not stderr. We do elsewhere. Adjust -chardev to match: use qemu_printf() instead of error_printf(). Plain printf() would be wrong because we need to print to the current monitor for "chardev-add help". Cc: "Marc-And

[Qemu-devel] [PATCH v3 09/15] vl: Make -machine $TYPE, help and -accel help print to stdout

2019-04-17 Thread Markus Armbruster
Command line help help explicitly requested by the user should be printed to stdout, not stderr. We do elsewhere. Adjust -machine $TYPE,help and -accel help to match: use printf() instead of error_printf(). Cc: Marcel Apfelbaum Signed-off-by: Markus Armbruster Reviewed-by: Marcel Apfelbaum --

  1   2   >