[PATCH] hw/i386/cpu: remove default_cpu_version and simplify

2024-12-07 Thread Ani Sinha
commit 0788a56bd1ae3 ("i386: Make unversioned CPU models be aliases") introduced 'default_cpu_version' for PCMachineClass. This created three categories of CPU models: - Most unversioned CPU models would use version 1 by default. - For machines 4.0.1 and older that do not support cpu model aliase

Re: [PATCH] MAINTAINERS: Add correct email address for Vikram Garhwal

2024-12-07 Thread Francisco Iglesias
On Wed, Dec 04, 2024 at 10:42:05AM -0800, Vikram Garhwal wrote: > Previously, maintainer role was paused due to inactive email id. Commit id: > c009d715721861984c4987bcc78b7ee183e86d75. > > Signed-off-by: Vikram Garhwal Reviewed-by: Francisco Iglesias > --- > MAINTAINERS | 2 ++ > 1 file chan

[PATCH v2] ui/sdl2: reenable the SDL2 Windows keyboard hook procedure

2024-12-07 Thread Volker Rümelin
Windows only: The libSDL2 Windows message loop needs the libSDL2 Windows low level keyboard hook procedure to grab the left and right Windows keys correctly. Reenable the SDL2 Windows keyboard hook procedure. Since SDL2 2.30.4 the SDL2 keyboard hook procedure also filters out the special left Con

Re: [PATCH] tcg: Reset free_temps before tcg_optimize

2024-12-07 Thread Pierrick Bouvier
On 12/7/24 13:47, Richard Henderson wrote: When allocating new temps during tcg_optmize, do not re-use any EBB temps that were used within the TB. We do not have any idea what span of the TB in which the temp was live. Cc: qemu-sta...@nongnu.org Fixes: fb04ab7ddd8 ("tcg/optimize: Lower TCG_COND

Re: [PATCH 1/9] target/arm: Introduce fpst alias for helper.h

2024-12-07 Thread Richard Henderson
On 12/5/24 21:12, Richard Henderson wrote: This allows us to declare that the helper requires a float_status pointer and not a generic void pointer. Signed-off-by: Richard Henderson --- target/arm/helper.h | 4 1 file changed, 4 insertions(+) diff --git a/target/arm/helper.h b/target/a

[PATCH] tcg: Reset free_temps before tcg_optimize

2024-12-07 Thread Richard Henderson
When allocating new temps during tcg_optmize, do not re-use any EBB temps that were used within the TB. We do not have any idea what span of the TB in which the temp was live. Cc: qemu-sta...@nongnu.org Fixes: fb04ab7ddd8 ("tcg/optimize: Lower TCG_COND_TST{EQ,NE} if unsupported") Resolves: https:

Re: [RFC 03/13] rust/cell: add get_mut() method for BqlCell

2024-12-07 Thread Paolo Bonzini
Il sab 7 dic 2024, 16:38 Zhao Liu ha scritto: > Thanks for pointing that out, I really didn't think of that, I > understand how that would break the atomicity of the BQL lock, right? > Yes, but also the function seems unnecessary. > impl fw_cfg_config { > > pub(crate) fn assign_hpet_id() ->

Re: [RFC 05/13] rust: add a bit operation binding for deposit64

2024-12-07 Thread Paolo Bonzini
Il sab 7 dic 2024, 16:43 Zhao Liu ha scritto: > > impl IntegerExt for u64 > > { > > fn deposit(self, start: usize, length: usize, fieldval: u64) -> u64 { > > /* FIXME: Implement a more elegant check with error handling > support? */ > > assert!(length > 0 && length <= 64 - sta

Re: [PATCH] tcg/optimize: Fix constant folding of setcond

2024-12-07 Thread Richard Henderson
On 12/6/24 03:58, wannacu wrote: The `z_mask` field of TCGTemp argument needs to be properly set for the upcoming `fold_setcond_zmask` call This patch resolves issues with running some x86_64 applications (e.g., FontForge, Krita) on riscv64 Signed-off-by: wannacu --- tcg/optimize.c

Re: [RFC 07/13] rust: add bindings for timer

2024-12-07 Thread Zhao Liu
> It might be cleaner to move all of those static inline into timer.c. > I don't see anything performance sensitive there... I agree, thanks! I'll submit a patch to clean up this. Regards, Zhao

Re: [RFC 07/13] rust: add bindings for timer

2024-12-07 Thread Zhao Liu
On Thu, Dec 05, 2024 at 07:46:52PM +0100, Paolo Bonzini wrote: > Date: Thu, 5 Dec 2024 19:46:52 +0100 > From: Paolo Bonzini > Subject: Re: [RFC 07/13] rust: add bindings for timer > > On 12/5/24 07:07, Zhao Liu wrote: > > +impl QEMUTimer { > > +fn new() -> Self { > > +QEMUTimer { > >

Re: [RFC 12/13] rust/timer/hpet: add qdev APIs support

2024-12-07 Thread Zhao Liu
On Thu, Dec 05, 2024 at 07:58:07PM +0100, Paolo Bonzini wrote: > Date: Thu, 5 Dec 2024 19:58:07 +0100 > From: Paolo Bonzini > Subject: Re: [RFC 12/13] rust/timer/hpet: add qdev APIs support > > On 12/5/24 07:07, Zhao Liu wrote: > > Implement QAPI support for HPET device in qdev.rs. > > > > Addit

Re: [RFC 05/13] rust: add a bit operation binding for deposit64

2024-12-07 Thread Zhao Liu
On Thu, Dec 05, 2024 at 05:09:42PM +0100, Paolo Bonzini wrote: > Date: Thu, 5 Dec 2024 17:09:42 +0100 > From: Paolo Bonzini > Subject: Re: [RFC 05/13] rust: add a bit operation binding for deposit64 > > On 12/5/24 07:07, Zhao Liu wrote: > > +pub fn deposit64(value: u64, start: usize, length: usiz

Re: [RFC 03/13] rust/cell: add get_mut() method for BqlCell

2024-12-07 Thread Zhao Liu
On Thu, Dec 05, 2024 at 04:55:47PM +0100, Paolo Bonzini wrote: > Date: Thu, 5 Dec 2024 16:55:47 +0100 > From: Paolo Bonzini > Subject: Re: [RFC 03/13] rust/cell: add get_mut() method for BqlCell > > On 12/5/24 07:07, Zhao Liu wrote: > > The get_mut() is useful when doing compound assignment opera

Re: [RFC 09/13] i386/fw_cfg: move hpet_cfg definition to hpet.c

2024-12-07 Thread Zhao Liu
On Sat, Dec 07, 2024 at 10:16:03AM +0100, Philippe Mathieu-Daudé wrote: > Date: Sat, 7 Dec 2024 10:16:03 +0100 > From: Philippe Mathieu-Daudé > Subject: Re: [RFC 09/13] i386/fw_cfg: move hpet_cfg definition to hpet.c > > On 5/12/24 22:19, Paolo Bonzini wrote: > > On Thu, Dec 5, 2024 at 10:18 PM P

Re: [PATCH 00/31] Prepare GHES driver to support error injection

2024-12-07 Thread Markus Armbruster
Mauro Carvalho Chehab writes: [...] >> However, it doesn't apply for me. What's your base? > > That's weird. Despite my mistake, the series is based on v9.2.0-rc3 > (which was identical to master last time I rebased). Either something conflicting got committed meanwhile, or I screwed up someh

Re: [RFC 09/13] i386/fw_cfg: move hpet_cfg definition to hpet.c

2024-12-07 Thread Zhao Liu
Hi Paolo, Sorry for late reply, On Thu, Dec 05, 2024 at 04:30:15PM +0100, Paolo Bonzini wrote: > Date: Thu, 5 Dec 2024 16:30:15 +0100 > From: Paolo Bonzini > Subject: Re: [RFC 09/13] i386/fw_cfg: move hpet_cfg definition to hpet.c > > On 12/5/24 07:07, Zhao Liu wrote: > > HPET device needs to a

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-07 Thread Julian Ganz
Hi Richard, December 6, 2024 at 11:56 PM, "Richard Henderson" wrote: > On 12/6/24 14:40, Pierrick Bouvier wrote: > > > > > Do we have an architecture agnostic pc representation, or do we have to add > > this for every > target in {arch}_cpu_exec_interrupt? > > > We have CPUClass.get_pc, which

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-07 Thread Julian Ganz
Hi Richard, December 6, 2024 at 8:42 PM, "Richard Henderson" wrote: > On 12/6/24 13:02, Pierrick Bouvier wrote: > > On 12/6/24 00:42, Julian Ganz wrote: > > > IIUC qemu will schedule interrupts "opportunistically" between tb > > > executions. If that's the case we'll observe interrupts exclusivel

Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities

2024-12-07 Thread Julian Ganz
Hi Pierrick, December 6, 2024 at 7:59 PM, "Pierrick Bouvier" wrote: > On 12/6/24 00:58, Julian Ganz wrote: > > December 6, 2024 at 12:03 AM, "Pierrick Bouvier" wrote: > > > It's an interesting conversation. For the scope of this series, I agree > > > you should use the jump target, which trigger

Re: [PATCH 1/3] ui/sdl2: reenable the SDL2 Windows keyboard hook procedure

2024-12-07 Thread Bernhard Beschow
Am 9. September 2024 19:38:26 UTC schrieb "Volker Rümelin" : >Am 09.09.24 um 09:26 schrieb Marc-André Lureau: >> Hi >> >> On Mon, Sep 9, 2024 at 10:22 AM Volker Rümelin wrote: >>> Windows only: >>> >>> The libSDL2 Windows message loop needs the libSDL2 Windows low >>> level keyboard hook proce

[PATCH 0/3] Support getting p2pdma_distance

2024-12-07 Thread Julia Zhang
To implement dGPU prime feature, virtgpu needs to import/export buffer between virtio iGPU and passthrough dGPU. Before that, virtgpu has to checkout p2pdma_distance. But calling function pci_p2pdma_distance in guest VM will only get virtual p2pdma_distance instead of real physical p2pdma_distance.

[PATCH 3/3] virtio-gpu: add a new command to get p2pdma_distance

2024-12-07 Thread Julia Zhang
To implement passthrough dGPU prime in guest, virtio-gpu need to check p2pdma_distance of two GPUs. This adds a new command for guest to pass virtual pci notations of two pci devices to host and send xen privcmd to calculate physical p2pdma_distance. Signed-off-by: Julia Zhang --- hw/display/vir

[PATCH 2/3] pci: introduce a function to get PCIDevice

2024-12-07 Thread Julia Zhang
Introduce a helper function to get PCIDevice from qdev pci notation. Signed-off-by: Julia Zhang --- hw/pci/pci.c | 22 ++ include/hw/pci/pci.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 1416ae202c..95806ead4f 100644 ---

[PATCH 1/3] virtio-gpu: set hostaddr for virtio iGPU

2024-12-07 Thread Julia Zhang
Get physical pci notation from hvm file and set hostaddr for virtio iGPU. Signed-off-by: Julia Zhang --- hw/display/virtio-gpu.c| 6 ++ hw/xen/xen_pt.c| 10 +- hw/xen/xen_pt.h| 1 - include/hw/pci/pci_device.h| 1 + include/hw/virtio/vi

Re: [RFC 06/13] rust: add bindings for memattrs

2024-12-07 Thread Philippe Mathieu-Daudé
On 6/12/24 11:59, Peter Maydell wrote: On Thu, 5 Dec 2024 at 18:30, Paolo Bonzini wrote: On 12/5/24 19:15, Richard Henderson wrote: On 12/5/24 00:07, Zhao Liu wrote: The MemTxAttrs structure is composed of bitfield members, and bindgen is unable to generate an equivalent macro definition for

Re: [RFC 09/13] i386/fw_cfg: move hpet_cfg definition to hpet.c

2024-12-07 Thread Philippe Mathieu-Daudé
On 5/12/24 22:19, Paolo Bonzini wrote: On Thu, Dec 5, 2024 at 10:18 PM Philippe Mathieu-Daudé wrote: On 5/12/24 13:46, Zhao Liu wrote: Hi Philippe, On Thu, Dec 05, 2024 at 01:04:58PM +0100, Philippe Mathieu-Daudé wrote: Date: Thu, 5 Dec 2024 13:04:58 +0100 From: Philippe Mathieu-Daudé Subj

[PATCH v6 13/16] acpi/ghes: better name the offset of the hardware error firmware

2024-12-07 Thread Mauro Carvalho Chehab
The hardware error firmware is where HEST error structures are stored. Those can be GHESv2, but they can also be other types. Better name the location of the hardware error. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --

[PATCH v6 01/16] acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED

2024-12-07 Thread Mauro Carvalho Chehab
This is just duplicating ACPI_GHES_ERROR_SOURCE_COUNT, which has a better name. So, drop the duplication. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 7 ++- include/hw/acpi/ghes.h | 3 ++- 2 files changed, 4 ins

[PATCH v6 12/16] acpi/ghes: rename etc/hardware_error file macros

2024-12-07 Thread Mauro Carvalho Chehab
Now that we have also have a file to store HEST data location, which is part of GHES, better name the file where CPER records are stored. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 38 ++

[PATCH v6 06/16] acpi/ghes: Remove a duplicated out of bounds check

2024-12-07 Thread Mauro Carvalho Chehab
acpi_ghes_record_errors() has an assert() at the beginning to ensure that source_id will be lower than ACPI_GHES_ERROR_SOURCE_COUNT. Remove a duplicated check. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 4 +--- 1 file chan

[PATCH v6 10/16] acpi/ghes: better name GHES memory error function

2024-12-07 Thread Mauro Carvalho Chehab
The current function used to generate GHES data is specific for memory errors. Give a better name for it, as we now have a generic function as well. Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 2 +- hw/acpi/ghes.c

[PATCH v6 11/16] acpi/ghes: don't crash QEMU if ghes GED is not found

2024-12-07 Thread Mauro Carvalho Chehab
Make error handling within ghes_record_cper_errors() consistent, i.e. instead abort just print a error in case ghes GED is not found. Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 5 - 1 file changed, 4 insertions(+), 1 d

[PATCH v6 05/16] acpi/ghes: Fix acpi_ghes_record_errors() argument

2024-12-07 Thread Mauro Carvalho Chehab
Align the header file with the actual implementation of this function, as the first argument is source ID and not notification type. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- Changes from v8: - Non-rename/cleanup changes merged altogethe

[PATCH v6 15/16] acpi/ghes: Change ghes fill logic to work with only one source

2024-12-07 Thread Mauro Carvalho Chehab
Extending to multiple sources require a BIOS pointer to the beginning of the HEST table, which in turn requires a backward-compatible code. So, the current code supports only one source. Ensure that and simplify the code. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Review

[PATCH v6 09/16] acpi/ghes: make the GHES record generation more generic

2024-12-07 Thread Mauro Carvalho Chehab
Split the code into separate functions to allow using the common CPER filling code by different error sources. The generic code was moved to ghes_record_cper_errors(), and ghes_gen_err_data_uncorrectable_recoverable() now contains only a logic to fill the Generic Error Data part of the record, as

[PATCH v6 07/16] acpi/ghes: Change the type for source_id

2024-12-07 Thread Mauro Carvalho Chehab
As described at: ACPI 6.5 spec at: 18.3.2. ACPI Error Source In particular at GHES/GHESv2 table: Table 18.10 Generic Hardware Error Source Structure HEST source ID is actually a 16-bit value. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor M

[PATCH v6 08/16] acpi/ghes: don't check if physical_address is not zero

2024-12-07 Thread Mauro Carvalho Chehab
The 'physical_address' value is a faulty page. As such, 0 is as valid as any other value. Suggested-by: Igor Mammedov Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index edc74c38bf8a..a3dffd78b012 1

[PATCH v6 02/16] acpi/ghes: simplify acpi_ghes_record_errors() code

2024-12-07 Thread Mauro Carvalho Chehab
Reduce the ident of the function and prepares it for the next changes. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 56 ++ 1 file changed, 29 insertions

[PATCH v6 00/16] Prepare GHES driver to support error injection

2024-12-07 Thread Mauro Carvalho Chehab
Hi Michael, Please ignore the patch series I sent yesterday: https://lore.kernel.org/qemu-devel/20241207093922.1efa0...@foz.lan/T/#t The git range was wrong, and it was supposed to be v6. This is the right one. It is based on the top of v9.2.0-rc3. Could you please merge this series for

[PATCH v6 14/16] acpi/ghes: move offset calculus to a separate function

2024-12-07 Thread Mauro Carvalho Chehab
Currently, CPER address location is calculated as an offset of the hardware_errors table. It is also badly named, as the offset actually used is the address where the CPER data starts, and not the beginning of the error source. Move the logic which calculates such offset to a separate function, in

[PATCH v6 03/16] acpi/ghes: simplify the per-arch caller to build HEST table

2024-12-07 Thread Mauro Carvalho Chehab
The GHES driver requires not only a HEST table, but also a separate firmware file to store Error Structure records. It can't do one without the other. Simplify the caller logic for it to require one function. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Came

[PATCH v6 16/16] docs: acpi_hest_ghes: fix documentation for CPER size

2024-12-07 Thread Mauro Carvalho Chehab
While the spec defines a CPER size of 4KiB for each record, currently it is set to 1KiB. Fix the documentation and add a pointer to the macro name there, as this may help to keep it updated. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- docs/

[PATCH v6 04/16] acpi/ghes: better handle source_id and notification

2024-12-07 Thread Mauro Carvalho Chehab
GHES has two fields that are stored on HEST error source blocks associated with notifications: - notification type, which is a number defined at the ACPI spec containing several arch-specific synchronous and assynchronous types; - source id, which is a HW/FW defined number, used to distinguish

Re: [PATCH 31/31] FIXME: acpi/ghes: properly set data record size

2024-12-07 Thread Mauro Carvalho Chehab
Em Sat, 07 Dec 2024 07:17:42 +0100 Markus Armbruster escreveu: > Another subject line that suggests this isn't fully baked. Respin to > reduce confusion? The last 3 patches on this series were purely to debug some things, and aren't meant to be submitted. This particular one is just a potential

Re: [PATCH 00/31] Prepare GHES driver to support error injection

2024-12-07 Thread Mauro Carvalho Chehab
Em Sat, 07 Dec 2024 07:15:19 +0100 Markus Armbruster escreveu: > Markus Armbruster writes: > > > This is v10, right? > > Scratch that, the cover letter explains: "As agreed duing v10 review, > I'll be splitting the big patch series into separate pull requests, > starting with the cleanup ser

Re: [PATCH 27/31] DEBUG

2024-12-07 Thread Mauro Carvalho Chehab
Em Sat, 07 Dec 2024 07:16:31 +0100 Markus Armbruster escreveu: > Ani Sinha writes: > > > On Fri, Dec 6, 2024 at 10:51 PM Mauro Carvalho Chehab > > wrote: > >> > >> Signed-off-by: Mauro Carvalho Chehab > >> --- > >> hw/acpi/ghes.c | 2 ++ > >> 1 file changed, 2 insertions(+) > >> > >> diff

Re: [PATCH] tcg/optimize: Fix constant folding of setcond

2024-12-07 Thread wannacu
> The problem is stale data in tmp's arg_info, correct? Better would be adding > fold_and(op2) a few lines later, after finishing setup of op2's arguments. You're absolutely right, stale data in tmp's arg_info is the root issue here. > (1) The inline assembly is incorrect, and (2) the test does