[Qemu-devel] [PATCH v4] target/ppc: add external PID support

2018-09-20 Thread Roman Kapl
External PID is a mechanism present on BookE 2.06 that enables application to store/load data from different address spaces. There are special version of some instructions, which operate on alternate address space, which is specified in the EPLC/EPSC regiser. This implementation uses two additiona

Re: [Qemu-devel] [PATCH v3 08/22] memory-device: factor out get_memory_region() from pc-dimm

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:29PM +0200, David Hildenbrand wrote: > The memory region is necessary for plugging/unplugging a memory device. > The region size (via get_region_size()) is no longer sufficient, as > besides the alignment, also the region itself is required in order to > add it to the

Re: [Qemu-devel] [PATCH v3 02/22] memory-device: handle integer overflows properly

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:23PM +0200, David Hildenbrand wrote: > Although unlikely in practice, we could have integer overflows on some > calculations based on addresses and sizes, leading to error checks not > triggering. > > Let's properly handle this whenever we do an addition. Make > addre

Re: [Qemu-devel] [PATCH v3 05/22] memory-device: forward errors in get_region_size()/get_plugged_size()

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:26PM +0200, David Hildenbrand wrote: > Let's properly forward the errors, so errors from get_region_size() / > get_plugged_size() can be handled. > > Users right now call both functions after the device has been realized, > which is will never fail, so it is fine to c

Re: [Qemu-devel] [PATCH v3 01/22] memory-device: fix error message when hinted address is too small

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:22PM +0200, David Hildenbrand wrote: > The "at" should actually be a "before". > if (new_addr < address_space_start) > -> "can't add memory ... before... $address_space_start" > > So it looks similar to the other check > } else if ((new_addr + size) > add

Re: [Qemu-devel] [PATCH v3 03/22] memory-device: use memory device terminology in error messages

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:24PM +0200, David Hildenbrand wrote: > While we rephrased most error messages, we missed these. > > Reviewed-by: Dr. David Alan Gilbert > Reviewed-by: Igor Mammedov > Signed-off-by: David Hildenbrand Reviewed-by: David Gibson > --- > hw/mem/memory-device.c | 6

Re: [Qemu-devel] [PATCH v3 09/22] memory-device: drop get_region_size()

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:30PM +0200, David Hildenbrand wrote: > We now have get_memory_region(), which can be used generically to detect > the region size. Use memory_device_get_region_size() where > get_region_size() was used and use memory_device_get_region_size() as > callback for get_plugg

Re: [Qemu-devel] [PATCH v3 07/22] memory-device: add and use memory_device_get_region_size()

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:28PM +0200, David Hildenbrand wrote: > We will factor out get_memory_region() from pc-dimm to memory device code > soon. Once that is done, get_region_size() can be implemented > generically and essentially be replaced by > memory_device_get_region_size (and work only

Re: [Qemu-devel] [PATCH v3 06/22] memory-device: document MemoryDeviceClass

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:27PM +0200, David Hildenbrand wrote: > Document the functions and when to not expect errors. > > Signed-off-by: David Hildenbrand Reviewed-by: David Gibson > --- > include/hw/mem/memory-device.h | 13 + > 1 file changed, 13 insertions(+) > > diff --g

Re: [Qemu-devel] [PATCH v3 04/22] memory-device: introduce separate config option

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:25PM +0200, David Hildenbrand wrote: > Some architectures might support memory devices, while they don't > support DIMM/NVDIMM. So let's > - Rename CONFIG_MEM_HOTPLUG to CONFIG_MEM_DEVICE > - Introduce CONFIG_DIMM and use it similarly to CONFIG NVDIMM > > CONFIG_DIMM

Re: [Qemu-devel] [PATCH v2] Drop "qemu:" prefix from error_report() arguments

2018-09-20 Thread Markus Armbruster
Mao Zhongyi writes: > error_report and friends already add a "qemu-system-xxx" prefix > to the string, so a "qemu:" prefix is redundant in the string. > Just drop it. > > Reported-by: Thomas Huth > Signed-off-by: Mao Zhongyi > Reviewed-by: Eduardo Habkost v1 dequeued, v2 queued, thanks!

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-20 Thread Markus Armbruster
Eduardo Habkost writes: > On Thu, Sep 20, 2018 at 11:19:56AM -0400, Cleber Rosa wrote: >> The acceptance (aka functional, aka Avocado-based) tests are >> Python files located in "tests/acceptance" that need to be run >> with the Avocado libs and test runner. >> >> Let's provide a convenient way

Re: [Qemu-devel] [PATCH] Deprecate QMP `cpu-add`

2018-09-20 Thread Markus Armbruster
Eduardo Habkost writes: > On Thu, Sep 20, 2018 at 02:27:02PM +0200, Markus Armbruster wrote: >> Kashyap Chamarthy writes: > [...] >> > --- >> > qapi/misc.json | 6 +- >> > qemu-deprecated.texi | 5 + >> > 2 files changed, 10 insertions(+), 1 deletion(-) >> > >> > diff --git a/qapi

Re: [Qemu-devel] [PATCH v2 4/4] hw/core/machine: Officially deprecate the enforce-config-section parameter

2018-09-20 Thread Peter Xu
On Thu, Sep 20, 2018 at 10:50:16AM +0200, Thomas Huth wrote: > Commit 16f7244842b5135543ef068a1adafd94c6965953 added this parameter > to the documentation, including a note that it is deprecated. But it > has never been added to the "Deprecated features" appendix, which is > our official way to dep

Re: [Qemu-devel] [PATCH v4 3/3] x86: define a new MSR based feature word -- FEATURE_WORDS_ARCH_CAPABILITIES

2018-09-20 Thread Robert Hoo
On Thu, 2018-09-20 at 14:18 -0300, Eduardo Habkost wrote: > On Thu, Sep 20, 2018 at 05:55:48PM +0800, Robert Hoo wrote: > > On Thu, 2018-09-20 at 00:13 -0300, Eduardo Habkost wrote: > > > On Sun, Sep 02, 2018 at 07:46:07PM +0800, Robert Hoo wrote: > > > > Note RSBA is specially treated -- no matter

Re: [Qemu-devel] [PATCH] target/i386: fix translation for icount mode

2018-09-20 Thread Pavel Dovgalyuk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 20/09/2018 09:17, Pavel Dovgalyuk wrote: > > This patch fixes the checking of boundary crossing instructions. > > In icount mode only first instruction of the block may cross > > the page boundary to keep the translation deterministic. > > The

Re: [Qemu-devel] [PATCH v2] Drop "qemu:" prefix from error_report() arguments

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 10:05:30PM -0400, Mao Zhongyi wrote: > error_report and friends already add a "qemu-system-xxx" prefix > to the string, so a "qemu:" prefix is redundant in the string. > Just drop it. > > Reported-by: Thomas Huth > Signed-off-by: Mao Zhongyi > Reviewed-by: Eduardo Habkost

Re: [Qemu-devel] [PATCH v4 2/3] kvm: Add support to KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS system ioctl

2018-09-20 Thread Eduardo Habkost
On Fri, Sep 21, 2018 at 08:28:24AM +0800, Robert Hoo wrote: > On Thu, 2018-09-20 at 14:22 -0300, Eduardo Habkost wrote: > > On Thu, Sep 20, 2018 at 03:45:42PM +0800, Robert Hoo wrote: > > [...] > > > > > diff --git a/target/i386/cpu.c b/target/i386/cpu.c > > > > > index a252c26..0160e97 100644 > >

Re: [Qemu-devel] [PATCH] target/ppc: fix dcbz, dcbzep, dcbtst and insn type

2018-09-20 Thread Peter Maydell
On 20 September 2018 at 02:34, Roman Kapl wrote: > dcbz was broken with the refactoring introduced in the External PID patch. The > GETPC() call is moved directly to the helper in this patch, to report correct > PC > address. The issue did not always manifest: if the compiler decided to inline >

Re: [Qemu-devel] [PATCH] Drop the "qemu:" prefix from error_report()

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 07:08:32AM -0400, Mao Zhongyi wrote: > error_report and friends already add a "qemu-system-xxx" prefix > to the string, so a "qemu:" prefix is redundant in the string. > Just drop it. > > Reported-by: Thomas Huth > Signed-off-by: Mao Zhongyi ppc parts Acked-by: David Gib

Re: [Qemu-devel] [PATCH] target/ppc: fix dcbz, dcbzep, dcbtst and insn type

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 01:17:59PM +0200, Roman Kapl wrote: > On 09/20/2018 01:13 PM, Philippe Mathieu-Daudé wrote: > > > > > Fixes: ea8073c10d ("target/ppc: add external PID support") > > > > Your previous patch is now d12a22c5c7 in David Gibson's tree, so I think > > here squashing your fixes (

Re: [Qemu-devel] [PATCH 0/5] 40p: LSI SCSI IRQ routing patch roll-up

2018-09-20 Thread David Gibson
On Thu, Sep 20, 2018 at 06:34:05AM +0100, Mark Cave-Ayland wrote: > On 20/09/2018 05:26, Peter Maydell wrote: > > > On 19 September 2018 at 19:55, David Gibson > > wrote: > >> On Wed, Sep 19, 2018 at 06:20:56PM +0100, Mark Cave-Ayland wrote: > >>> Here is the final set of 40p LSI SCSI routing pa

Re: [Qemu-devel] [PATCH 0/5] 40p: LSI SCSI IRQ routing patch roll-up

2018-09-20 Thread David Gibson
On Wed, Sep 19, 2018 at 09:26:33PM -0700, Peter Maydell wrote: > On 19 September 2018 at 19:55, David Gibson > wrote: > > On Wed, Sep 19, 2018 at 06:20:56PM +0100, Mark Cave-Ayland wrote: > >> Here is the final set of 40p LSI SCSI routing patches with reviewer tags > >> rebased upon ppc-for-3.1 a

Re: [Qemu-devel] [PATCH] target/ppc: fix dcbz, dcbzep, dcbtst and insn type

2018-09-20 Thread David Gibson
On Fri, Sep 21, 2018 at 10:55:56AM +1000, David Gibson wrote: > On Thu, Sep 20, 2018 at 01:17:59PM +0200, Roman Kapl wrote: > > On 09/20/2018 01:13 PM, Philippe Mathieu-Daudé wrote: > > > > > > > Fixes: ea8073c10d ("target/ppc: add external PID support") > > > > > > Your previous patch is now d12

Re: [Qemu-devel] [RFC v2 8/8] virtio: guest driver reload for vhost-net

2018-09-20 Thread Jason Wang
On 2018年09月21日 04:39, Maxime Coquelin wrote: Hi Wei, Jason, On 06/19/2018 09:53 AM, Wei Xu wrote: On Wed, Jun 06, 2018 at 11:48:19AM +0800, Jason Wang wrote: On 2018å¹´06月06æ—¥ 03:08, w...@redhat.com wrote: From: Wei Xu last_avail, avail_wrap_count, used_idx and used_wrap_count are n

[Qemu-devel] [PATCH v2] Drop "qemu:" prefix from error_report() arguments

2018-09-20 Thread Mao Zhongyi
error_report and friends already add a "qemu-system-xxx" prefix to the string, so a "qemu:" prefix is redundant in the string. Just drop it. Reported-by: Thomas Huth Signed-off-by: Mao Zhongyi Reviewed-by: Eduardo Habkost --- hw/i386/multiboot.c | 8 hw/ppc/e500.c | 4 ++-- hw/p

Re: [Qemu-devel] [PATCH] Drop the "qemu:" prefix from error_report()

2018-09-20 Thread Mao Zhongyi
On 9/20/18 1:34 PM, Eduardo Habkost wrote: On Thu, Sep 20, 2018 at 07:08:32AM -0400, Mao Zhongyi wrote: error_report and friends already add a "qemu-system-xxx" prefix to the string, so a "qemu:" prefix is redundant in the string. Just drop it. Reported-by: Thomas Huth Signed-off-by: Mao Zh

Re: [Qemu-devel] [PATCH] Drop the "qemu:" prefix from error_report()

2018-09-20 Thread Mao Zhongyi
On 9/20/18 1:39 PM, Peter Maydell wrote: if (flags & 0x0004) { /* MULTIBOOT_HEADER_HAS_VBE */ -error_report("qemu: multiboot knows VBE. we don't."); +error_report("multiboot knows VBE. we don't."); Since this one is intended to be a user-facing error message rather t

Re: [Qemu-devel] [PATCH RFC v3 7/7] qemu_thread_create: propagate the error to callers to handle

2018-09-20 Thread Fam Zheng
On Thu, 09/20 18:19, Fei Li wrote: > > > On 09/19/2018 11:51 PM, Fam Zheng wrote: > > On Wed, 09/19 21:35, Fei Li wrote: > > > Make qemu_thread_create() return a Boolean to indicate if it succeeds > > > rather than failing with an error. And add an Error parameter to hold > > > the error message

Re: [Qemu-devel] [PATCH v4 2/3] kvm: Add support to KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS system ioctl

2018-09-20 Thread Robert Hoo
On Thu, 2018-09-20 at 14:22 -0300, Eduardo Habkost wrote: > On Thu, Sep 20, 2018 at 03:45:42PM +0800, Robert Hoo wrote: > [...] > > > > diff --git a/target/i386/cpu.c b/target/i386/cpu.c > > > > index a252c26..0160e97 100644 > > > > --- a/target/i386/cpu.c > > > > +++ b/target/i386/cpu.c > > > > @@

Re: [Qemu-devel] [RFC v2 0/2] Add BPF suuport to Qemu

2018-09-20 Thread Alex Bennée
Sameeh Jubran writes: > From: Sameeh Jubran > > The Berkeley Packet Filter has been in the kernel for a while now and I > think it is time that it is introduced to Qemu. This patch is an > infrastructure for any future usage of the BPF in Qemu. > > It is important to note that the tun driver h

Re: [Qemu-devel] [PATCH v5 6/8] target/mips: Define the R5900 CPU

2018-09-20 Thread Maciej W. Rozycki
Hi Philippe, > > diff --git a/target/mips/translate_init.inc.c > > b/target/mips/translate_init.inc.c > > index b3320b9dc7..71fd83de06 100644 > > --- a/target/mips/translate_init.inc.c > > +++ b/target/mips/translate_init.inc.c > > @@ -410,6 +410,53 @@ const mips_def_t mips_defs[] = > >

Re: [Qemu-devel] [PATCH 1/2] Bootstrap Python venv for tests

2018-09-20 Thread Philippe Mathieu-Daudé
Hi Cleber, On 9/20/18 5:19 PM, Cleber Rosa wrote: > A number of QEMU tests are written in Python, and may benefit > from an untainted Python venv. > > By using make rules, tests that depend on specific Python libs > can set that rule as a requiment, along with rules that require > the presence or

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-20 Thread Philippe Mathieu-Daudé
On 9/21/18 12:06 AM, Eduardo Habkost wrote: > On Thu, Sep 20, 2018 at 11:18:46PM +0200, Philippe Mathieu-Daudé wrote: >> On 9/20/18 10:14 PM, Eduardo Habkost wrote: >>> On Thu, Sep 20, 2018 at 04:00:27PM -0400, Cleber Rosa wrote: On 9/20/18 2:58 PM, Eduardo Habkost wrote: > On Thu, Sep 20,

Re: [Qemu-devel] [PATCH v5 6/8] target/mips: Define the R5900 CPU

2018-09-20 Thread Philippe Mathieu-Daudé
Hi Fredrik, On 9/15/18 11:50 AM, Fredrik Noring wrote: > The primary purpose of this change is to support programs compiled by > GCC for the R5900 target and thereby run R5900 Linux distributions, for > example Gentoo. In particular, this avoids issues with cross compilation. > > This change has

[Qemu-devel] virtio-vhost-user with virtio-scsi: end-to-end setup

2018-09-20 Thread Nikos Dragazis
Dear Stefan, I hope you are the right person to contact about this, please point me to the right direction otherwise. I am also Cc:ing the SPDK and qemu-devel mailing lists, to solicit community feedback. As part of my internship at Arrikto, I have spent the last few months working on the SPDK vh

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-20 Thread Eduardo Habkost
On Thu, Sep 20, 2018 at 11:18:46PM +0200, Philippe Mathieu-Daudé wrote: > On 9/20/18 10:14 PM, Eduardo Habkost wrote: > > On Thu, Sep 20, 2018 at 04:00:27PM -0400, Cleber Rosa wrote: > >> On 9/20/18 2:58 PM, Eduardo Habkost wrote: > >>> On Thu, Sep 20, 2018 at 11:19:56AM -0400, Cleber Rosa wrote: >

[Qemu-devel] [Bug 1793608] [NEW] qemu doesn't seem to support lxvwsx for POWER9 target

2018-09-20 Thread Sergey Evlashev
Public bug reported: When running a simple program built for POWER9 on QEMU 3.0.0 in linux- user mode, it crashes with a message: "illegal instruction". It turns out that lxvwsx instruction "Load Word and Splat Indexed" is not supported. If workaround is implemented by issuing two separate instruc

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-20 Thread Philippe Mathieu-Daudé
On 9/20/18 10:14 PM, Eduardo Habkost wrote: > On Thu, Sep 20, 2018 at 04:00:27PM -0400, Cleber Rosa wrote: >> On 9/20/18 2:58 PM, Eduardo Habkost wrote: >>> On Thu, Sep 20, 2018 at 11:19:56AM -0400, Cleber Rosa wrote: The acceptance (aka functional, aka Avocado-based) tests are Python fil

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-20 Thread Cleber Rosa
On 9/20/18 4:14 PM, Eduardo Habkost wrote: > On Thu, Sep 20, 2018 at 04:00:27PM -0400, Cleber Rosa wrote: >> >> >> On 9/20/18 2:58 PM, Eduardo Habkost wrote: >>> On Thu, Sep 20, 2018 at 11:19:56AM -0400, Cleber Rosa wrote: The acceptance (aka functional, aka Avocado-based) tests are Py

Re: [Qemu-devel] [RFC v2 8/8] virtio: guest driver reload for vhost-net

2018-09-20 Thread Maxime Coquelin
Hi Wei, Jason, On 06/19/2018 09:53 AM, Wei Xu wrote: On Wed, Jun 06, 2018 at 11:48:19AM +0800, Jason Wang wrote: On 2018年06月06日 03:08, w...@redhat.com wrote: From: Wei Xu last_avail, avail_wrap_count, used_idx and used_wrap_count are needed to support vhost-net backend, all these are eithe

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-20 Thread Eduardo Habkost
On Thu, Sep 20, 2018 at 04:00:27PM -0400, Cleber Rosa wrote: > > > On 9/20/18 2:58 PM, Eduardo Habkost wrote: > > On Thu, Sep 20, 2018 at 11:19:56AM -0400, Cleber Rosa wrote: > >> The acceptance (aka functional, aka Avocado-based) tests are > >> Python files located in "tests/acceptance" that nee

Re: [Qemu-devel] [PATCH 00/35] exec: drop BQL from interrupt handling

2018-09-20 Thread Mark Cave-Ayland
On 17/09/2018 17:30, Emilio G. Cota wrote: > This series comes originally from a series of patches that Paolo > sent to me a long time ago. I have kept most of his S-o-b tags, > but I have done the forward port of the patches to the current > QEMU code base, so please blame all possible bugs on me

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-20 Thread Cleber Rosa
On 9/20/18 2:58 PM, Eduardo Habkost wrote: > On Thu, Sep 20, 2018 at 11:19:56AM -0400, Cleber Rosa wrote: >> The acceptance (aka functional, aka Avocado-based) tests are >> Python files located in "tests/acceptance" that need to be run >> with the Avocado libs and test runner. >> >> Let's provid

Re: [Qemu-devel] [PATCH v2 5/6] qapi: add block-dirty-bitmap-merge

2018-09-20 Thread Eric Blake
[reviving an old patch] On 1/16/18 6:54 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 38 ++ include/block/dirty-bitmap.h | 2 ++ block/dirty-bitmap.c | 18 +

Re: [Qemu-devel] [PATCH] sm501: Adjust endianness of pixel value in rectangle fill

2018-09-20 Thread BALATON Zoltan
On Wed, 19 Sep 2018, Marcus Comstedt wrote: BALATON Zoltan writes: Thanks for testing on big endian host and fixing this bug. Have you also tried KVM? That would be interesting but I think it may have problems currently and maybe only PR KVM would work as it need to emulate PPC440 on server CPU

Re: [Qemu-devel] Wanted: reviewers for english style and grammar

2018-09-20 Thread Eduardo Habkost
On Thu, Sep 20, 2018 at 01:57:34PM -0500, Eric Blake wrote: > On 9/20/18 1:45 PM, Eduardo Habkost wrote: > > When reviewing some patches that touch documentation or error > > messages, I often think we could improve readability, but I don't > > trust my english skills completely when suggesting imp

Re: [Qemu-devel] [PATCH v2 0/2] qemu-error: advanced report_once handling

2018-09-20 Thread Markus Armbruster
Cornelia Huck writes: > [Markus: I've decided to not include your R-b, as I did too many changes > to feel comfortable with that.] > > [Also note that I'm about to disappear on vacation, so don't expect > quick responses. I just want to get it out before I forget about it.] > > Based on previous

Re: [Qemu-devel] [PATCH] Drop the "qemu:" prefix from error_report()

2018-09-20 Thread Markus Armbruster
Eduardo Habkost writes: > On Thu, Sep 20, 2018 at 07:08:32AM -0400, Mao Zhongyi wrote: >> error_report and friends already add a "qemu-system-xxx" prefix >> to the string, so a "qemu:" prefix is redundant in the string. >> Just drop it. >> >> Reported-by: Thomas Huth >> Signed-off-by: Mao Zhong

Re: [Qemu-devel] [PATCH v2 2/2] qemu-error: make use of {error, warn}_report_once_cond

2018-09-20 Thread Markus Armbruster
Cornelia Huck writes: > On Fri, 31 Aug 2018 08:01:39 +0200 > Markus Armbruster wrote: > >> Cornelia Huck writes: >> >> > {error,warn}_report_once() are a special case of the new functions >> > and can simply switch to them. >> > >> > Signed-off-by: Cornelia Huck >> > --- >> > include/qemu/er

Re: [Qemu-devel] [PATCH v5 0/8] target/mips: Support R5900 GCC programs in user mode

2018-09-20 Thread Aleksandar Markovic
> From: Fredrik Noring > Sent: Wednesday, September 19, 2018 7:48 PM Fredrik, first of all, many thanks for your efforts. There is a visible progress in the way you create, organize, and present the changes you devised. However, I will be mainly expressing criticism in this mail, but this shoul

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-20 Thread Eduardo Habkost
On Thu, Sep 20, 2018 at 11:19:56AM -0400, Cleber Rosa wrote: > The acceptance (aka functional, aka Avocado-based) tests are > Python files located in "tests/acceptance" that need to be run > with the Avocado libs and test runner. > > Let's provide a convenient way for QEMU developers to run them,

Re: [Qemu-devel] Wanted: reviewers for english style and grammar

2018-09-20 Thread Eric Blake
On 9/20/18 1:45 PM, Eduardo Habkost wrote: When reviewing some patches that touch documentation or error messages, I often think we could improve readability, but I don't trust my english skills completely when suggesting improvements. I wonder if we could find a group of people that would volun

[Qemu-devel] Wanted: reviewers for english style and grammar

2018-09-20 Thread Eduardo Habkost
When reviewing some patches that touch documentation or error messages, I often think we could improve readability, but I don't trust my english skills completely when suggesting improvements. I wonder if we could find a group of people that would volunteer to be listed on MAINTAINERS as willing t

Re: [Qemu-devel] [PATCH] Deprecate QMP `cpu-add`

2018-09-20 Thread Eduardo Habkost
On Thu, Sep 20, 2018 at 02:27:02PM +0200, Markus Armbruster wrote: > Kashyap Chamarthy writes: [...] > > --- > > qapi/misc.json | 6 +- > > qemu-deprecated.texi | 5 + > > 2 files changed, 10 insertions(+), 1 deletion(-) > > > > diff --git a/qapi/misc.json b/qapi/misc.json > > index

Re: [Qemu-devel] [PATCH v2 3/4] net/slirp: Deprecate the [hub_id name] parameter tuple

2018-09-20 Thread Markus Armbruster
Thomas Huth writes: > The "name" in the [hub_id name] parameter tuple is the same as a > "netdev_id" (which should be unique), so specifying the hub_id here > is just redundant (it was likely just necessary in the past when > the network subsystem was still using "vlans" only and when it did > no

Re: [Qemu-devel] [PATCH v2 2/4] net: Deprecate the "name" parameter of -net

2018-09-20 Thread Markus Armbruster
Thomas Huth writes: > In early times, network backends were specified by a "vlan" and "name" > tuple. With the introduction of netdevs, the "name" was replaced by an > "id" (which is supposed to be unique), but the "name" parameter stayed > as an alias which could be used instead of "id". Unfort

Re: [Qemu-devel] [PATCH v2 1/4] Makefile: Add missing dependency for qemu-deprecated.texi

2018-09-20 Thread Markus Armbruster
Thomas Huth writes: > Make sure that the docs get correctly regenerated when the > file qemu-deprecated.texi has been changed. > > Fixes: 44c67847e32c91a6071fb0440c357b9489f08bc6 > Signed-off-by: Thomas Huth > --- > Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [Qemu-devel] [PATCH v2 4/4] hw/core/machine: Officially deprecate the enforce-config-section parameter

2018-09-20 Thread Markus Armbruster
Thomas Huth writes: > Commit 16f7244842b5135543ef068a1adafd94c6965953 added this parameter > to the documentation, including a note that it is deprecated. But it > has never been added to the "Deprecated features" appendix, which is > our official way to deprecate legacy parameters. So let's do t

Re: [Qemu-devel] [PATCH] qdev: fix a typo in comment

2018-09-20 Thread Markus Armbruster
Could be merged via qemu-trivial (cc'ed). Li Qiang writes: > Found by reading code. > > Signed-off-by: Li Qiang > --- > hw/core/qdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/core/qdev.c b/hw/core/qdev.c > index 529b82de18..7e4bfcb8f7 100644 > --- a/hw/core/

Re: [Qemu-devel] [PATCH] Drop the "qemu:" prefix from error_report()

2018-09-20 Thread Peter Maydell
On 20 September 2018 at 10:34, Eduardo Habkost wrote: > On Thu, Sep 20, 2018 at 07:08:32AM -0400, Mao Zhongyi wrote: >> error_report and friends already add a "qemu-system-xxx" prefix >> to the string, so a "qemu:" prefix is redundant in the string. >> Just drop it. >> >> Reported-by: Thomas Huth

Re: [Qemu-devel] [PATCH] Drop the "qemu:" prefix from error_report()

2018-09-20 Thread Eduardo Habkost
On Thu, Sep 20, 2018 at 07:08:32AM -0400, Mao Zhongyi wrote: > error_report and friends already add a "qemu-system-xxx" prefix > to the string, so a "qemu:" prefix is redundant in the string. > Just drop it. > > Reported-by: Thomas Huth > Signed-off-by: Mao Zhongyi Reviewed-by: Eduardo Habkost

Re: [Qemu-devel] [PATCH v4 2/3] kvm: Add support to KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS system ioctl

2018-09-20 Thread Eduardo Habkost
On Thu, Sep 20, 2018 at 03:45:42PM +0800, Robert Hoo wrote: [...] > > > diff --git a/target/i386/cpu.c b/target/i386/cpu.c > > > index a252c26..0160e97 100644 > > > --- a/target/i386/cpu.c > > > +++ b/target/i386/cpu.c > > > @@ -3670,7 +3670,7 @@ static uint32_t > > > x86_cpu_get_supported_feature_

Re: [Qemu-devel] [PATCH v4 3/3] x86: define a new MSR based feature word -- FEATURE_WORDS_ARCH_CAPABILITIES

2018-09-20 Thread Eduardo Habkost
On Thu, Sep 20, 2018 at 05:55:48PM +0800, Robert Hoo wrote: > On Thu, 2018-09-20 at 00:13 -0300, Eduardo Habkost wrote: > > On Sun, Sep 02, 2018 at 07:46:07PM +0800, Robert Hoo wrote: > > > Note RSBA is specially treated -- no matter host support it or not, > > > qemu > > > pretends it is supported

[Qemu-devel] [PATCH] Add "boot_linux" acceptance test

2018-09-20 Thread Cleber Rosa
This acceptance test, validates that a full blown Linux guest can successfully boot in QEMU. In this specific case, the guest chosen is Fedora version 28. By passing parameters, the same test can attempt to boot different distros, arches, etc. The method for checking the successfull boot is base

[Qemu-devel] [PATCH v3 16/19] test-bdrv-drain: AIO_WAIT_WHILE() in job .commit/.abort

2018-09-20 Thread Kevin Wolf
This adds tests for calling AIO_WAIT_WHILE() in the .commit and .abort callbacks. Both reasons why .abort could be called for a single job are tested: Either .run or .prepare could return an error. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/test-bdrv-drain.c | 116 ++

Re: [Qemu-devel] [PATCH] RFC: mark non-volatile memory region

2018-09-20 Thread Michael S. Tsirkin
On Thu, Sep 20, 2018 at 07:17:30PM +0400, Marc-André Lureau wrote: > This is RFC patch to show how NVDIMM could set a flag on the > MemoryRegion that would be propagated down to the flat view. > > This way, guest_phys_blocks_region_add() can skip the NV memory > regions for dumps and TCG memory cl

[Qemu-devel] [PATCH v3 19/19] test-bdrv-drain: Test draining job source child and parent

2018-09-20 Thread Kevin Wolf
For the block job drain test, don't only test draining the source and the target node, but create a backing chain for the source (source_backing <- source <- source_overlay) and test draining each of the nodes in it. When using iothreads, the source node (and therefore the job) is in a different A

Re: [Qemu-devel] [PATCH v3 11/19] block-backend: Decrease in_flight only after callback

2018-09-20 Thread Paolo Bonzini
On 20/09/2018 18:19, Kevin Wolf wrote: > Request callbacks can do pretty much anything, including operations that > will yield from the coroutine (such as draining the backend). In that > case, a decreased in_flight would be visible to other code and could > lead to a drain completing while the cal

[Qemu-devel] [PATCH v3 10/19] block-backend: Fix potential double blk_delete()

2018-09-20 Thread Kevin Wolf
blk_unref() first decreases the refcount of the BlockBackend and calls blk_delete() if the refcount reaches zero. Requests can still be in flight at this point, they are only drained during blk_delete(): At this point, arbitrary callbacks can run. If any callback takes a temporary BlockBackend ref

[Qemu-devel] [PATCH v3 18/19] block: Use a single global AioWait

2018-09-20 Thread Kevin Wolf
When draining a block node, we recurse to its parent and for subtree drains also to its children. A single AIO_WAIT_WHILE() is then used to wait for bdrv_drain_poll() to become true, which depends on all of the nodes we recursed to. However, if the respective child or parent becomes quiescent and c

[Qemu-devel] [PATCH v3 15/19] job: Avoid deadlocks in job_completed_txn_abort()

2018-09-20 Thread Kevin Wolf
Amongst others, job_finalize_single() calls the .prepare/.commit/.abort callbacks of the individual job driver. Recently, their use was adapted for all block jobs so that they involve code calling AIO_WAIT_WHILE() now. Such code must be called under the AioContext lock for the respective job, but w

[Qemu-devel] [PATCH v3 07/19] test-bdrv-drain: Test AIO_WAIT_WHILE() in completion callback

2018-09-20 Thread Kevin Wolf
This is a regression test for a deadlock that occurred in block job completion callbacks (via job_defer_to_main_loop) because the AioContext lock was taken twice: once in job_finish_sync() and then again in job_defer_to_main_loop_bh(). This would cause AIO_WAIT_WHILE() to hang. Signed-off-by: Kevi

[Qemu-devel] [PATCH v3 12/19] blockjob: Lie better in child_job_drained_poll()

2018-09-20 Thread Kevin Wolf
Block jobs claim in .drained_poll() that they are in a quiescent state as soon as job->deferred_to_main_loop is true. This is obviously wrong, they still have a completion BH to run. We only get away with this because commit 91af091f923 added an unconditional aio_poll(false) to the drain functions,

[Qemu-devel] [PATCH v3 17/19] test-bdrv-drain: Fix outdated comments

2018-09-20 Thread Kevin Wolf
Commit 89bd030533e changed the test case from using job_sleep_ns() to using qemu_co_sleep_ns() instead. Also, block_job_sleep_ns() became job_sleep_ns() in commit 5d43e86e11f. In both cases, some comments in the test case were not updated. Do that now. Reported-by: Max Reitz Signed-off-by: Kevin

[Qemu-devel] [PATCH v3 13/19] block: Remove aio_poll() in bdrv_drain_poll variants

2018-09-20 Thread Kevin Wolf
bdrv_drain_poll_top_level() was buggy because it didn't release the AioContext lock of the node to be drained before calling aio_poll(). This way, callbacks called by aio_poll() would possibly take the lock a second time and run into a deadlock with a nested AIO_WAIT_WHILE() call. However, it turn

[Qemu-devel] [PATCH v3 06/19] job: Use AIO_WAIT_WHILE() in job_finish_sync()

2018-09-20 Thread Kevin Wolf
job_finish_sync() needs to release the AioContext lock of the job before calling aio_poll(). Otherwise, callbacks called by aio_poll() would possibly take the lock a second time and run into a deadlock with a nested AIO_WAIT_WHILE() call. Also, job_drain() without aio_poll() isn't necessarily enou

[Qemu-devel] [PATCH v3 09/19] block-backend: Add .drained_poll callback

2018-09-20 Thread Kevin Wolf
A bdrv_drain operation must ensure that all parents are quiesced, this includes BlockBackends. Otherwise, callbacks called by requests that are completed on the BDS layer, but not quite yet on the BlockBackend layer could still create new requests. Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng

[Qemu-devel] [PATCH v3 14/19] test-bdrv-drain: Test nested poll in bdrv_drain_poll_top_level()

2018-09-20 Thread Kevin Wolf
This is a regression test for a deadlock that could occur in callbacks called from the aio_poll() in bdrv_drain_poll_top_level(). The AioContext lock wasn't released and therefore would be taken a second time in the callback. This would cause a possible AIO_WAIT_WHILE() in the callback to hang. Si

[Qemu-devel] [PATCH v3 04/19] test-bdrv-drain: Drain with block jobs in an I/O thread

2018-09-20 Thread Kevin Wolf
This extends the existing drain test with a block job to include variants where the block job runs in a different AioContext. Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng --- tests/test-bdrv-drain.c | 92 + 1 file changed, 86 insertions(+), 6

[Qemu-devel] [PATCH v3 11/19] block-backend: Decrease in_flight only after callback

2018-09-20 Thread Kevin Wolf
Request callbacks can do pretty much anything, including operations that will yield from the coroutine (such as draining the backend). In that case, a decreased in_flight would be visible to other code and could lead to a drain completing while the callback hasn't actually completed yet. Signed-of

[Qemu-devel] [PATCH v3 08/19] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-20 Thread Kevin Wolf
bdrv_do_drained_begin/end() assume that they are called with the AioContext lock of bs held. If we call drain functions from a coroutine with the AioContext lock held, we yield and schedule a BH to move out of coroutine context. This means that the lock for the home context of the coroutine is rele

[Qemu-devel] [PATCH v3 03/19] aio-wait: Increase num_waiters even in home thread

2018-09-20 Thread Kevin Wolf
Even if AIO_WAIT_WHILE() is called in the home context of the AioContext, we still want to allow the condition to change depending on other threads as long as they kick the AioWait. Specfically block jobs can be running in an I/O thread and should then be able to kick a drain in the main loop conte

[Qemu-devel] [PATCH v3 00/19] Fix some jobs/drain/aio_poll related hangs

2018-09-20 Thread Kevin Wolf
Especially the combination of iothreads, block jobs and drain tends to lead to hangs currently. This series fixes a few of these bugs, although there are more of them, to be addressed in separate patches. The primary goal of this series is to fix the scenario from: https://bugzilla.redhat.com/show

[Qemu-devel] [PATCH v3 02/19] blockjob: Wake up BDS when job becomes idle

2018-09-20 Thread Kevin Wolf
In the context of draining a BDS, the .drained_poll callback of block jobs is called. If this returns true (i.e. there is still some activity pending), the drain operation may call aio_poll() with blocking=true to wait for completion. As soon as the pending activity is completed and the job finall

[Qemu-devel] [PATCH v3 05/19] test-blockjob: Acquire AioContext around job_cancel_sync()

2018-09-20 Thread Kevin Wolf
All callers in QEMU proper hold the AioContext lock when calling job_finish_sync(). test-blockjob should do the same when it calls the function indirectly through job_cancel_sync(). Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng --- include/qemu/job.h| 6 ++ tests/test-blockjob.c | 6

[Qemu-devel] [PATCH v3 01/19] job: Fix missing locking due to mismerge

2018-09-20 Thread Kevin Wolf
job_completed() had a problem with double locking that was recently fixed independently by two different commits: "job: Fix nested aio_poll() hanging in job_txn_apply" "jobs: add exit shim" One fix removed the first aio_context_acquire(), the other fix removed the other one. Now we have a bug aga

Re: [Qemu-devel] [PULL 6/7] monitor: move init global earlier

2018-09-20 Thread Markus Armbruster
Wolfgang Bumiller writes: > On Thu, Sep 20, 2018 at 04:10:00PM +0800, Peter Xu wrote: >> On Thu, Sep 20, 2018 at 10:02:22AM +0200, Wolfgang Bumiller wrote: >> >> > Either way, spawning the iothread on demand can still make sense, as >> > does updating the check in resume()/suspend(). >> >> Yep.

Re: [Qemu-devel] [PULL 6/7] monitor: move init global earlier

2018-09-20 Thread Markus Armbruster
Wolfgang Bumiller writes: > On Thu, Sep 20, 2018 at 04:10:00PM +0800, Peter Xu wrote: >> On Thu, Sep 20, 2018 at 10:02:22AM +0200, Wolfgang Bumiller wrote: >> > On Thu, Sep 20, 2018 at 10:59:56AM +0800, Peter Xu wrote: >> > > On Wed, Sep 19, 2018 at 04:58:06PM +0200, Wolfgang Bumiller wrote: >> >

[Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-20 Thread Cleber Rosa
The acceptance (aka functional, aka Avocado-based) tests are Python files located in "tests/acceptance" that need to be run with the Avocado libs and test runner. Let's provide a convenient way for QEMU developers to run them, by making use of the tests-venv with the required setup. Also, while t

[Qemu-devel] [PATCH 1/2] Bootstrap Python venv for tests

2018-09-20 Thread Cleber Rosa
A number of QEMU tests are written in Python, and may benefit from an untainted Python venv. By using make rules, tests that depend on specific Python libs can set that rule as a requiment, along with rules that require the presence or installation of specific libraries. The tests/venv-requiremen

[Qemu-devel] [PATCH] Bootstrap Python venv and acceptance/functional tests

2018-09-20 Thread Cleber Rosa
TL;DR = Allow acceptance tests to be run with `make check-acceptance`. Details === This introduces a Python virtual environment that will be setup within the QEMU build directory, that will contain the exact environment that tests may require. There's one current caveat: it requires Pyt

[Qemu-devel] [PATCH] RFC: mark non-volatile memory region

2018-09-20 Thread Marc-André Lureau
This is RFC patch to show how NVDIMM could set a flag on the MemoryRegion that would be propagated down to the flat view. This way, guest_phys_blocks_region_add() can skip the NV memory regions for dumps and TCG memory clear. qemu-system-x86_64 -machine pc,nvdimm -m 2G,slots=4,maxmem=16G -enable-

[Qemu-devel] 64-bit MMIO aperture expansion

2018-09-20 Thread Laszlo Ersek
Hi Marcel, this email should actually be an RFC patch. But RFC patches tend to turn into real PATCHes (if the submitter is lucky, that is), and I can't really promise sending multiple versions of a PATCH at this time. So please consider this a "maybe bug report". In commit 9fa99d2519cb ("hw/pci-h

Re: [Qemu-devel] [PATCH v10 6/6] tpm: add ACPI memory clear interface

2018-09-20 Thread Dr. David Alan Gilbert
* Igor Mammedov (imamm...@redhat.com) wrote: > On Thu, 20 Sep 2018 10:20:49 +0100 > "Dr. David Alan Gilbert" wrote: > > > * Eduardo Habkost (ehabk...@redhat.com) wrote: > > > On Wed, Sep 19, 2018 at 08:15:25PM +0100, Dr. David Alan Gilbert wrote: > > > > * Igor Mammedov (imamm...@redhat.com) wr

[Qemu-devel] [Bug 1793539] [NEW] qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6003ddc5

2018-09-20 Thread Andreas Schwab
Public bug reported: During the build of gedit for RISC-V this error occurs: $ qemu-riscv64 -E LD_LIBRARY_PATH=gedit/.libs ./gedit/.libs/gedit qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6003ddc5 qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x69e4 h

Re: [Qemu-devel] [RFC v2 2/8] virtio: memory cache for packed ring

2018-09-20 Thread Maxime Coquelin
On 06/05/2018 09:07 PM, w...@redhat.com wrote: From: Wei Xu Mostly reuse memory cache with 1.0 except for the offset calculation. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 29 - 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/hw/virtio/vir

Re: [Qemu-devel] [PATCH v2 2/2] qemu-error: make use of {error, warn}_report_once_cond

2018-09-20 Thread Cornelia Huck
On Fri, 31 Aug 2018 08:01:39 +0200 Markus Armbruster wrote: > Cornelia Huck writes: > > > {error,warn}_report_once() are a special case of the new functions > > and can simply switch to them. > > > > Signed-off-by: Cornelia Huck > > --- > > include/qemu/error-report.h | 34 ++-

Re: [Qemu-devel] Freeze / spin in virtio blk...flatview do translate

2018-09-20 Thread Frank Yang via Qemu-devel
(Not reproducible locally) On Thu, Sep 20, 2018 at 7:16 AM Frank Yang wrote: > I have added more logging code and it seems that there is a hang that > happens with 4096 MB RAM on Mac in virtio_blk_handle_vq: > > #define VIRTIO_BLK_UNUSUAL_ITER_COUNT 1024 > > bool virtio_blk_handle_vq(VirtIOBlock

Re: [Qemu-devel] Freeze / spin in virtio blk...flatview do translate

2018-09-20 Thread Frank Yang via Qemu-devel
I have added more logging code and it seems that there is a hang that happens with 4096 MB RAM on Mac in virtio_blk_handle_vq: #define VIRTIO_BLK_UNUSUAL_ITER_COUNT 1024 bool virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq) { VirtIOBlockReq *req; MultiReqBuffer mrb = {}; bool progr

  1   2   >