[Bug 1802915] Re: GTK display refresh rate is throttled

2021-10-29 Thread Lee Garrett
** Changed in: qemu Status: Expired => Confirmed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1802915 Title: GTK display refresh rate is throttled Status in QEMU: Confirmed Bug descript

Re: [PATCH v3 03/32] tests/tcg/mips: Run MSA opcodes tests on user-mode emulation

2021-10-29 Thread Richard Henderson
On 10/28/21 2:08 PM, Philippe Mathieu-Daudé wrote: The following commits added various user-mode tests for various MSA instructions: - 0fdd986a6c8 ("Add tests for MSA integer add instructions") - 1be82d89011 ("Add tests for MSA integer average instructions") - 1d336c87a3c ("Add tests for M

Re: [PATCH v2 5/9] qapi: Generalize struct member policy checking

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 17:34, Markus Armbruster wrote: > Eric Blake writes: > >> On Thu, Oct 28, 2021 at 12:25:16PM +0200, Markus Armbruster wrote: >>> The generated visitor functions call visit_deprecated_accept() and >>> visit_deprecated() when visiting a struct member with special feature >>> flag 'depre

Re: [PATCH v2 6/9] qapi: Generalize command policy checking

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 17:28, Eric Blake wrote: > On Thu, Oct 28, 2021 at 12:25:17PM +0200, Markus Armbruster wrote: >> The code to check command policy can see special feature flag >> 'deprecated' as command flag QCO_DEPRECATED. I want to make feature >> flag 'unstable' visible there as well, so I can add p

Re: [PATCH v3 10/32] target/mips: Convert MSA BIT instruction format to decodetree

2021-10-29 Thread Richard Henderson
On 10/28/21 2:08 PM, Philippe Mathieu-Daudé wrote: Convert instructions with an immediate bit index and data format df/m to decodetree. Since the 'data format' field is a constant value, use tcg_constant_i32() instead of a TCG temporary. Reviewed-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-

Re: [PATCH v3 18/32] target/mips: Convert MSA 3RF instruction format to decodetree (DF_HALF)

2021-10-29 Thread Richard Henderson
On 10/28/21 2:08 PM, Philippe Mathieu-Daudé wrote: Convert 3-register floating-point or fixed-point operations to decodetree. Reviewed-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-Daudé --- v3: - Add plus_1(), extract DF in decoder - Remove TRANS_MSA(), call check_msa_enabled in trans_X() ---

Re: [PATCH v3 20/32] target/mips: Convert MSA 3R instruction format to decodetree (part 1/4)

2021-10-29 Thread Richard Henderson
On 10/28/21 2:08 PM, Philippe Mathieu-Daudé wrote: +@3r .. ... df:2 wt:5ws:5 wd:5 .. &msa_r Nit: should this be called @3rf, since it includes df and... +TRANS(SLD, trans_msa_3rf, gen_helper_msa_sld_df); ... you use trans_msa_3rf as the implementatio

Re: [PATCH v3 21/32] target/mips: Convert MSA 3R instruction format to decodetree (part 2/4)

2021-10-29 Thread Richard Henderson
On 10/28/21 2:08 PM, Philippe Mathieu-Daudé wrote: Convert 3-register operations to decodetree. Per the Encoding of Operation Field for 3R Instruction Format' (Table 3.25), these instructions are not defined for the BYTE format. Therefore the TRANS_DF_iii_b() macro returns 'false' in that case,

[RFC PATCH 00/15] job: replace AioContext lock with job_mutex

2021-10-29 Thread Emanuele Giuseppe Esposito
In this series, we want to remove the AioContext lock and instead use the already existent job_mutex to protect the job structures and list. This is part of the work to get rid of AioContext lock usage in favour of smaller granularity locks. In patches 1-3-5-6-7, we split the job API in two header

[RFC PATCH 04/15] jobs: add job-monitor.h

2021-10-29 Thread Emanuele Giuseppe Esposito
job-monitor.h contains all functions of job.h that are used by the monitor and essentially all functions that do not define a JobDriver/Blockdriver. Right now just move the headers, proper categorization and API definition will come in the next commit. No functional change intended. Signed-off-b

[RFC PATCH 01/15] jobs: add job-common.h

2021-10-29 Thread Emanuele Giuseppe Esposito
job-common.h contains all struct and common function that currently are in job.h and will be shared by job-monitor and job-driver in the next commits. No functional change intended. Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/job-common.h | 300 +++

[RFC PATCH 03/15] job-common.h: categorize fields in struct Job

2021-10-29 Thread Emanuele Giuseppe Esposito
Categorize the fields in struct Job to understand which need to be protected by the job muutex and which not. Also move job_type() and job_type_str() there, as they are common helper functions. Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/job-common.h | 62

[RFC PATCH 02/15] job.c: make job_lock/unlock public

2021-10-29 Thread Emanuele Giuseppe Esposito
job mutex will be used to protect the job struct elements and list, replacing AioContext locks. Right now use a shared lock for all jobs, in order to keep things simple. Once the AioContext lock is gone, we can introduce per-job locks. Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/

[RFC PATCH 05/15] job-monitor.h: define the job monitor API

2021-10-29 Thread Emanuele Giuseppe Esposito
These functions assume that the job lock is held by the caller, to avoid TOC/TOU conditions. Introduce also additional helpers that define _locked functions (useful when the job_mutex is globally applied). Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/job-monitor.h | 61 +++

[RFC PATCH 10/15] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED

2021-10-29 Thread Emanuele Giuseppe Esposito
Same as AIO_WAIT_WHILE macro, but if we are in the Main loop do not release and then acquire ctx_ 's aiocontext. Once all Aiocontext locks go away, this macro will replace AIO_WAIT_WHILE. Signed-off-by: Emanuele Giuseppe Esposito --- include/block/aio-wait.h | 15 +++ 1 file changed

[RFC PATCH 09/15] job.c: move inner aiocontext lock in callbacks

2021-10-29 Thread Emanuele Giuseppe Esposito
Instead of having the lock in job_tnx_apply, move it inside in the callback. This will be helpful for next commits, when we introduce job_lock/unlock pairs. job_transition_to_pending() and job_needs_finalize() do not need to be protected by the aiocontext lock. No functional change intended. Sig

[RFC PATCH 06/15] jobs: add job-driver.h

2021-10-29 Thread Emanuele Giuseppe Esposito
job-driver.h contains all functions of job.h that are used by the drivers (JobDriver, BlockJobDriver). These functions are unaware of the job_mutex, so they all will take and release the lock internally. No functional change intended. Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/

[RFC PATCH 14/15] jobs: add missing job locks to replace aiocontext lock

2021-10-29 Thread Emanuele Giuseppe Esposito
find_block_job() and find_job() cannot be handled like all other functions in the previous commit: in order to avoid unneccessary job lock/unlock, replace the aiocontext lock with the job_lock. However, once we start dropping these aiocontex locks we also break the assumptions of the callees in th

[RFC PATCH 15/15] jobs: remove all unnecessary AioContext locks

2021-10-29 Thread Emanuele Giuseppe Esposito
Now that we removed the aiocontext in find_* functions, we need to remove it also in all other functions of the job API that assumed the lock was held. Therefore: - when possible, remove completely the aiocontext lock/unlock pair - if it is used by some other funcitons too, just leave the job API

[RFC PATCH 08/15] job.c: minor adjustments in preparation to job-driver

2021-10-29 Thread Emanuele Giuseppe Esposito
job_event_* functions can be all static, as they are not used outside job.c Add also missing notifier initialization for the on_idle list in job_create(). Signed-off-by: Emanuele Giuseppe Esposito --- job.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/job.c

[PATCH v5 00/25] More SH4 clean ups

2021-10-29 Thread BALATON Zoltan
Based-on: ^ (hw/sh4: Codeing style fixes) Continuing the clean up stared in previous series. This got big enough for now so I'll wait until these are merged (hopefully before the freeze) before going on so I don't have to carry them in my tree. Only plan to submit another version if needed from r

[RFC PATCH 12/15] jobs: protect jobs with job_lock/unlock

2021-10-29 Thread Emanuele Giuseppe Esposito
Introduce the job locking mechanism through the whole job API, following the comments and requirements of job-monitor (assume lock is held) and job-driver (lock is not held). At this point, we do not care if the job lock is inside or outside the aiocontext. The aiocontext is going away and it is u

[RFC PATCH 07/15] job-driver.h: add helper functions

2021-10-29 Thread Emanuele Giuseppe Esposito
These functions will be useful when job_lock is globally applied, as they will allow drivers to access the job struct fields without worrying about the job lock. Now that we are done with the job API header split, update also the comments in blockjob.c (and move them in job.c). Signed-off-by: Ema

[RFC PATCH 11/15] jobs: remove aiocontext locks since the functions are under BQL

2021-10-29 Thread Emanuele Giuseppe Esposito
In preparation to the job_lock/unlock patch, remove these aiocontext locks. The main reason these two locks are removed here is because they are inside a loop iterating on the jobs list. Once the job_lock is added, it will have to protect the whole loop, wrapping also the aiocontext acquire/release

[RFC PATCH 13/15] jobs: use job locks and helpers also in the unit tests

2021-10-29 Thread Emanuele Giuseppe Esposito
Add missing job synchronization in the unit tests, with both explicit locks and helpers. Signed-off-by: Emanuele Giuseppe Esposito --- tests/unit/test-bdrv-drain.c | 40 +++--- tests/unit/test-block-iothread.c | 4 +++ tests/unit/test-blockjob-txn.c | 10 ++ tests/unit

[PATCH v5 02/25] hw/sh4: Change debug printfs to traces

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson --- hw/char/sh_serial.c | 13 ++- hw/char/trace-events | 4 +++ hw/intc/sh_intc.c | 79 +++ hw/intc/trace-events | 8 + hw/sh4/sh7750.c | 8 ++--- hw/sh4/trace-events |

[PATCH v5 04/25] hw/char/sh_serial: Do not abort on invalid access

2021-10-29 Thread BALATON Zoltan
Replace fprintf with qemu_log_mask LOG_GUEST_ERROR as the intention is to handle valid accesses in these functions so if we get to these errors then it's an invalid access. Do not abort as that would allow the guest to crash QEMU and the practice in other devices is to not do that just log and igno

[PATCH v5 03/25] hw/sh4/r2d: Use error_report instead of fprintf to stderr

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/sh4/r2d.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 57ccae7249..72759413f3 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -26

[PATCH v5 07/25] hw/char/sh_serial: Split off sh_serial_reset() from sh_serial_init()

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 5ee93dc732..80a548d19d 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -381,18 +3

[PATCH v5 14/25] hw/intc/sh_intc: Move sh_intc_register() closer to its only user

2021-10-29 Thread BALATON Zoltan
The sh_intc_register() function is only used at one place. Move them together so it's easier to see what's going on. Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/intc/sh_intc.c | 60 +++ 1 fi

[PATCH v5 10/25] hw/intc/sh_intc: Use existing macro instead of local one

2021-10-29 Thread BALATON Zoltan
The INTC_A7 local macro does the same as the A7ADDR from include/sh/sh.h so use the latter and drop the local macro definition. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/intc/sh_intc.c | 12 +--- 1 file changed, 5 insertions

[PATCH v5 06/25] hw/char/sh_serial: Embed QEMUTimer in state struct

2021-10-29 Thread BALATON Zoltan
Instead of allocating timer with timer_new store it directly in the state struct. This makes it simpler to free it together with the device. Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/char/sh_serial.c b/

[PATCH v5 11/25] hw/intc/sh_intc: Turn some defines into an enum

2021-10-29 Thread BALATON Zoltan
Turn the INTC_MODE defines into an enum and clean up the function returning these to make it clearer by removing nested ifs and superfluous parenthesis. The one remaining #define is a flag which is moved further apart by changing its value from 8 to 0x80 to leave some spare bits as this is or-ed wi

[PATCH v5 12/25] hw/intc/sh_intc: Rename iomem region

2021-10-29 Thread BALATON Zoltan
Rename the iomem region to "intc" from "interrupt-controller" which makes the info mtree output less wide as it is already too wide because of all the aliases. Also drop the format macro which was only used twice in close proximity so we can just use the literal string instead without a macro defin

[PATCH v5 05/25] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState

2021-10-29 Thread BALATON Zoltan
Coding style says types should be camel case. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/char/sh_serial.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh

[PATCH v5 13/25] hw/intc/sh_intc: Drop another useless macro

2021-10-29 Thread BALATON Zoltan
The INT_REG_PARAMS macro was only used a few times within one function on adjacent lines and is actually more complex than writing out the parameters so simplify it by expanding the macro at call sites and dropping the #define. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Re

[PATCH v5 08/25] hw/char/sh_serial: QOM-ify

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/char/sh_serial.c | 98 +++-- hw/sh4/sh7750.c | 56 +++--- include/hw/sh4/sh.h | 9 + 3 files changed, 101 insertions(+), 62 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.

[PATCH v5 18/25] hw/intc/sh_intc: Replace abort() with g_assert_not_reached()

2021-10-29 Thread BALATON Zoltan
All the places that call abort should not happen which is better marked by g_assert_not_reached. Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/intc/sh_intc.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw

[PATCH v5 09/25] hw/char/sh_serial: Add device id to trace output

2021-10-29 Thread BALATON Zoltan
Normally there are at least two sh_serial instances. Add device id to trace messages to make it clear which instance they belong to otherwise its not possible to tell which serial device is accessed. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson

[PATCH v5 25/25] hw/timer/sh_timer: Remove use of hw_error

2021-10-29 Thread BALATON Zoltan
The hw_error function calls abort and is not meant to be used by devices. Use qemu_log_mask instead to log and ignore invalid accesses. Also fix format strings to allow dropping type casts of hwaddr and use __func__ instead of hard coding function name in the message which were wrong in two cases.

[PATCH v5 01/25] hw/sh4: Fix typos in a comment

2021-10-29 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/timer/sh_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index 02eb865908..cc7c1897a8 100644 --- a/hw/timer/sh_timer.c ++

[PATCH v5 15/25] hw/intc/sh_intc: Remove excessive parenthesis

2021-10-29 Thread BALATON Zoltan
Drop unneded parenthesis and split up one complex expression to write it with less brackets so it's easier to follow. Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/intc/sh_intc.c | 9 + 1 file changed, 5 insertions(+), 4 deletio

[PATCH v5 20/25] hw/intc/sh_intc: Simplify allocating sources array

2021-10-29 Thread BALATON Zoltan
Use g_new0 instead of g_malloc0 and avoid some unneeded temporary variable assignments. Signed-off-by: BALATON Zoltan --- hw/intc/sh_intc.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c index eb58707e83..66d3a0f972 1006

[PATCH v5 16/25] hw/intc/sh_intc: Use array index instead of pointer arithmetics

2021-10-29 Thread BALATON Zoltan
Address of element i is one word thus clearer than array + i. Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/intc/sh_intc.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/intc/sh_int

[PATCH v5 23/25] hw/timer/sh_timer: Do not wrap lines that are not too long

2021-10-29 Thread BALATON Zoltan
It's more readable to keep things on one line if it fits the length limit. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/timer/sh_timer.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index 2038a

[PATCH v5 22/25] hw/timer/sh_timer: Rename sh_timer_state to SHTimerState

2021-10-29 Thread BALATON Zoltan
According to coding style types should be camel case, also remove unneded casts from void *. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- The tmu012_state is left for now, that's the real exported object with SHTimerState being an internal object for a single timer. I'll

[PATCH v5 21/25] hw/intc/sh_intc: Remove unneeded local variable initialisers

2021-10-29 Thread BALATON Zoltan
The sh_intc_locate function will either init these or not return so no need to initialise them. Signed-off-by: BALATON Zoltan --- hw/intc/sh_intc.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c index 66d3a0f972..

[PATCH v5 19/25] hw/intc/sh_intc: Avoid using continue in loops

2021-10-29 Thread BALATON Zoltan
Instead of if !expr continue else do something it is more straight forward to say if expr then do something, especially if the action is just a few lines. Remove such uses of continue to make the code easier to follow. Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson --- hw/intc/sh_

Re: [PATCH 1/4] configure: Remove the check for the __thread keyword

2021-10-29 Thread Richard Henderson
On 10/28/21 11:59 AM, Thomas Huth wrote: We recently bumped our minimum required version of GCC to 7.4 and Clang to 6.0, and those compiler versions should support the __thread keyword already. Signed-off-by: Thomas Huth --- configure | 11 --- 1 file changed, 11 deletions(-) Review

[PATCH v5 17/25] hw/intc/sh_intc: Inline and drop sh_intc_source() function

2021-10-29 Thread BALATON Zoltan
This function is very simple and provides no advantage. Call sites become simpler without it so just write it in line and drop the separate function. Signed-off-by: BALATON Zoltan --- hw/intc/sh_intc.c | 54 +++ hw/sh4/sh7750.c | 4 ++-- 2 files cha

Re: [PATCH v4 0/2] hw/core/machine: Add an unit test for smp_parse

2021-10-29 Thread Eduardo Habkost
On Thu, Oct 28, 2021 at 05:09:11PM +0200, Philippe Mathieu-Daudé wrote: > Respin of Yanan Wang v3, based on > "hw/core: Restrict qdev-hotplug to sysemu" > > Based-on: 20211028150521.1973821-1-phi...@redhat.com > https://lore.kernel.org/qemu-devel/20211028150521.1973821-1-phi...@redhat.com > > git

[PATCH v5 24/25] hw/timer/sh_timer: Fix timer memory region size

2021-10-29 Thread BALATON Zoltan
The timer memory region is only accessed via aliases that are 0x1000 bytes long, no need to have the timer region larger than that. Signed-off-by: BALATON Zoltan --- hw/timer/sh_timer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.

Re: [PATCH] target/mips: Remove obsolete FCR0_HAS2008 comment on P5600 CPU

2021-10-29 Thread Richard Henderson
On 10/28/21 2:21 PM, Philippe Mathieu-Daudé wrote: FCR0_HAS2008 flag has been enabled in commit ba5c79f2622 ("target-mips: indicate presence of IEEE 754-2008 FPU in R6/R5+MSA CPUs"), so remove the obsolete FIXME comment. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu-defs.c.inc | 1

Re: [PATCH v3 25/32] target/mips: Convert MSA COPY_U opcode to decodetree

2021-10-29 Thread Richard Henderson
On 10/28/21 2:08 PM, Philippe Mathieu-Daudé wrote: Convert the COPY_U opcode (Element Copy to GPR Unsigned) to decodetree. Since the 'n' field is a constant value, use tcg_constant_i32() instead of a TCG temporary. Reviewed-by: Jiaxun Yang Signed-off-by: Philippe Mathieu-Daudé --- v2: Add NULL_

Re: [PATCH v3 1/3] machine: add device_type_is_dynamic_sysbus function

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 16:22, Damien Hedde wrote: > Right now the allowance check for adding a sysbus device using > -device cli option (or device_add qmp command) is done well after > the device has been created. It is done during the machine init done > notifier: machine_init_notify() in hw/core/machine.c >

Re: [PATCH v2 8/9] qapi: Factor out compat_policy_input_ok()

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 18:55, Markus Armbruster wrote: > Markus Armbruster writes: > >> The code to check policy for handling deprecated input is triplicated. >> Factor it out into compat_policy_input_ok() before I mess with it in >> the next commit. >> >> Signed-off-by: Markus Armbruster >> Reviewed-by: P

Re: [PATCH v4 13/30] Hexagon HVX (target/hexagon) helper overrides infrastructure

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/12/21 12:10, Taylor Simpson wrote: > Build the infrastructure to create overrides for HVX instructions. > We create a new empty file (gen_tcg_hvx.h) that will be populated > in subsequent patches. > > Signed-off-by: Taylor Simpson > --- > target/hexagon/gen_tcg_hvx.h| 21 ++

[Bug 1802915] Re: GTK display refresh rate is throttled

2021-10-29 Thread Thomas Huth
The ticket has been re-opened here: https://gitlab.com/qemu-project/qemu/-/issues/700 ... so let's keep this one here closed, please. ** Bug watch added: gitlab.com/qemu-project/qemu/-/issues #700 https://gitlab.com/qemu-project/qemu/-/issues/700 ** Changed in: qemu Status: Confirmed

Re: [PATCH 0/4] hw/core: Restrict qdev-hotplug to sysemu

2021-10-29 Thread Eduardo Habkost
On Thu, Oct 28, 2021 at 05:05:17PM +0200, Philippe Mathieu-Daudé wrote: > Restrict various hw/core/ files to sysemu, > add stubs for qdev-hotplug. > > Philippe Mathieu-Daudé (4): > hw/core: Restrict sysemu specific files > hw/core: Declare meson source set > hw/core: Extract hotplug-related

Re: [PATCH v2 8/9] qapi: Factor out compat_policy_input_ok()

2021-10-29 Thread Markus Armbruster
Markus Armbruster writes: > The code to check policy for handling deprecated input is triplicated. > Factor it out into compat_policy_input_ok() before I mess with it in > the next commit. > > Signed-off-by: Markus Armbruster > Reviewed-by: Philippe Mathieu-Daudé > --- > include/qapi/compat-po

Re: [PATCH 08/31] target/loongarch: Add tlb instruction support

2021-10-29 Thread Richard Henderson
On 10/29/21 12:01 AM, yangxiaojuan wrote: +env->CSR_CPUID = (cs->cpu_index & 0x1ff); Any reason to have a copy of cpu_index, as opposed to just using that field? CSR_CPUID is read-only after all. Yes, we need this value, the uefi code read this CPUID when Start slave cores. That's not

Re: [PATCH v3 20/32] target/mips: Convert MSA 3R instruction format to decodetree (part 1/4)

2021-10-29 Thread Richard Henderson
On 10/29/21 10:23 AM, Philippe Mathieu-Daudé wrote: On 10/29/21 18:35, Richard Henderson wrote: On 10/28/21 2:08 PM, Philippe Mathieu-Daudé wrote: +@3r .. ...  df:2 wt:5ws:5  wd:5 ..  &msa_r Nit: should this be called @3rf, since it includes df and... "3R" is how the

Re: [PATCH v3 20/32] target/mips: Convert MSA 3R instruction format to decodetree (part 1/4)

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 18:35, Richard Henderson wrote: > On 10/28/21 2:08 PM, Philippe Mathieu-Daudé wrote: >> +@3r .. ...  df:2 wt:5ws:5  wd:5 ..  &msa_r > > Nit: should this be called @3rf, since it includes df and... "3R" is how the manual names this instruction class: Figure 3

Re: [PATCH v3 2/3] qdev-monitor: Check sysbus device type before creating it

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 16:22, Damien Hedde wrote: > Add an early check to test if the requested sysbus device type > is allowed by the current machine before creating the device. This > impacts both -device cli option and device_add qmp command. > > Before this patch, the check was done well after the device

Re: [PATCH 07/31] target/loongarch: Add loongarch csr/iocsr instruction support

2021-10-29 Thread Richard Henderson
On 10/28/21 11:26 PM, yangxiaojuan wrote: (1) For the iocsr registers, most of them act on the interrupt controller, the read and write will go to interrupt's mmio read/write. So I modified the addr to their mmio range. The ext interrupt controller use the sysbus's function to handle the interr

Re: [PULL v2 00/60] tcg patch queue

2021-10-29 Thread Richard Henderson
On 10/28/21 9:32 PM, Richard Henderson wrote: The following changes since commit c52d69e7dbaaed0ffdef8125e79218672c30161d: Merge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20211027' into staging (2021-10-27 11:45:18 -0700) are available in the Git repository at: https://g

Re: [PATCH v2] target/mips: Fix Loongson-3A4000 MSAIR config register

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/26/21 20:09, Philippe Mathieu-Daudé wrote: > When using the Loongson-3A4000 CPU, the MSAIR is returned with a > zero value (because unimplemented). Checking on real hardware, > this value appears incorrect: > > $ cat /proc/cpuinfo > system type : generic-loongson-machine > machine

Re: [PATCH] target/mips: Remove obsolete FCR0_HAS2008 comment on P5600 CPU

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/28/21 23:21, Philippe Mathieu-Daudé wrote: > FCR0_HAS2008 flag has been enabled in commit ba5c79f2622 > ("target-mips: indicate presence of IEEE 754-2008 FPU in > R6/R5+MSA CPUs"), so remove the obsolete FIXME comment. > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/mips/cpu-defs.

Re: [PATCH v3 2/3] qdev-monitor: Check sysbus device type before creating it

2021-10-29 Thread Philippe Mathieu-Daudé
On 10/29/21 19:34, Philippe Mathieu-Daudé wrote: > On 10/29/21 16:22, Damien Hedde wrote: >> Add an early check to test if the requested sysbus device type >> is allowed by the current machine before creating the device. This >> impacts both -device cli option and device_add qmp command. >> >> Befo

[RFC PATCH v5 03/26] virtio: Add VIRTIO_F_QUEUE_STATE

2021-10-29 Thread Eugenio Pérez
Implementation of RFC of device state capability: https://lists.oasis-open.org/archives/virtio-comment/202012/msg5.html With this capability, vdpa device can reset it's index so it can start consuming from guest after disabling shadow virtqueue (SVQ), with state not 0. The use case is to test

[RFC PATCH v5 05/26] vhost: Add x-vhost-set-shadow-vq qmp

2021-10-29 Thread Eugenio Pérez
Command to set shadow virtqueue mode. Signed-off-by: Eugenio Pérez --- qapi/net.json| 22 ++ net/vhost-vdpa.c | 6 ++ 2 files changed, 28 insertions(+) diff --git a/qapi/net.json b/qapi/net.json index 7fab2e7cd8..b191b6787b 100644 --- a/qapi/net.json +++ b/qapi/net.

[RFC PATCH v5 00/26] vDPA shadow virtqueue

2021-10-29 Thread Eugenio Pérez
This series enable shadow virtqueue (SVQ) for vhost-vdpa devices. This is intended as a new method of tracking the memory the devices touch during a migration process: Instead of relay on vhost device's dirty logging capability, SVQ intercepts the VQ dataplane forwarding the descriptors between VM

[RFC PATCH v5 07/26] vdpa: Save kick_fd in vhost-vdpa

2021-10-29 Thread Eugenio Pérez
We need to know it to switch to Shadow VirtQueue and back to normal operation. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost-vdpa.h | 1 + hw/virtio/vhost-vdpa.c | 5 + 2 files changed, 6 insertions(+) diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-

[RFC PATCH v5 08/26] vdpa: Add vhost_svq_get_dev_kick_notifier

2021-10-29 Thread Eugenio Pérez
Is needed so vhost-vdpa knows what to send to device as kick event fd. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 4 hw/virtio/vhost-shadow-virtqueue.c | 10 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-shadow-virtqueu

[RFC PATCH v5 01/26] util: Make some iova_tree parameters const

2021-10-29 Thread Eugenio Pérez
As qemu guidelines: Unless a pointer is used to modify the pointed-to storage, give it the "const" attribute. In the particular case of iova_tree_find it allows to enforce what is requested by its comment, since the compiler would shout in case of modifying or freeing the const-qualified returned

[RFC PATCH v5 02/26] vhost: Fix last queue index of devices with no cvq

2021-10-29 Thread Eugenio Pérez
The -1 assumes that all devices with no cvq have an spare vq allocated for them, but with no offer of VIRTIO_NET_F_CTRL_VQ. This may not be the case, and the device may have a pair number of queues. To fix this, just resort to the lower even number of queues. Fixes: 049eb15b5fc9 ("vhost: record t

[RFC PATCH v5 11/26] vhost: Handle host notifiers in SVQ

2021-10-29 Thread Eugenio Pérez
If device supports host notifiers, this makes one jump less (kernel) to deliver SVQ notifications to it. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 2 ++ hw/virtio/vhost-shadow-virtqueue.c | 23 ++- 2 files changed, 24 insertions(+), 1 deletion(-)

[RFC PATCH v5 13/26] Add vhost_svq_get_svq_call_notifier

2021-10-29 Thread Eugenio Pérez
This allows vhost-vdpa device to retrieve device -> svq call eventfd. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 2 ++ hw/virtio/vhost-shadow-virtqueue.c | 12 2 files changed, 14 insertions(+) diff --git a/hw/virtio/vhost-shadow-virtqueue.h b/hw/virtio

[RFC PATCH v5 06/26] vhost: Add VhostShadowVirtqueue

2021-10-29 Thread Eugenio Pérez
Vhost shadow virtqueue (SVQ) is an intermediate jump for virtqueue notifications and buffers, allowing qemu to track them. While qemu is forwarding the buffers and virtqueue changes, is able to commit the memory it's being dirtied, the same way regular qemu's VirtIO devices do. This commit only ex

[RFC PATCH v5 04/26] virtio-net: Honor VIRTIO_CONFIG_S_DEVICE_STOPPED

2021-10-29 Thread Eugenio Pérez
So the guest can stop and start net device. It freely implements the RFC https://lists.oasis-open.org/archives/virtio-comment/202012/msg00027.html To stop (as "pause") the device is required to migrate status and vring addresses between device and SVQ. Once the device is stopped, the driver can re

[RFC PATCH v5 14/26] Add vhost_svq_set_guest_call_notifier

2021-10-29 Thread Eugenio Pérez
This allows vhost-vdpa device to set SVQ -> guest notifier to SVQ. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 1 + hw/virtio/vhost-shadow-virtqueue.c | 16 2 files changed, 17 insertions(+) diff --git a/hw/virtio/vhost-shadow-virtqueue.h b/hw/virtio

[RFC PATCH v5 09/26] vdpa: Add vhost_svq_set_svq_kick_fd

2021-10-29 Thread Eugenio Pérez
This function allow vhost-vdpa backend to override kick_fd. There are a few pieces still missing, like the guest's kick handler in SVQ, and how to handle the first set of kick file descriptor, that has its own complexities. These will be added in next patches. Signed-off-by: Eugenio Pérez --- h

[RFC PATCH v5 10/26] vhost: Add Shadow VirtQueue kick forwarding capabilities

2021-10-29 Thread Eugenio Pérez
At this mode no buffer forwarding will be performed in SVQ mode: Qemu will just forward the guest's kicks to the device. Also, host notifiers must be disabled at SVQ start, and they will not start if SVQ has been enabled when device is stopped. This will be addressed in next patches. Signed-off-b

[RFC PATCH v5 15/26] vdpa: Save call_fd in vhost-vdpa

2021-10-29 Thread Eugenio Pérez
We need to know it to switch to Shadow VirtQueue. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost-vdpa.h | 2 ++ hw/virtio/vhost-vdpa.c | 5 + 2 files changed, 7 insertions(+) diff --git a/include/hw/virtio/vhost-vdpa.h b/include/hw/virtio/vhost-vdpa.h index 6d60092c96..2f5

[RFC PATCH v5 12/26] vhost: Route guest->host notification through shadow virtqueue

2021-10-29 Thread Eugenio Pérez
At this mode no buffer forwarding will be performed in SVQ mode: Qemu just forward the guest's kicks to the device. Shadow virtqueue notifications forwarding is disabled when vhost_dev stops, so code flow follows usual cleanup. Also, host notifiers must be disabled at SVQ start, and they will not

[RFC PATCH v5 16/26] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call

2021-10-29 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 64f71bd51b..89d77f3452 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -758,16 +

[RFC PATCH v5 17/26] vhost: Route host->guest notification through shadow virtqueue

2021-10-29 Thread Eugenio Pérez
This will make qemu aware of the device used buffers, allowing it to write the guest memory with its contents if needed. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 15 +++ hw/virtio/vhost-vdpa.c | 13 + 2 files changed, 28 insertions

[RFC PATCH v5 23/26] util: Add iova_tree_alloc

2021-10-29 Thread Eugenio Pérez
This iova tree function allows it to look for a hole in allocated regions and return a totally new translation for a given translated address. It's usage is mainly to allow devices to access qemu address space, remapping guest's one into a new iova space where qemu can add chunks of addresses. Si

[RFC PATCH v5 20/26] vhost: Add vhost_svq_valid_device_features to shadow vq

2021-10-29 Thread Eugenio Pérez
This allows it to test if the guest has aknowledge an invalid transport feature for SVQ. This will include packed vq layout, invalid descriptors or event idx at the moment we start forwarding buffers. We don't check for device features here since they will be re-negotiated again. This allows SVQ t

[RFC PATCH v5 21/26] vhost: Add vhost_svq_valid_guest_features to shadow vq

2021-10-29 Thread Eugenio Pérez
This allows it to test if the guest has aknowledge an invalid transport feature for SVQ. This will include packed vq layout or event_idx, where VirtIO device needs help from SVQ. There is not needed at this moment, but since SVQ will not re-negotiate features again with the guest, a failure in ack

[RFC PATCH v5 25/26] vhost: Use a tree to store memory mappings

2021-10-29 Thread Eugenio Pérez
Track memory translations of devices with IOMMU (all vhost-vdpa devices at the moment). It does not work if device has restrictions in its iova range at the moment. Updates to tree are protected by BQL, each one always run from main event loop context. Signed-off-by: Eugenio Pérez --- include/h

[RFC PATCH v5 18/26] virtio: Add vhost_shadow_vq_get_vring_addr

2021-10-29 Thread Eugenio Pérez
It reports the shadow virtqueue address from qemu virtual address space. Since this will be different from the guest's vaddr, but device can access it, SVQ takes special care about its alignment & lack of garbage data. It assumes that IOMMU will work in host_page_size ranges for that. Signed-off-

[RFC PATCH v5 26/26] vdpa: Add custom IOTLB translations to SVQ

2021-10-29 Thread Eugenio Pérez
Use translations added in VhostIOVATree in SVQ. Now every element needs to remember the iova / GPA address also, so VirtQueue can consume the elements properly. This adds a little overhead per VQ element, having to allocate more memory to stash them. As a possible optimization, this allocation co

[RFC PATCH v5 19/26] vdpa: ack VIRTIO_F_QUEUE_STATE if device supports it

2021-10-29 Thread Eugenio Pérez
This is needed to enable or disable SVQ. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index c2580693b3..fc8396ba8a 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@

Re: [PATCH v4 14/30] Hexagon HVX (target/hexagon) helper overrides for histogram instructions

2021-10-29 Thread Richard Henderson
On 10/12/21 3:10 AM, Taylor Simpson wrote: Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 106 +++ 1 file changed, 106 insertions(+) Reviewed-by: Richard Henderson r~

[RFC PATCH v5 22/26] vhost: Shadow virtqueue buffers forwarding

2021-10-29 Thread Eugenio Pérez
Initial version of shadow virtqueue that actually forward buffers. There are no iommu support at the moment, and that will be addressed in future patches of this series. Since all vhost-vdpa devices uses forced IOMMU, this means that SVQ is not usable at this point of the series on any device. For

Re: [PATCH v4 19/30] Hexagon HVX (target/hexagon) helper overrides - vector logical ops

2021-10-29 Thread Richard Henderson
On 10/12/21 3:10 AM, Taylor Simpson wrote: Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg_hvx.h | 42 ++ 1 file changed, 42 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH v4 10/30] Hexagon HVX (target/hexagon) instruction utility functions

2021-10-29 Thread Richard Henderson
On 10/12/21 3:10 AM, Taylor Simpson wrote: +void mem_vector_scatter_init(CPUHexagonState *env, int slot, + target_ulong base_vaddr, + int length, int element_size) +{ +int i; + +for (i = 0; i < sizeof(MMVector); i++) { +env->

[RFC PATCH v5 24/26] vhost: Add VhostIOVATree

2021-10-29 Thread Eugenio Pérez
This tree is able to look for a translated address from an IOVA address. At first glance is similar to util/iova-tree. However, SVQ working on devices with limited IOVA space need more capabilities, like allocating IOVA chunks or perform reverse translations (qemu addresses to iova). The allocati

Re: [PATCH v4 27/30] Hexagon HVX (tests/tcg/hexagon) vector_add_int test

2021-10-29 Thread Richard Henderson
On 10/12/21 3:11 AM, Taylor Simpson wrote: Signe-off-by: Taylor Simpson "Signed" Reviewed-by: Richard Henderson r~

<    1   2   3   4   5   >