[PATCH] memory: Fix incorrect calls of log_global_start/stop

2021-11-30 Thread Peter Xu
We should only call the log_global_start/stop when the global dirty track bitmask changes from zero<->non-zero. No real issue reported for this yet probably because no immediate user to enable both dirty rate measurement and migration at the same time. However it'll be good to be prepared for it.

Re: [PULL 0/1] ppc queue

2021-11-30 Thread Richard Henderson
On 11/29/21 9:53 PM, Cédric Le Goater wrote: The following changes since commit a0fd8a5492240379a07c0b39c8dae3b8341b458f: Merge tag 'pull-for-6.2-291121-1' of https://github.com/stsquad/qemu into staging (2021-11-29 18:58:06 +0100) are available in the Git repository at: https://github.

Re: [PATCH v11 11/26] target/loongarch: Add floating point comparison instruction translation

2021-11-30 Thread gaosong
Hi Richard, On 2021/11/20 下午5:02, Richard Henderson wrote: +#define FCMP_LT 0x0001  /* fp0 < fp1 */ +#define FCMP_EQ   0x0010  /* fp0 = fp1 */ +#define FCMP_UN   0x0100  /* unordered */ +#define FCMP_GT   0x1000  /* fp0 > fp1 */ Any reason why these bits are not sequential? I think this is

Odd square bracket encoding in QOM names

2021-11-30 Thread Mark Cave-Ayland
Hi all, Has there been a recent change as to how square brackets are encoded within QOM names? I noticed that the output has changed here in the "info qom-tree" output in qemu-system-m68k for the q800 machine. The q800 machine has a set of 256 memory region aliases that used to appear in the

Re: [PATCH v11 11/26] target/loongarch: Add floating point comparison instruction translation

2021-11-30 Thread Richard Henderson
On 11/30/21 9:22 AM, gaosong wrote: On 2021/11/20 下午5:02, Richard Henderson wrote: +#define FCMP_LT 0x0001  /* fp0 < fp1 */ +#define FCMP_EQ   0x0010  /* fp0 = fp1 */ +#define FCMP_UN   0x0100  /* unordered */ +#define FCMP_GT   0x1000  /* fp0 > fp1 */ Any reason why these bits are not seque

Re: [PATCH for-7.0 0/4] qemu-common.h include cleanup

2021-11-30 Thread Richard Henderson
On 11/29/21 9:05 PM, Peter Maydell wrote: qemu-common.h has a comment at the top: * This file is supposed to be included only by .c files. No header file should * depend on qemu-common.h, as this would easily lead to circular header * dependencies. We still have a few .h files which inclu

Re: [PATCH v5 00/31] block layer: split block APIs in global state and I/O

2021-11-30 Thread Emanuele Giuseppe Esposito
On 29/11/2021 14:32, Stefan Hajnoczi wrote: On Wed, Nov 24, 2021 at 01:43:47AM -0500, Emanuele Giuseppe Esposito wrote: v5 -> v6: * In short, apply all Hanna's comments. More in details, the following functions in the following headers have been moved: block-backend: blk_replace_bs

Re: [PATCH v4] target/ppc: fix Hash64 MMU update of PTE bit R

2021-11-30 Thread Cédric Le Goater
On 11/30/21 01:30, David Gibson wrote: On Mon, Nov 29, 2021 at 03:57:51PM -0300, Leandro Lupori wrote: When updating the R bit of a PTE, the Hash64 MMU was using a wrong byte offset, causing the first byte of the adjacent PTE to be corrupted. This caused a panic when booting FreeBSD, using the H

Re: [PATCH v11 11/26] target/loongarch: Add floating point comparison instruction translation

2021-11-30 Thread gaosong
Hi Richard. On 2021/11/30 下午4:37, Richard Henderson wrote: I think you should simply replace "0x" with "0b" so that the bits of FCMP are more compact.  I assume that's what you were originally thinking. Ooh,  suddenly become clear-minded. Thanks Song Gao

[Bug 1749393] Re: sbrk() not working under qemu-user with a PIE-compiled binary?

2021-11-30 Thread Christian Ehrhardt 
Hi, sorry this has fallen through the cracks, but bug 1928075 made me re-discover it and it is time finally to complete that. ** Tags added: server-next ** Description changed: [Impact] - * The current space reserved can be too small and we can end up -with no space at all for BRK. It

Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base

2021-11-30 Thread Claudio Fontana
On 11/29/21 9:29 PM, David Woodhouse wrote: > On Mon, 2021-11-29 at 20:55 +0100, Claudio Fontana wrote: >> On 11/29/21 8:19 PM, David Woodhouse wrote: >>> On Mon, 2021-11-29 at 20:10 +0100, Claudio Fontana wrote: Hmm I thought what you actually care for, for cpu "host", is just the

[Bug 1749393] Re: sbrk() not working under qemu-user with a PIE-compiled binary?

2021-11-30 Thread Christian Ehrhardt 
SRU template updated, PPA rebuilt, Merge requests updated. Also bundled another bug fix. Waiting for MR review now. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1749393 Title: sbrk() not working

[PATCH v1 0/3] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-11-30 Thread David Hildenbrand
Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE in QEMU, which indicates to a guest that we don't support reading unplugged memory. We indicate the feature based on a new "unplugged-inaccessible" property available for x86 targets only (the only ones with legacy guests). Guests that don't support VIRTI

[PATCH v1 1/3] linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-11-30 Thread David Hildenbrand
TODO: replace by a proper header sync. Signed-off-by: David Hildenbrand --- include/standard-headers/linux/virtio_mem.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/standard-headers/linux/virtio_mem.h b/include/standard-headers/linux/virtio_mem.h index 05

[PATCH v1 2/3] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-11-30 Thread David Hildenbrand
With VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, we signal the VM that reading unplugged memory is not supported. We have to fail feature negotiation in case the guest does not support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE. First, VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE is required to properly handle memory ba

[Bug 1749393] Re: sbrk() not working under qemu-user with a PIE-compiled binary?

2021-11-30 Thread Christian Ehrhardt 
** Changed in: qemu (Ubuntu Focal) Status: Triaged => In Progress ** Changed in: qemu (Ubuntu Focal) Assignee: (unassigned) => Christian Ehrhardt  (paelzer) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.la

[PATCH v1 3/3] virtio-mem: Set "unplugged-inaccessible=auto" for the 6.2 machine on x86

2021-11-30 Thread David Hildenbrand
Set the new default to "auto", keeping it set to "on" for compat machines. This property is only available for x86 targets. TODO: once 6.2 was released and we have compat machines, target the next QEMU release. Signed-off-by: David Hildenbrand --- hw/i386/pc.c | 1 + hw/virtio/v

Re: [PATCH 1/1] hw/arm/virt: Support for virtio-mem-pci

2021-11-30 Thread David Hildenbrand
On 30.11.21 01:33, Gavin Shan wrote: > This supports virtio-mem-pci device on "virt" platform, by simply > following the implementation on x86. Thanks for picking this up! > >* The patch was written by David Hildenbrand > modified by Jonathan Cameron Maybe replace this section by Co

Re: Odd square bracket encoding in QOM names

2021-11-30 Thread Michal Prívozník
On 11/30/21 09:35, Mark Cave-Ayland wrote: > Hi all, > > Has there been a recent change as to how square brackets are encoded > within QOM names? I noticed that the output has changed here in the > "info qom-tree" output in qemu-system-m68k for the q800 machine. > > The q800 machine has a set of

[PATCH v2 0/4] block: minor refactoring in preparation to the block layer API split

2021-11-30 Thread Emanuele Giuseppe Esposito
These patches are taken from my old patches and feedback of my series "block layer: split block APIs in global state and I/O". The reason for a separate series is that the original one is already too long, and these patches are just refactoring the code, mainly deleting or moving functions in bloc

[PATCH v2 3/4] include/sysemu/blockdev.h: move drive_add and inline drive_def

2021-11-30 Thread Emanuele Giuseppe Esposito
drive_add is only used in softmmu/vl.c, so it can be a static function there, and drive_def is only a particular use case of qemu_opts_parse_noisily, so it can be inlined. Also remove drive_mark_claimed_by_board, as it is only defined but not implemented (nor used) anywhere. Signed-off-by: Emanue

[PATCH v2 2/4] include/sysemu/blockdev.c: introduce block_if_name

2021-11-30 Thread Emanuele Giuseppe Esposito
Add a getter function for the if_name array, so that also outside functions can access it. Signed-off-by: Emanuele Giuseppe Esposito --- blockdev.c| 5 + include/sysemu/blockdev.h | 1 + 2 files changed, 6 insertions(+) diff --git a/blockdev.c b/blockdev.c index b35072644e..

[PATCH v2 4/4] include/sysemu/blockdev.h: remove drive_get_max_devs

2021-11-30 Thread Emanuele Giuseppe Esposito
Remove drive_get_max_devs, as it is not used by anyone. Last use was removed in commit 8f2d75e81d5 ("hw: Drop superfluous special checks for orphaned -drive"). Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Philippe Mathieu-Daudé --- blockdev.c| 17 - in

[PATCH v2 1/4] block_int: make bdrv_backing_overridden static

2021-11-30 Thread Emanuele Giuseppe Esposito
bdrv_backing_overridden is only used in block.c, so there is no need to leave it in block_int.h Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 4 +++- include/block/block_int.h | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c in

Re: [PATCH for-7.0 0/4] qemu-common.h include cleanup

2021-11-30 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 29 Nov 2021 at 20:05, Peter Maydell wrote: >> >> qemu-common.h has a comment at the top: >> >> * This file is supposed to be included only by .c files. No header file >> should >> * depend on qemu-common.h, as this would easily lead to circular header >> * dep

[Bug 1749393] Re: sbrk() not working under qemu-user with a PIE-compiled binary?

2021-11-30 Thread Christian Ehrhardt 
Uploaded to F-unapproved, waiting for the SRU team to accept it. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1749393 Title: sbrk() not working under qemu-user with a PIE-compiled binary? Status

[PATCH v7 3/3] cpus-common: implement dirty page limit on vCPU

2021-11-30 Thread huangy81
From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirty page rate given by user. Introduce qmp commands set-dirty-limit/cancel-dirty-limit to set/cancel dirty page limit on vCPU. Signed-off-by: Hyman Huang(黄勇) --

[PATCH 1/3] target/m68k: Implement TRAPV

2021-11-30 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/m68k/translate.c | 17 + 1 file changed, 17 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index af43c8eab8..858ba761fc 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -4863,6 +4863,22

[PATCH for-7.0 0/3] target/m68k: Implement conditional traps

2021-11-30 Thread Richard Henderson
While looking at #754 for trapcc, I noticed that the other conditional traps, trapv and ftrapcc, are also missing. r~ Richard Henderson (3): target/m68k: Implement TRAPV target/m68k: Implement TRAPcc target/m68k: Implement FTRAPcc target/m68k/cpu.h | 2 ++ target/m68k/cpu.c

[PATCH 3/3] target/m68k: Implement FTRAPcc

2021-11-30 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/m68k/translate.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index cf29f35d91..3c04f9d1a9 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.

[PATCH v7 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-30 Thread huangy81
From: Hyman Huang(黄勇) Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly for dirty restraint. Implement thread for calculate dirtyrate periodly, which will be used for dirty restraint. Add dirtylimit.h to introduce the util function for dirty limit

[PATCH v7 2/3] cpu-throttle: implement vCPU throttle

2021-11-30 Thread huangy81
From: Hyman Huang(黄勇) Impose dirty restraint on vCPU by kicking it and sleep as the auto-converge does during migration, but just kick the specified vCPU instead, not all vCPUs of vm. Start a thread to track the dirtylimit status and adjust the throttle pencentage dynamically depend on current a

[PATCH 2/3] target/m68k: Implement TRAPcc

2021-11-30 Thread Richard Henderson
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/754 Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 ++ target/m68k/cpu.c | 1 + target/m68k/translate.c | 21 + 3 files changed, 24 insertions(+) diff --git a/target/m68k/cpu.h b/target/m68k/cpu

[PATCH v1 1/8] util/oslib-posix: Let touch_all_pages() return an error

2021-11-30 Thread David Hildenbrand
Let's prepare touch_all_pages() for returning differing errors. Return an error from the thread and report the last processed error. Translate SIGBUS to -EFAULT, as a SIGBUS can mean all different kind of things (memory error, read error, out of memory). When allocating memory fails via the curren

[PATCH v1 0/8] virtio-mem: Support "prealloc=on"

2021-11-30 Thread David Hildenbrand
Based-on: <20211130092838.24224-1-da...@redhat.com> Patch #1 - #7 are fully reviewed [1] but did not get picked up yet, so I'm sending them along here, as they are required to use os_mem_prealloc() in a safe way once the VM is running. Support preallocation of memory to make virtio-mem safe to us

[PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread huangy81
From: Hyman Huang(黄勇) The patch [2/3] has not been touched so far. Any corrections and suggetions are welcome. Please review, thanks! v7: - rebase on master - polish the comments and error message according to the advices given by Markus - introduce dirtylimit_enabled function to pre-check i

[PATCH v1 2/8] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()

2021-11-30 Thread David Hildenbrand
Let's sense support and use it for preallocation. MADV_POPULATE_WRITE does not require a SIGBUS handler, doesn't actually touch page content, and avoids context switches; it is, therefore, faster and easier to handle than our current approach. While MADV_POPULATE_WRITE is, in general, faster than

[PATCH v1 4/8] util/oslib-posix: Don't create too many threads with small memory or little pages

2021-11-30 Thread David Hildenbrand
Let's limit the number of threads to something sane, especially that - We don't have more threads than the number of pages we have - We don't have threads that initialize small (< 64 MiB) memory Reviewed-by: Pankaj Gupta Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrangé Signed

[PATCH v1 5/8] util/oslib-posix: Avoid creating a single thread with MADV_POPULATE_WRITE

2021-11-30 Thread David Hildenbrand
Let's simplify the case when we only want a single thread and don't have to mess with signal handlers. Reviewed-by: Pankaj Gupta Reviewed-by: Daniel P. Berrangé Signed-off-by: David Hildenbrand --- util/oslib-posix.c | 8 1 file changed, 8 insertions(+) diff --git a/util/oslib-posix.

[PATCH v1 3/8] util/oslib-posix: Introduce and use MemsetContext for touch_all_pages()

2021-11-30 Thread David Hildenbrand
Let's minimize the number of global variables to prepare for os_mem_prealloc() getting called concurrently and make the code a bit easier to read. The only consumer that really needs a global variable is the sigbus handler, which will require protection via a mutex in the future either way as we c

[PATCH v1 7/8] util/oslib-posix: Forward SIGBUS to MCE handler under Linux

2021-11-30 Thread David Hildenbrand
Temporarily modifying the SIGBUS handler is really nasty, as we might be unlucky and receive an MCE SIGBUS while having our handler registered. Unfortunately, there is no way around messing with SIGBUS when MADV_POPULATE_WRITE is not applicable or not around. Let's forward SIGBUS that don't belong

Re: [PATCH v3 16/23] multifd: Unfold "used" variable by its value

2021-11-30 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert > --- > migration/multifd.c | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/migration/multifd.c b/migration/multifd.c > index 65676d56fd..6983ba3e7c

[PATCH v1 6/8] util/oslib-posix: Support concurrent os_mem_prealloc() invocation

2021-11-30 Thread David Hildenbrand
Add a mutex to protect the SIGBUS case, as we cannot mess concurrently with the sigbus handler and we have to manage the global variable sigbus_memset_context. The MADV_POPULATE_WRITE path can run concurrently. Note that page_mutex and page_cond are shared between concurrent invocations, which sho

[PATCH v1 8/8] virtio-mem: Support "prealloc=on" option

2021-11-30 Thread David Hildenbrand
For scarce memory resources, such as hugetlb, we want to be able to prealloc such memory resources in order to not crash later on access. On simple user errors we could otherwise easily run out of memory resources an crash the VM -- pretty much undesired. For ordinary memory devices, such as DIMMs

Re: [PATCH v3 17/23] multifd: Use normal pages array on the send side

2021-11-30 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Signed-off-by: Juan Quintela Can you explain a bit more what's going on here? Dave > --- > migration/multifd.h | 8 ++-- > migration/multifd-zlib.c | 6 +++--- > migration/multifd-zstd.c | 6 +++--- > migration/multifd.c | 30

[PATCH] aio-posix: split poll check from ready handler

2021-11-30 Thread Stefan Hajnoczi
Adaptive polling measures the execution time of the polling check plus handlers called when a polled event becomes ready. Handlers can take a significant amount of time, making it look like polling was running for a long time when in fact the event handler was running for a long time. For example,

Re: [PATCH 3/3] target/m68k: Implement FTRAPcc

2021-11-30 Thread Richard Henderson
On 11/30/21 11:37 AM, Richard Henderson wrote: +INSN(ftrapcc, f278, ff80, FPU); Whoops, mask should be fff8. r~

Re: [PATCH 2/3] target/m68k: Implement TRAPcc

2021-11-30 Thread Laurent Vivier
Le 30/11/2021 à 11:37, Richard Henderson a écrit : Resolves: https://gitlab.com/qemu-project/qemu/-/issues/754 Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 ++ target/m68k/cpu.c | 1 + target/m68k/translate.c | 21 + 3 files changed, 24 insert

Re: [PATCH v3 17/23] multifd: Use normal pages array on the send side

2021-11-30 Thread Juan Quintela
"Dr. David Alan Gilbert" wrote: > * Juan Quintela (quint...@redhat.com) wrote: >> Signed-off-by: Juan Quintela > > Can you explain a bit more what's going on here? Sorry. Until patch 20, we have what we had always have: pages that are sent through multifd (non zero pages). We are going to cal

Re: [PATCH 1/3] target/m68k: Implement TRAPV

2021-11-30 Thread Laurent Vivier
Le 30/11/2021 à 11:37, Richard Henderson a écrit : Signed-off-by: Richard Henderson --- target/m68k/translate.c | 17 + 1 file changed, 17 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index af43c8eab8..858ba761fc 100644 --- a/target/m68k/transl

Re: [PATCH for-6.1 v2] i386: do not call cpudef-only models functions for max, host, base

2021-11-30 Thread David Woodhouse
On Tue, 2021-11-30 at 10:00 +0100, Claudio Fontana wrote: > I tend to agree that what we want if kvm_enable_x2apic fails is to abort QEMU > if we have been requesting smp > 255, > and if we did not request smp > 255 cpus, we want to not advertise the > feature. > > This is not accomplished, neit

Re: unable to execute QEMU command 'qom-get': Property 'sgx-epc.unavailable-features' not found

2021-11-30 Thread Yang Zhong
On Thu, Nov 25, 2021 at 08:47:22PM +0800, Yang Zhong wrote: > Hello Paolo, > > Our customer used the Libvirt XML to start a SGX VM, but failed. > > libvirt.libvirtError: internal error: unable to execute QEMU command > 'qom-get': Property 'sgx-epc.unavailable-features' not found > > The XML fil

Re: [PATCH 2/3] target/m68k: Implement TRAPcc

2021-11-30 Thread Richard Henderson
On 11/30/21 12:57 PM, Laurent Vivier wrote: +DISAS_INSN(trapcc) +{ +    /* Consume and discard the immediate operand. */ +    switch (extract32(insn, 0, 3)) { +    case 2: /* trapcc.w */ +    (void)read_im16(env, s); +    break; +    case 3: /* trapcc.l */ +    (void)read_im32(env, s)

Re: [PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread Peter Xu
On Tue, Nov 30, 2021 at 06:28:10PM +0800, huang...@chinatelecom.cn wrote: > From: Hyman Huang(黄勇) > > The patch [2/3] has not been touched so far. Any corrections and > suggetions are welcome. I played with it today, but the vcpu didn't got throttled as expected. What I did was starting two wo

Re: [PATCH v7 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-30 Thread Peter Xu
On Tue, Nov 30, 2021 at 06:28:11PM +0800, huang...@chinatelecom.cn wrote: > +static void dirtylimit_calc_func(void) > +{ > +CPUState *cpu; > +DirtyPageRecord *dirty_pages; > +int64_t start_time, end_time, calc_time; > +DirtyRateVcpu rate; > +int i = 0; > + > +dirty_pages = g

Re: Follow-up on the CXL discussion at OFTC

2021-11-30 Thread Jonathan Cameron via
On Mon, 29 Nov 2021 18:28:43 + Alex Bennée wrote: > Ben Widawsky writes: > > > On 21-11-26 12:08:08, Alex Bennée wrote: > >> > >> Ben Widawsky writes: > >> > >> > On 21-11-19 02:29:51, Shreyas Shah wrote: > >> >> Hi Ben > >> >> > >> >> Are you planning to add the CXL2.0 switch ins

Re: [PATCH for-6.2 v2] block/nbd: forbid incompatible change of server options on reconnect

2021-11-30 Thread Vladimir Sementsov-Ogievskiy
30.11.2021 00:53, Vladimir Sementsov-Ogievskiy wrote: Reconnect feature was never prepared to handle server options changed on reconnect. Let's be stricter and check what exactly is changed. If server capabilities just got richer don't worry. Otherwise fail and drop the established connection. S

Re: [PATCH v7 3/3] cpus-common: implement dirty page limit on vCPU

2021-11-30 Thread Peter Xu
On Tue, Nov 30, 2021 at 06:28:13PM +0800, huang...@chinatelecom.cn wrote: > ## > +# @set-dirty-limit: > +# > +# Set the upper limit of dirty page rate for a virtual CPU. > +# > +# Requires KVM with accelerator property "dirty-ring-size" set. > +# A virtual CPU's dirty page rate is a measure of its

[PATCH v2 0/2] ppc/pnv.c: add a friendly warning when accel=kvm is used

2021-11-30 Thread Daniel Henrique Barboza
Hi, In this version a documentation patch was added to explain our motivations to officially disable KVM accel in the powernv machine. Changes from v1: - added a doc patch - v1 link: https://lists.gnu.org/archive/html/qemu-devel/2021-11/msg05207.html Daniel Henrique Barboza (2): ppc/pnv.c: ad

[PATCH v2 2/2] docs/system/ppc/powernv.rst: document KVM support status

2021-11-30 Thread Daniel Henrique Barboza
Put in a more accessible place the reasoning behind our decision to officially drop KVM support in the powernv machine. Signed-off-by: Daniel Henrique Barboza --- docs/system/ppc/powernv.rst | 13 + 1 file changed, 13 insertions(+) diff --git a/docs/system/ppc/powernv.rst b/docs/sys

[PATCH v2 1/2] ppc/pnv.c: add a friendly warning when accel=kvm is used

2021-11-30 Thread Daniel Henrique Barboza
If one tries to use -machine powernv9,accel=kvm in a Power9 host, a cryptic error will be shown: qemu-system-ppc64: Register sync failed... If you're using kvm-hv.ko, only "-cpu host" is possible qemu-system-ppc64: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument Appending '-cpu h

[PATCH 2/2] intel_iommu: Fix irqchip / X2APIC configuration checks

2021-11-30 Thread David Woodhouse
We don't need to check kvm_enable_x2apic(). It's perfectly OK to support interrupt remapping even if we can't address CPUs above 254. Kind of pointless, but still functional. The check on kvm_enable_x2apic() needs to happen *anyway* in order to allow CPUs above 254 even without an IOMMU, so allow

[PATCH 1/2] target/i386: Fix sanity check on max APIC ID / X2APIC enablement

2021-11-30 Thread David Woodhouse
The check on x86ms->apic_id_limit in pc_machine_done() had two problems. Firstly, we need KVM to support the X2APIC API in order to allow IRQ delivery to APICs >= 255. So we need to call/check kvm_enable_x2apic(), which was done elsewhere in *some* cases but not all. Secondly, microvm needs the s

[PATCH] virtio: signal after wrapping packed used_idx

2021-11-30 Thread Stefan Hajnoczi
Packed Virtqueues wrap used_idx instead of letting it run freely like Split Virtqueues do. If the used ring wraps more than once there is no way to compare vq->signalled_used and vq->used_idx in virtio_packed_should_notify() since they are modulo vq->vring.num. This causes the device to stop sendi

Re: [PATCH 2/2] intel_iommu: Fix irqchip / X2APIC configuration checks

2021-11-30 Thread Claudio Fontana
Acked-by: Claudio Fontana I'll try to find time tonight to give you a tested by. Ciao, Claudio On 11/30/21 2:42 PM, David Woodhouse wrote: > We don't need to check kvm_enable_x2apic(). It's perfectly OK to support > interrupt remapping even if we can't address CPUs above 254. Kind of > pointle

why is iommu_platform set to off by default?

2021-11-30 Thread Peter Maydell
I've just spent a day or so trying to track down why PCI passthrough of a virtio-blk-pci device wasn't working. The problem turns out to be that by default virtio pci devices don't use the IOMMU, even when the machine model has created an IOMMU and arranged for the PCI bus to be underneath it. So w

Re: [PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread Hyman Huang
1. Start vm with kernel+initrd.img with qemu command line as following: [root@Hyman_server1 fast_qemu]# cat vm.sh #!/bin/bash /usr/bin/qemu-system-x86_64 \ -display none -vga none \ -name guest=simple_vm,debug-threads=on \ -monitor stdio \ -machine pc-i440fx-2.12 \ -accel kvm,

Re: [PATCH] memory: Fix incorrect calls of log_global_start/stop

2021-11-30 Thread David Hildenbrand
On 30.11.21 09:00, Peter Xu wrote: > We should only call the log_global_start/stop when the global dirty track > bitmask changes from zero<->non-zero. > > No real issue reported for this yet probably because no immediate user to > enable both dirty rate measurement and migration at the same time.

Re: [PATCH v7 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-30 Thread Hyman Huang
On 11/30/21 21:04, Peter Xu wrote: On Tue, Nov 30, 2021 at 06:28:11PM +0800, huang...@chinatelecom.cn wrote: +static void dirtylimit_calc_func(void) +{ +CPUState *cpu; +DirtyPageRecord *dirty_pages; +int64_t start_time, end_time, calc_time; +DirtyRateVcpu rate; +int i = 0;

Re: [PATCH v7 3/3] cpus-common: implement dirty page limit on vCPU

2021-11-30 Thread Hyman Huang
On 11/30/21 21:21, Peter Xu wrote: On Tue, Nov 30, 2021 at 06:28:13PM +0800, huang...@chinatelecom.cn wrote: ## +# @set-dirty-limit: +# +# Set the upper limit of dirty page rate for a virtual CPU. +# +# Requires KVM with accelerator property "dirty-ring-size" set. +# A virtual CPU's dirty p

Re: [PATCH v1 1/3] linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-11-30 Thread Michal Prívozník
On 11/30/21 10:28, David Hildenbrand wrote: > TODO: replace by a proper header sync. > > Signed-off-by: David Hildenbrand > --- > include/standard-headers/linux/virtio_mem.h | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/include/standard-headers/linux/virtio_m

Re: [PATCH v1 3/3] virtio-mem: Set "unplugged-inaccessible=auto" for the 6.2 machine on x86

2021-11-30 Thread Michal Prívozník
On 11/30/21 10:28, David Hildenbrand wrote: > Set the new default to "auto", keeping it set to "on" for compat I believe you wanted to say: keeping it set to "off", because that's what the patch does. > machines. This property is only available for x86 targets. > > TODO: once 6.2 was released an

Re: [PATCH v1 2/3] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-11-30 Thread Michal Prívozník
On 11/30/21 10:28, David Hildenbrand wrote: > With VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, we signal the VM that reading > unplugged memory is not supported. We have to fail feature negotiation > in case the guest does not support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE. > > First, VIRTIO_MEM_F_UNPLUGGED

Re: [PATCH 2/2] hw/core/loader: workaround read() size limit.

2021-11-30 Thread Jamie Iles
Hi Philippe, On Thu, Nov 11, 2021 at 05:04:56PM +, Jamie Iles wrote: > On Thu, Nov 11, 2021 at 04:55:35PM +0100, Philippe Mathieu-Daudé wrote: > > On 11/11/21 16:43, Philippe Mathieu-Daudé wrote: > > > On 11/11/21 16:36, Jamie Iles wrote: > > >> Hi Philippe, > > >> > > >> On Thu, Nov 11, 2021

Re: [PATCH v1 3/3] virtio-mem: Set "unplugged-inaccessible=auto" for the 6.2 machine on x86

2021-11-30 Thread David Hildenbrand
On 30.11.21 16:34, Michal Prívozník wrote: > On 11/30/21 10:28, David Hildenbrand wrote: >> Set the new default to "auto", keeping it set to "on" for compat > > I believe you wanted to say: keeping it set to "off", because that's > what the patch does. Right, I switched semantics from a "legacy-g

Re: [PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread Hyman Huang
On 11/30/21 22:57, Hyman Huang wrote: 1. Start vm with kernel+initrd.img with qemu command line as following: [root@Hyman_server1 fast_qemu]# cat vm.sh #!/bin/bash /usr/bin/qemu-system-x86_64 \     -display none -vga none \     -name guest=simple_vm,debug-threads=on \     -monitor stdio \

Re: [PATCH V6 19/27] vfio-pci: cpr part 1 (fd and dma)

2021-11-30 Thread Steven Sistare
On 11/10/2021 2:48 AM, Zheng Chuan wrote: > > Hi, steve > > On 2021/8/11 1:06, Alex Williamson wrote: >> On Fri, 6 Aug 2021 14:43:53 -0700 >> Steve Sistare wrote: >> [...] >>> +static int >>> +vfio_region_remap(MemoryRegionSection *section, void *handle, Error **errp) >>> +{ >>> +MemoryRegi

Re: [PATCH v1 0/8] virtio-mem: Support "prealloc=on"

2021-11-30 Thread Michal Prívozník
On 11/30/21 11:41, David Hildenbrand wrote: > Based-on: <20211130092838.24224-1-da...@redhat.com> > > Patch #1 - #7 are fully reviewed [1] but did not get picked up yet, so I'm > sending them along here, as they are required to use os_mem_prealloc() in > a safe way once the VM is running. > > Sup

Re: why is iommu_platform set to off by default?

2021-11-30 Thread Stefan Hajnoczi
On Tue, Nov 30, 2021 at 02:32:49PM +, Peter Maydell wrote: > I've just spent a day or so trying to track down why PCI passthrough > of a virtio-blk-pci device wasn't working. The problem turns out to be > that by default virtio pci devices don't use the IOMMU, even when the > machine model has

Re: [PATCH v3 2/3] test/tcg/ppc64le: test mtfsf

2021-11-30 Thread Cédric Le Goater
Hello Lucas, On 11/24/21 18:25, Lucas Mateus Castro (alqotel) wrote: Added tests for the mtfsf to check if FI bit of FPSCR is being set and if exception calls are being made correctly. Signed-off-by: Lucas Mateus Castro (alqotel) Could you please rebase on mainline and resend ? Thanks, C.

Re: Odd square bracket encoding in QOM names

2021-11-30 Thread Peter Maydell
On Tue, 30 Nov 2021 at 08:36, Mark Cave-Ayland wrote: > Has there been a recent change as to how square brackets are encoded within > QOM > names? I noticed that the output has changed here in the "info qom-tree" > output in > qemu-system-m68k for the q800 machine. > > The q800 machine has a set

[PATCH] scripts/entitlement.sh: Use backward-compatible cp flags

2021-11-30 Thread Evan Miller
Older versions of Mac OS X do not support cp -a. The cp man page indicates that -a is equivalent to -pPR. Signed-off-by: Evan Miller --- scripts/entitlement.sh.orig +++ scripts/entitlement.sh @@ -15,7 +15,7 @@ if $in_place; then trap 'rm "$DST.tmp"' exit - cp -af "$SRC" "$DST.tmp" + cp -

[PATCH] target/arm: Correct calculation of tlb range invalidate length

2021-11-30 Thread Peter Maydell
The calculation of the length of TLB range invalidate operations in tlbi_aa64_range_get_length() is incorrect in two ways: * the NUM field is 5 bits, but we read only 4 bits * we miscalculate the page_shift value, because of an off-by-one error: TG 0b00 is invalid TG 0b01 is 4K granule

Re: [PATCH] target/arm: Correct calculation of tlb range invalidate length

2021-11-30 Thread Richard Henderson
On 11/30/21 6:32 PM, Peter Maydell wrote: The calculation of the length of TLB range invalidate operations in tlbi_aa64_range_get_length() is incorrect in two ways: * the NUM field is 5 bits, but we read only 4 bits * we miscalculate the page_shift value, because of an off-by-one error:

Re: Follow-up on the CXL discussion at OFTC

2021-11-30 Thread Ben Widawsky
On 21-11-30 13:09:56, Jonathan Cameron wrote: > On Mon, 29 Nov 2021 18:28:43 + > Alex Bennée wrote: > > > Ben Widawsky writes: > > > > > On 21-11-26 12:08:08, Alex Bennée wrote: > > >> > > >> Ben Widawsky writes: > > >> > > >> > On 21-11-19 02:29:51, Shreyas Shah wrote: > > >> >> H

Re: Odd square bracket encoding in QOM names

2021-11-30 Thread Mark Cave-Ayland
On 30/11/2021 16:41, Peter Maydell wrote: On Tue, 30 Nov 2021 at 08:36, Mark Cave-Ayland wrote: Has there been a recent change as to how square brackets are encoded within QOM names? I noticed that the output has changed here in the "info qom-tree" output in qemu-system-m68k for the q800 mach

Re: [PATCH v5 5/6] migration: Add migrate_use_tls() helper

2021-11-30 Thread Leonardo Bras Soares Passos
Hello Juan, Thanks for reviewing! Best regards, Leo On Fri, Nov 12, 2021 at 8:04 AM Juan Quintela wrote: > Leonardo Bras wrote: > > A lot of places check parameters.tls_creds in order to evaluate if TLS is > > in use, and sometimes call migrate_get_current() just for that test. > > > > Add ne

[Bug 1749393] Re: sbrk() not working under qemu-user with a PIE-compiled binary?

2021-11-30 Thread Brian Murray
Hello Raphaël, or anyone else affected, Accepted qemu into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/qemu/1:4.2-3ubuntu6.19 in a few hours, and then in the -proposed repository. Please help us by testing this new package. See https://wiki

Re: [PATCH v4] target/ppc: fix Hash64 MMU update of PTE bit R

2021-11-30 Thread Leandro Lupori
On 30/11/2021 05:44, Cédric Le Goater wrote: It would be interesting to boot directly the PowerNV machine from a FreeBSB kernel and a minimum inirtd without using the skiroot images and an iso. Are images available ? AFAIK there are no minimum initrd images available. The closest thing would b

Re: [PATCH] target/arm: Correct calculation of tlb range invalidate length

2021-11-30 Thread Alex Bennée
Peter Maydell writes: > The calculation of the length of TLB range invalidate operations > in tlbi_aa64_range_get_length() is incorrect in two ways: > * the NUM field is 5 bits, but we read only 4 bits > * we miscalculate the page_shift value, because of an >off-by-one error: > TG 0b0

[PATCH 0/2] MIPS misc fixes

2021-11-30 Thread Jiaxun Yang
Two problems caught when I was trying to add CI job for various configurations. Jiaxun Yang (2): hw/mips: bootloader: Fix write_ulong hw/mips/boston: Fix elf_load error detection hw/mips/bootloader.c | 6 +- hw/mips/boston.c | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-)

[PATCH 1/2] hw/mips: bootloader: Fix write_ulong

2021-11-30 Thread Jiaxun Yang
bl_gen_write_ulong uses sd for both 32 and 64 bit CPU, while sd is illegal on 32 bit CPUs. Replace sd with sw on 32bit CPUs. Fixes: 3ebbf86 ("hw/mips: Add a bootloader helper") Signed-off-by: Jiaxun Yang --- Should be backported to 6.0 onwards. --- hw/mips/bootloader.c | 6 +- 1 file change

[PATCH 2/2] hw/mips/boston: Fix load_elf error detection

2021-11-30 Thread Jiaxun Yang
load_elf gives negative return in case of error, not zero. Fixes: 10e3f30 ("hw/mips/boston: Allow loading elf kernel and dtb") Signed-off-by: Jiaxun Yang --- For 6.2. --- hw/mips/boston.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c

Re: [PATCH 1/2] hw/mips: bootloader: Fix write_ulong

2021-11-30 Thread Philippe Mathieu-Daudé
On 11/30/21 22:17, Jiaxun Yang wrote: > bl_gen_write_ulong uses sd for both 32 and 64 bit CPU, > while sd is illegal on 32 bit CPUs. > > Replace sd with sw on 32bit CPUs. > > Fixes: 3ebbf86 ("hw/mips: Add a bootloader helper") > Signed-off-by: Jiaxun Yang > --- > Should be backported to 6.0 onwa

Re: [PATCH 2/2] hw/mips/boston: Fix load_elf error detection

2021-11-30 Thread Philippe Mathieu-Daudé
On 11/30/21 22:17, Jiaxun Yang wrote: > load_elf gives negative return in case of error, not zero. > > Fixes: 10e3f30 ("hw/mips/boston: Allow loading elf kernel and dtb") > Signed-off-by: Jiaxun Yang > --- > For 6.2. > --- > hw/mips/boston.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deleti

Re: [PATCH v8 06/10] target/ppc: enable PMU instruction count

2021-11-30 Thread Daniel Henrique Barboza
On 11/29/21 01:36, David Gibson wrote: On Thu, Nov 25, 2021 at 12:08:13PM -0300, Daniel Henrique Barboza wrote: The PMU is already counting cycles by calculating time elapsed in nanoseconds. Counting instructions is a different matter and requires another approach. This patch adds the capabi

[RFC PATCH v2 2/4] target/ppc: Disable unused facilities in the e600 CPU

2021-11-30 Thread Fabiano Rosas
The e600 CPU is a successor of the 7448 and like all the 7450s CPUs, it has an optional software TLB feature. We have determined that there is no OS software support for the 7450 software TLB available these days. See the previous commit for more information. This patch disables the SPRs and inst

[RFC PATCH v2 0/4] QEMU/openbios: PPC Software TLB support in the G4 family

2021-11-30 Thread Fabiano Rosas
Hi all, Recap: - QEMU enables 7450 SW TLB search by default; - OpenBIOS does not know about SW TLB (vectors 0x1000, 0x1100, 0x1200); - OpenBIOS does not know about 7450s PVRs. Proposed solutions: a) find another firmware/guest OS code that supports the feature; b) implement the switching of th

[RFC PATCH v2 1/4] target/ppc: Disable software TLB for the 7450 family

2021-11-30 Thread Fabiano Rosas
(Applies to 7441, 7445, 7450, 7451, 7455, 7457, 7447 and 7447a)* We have since 2011 [1] been unable to run OpenBIOS in the 7450s and have not heard of any other software that is used with those CPUs in QEMU. A current discussion [2] shows that the 7450 software TLB is unsupported in Linux 5.15, Fr

[RFC PATCH v2 4/4] tests/avocado: ppc: Add smoke tests for MPC7400 and MPC7450 families

2021-11-30 Thread Fabiano Rosas
These tests ensure that our emulation for these cpus is not completely broken and we can at least run OpenBIOS on them. $ make check-avocado AVOCADO_TESTS=../tests/avocado/ppc_74xx.py Signed-off-by: Fabiano Rosas Reviewed-by: Willian Rampazzo --- Note that the 7450s depend on an OpenBIOS change

  1   2   >