Re: [PATCH v2 6/8] x86: add support for KVM_CAP_XSAVE2 and AMX state migration

2022-02-24 Thread Yang Zhong
On Mon, Feb 21, 2022 at 01:25:53PM +, David Edmondson wrote: > On Wednesday, 2022-02-16 at 22:04:32 -08, Yang Zhong wrote: > > > From: Jing Liu > > > > When dynamic xfeatures (e.g. AMX) are used by the guest, the xsave > > area would be larger than 4KB. KVM_GET_XSAVE2 and KVM_SET_XSAVE > >

Re: [PATCH v2 4/8] x86: Add XFD faulting bit for state components

2022-02-24 Thread Yang Zhong
On Mon, Feb 21, 2022 at 01:00:41PM +, David Edmondson wrote: > On Wednesday, 2022-02-16 at 22:04:30 -08, Yang Zhong wrote: > > > From: Jing Liu > > > > Intel introduces XFD faulting mechanism for extended > > XSAVE features to dynamically enable the features in > > runtime. If CPUID

Re: [PATCH v2] Added parameter to take screenshot with screendump as PNG

2022-02-24 Thread Kshitij Suri
On 24/02/22 9:48 pm, Daniel P. Berrangé wrote: On Thu, Feb 24, 2022 at 11:59:08AM +, Kshitij Suri wrote: Currently screendump only supports PPM format, which is un-compressed and not standard. Added a "format" parameter to qemu monitor screendump capabilites to support PNG image capture

Re: [PATCH v2] Added parameter to take screenshot with screendump as PNG

2022-02-24 Thread Kshitij Suri
On 24/02/22 9:32 pm, Eric Blake wrote: On Thu, Feb 24, 2022 at 11:59:08AM +, Kshitij Suri wrote: Currently screendump only supports PPM format, which is un-compressed and not standard. Added a "format" parameter to qemu monitor screendump capabilites to support PNG image capture using

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 08:34:40PM +, Joao Martins wrote: > On 2/24/22 20:12, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: > >> On 2/24/22 19:54, Michael S. Tsirkin wrote: > >>> On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: >

Fix a potential Use-after-free in test_blockjob_common_drain_node() (v6.2.0).

2022-02-24 Thread wliang
Hi all, I find a potential Use-after-free in QEMU 6.2.0, which is in test_blockjob_common_drain_node() (./tests/unit/test-bdrv-drain.c). Specifically, at line 880, the variable 'scr' is released by the bdrv_unref(). However, at line 881, it is subsequently used as the 1st parameter of the

Re: [RFC PATCH 3/4] hw/ppc: Take nested guest into account when saving timebase

2022-02-24 Thread David Gibson
On Thu, Feb 24, 2022 at 03:58:16PM -0300, Fabiano Rosas wrote: > When saving the guest "timebase" we look to the first_cpu for its > tb_offset. If that CPU happens to be running a nested guest at this > time, the tb_offset will have the nested guest value. > > This was caught by code inspection.

Re: [PATCH] aio-posix: fix spurious ->poll_ready() callbacks in main loop

2022-02-24 Thread Jason Wang
在 2022/2/23 下午11:57, Stefan Hajnoczi 写道: When ->poll() succeeds the AioHandler is placed on the ready list with revents set to the magic value 0. This magic value causes aio_dispatch_handler() to invoke ->poll_ready() instead of ->io_read() for G_IO_IN or ->io_write() for G_IO_OUT. This magic

Re: Re: Fix a potential Use-after-free bug in handle_simd_shift_fpint_conv() (v6.2.0).

2022-02-24 Thread wliang
> > The fix is correct. We just need the submission formatted properly, with > your > Signed-off-by tag. When re-formatting, you can add my > > Reviewed-by: Richard Henderson > > r~ Hi guys, Thank you for waiting for me. Here is a new patch with Signed-off-by tags. Best, Wentao From

Re: [PATCH v6 01/19] configure, meson: override C compiler for cmake

2022-02-24 Thread Jag Raman
> On Feb 24, 2022, at 12:52 PM, Paolo Bonzini wrote: > > On 2/22/22 20:05, Jag Raman wrote: >>> -defaults[prefix + 'COMPILER'] = exe_list >>> +defaults[f'{prefix}COMPILER'] = [exe_list[0]] >>> +for i in range(1, len(exe_list)): >>> +

Re: Fix a potential Use-after-free in virtio_iommu_handle_command() (v6.2.0).

2022-02-24 Thread wliang
Hi all, Here is a new patch with Signed-off-by tags. The old one is wrong for it did't have Signed-off-by tags. I am looking forward to your confirmation. Thanks, Wentao From 8ece42bda1099a9a0df584cac2478ec5a6e83924 Mon Sep 17 00:00:00 2001 From: Wentao_Liang Date: Fri, 25 Feb 2022 11:49:54

Re: [RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG)

2022-02-24 Thread David Gibson
On Thu, Feb 24, 2022 at 09:00:24PM +, Mark Cave-Ayland wrote: > On 24/02/2022 18:58, Fabiano Rosas wrote: > > > This series implements the migration for a TCG pseries guest running a > > nested KVM guest. This is just like migrating a pseries TCG guest, but > > with some extra state to allow

Re: [RFC PATCH 4/4] spapr: Add KVM-on-TCG migration support

2022-02-24 Thread David Gibson
On Thu, Feb 24, 2022 at 03:58:17PM -0300, Fabiano Rosas wrote: > This adds migration support for TCG pseries machines running a KVM-HV > guest. > > The state that needs to be migrated is: > > - the nested PTCR value; > - the in_nested flag; > - the nested_tb_offset. > - the saved host

Re: [RFC PATCH 1/4] target/ppc: TCG: Migrate tb_offset and decr

2022-02-24 Thread David Gibson
On Thu, Feb 24, 2022 at 03:58:14PM -0300, Fabiano Rosas wrote: > These two were not migrated so the remote end was starting with the > decrementer expired. > > I am seeing less frequent crashes with this patch (tested with -smp 4 > and -smp 32). It certainly doesn't fix all issues but it looks

Re: [RFC PATCH 2/4] spapr: TCG: Migrate spapr_cpu->prod

2022-02-24 Thread David Gibson
On Thu, Feb 24, 2022 at 03:58:15PM -0300, Fabiano Rosas wrote: > I'm seeing some stack traces in the migrated guest going through cede > and some hangs at the plpar_hcall_norets so let's make sure everything > related to cede/prod is being migrated just in case. This is a poor approach in

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Jason Wang
On Fri, Feb 25, 2022 at 2:30 AM Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: > > On 2/24/22 17:23, Michael S. Tsirkin wrote: > > > On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: > > >> On 2/23/22 23:35, Joao Martins wrote: > > >>> On

Re: [PATCH v2] target/arm: Support PSCI 1.1 and SMCCC 1.0

2022-02-24 Thread Akihiko Odaki
On 2022/02/24 21:53, Peter Maydell wrote: On Sun, 13 Feb 2022 at 03:58, Akihiko Odaki wrote: Support the latest PSCI on TCG and HVF. A 64-bit function called from AArch32 now returns NOT_SUPPORTED, which is necessary to adhere to SMC Calling Convention 1.0. It is still not compliant with

Re: Fix a potential memory leak bug in write_boot_rom() (v6.2.0).

2022-02-24 Thread wliang
> > yes. Could you please send a patch using g_autofree ? > > Thanks, > > C. Here is the new patch. Thanks, WentaoFrom 8ed76446f78ab1b4152403fdb9dd6f349d6fd52e Mon Sep 17 00:00:00 2001 From: Wentao_Liang Date: Fri, 25 Feb 2022 11:17:33 +0800 Subject: [PATCH] Fix a potential memory leak

RE: [PATCH] vl: transform QemuOpts device to JSON syntax device

2022-02-24 Thread Duan, Zhenzhong
>-Original Message- >From: Kevin Wolf >Sent: Thursday, February 24, 2022 7:31 PM >To: Duan, Zhenzhong >Cc: qemu-devel@nongnu.org; pbonz...@redhat.com; ebl...@redhat.com; >m...@redhat.com; pkre...@redhat.com; ler...@redhat.com >Subject: Re: [PATCH] vl: transform QemuOpts device to JSON

Re: [PATCH] accel/tcg/cpu-exec: fix precise single-stepping after interrupt

2022-02-24 Thread Richard Henderson
On 2/24/22 14:23, Richard Henderson wrote: On 2/14/22 03:26, Luc Michel wrote: In some cases, cpu->exit_request can be false after handling the interrupt, leading to another TB being executed instead of returning to the main loop. Fix this by returning true unconditionally when in single-step

Re: [RFC PATCH 4/4] spapr: Add KVM-on-TCG migration support

2022-02-24 Thread Nicholas Piggin
Excerpts from Fabiano Rosas's message of February 25, 2022 4:58 am: > This adds migration support for TCG pseries machines running a KVM-HV > guest. > > The state that needs to be migrated is: > > - the nested PTCR value; > - the in_nested flag; > - the nested_tb_offset. > - the saved host

Re: [PATCH] accel/tcg/cpu-exec: fix precise single-stepping after interrupt

2022-02-24 Thread Richard Henderson
On 2/14/22 03:26, Luc Michel wrote: In some cases, cpu->exit_request can be false after handling the interrupt, leading to another TB being executed instead of returning to the main loop. Fix this by returning true unconditionally when in single-step mode. Fixes:

Re: [PATCH v2 14/14] target: Use ArchCPU as interface to target CPU

2022-02-24 Thread Richard Henderson
On 2/14/22 08:31, Philippe Mathieu-Daudé wrote: ArchCPU is our interface with target-specific code. Use it as a forward-declared opaque pointer (abstract type), having its structure defined by each target. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 4 ++--

Re: [PATCH v2 13/14] target: Introduce and use OBJECT_DECLARE_CPU_TYPE() macro

2022-02-24 Thread Richard Henderson
On 2/14/22 08:31, Philippe Mathieu-Daudé wrote: Replace the boilerplate code to declare CPU QOM types and macros, and forward-declare the CPU instance type. Signed-off-by: Philippe Mathieu-Daudé --- Reviewed-by: Richard Henderson r~

Re: [PATCH v2 10/14] target/hexagon: Add missing 'hw/core/cpu.h' include

2022-02-24 Thread Richard Henderson
On 2/14/22 08:31, Philippe Mathieu-Daudé wrote: HexagonCPU field parent_class is of type CPUClass, which is declared in "hw/core/cpu.h". Signed-off-by: Philippe Mathieu-Daudé --- target/hexagon/cpu.h | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 2/4] target/nios2: Exteral Interrupt Controller (EIC)

2022-02-24 Thread Richard Henderson
On 2/24/22 03:48, Amir Gonnen wrote: +static void nios2_cpu_set_eic_irq(Nios2CPU *cpu, int level) +{ +CPUNios2State *env = >env; +CPUState *cs = CPU(cpu); + +env->irq_pending = level; + +if (env->irq_pending && nios2_take_eic_irq(cpu)) { +env->irq_pending = 0; +

Re: [PATCH v2 1/4] target/nios2: Shadow register set

2022-02-24 Thread Richard Henderson
On 2/24/22 03:48, Amir Gonnen wrote: +void helper_eret(CPUNios2State *env, uint32_t new_pc) +{ +uint32_t crs = cpu_get_crs(env); +if (crs == 0) { +env->regs[CR_STATUS] = env->regs[CR_ESTATUS]; +} else { +env->regs[CR_STATUS] = env->regs[R_SSTATUS]; +} +

Re: [PATCH] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM)

2022-02-24 Thread Philippe Mathieu-Daudé
On 24/2/22 22:22, Stefan Weil wrote: Am 07.01.22 um 16:49 schrieb Stefan Weil: Signed-off-by: Stefan Weil --- LGTM has some more alerts which need attention: https://lgtm.com/projects/g/qemu/qemu/ Regards, Stefan   subprojects/libvhost-user/libvhost-user.c | 2 +-   1 file changed, 1

Re: [PATCH v2 1/4] target/nios2: Shadow register set

2022-02-24 Thread Richard Henderson
On 2/24/22 03:48, Amir Gonnen wrote: @@ -88,7 +93,9 @@ struct Nios2CPUClass { #define CR_STATUS_IH (1 << 3) #define CR_STATUS_IL (63 << 4) #define CR_STATUS_CRS (63 << 10) +#define CR_STATUS_CRS_OFFSET 10 #define CR_STATUS_PRS (63 << 16) +#define CR_STATUS_PRS_OFFSET 16

Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround

2022-02-24 Thread Marc-André Lureau
Hi On Fri, Feb 25, 2022 at 1:41 AM Stefan Weil wrote: > Am 24.02.22 um 20:12 schrieb Peter Maydell: > > > On Thu, 24 Feb 2022 at 18:38, wrote: > >> From: Marc-André Lureau > >> > >> This workaround was added in commit 95df51a4 ("w32: Always use standard > >> instead of native format

Re: [PATCH v13 4/4] target/ppc: trigger PERFM EBBs from power8-pmu.c

2022-02-24 Thread Richard Henderson
On 2/24/22 10:19, Daniel Henrique Barboza wrote: +void helper_ebb_perfm_excp(CPUPPCState *env) Please reserve the prefix "helper_" for something that is called from tcg generated code, which this is not. r~

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Alex Williamson
On Thu, 24 Feb 2022 20:34:40 + Joao Martins wrote: > On 2/24/22 20:12, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: > >> On 2/24/22 19:54, Michael S. Tsirkin wrote: > >>> On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: >

Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround

2022-02-24 Thread Stefan Weil
Am 24.02.22 um 20:12 schrieb Peter Maydell: On Thu, 24 Feb 2022 at 18:38, wrote: From: Marc-André Lureau This workaround was added in commit 95df51a4 ("w32: Always use standard instead of native format strings"), as it claimed glib was using __printf__ attribute. This is surprising, since

Re: [PATCH v13 1/4] target/ppc: make power8-pmu.c CONFIG_TCG only

2022-02-24 Thread Richard Henderson
On 2/24/22 10:18, Daniel Henrique Barboza wrote: This is an exclusive TCG helper. Gating it with CONFIG_TCG and changing meson.build accordingly will prevent problems --disable-tcg and --disable-linux-user later on. We're also changing the uses of !kvm_enabled() to tcg_enabled() to avoid adding

Re: [PATCH v4 24/47] target/ppc: move vrl[bhwd]nm/vrl[bhwd]mi to decodetree

2022-02-24 Thread Richard Henderson
On 2/24/22 10:23, Matheus K. Ferst wrote: You don't want to use tcg_gen_rotlv_vec directly, but tcg_gen_rotlv_vec. I guess there is a typo here. Did you mean tcg_gen_gvec_rotlv? Or tcg_gen_rotlv_mod_vec? Dangit. Paste-paste error. The first: tcg_gen_gvec_rotlv. r~

Re: [PATCH v4 38/47] target/ppc: Refactor VSX_SCALAR_CMP_DP

2022-02-24 Thread Richard Henderson
On 2/24/22 09:16, Víctor Colombo wrote: Could you please elaborate more on how do you think using float*_compare and its FloatRelation result would work here? I noticed do_scalar_cmp modifies CR and sets FPCC flag, which is not what VSX_SCALAR_CMP do. Using that function would require a rework.

Re: [PATCH] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM)

2022-02-24 Thread Stefan Weil
Am 07.01.22 um 16:49 schrieb Stefan Weil: Signed-off-by: Stefan Weil --- LGTM has some more alerts which need attention: https://lgtm.com/projects/g/qemu/qemu/ Regards, Stefan subprojects/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG)

2022-02-24 Thread Mark Cave-Ayland
On 24/02/2022 18:58, Fabiano Rosas wrote: This series implements the migration for a TCG pseries guest running a nested KVM guest. This is just like migrating a pseries TCG guest, but with some extra state to allow a nested guest to continue to run on the destination. Unfortunately the regular

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/24/22 20:12, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: >> On 2/24/22 19:54, Michael S. Tsirkin wrote: >>> On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: On 2/24/22 18:30, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022

Re: [PATCH v4 24/47] target/ppc: move vrl[bhwd]nm/vrl[bhwd]mi to decodetree

2022-02-24 Thread Matheus K. Ferst
On 23/02/2022 19:19, Richard Henderson wrote: On 2/23/22 11:43, Matheus K. Ferst wrote: Note that rotlv does the masking itself: /*   * Expand D = A << (B % element bits)   *   * Unlike scalar shifts, where it is easy for the target front end   * to include the modulo as part of the expansion. 

[PATCH v13 4/4] target/ppc: trigger PERFM EBBs from power8-pmu.c

2022-02-24 Thread Daniel Henrique Barboza
This patch adds the EBB exception support that are triggered by Performance Monitor alerts. This happens when a Performance Monitor alert occurs and MMCR0_EBE, BESCR_PME and BESCR_GE are set. fire_PMC_interrupt() will execute a new ebb_perfm_excp() helper that will check for MMCR0_EBE, BESCR_PME

[PATCH v13 1/4] target/ppc: make power8-pmu.c CONFIG_TCG only

2022-02-24 Thread Daniel Henrique Barboza
This is an exclusive TCG helper. Gating it with CONFIG_TCG and changing meson.build accordingly will prevent problems --disable-tcg and --disable-linux-user later on. We're also changing the uses of !kvm_enabled() to tcg_enabled() to avoid adding "defined(CONFIG_TCG)" ifdefs, since tcg_enabled()

[PATCH v13 2/4] target/ppc: finalize pre-EBB PMU logic

2022-02-24 Thread Daniel Henrique Barboza
There are still PMU exclusive bits to handle in fire_PMC_interrupt() before implementing the EBB support. Let's finalize it now to avoid dealing with PMU and EBB logic at the same time in the next patches. fire_PMC_interrupt() will fire an Performance Monitor alert depending on MMCR0_PMAE. If we

[PATCH v13 3/4] target/ppc: add PPC_INTERRUPT_EBB and EBB exceptions

2022-02-24 Thread Daniel Henrique Barboza
PPC_INTERRUPT_EBB is a new interrupt that will be used to deliver EBB exceptions that had to be postponed because the thread wasn't in problem state at the time the event-based branch was supposed to occur. ISA 3.1 also defines two EBB exceptions: Performance Monitor EBB exception and External

[PATCH v13 0/4] PMU-EBB support for PPC64 TCG

2022-02-24 Thread Daniel Henrique Barboza
Hi, This new version contains a change in patch 1 (former 2) that was proposed by Richard in the v12 review. Changes from v12: - former patch 1: dropped, no longer applicable - patch 1 (former 2): * use tcg_enabled() instead of !kvm_enabled() to avoid defined(CONFIG_TCG) ifdefs - v12 link:

Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround

2022-02-24 Thread Peter Maydell
On Thu, 24 Feb 2022 at 19:50, Marc-André Lureau wrote: > On Thu, Feb 24, 2022 at 11:23 PM Peter Maydell > wrote: >> You're probably building with a newer glib, and possibly also >> a newer mingw. >> >> I've cc'd Stefan Weil who might know whether we can drop this >> workaround as far as the

Re: [PATCH v12 2/5] target/ppc: make power8-pmu.c CONFIG_TCG only

2022-02-24 Thread Daniel Henrique Barboza
On 2/17/22 19:17, Richard Henderson wrote: On 2/16/22 21:10, Daniel Henrique Barboza wrote:   static void init_tcg_pmu_power8(CPUPPCState *env)   { -#if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY) +#if defined(CONFIG_TCG)   /* Init PMU overflow timers */   if (!kvm_enabled())

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 08:04:48PM +, Joao Martins wrote: > > > On 2/24/22 19:54, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: > >> On 2/24/22 18:30, Michael S. Tsirkin wrote: > >>> On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: >

Re: [RFC PATCH 1/4] target/ppc: TCG: Migrate tb_offset and decr

2022-02-24 Thread Richard Henderson
On 2/24/22 08:58, Fabiano Rosas wrote: These two were not migrated so the remote end was starting with the decrementer expired. I am seeing less frequent crashes with this patch (tested with -smp 4 and -smp 32). It certainly doesn't fix all issues but it looks like it helps. Signed-off-by:

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/24/22 19:54, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: >> On 2/24/22 18:30, Michael S. Tsirkin wrote: >>> On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: On 2/24/22 17:23, Michael S. Tsirkin wrote: > On Thu, Feb 24,

Re: [PATCH 11/12] util: remove the net/net.h dependency

2022-02-24 Thread Richard Henderson
On 2/24/22 08:37, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Move qemu_ether_ntoa() which is only needed in net/. Signed-off-by: Marc-André Lureau --- include/qemu-common.h | 1 - net/announce.c| 13 + util/cutils.c | 14 -- 3 files

Re: [PATCH 12/12] qapi: remove needless include

2022-02-24 Thread Richard Henderson
On 2/24/22 08:37, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- qapi/qmp-dispatch.c | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 10/12] util: remove needless includes

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- util/cutils.c | 2 -- 1 file changed, 2 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 03/12] osdep.h: move qemu_build_not_reached()

2022-02-24 Thread Marc-André Lureau
Hi On Thu, Feb 24, 2022 at 11:43 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Move the macro and declaration so it can use glib in the following > > patch. > > > > Signed-off-by: Marc-André

Re: [PATCH 08/12] Move HOST_LONG_BITS to compiler.h

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau This will help to make common code independent. Signed-off-by: Marc-André Lureau --- include/qemu/compiler.h | 3 +++ include/qemu/osdep.h| 3 --- 2 files changed, 3 insertions(+), 3 deletions(-)

Re: [PATCH 06/12] Replace config-time define HOST_WORDS_BIGENDIAN

2022-02-24 Thread Marc-André Lureau
Hi On Thu, Feb 24, 2022 at 11:41 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Replace a config-time define with a compile time condition > > define (compatible with clang and gcc) that must

Re: [PATCH 07/12] Simplify HOST_LONG_BITS

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: -#if UINTPTR_MAX == UINT32_MAX -# define HOST_LONG_BITS 32 -#elif UINTPTR_MAX == UINT64_MAX -# define HOST_LONG_BITS 64 -#else -# error Unknown pointer size -#endif +#define HOST_LONG_BITS (__SIZEOF_POINTER__ * 8) I guess. I'll note that

Re: [PATCH 04/12] compiler.h: replace QEMU_NORETURN with G_NORETURN

2022-02-24 Thread Marc-André Lureau
Hi On Thu, Feb 24, 2022 at 11:37 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in > > glib-compat. > > > > Note that this

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 07:44:26PM +, Joao Martins wrote: > On 2/24/22 18:30, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: > >> On 2/24/22 17:23, Michael S. Tsirkin wrote: > >>> On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: >

Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround

2022-02-24 Thread Marc-André Lureau
Hi Peter On Thu, Feb 24, 2022 at 11:23 PM Peter Maydell wrote: > On Thu, 24 Feb 2022 at 18:38, wrote: > > > > From: Marc-André Lureau > > > > This workaround was added in commit 95df51a4 ("w32: Always use standard > > instead of native format strings"), as it claimed glib was using > >

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Joao Martins
On 2/24/22 18:30, Michael S. Tsirkin wrote: > On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: >> On 2/24/22 17:23, Michael S. Tsirkin wrote: >>> On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: On 2/23/22 23:35, Joao Martins wrote: > On 2/23/22 21:22, Michael S.

Re: [PATCH 03/12] osdep.h: move qemu_build_not_reached()

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Move the macro and declaration so it can use glib in the following patch. Signed-off-by: Marc-André Lureau --- include/qemu/compiler.h | 16 include/qemu/osdep.h| 16 2 files

Re: [PATCH 06/12] Replace config-time define HOST_WORDS_BIGENDIAN

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Replace a config-time define with a compile time condition define (compatible with clang and gcc) that must be declared prior to its usage. This avoids having a global configure time define, but also prevents from bad

Re: [PATCH 02/12] compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau --- include/qemu/compiler.h| 2 --

Re: [PATCH 04/12] compiler.h: replace QEMU_NORETURN with G_NORETURN

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in glib-compat. Note that this attribute must be placed before the function declaration (bringing a bit of consistency in qemu codebase usage).

Re: [PATCH 01/12] compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT

2022-02-24 Thread Richard Henderson
On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau --- include/qemu-common.h | 2 +-

Re: [PATCH 0/5] Fixups for PMBus and new sensors

2022-02-24 Thread Patrick Venture
On Thu, Jan 6, 2022 at 3:09 PM Titus Rwantare wrote: > This patch series contains updates to PMBus in QEMU along with some PMBus > device models for Renesas regulators. > I have also added myself to MAINTAINERS as this code is in use daily, > where I am responsible for it. > > Shengtan Mao (1):

Re: [PATCH v4 38/47] target/ppc: Refactor VSX_SCALAR_CMP_DP

2022-02-24 Thread Víctor Colombo
On 22/02/2022 21:20, Richard Henderson wrote:> On 2/22/22 04:36, matheus.fe...@eldorado.org.br wrote: From: Víctor Colombo Refactor VSX_SCALAR_CMP_DP, changing its name to VSX_SCALAR_CMP and prepare the helper to be used for quadword comparisons. Signed-off-by: Víctor Colombo Signed-off-by:

Re: [PATCH 11/12] util: remove the net/net.h dependency

2022-02-24 Thread Peter Maydell
On Thu, 24 Feb 2022 at 18:39, wrote: > > From: Marc-André Lureau > > Move qemu_ether_ntoa() which is only needed in net/. > > Signed-off-by: Marc-André Lureau > --- Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v2] hw/i2c: flatten pca954x mux device

2022-02-24 Thread Patrick Venture
On Thu, Feb 24, 2022 at 2:56 AM Peter Maydell wrote: > On Wed, 2 Feb 2022 at 17:57, Patrick Venture wrote: > > > > Previously this device created N subdevices which each owned an i2c bus. > > Now this device simply owns the N i2c busses directly. > > > > Tested: Verified devices behind mux are

[RESEND PATCH v3 1/1] multifd: Remove some redundant code

2022-02-24 Thread Li Zhang
Clean up some unnecessary code Signed-off-by: Li Zhang --- migration/multifd.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 3242f688e5..d44cc6670f 100644 --- a/migration/multifd.c +++ b/migration/multifd.c

Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround

2022-02-24 Thread Peter Maydell
On Thu, 24 Feb 2022 at 18:38, wrote: > > From: Marc-André Lureau > > This workaround was added in commit 95df51a4 ("w32: Always use standard > instead of native format strings"), as it claimed glib was using > __printf__ attribute. This is surprising, since glib has always used > G_GNUC_PRINTF

Re: [PATCH 0/5] Fixups for PMBus and new sensors

2022-02-24 Thread Corey Minyard
On Thu, Feb 24, 2022 at 10:58:52AM -0800, Patrick Venture wrote: > On Thu, Jan 6, 2022 at 3:09 PM Titus Rwantare wrote: > > > This patch series contains updates to PMBus in QEMU along with some PMBus > > device models for Renesas regulators. > > I have also added myself to MAINTAINERS as this

Re: [PATCH V7 05/29] vl: start on wakeup request

2022-02-24 Thread Dr. David Alan Gilbert
* Steve Sistare (steven.sist...@oracle.com) wrote: > If qemu starts and loads a VM in the suspended state, then a later wakeup > request will set the state to running, which is not sufficient to initialize > the vm, as vm_start was never called during this invocation of qemu. See >

[RFC PATCH 4/4] spapr: Add KVM-on-TCG migration support

2022-02-24 Thread Fabiano Rosas
This adds migration support for TCG pseries machines running a KVM-HV guest. The state that needs to be migrated is: - the nested PTCR value; - the in_nested flag; - the nested_tb_offset. - the saved host CPUPPCState structure; Signed-off-by: Fabiano Rosas --- (this migrates just fine with L2

[PATCH v4] tests/qtest: add qtests for npcm7xx sdhci

2022-02-24 Thread Hao Wu
From: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Chris Rauer Signed-off-by: Shengtan Mao Signed-off-by: Patrick Venture Signed-off-by: Hao Wu --- v4: * use strncmp to compare fixed length strings v3: * fixup compilation from missing macro value v2: * update copyright year * check

[RFC PATCH 3/4] hw/ppc: Take nested guest into account when saving timebase

2022-02-24 Thread Fabiano Rosas
When saving the guest "timebase" we look to the first_cpu for its tb_offset. If that CPU happens to be running a nested guest at this time, the tb_offset will have the nested guest value. This was caught by code inspection. Signed-off-by: Fabiano Rosas --- hw/ppc/ppc.c | 17 -

[PATCH 12/12] qapi: remove needless include

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- qapi/qmp-dispatch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index d378bccac73b..0990873ec8ec 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -21,7 +21,6 @@ #include

[RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG)

2022-02-24 Thread Fabiano Rosas
This series implements the migration for a TCG pseries guest running a nested KVM guest. This is just like migrating a pseries TCG guest, but with some extra state to allow a nested guest to continue to run on the destination. Unfortunately the regular TCG migration scenario (not nested) is not

[PATCH 11/12] util: remove the net/net.h dependency

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Move qemu_ether_ntoa() which is only needed in net/. Signed-off-by: Marc-André Lureau --- include/qemu-common.h | 1 - net/announce.c| 13 + util/cutils.c | 14 -- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git

[RFC PATCH 2/4] spapr: TCG: Migrate spapr_cpu->prod

2022-02-24 Thread Fabiano Rosas
I'm seeing some stack traces in the migrated guest going through cede and some hangs at the plpar_hcall_norets so let's make sure everything related to cede/prod is being migrated just in case. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_cpu_core.c | 1 +

Re: [PATCH V7 02/29] migration: fix populate_vfio_info

2022-02-24 Thread Peter Maydell
On Wed, 22 Dec 2021 at 19:45, Steve Sistare wrote: > > Include CONFIG_DEVICES so that populate_vfio_info is instantiated for > CONFIG_VFIO. The commit message says "include CONFIG_DEVICES"... > Signed-off-by: Steve Sistare > --- > migration/target.c | 10 +++--- > 1 file changed, 7

Re: [PATCH v3] tests/qtest: add qtests for npcm7xx sdhci

2022-02-24 Thread Hao Wu
The problem is probably because we read it in using "strcmp". strcmp compares two strings that end with "\0". But one of the string is read in using read() so it didn't read in the ending '\0' character. We should use strncmp to compare the two strings. It probably avoids the issue. On Tue, Feb

[RFC PATCH 1/4] target/ppc: TCG: Migrate tb_offset and decr

2022-02-24 Thread Fabiano Rosas
These two were not migrated so the remote end was starting with the decrementer expired. I am seeing less frequent crashes with this patch (tested with -smp 4 and -smp 32). It certainly doesn't fix all issues but it looks like it helps. Signed-off-by: Fabiano Rosas --- target/ppc/machine.c |

[PATCH 04/12] compiler.h: replace QEMU_NORETURN with G_NORETURN

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in glib-compat. Note that this attribute must be placed before the function declaration (bringing a bit of consistency in qemu codebase usage). Signed-off-by: Marc-André Lureau ---

[PATCH 10/12] util: remove needless includes

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- util/cutils.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/util/cutils.c b/util/cutils.c index c9b91e7535a8..53346138c970 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -27,8 +27,6 @@ #include #include "qemu-common.h"

[PATCH 07/12] Simplify HOST_LONG_BITS

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Simplify the macro, not depending on headers defines, but compiler predefined __SIZEOF__POINTER__ only. Available since gcc 4.3 and clang 2.8. Signed-off-by: Marc-André Lureau --- include/qemu/osdep.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff

[PATCH 03/12] osdep.h: move qemu_build_not_reached()

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Move the macro and declaration so it can use glib in the following patch. Signed-off-by: Marc-André Lureau --- include/qemu/compiler.h | 16 include/qemu/osdep.h| 16 2 files changed, 16 insertions(+), 16 deletions(-) diff --git

[PATCH 09/12] scripts/modinfo-collect: remove unused/dead code

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- scripts/modinfo-collect.py | 5 - 1 file changed, 5 deletions(-) diff --git a/scripts/modinfo-collect.py b/scripts/modinfo-collect.py index 61b90688c6dc..4e7584df6676 100755 --- a/scripts/modinfo-collect.py +++

[PATCH 08/12] Move HOST_LONG_BITS to compiler.h

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau This will help to make common code independent. Signed-off-by: Marc-André Lureau --- include/qemu/compiler.h | 3 +++ include/qemu/osdep.h| 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index

[PATCH 06/12] Replace config-time define HOST_WORDS_BIGENDIAN

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Replace a config-time define with a compile time condition define (compatible with clang and gcc) that must be declared prior to its usage. This avoids having a global configure time define, but also prevents from bad usage, if the config header wasn't included before.

[PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau This workaround was added in commit 95df51a4 ("w32: Always use standard instead of native format strings"), as it claimed glib was using __printf__ attribute. This is surprising, since glib has always used G_GNUC_PRINTF which, as the name implies, uses __gnu_printf__ when

[PATCH 02/12] compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau --- include/qemu/compiler.h| 2 -- include/qom/object.h | 6 +++---

[PATCH 00/12] Misc cleanups

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau Hi, A small collection of patches gleaned while working on different things (more specifically, I am looking at making qapi code usable outside of qemu, many things are twisted together, it takes effort but it is hopefully worth it) Based-on:

[PATCH 01/12] compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT

2022-02-24 Thread marcandre . lureau
From: Marc-André Lureau One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau --- include/qemu-common.h | 2 +- include/qemu/compiler.h| 2 --

Re: [PATCH v3 4/6] i386/pc: relocate 4g start to 1T where applicable

2022-02-24 Thread Michael S. Tsirkin
On Thu, Feb 24, 2022 at 05:54:58PM +, Joao Martins wrote: > On 2/24/22 17:23, Michael S. Tsirkin wrote: > > On Thu, Feb 24, 2022 at 04:07:22PM +, Joao Martins wrote: > >> On 2/23/22 23:35, Joao Martins wrote: > >>> On 2/23/22 21:22, Michael S. Tsirkin wrote: > > +static void

Re: [PATCH V7 01/29] memory: qemu_check_ram_volatile

2022-02-24 Thread Dr. David Alan Gilbert
* Steve Sistare (steven.sist...@oracle.com) wrote: > Add a function that returns an error if any ram_list block represents > volatile memory. > > Signed-off-by: Steve Sistare > --- > include/exec/memory.h | 8 > softmmu/memory.c | 26 ++ > 2 files changed,

Re: [PATCH V7 04/29] migration: simplify savevm

2022-02-24 Thread Dr. David Alan Gilbert
* Steve Sistare (steven.sist...@oracle.com) wrote: > Use qemu_file_open to simplify a few functions in savevm.c. > No functional change. > > Signed-off-by: Steve Sistare So I think this is mostly OK, but a couple of minor tidyups below; so with the tidies and the renames from the previous

Re: [PATCH V7 03/29] migration: qemu file wrappers

2022-02-24 Thread Dr. David Alan Gilbert
* Steve Sistare (steven.sist...@oracle.com) wrote: > Add qemu_file_open and qemu_fd_open to create QEMUFile objects for unix > files and file descriptors. > > Signed-off-by: Steve Sistare > --- > migration/qemu-file-channel.c | 36 >

Re: [PATCH] target/arm: Report KVM's actual PSCI version to guest in dtb

2022-02-24 Thread Richard Henderson
On 2/24/22 03:46, Peter Maydell wrote: When we're using KVM, the PSCI implementation is provided by the kernel, but QEMU has to tell the guest about it via the device tree. Currently we look at the KVM_CAP_ARM_PSCI_0_2 capability to determine if the kernel is providing at least PSCI 0.2, but if

  1   2   3   >