[PATCH 24/28] target/arm: Move regime_ttbr to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 1 - target/arm/helper.c | 16 target/arm/ptw.c| 16 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/target/arm/ptw.h b/target/arm/ptw.h index 3d3061a435..ed152ddaf4 100644 --- a/tar

[PATCH 23/28] target/arm: Move regime_is_user to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 1 - target/arm/helper.c | 24 target/arm/ptw.c| 22 ++ 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/target/arm/ptw.h b/target/arm/ptw.h index 85ad576794..3d3061a435 10

[PATCH 21/28] target/arm: Move aa32_va_parameters to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 3 --- target/arm/helper.c | 64 - target/arm/ptw.c| 64 + 3 files changed, 64 insertions(+), 67 deletions(-) diff --git a/target/arm/ptw.h b/ta

[PATCH 28/28] target/arm: Pass CPUARMState to arm_ld[lq]_ptw

2022-06-03 Thread Richard Henderson
The use of ARM_CPU to recover env from cs calls object_class_dynamic_cast, which shows up on the profile. This is pointless, because all callers already have env, and the reverse operation, env_cpu, is only pointer arithmetic. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 23 +-

[PATCH 20/28] target/arm: Move check_s2_mmu_setup to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 2 -- target/arm/helper.c | 70 - target/arm/ptw.c| 70 + 3 files changed, 70 insertions(+), 72 deletions(-) diff --git a/target/arm/ptw.h b/tar

[PATCH 25/28] target/arm: Move regime_translation_disabled to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 17 target/arm/helper.c | 47 - target/arm/ptw.c| 47 - 3 files changed, 46 insertions(+), 65 deletions(-) delete mode 100644 ta

[PATCH 27/28] target/arm: Move stage_1_mmu_idx, arm_stage1_mmu_idx to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/helper.c | 32 target/arm/ptw.c| 28 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 1c75962a3b..1018cd24eb 100644 ---

[PATCH 19/28] target/arm: Move get_S1prot, get_S2prot to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 3 -- target/arm/helper.c | 128 target/arm/ptw.c| 128 3 files changed, 128 insertions(+), 131 deletions(-) diff --git a/target/arm/ptw.h b/

[PATCH 26/28] target/arm: Move arm_cpu_get_phys_page_attrs_debug to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/helper.c | 26 -- target/arm/ptw.c| 24 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 7390798463..1c75962a3b 100644 --- a/target/

[PATCH 15/28] target/arm: Move get_phys_addr_lpae to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 10 ++ target/arm/helper.c | 416 +--- target/arm/ptw.c| 411 +++ 3 files changed, 429 insertions(+), 408 deletions(-) diff --git a/target/arm/ptw.h b/t

[PATCH 18/28] target/arm: Move arm_pamax, pamax_map into ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 2 -- target/arm/helper.c | 25 - target/arm/ptw.c| 25 + 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/target/arm/ptw.h b/target/arm/ptw.h index 28b8cb9fb8..fba650d0

[PATCH 16/28] target/arm: Move arm_{ldl,ldq}_ptw to ptw.c

2022-06-03 Thread Richard Henderson
Move the ptw load functions, plus 3 common subroutines: S1_ptw_translate, ptw_attrs_are_device, and regime_translation_big_endian. This also allows get_phys_addr_lpae to become static again. Signed-off-by: Richard Henderson --- target/arm/ptw.h| 13 target/arm/helper.c | 141 --

[PATCH 09/28] target/arm: Move pmsav8_mpu_lookup to ptw.c

2022-06-03 Thread Richard Henderson
This is the final user of get_phys_addr_pmsav7_default within helper.c, so make it static within ptw.c. Signed-off-by: Richard Henderson --- target/arm/ptw.h| 3 - target/arm/helper.c | 136 - target/arm/ptw.c| 146 +++

[PATCH 17/28] target/arm: Move {arm_s1_, }regime_using_lpae_format to tlb_helper.c

2022-06-03 Thread Richard Henderson
These functions are used for both page table walking and for deciding what format in which to deliver exception results. Since ptw.c is only present for system mode, put the functions into tlb_helper.c. Signed-off-by: Richard Henderson --- target/arm/helper.c | 24 t

[PATCH 12/28] target/arm: Move m_is_{ppb,system}_region to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 3 --- target/arm/helper.c | 15 --- target/arm/ptw.c| 16 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/target/arm/ptw.h b/target/arm/ptw.h index d2d2711908..6c47a57599 100644 --- a/ta

[PATCH 08/28] target/arm: Move get_phys_addr_pmsav8 to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 5 --- target/arm/helper.c | 75 --- target/arm/ptw.c| 77 + 3 files changed, 77 insertions(+), 80 deletions(-) diff --git a/target/arm/ptw.h b/targ

[PATCH 13/28] target/arm: Move get_level1_table_address to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 4 ++-- target/arm/helper.c | 26 +- target/arm/ptw.c| 23 +++ 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/target/arm/ptw.h b/target/arm/ptw.h index 6c47a57599..dd6fb93

[PATCH 22/28] target/arm: Move ap_to_tw_prot etc to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 10 -- target/arm/helper.c | 77 -- target/arm/ptw.c| 81 + 3 files changed, 81 insertions(+), 87 deletions(-) diff --git a/target/arm/ptw.h b/ta

[PATCH 10/28] target/arm: Move pmsav7_use_background_region to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 2 -- target/arm/helper.c | 19 --- target/arm/ptw.c| 21 + 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/target/arm/ptw.h b/target/arm/ptw.h index 8d2e239714..d2d2711908 100644

[PATCH 06/28] target/arm: Move get_phys_addr_pmsav7_default to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 3 +++ target/arm/helper.c | 41 - target/arm/ptw.c| 41 + 3 files changed, 44 insertions(+), 41 deletions(-) diff --git a/target/arm/ptw.h b/target/arm

[PATCH 11/28] target/arm: Move v8m_security_lookup to ptw.c

2022-06-03 Thread Richard Henderson
This function has one private helper, v8m_is_sau_exempt, so move that at the same time. Signed-off-by: Richard Henderson --- target/arm/helper.c | 123 -- target/arm/ptw.c| 126 2 files changed, 126 insertio

[PATCH 14/28] target/arm: Move combine_cacheattrs and subroutines to ptw.c

2022-06-03 Thread Richard Henderson
There are a handful of helpers for combine_cacheattrs that we can move at the same time as the main entry point. Signed-off-by: Richard Henderson --- target/arm/ptw.h| 3 - target/arm/helper.c | 218 --- target/arm/ptw.c| 221

[PATCH 07/28] target/arm: Move get_phys_addr_pmsav7 to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 10 +-- target/arm/helper.c | 194 +--- target/arm/ptw.c| 190 +++ 3 files changed, 198 insertions(+), 196 deletions(-) diff --git a/target/arm/ptw.h b/

[PATCH 04/28] target/arm: Move get_phys_addr_v6 to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 11 +-- target/arm/helper.c | 161 +--- target/arm/ptw.c| 153 + 3 files changed, 161 insertions(+), 164 deletions(-) diff --git a/target/arm/ptw.h b/ta

[PATCH 05/28] target/arm: Move get_phys_addr_pmsav5 to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 4 --- target/arm/helper.c | 85 - target/arm/ptw.c| 85 + 3 files changed, 85 insertions(+), 89 deletions(-) diff --git a/target/arm/ptw.h b/ta

[PATCH 02/28] target/arm: Move get_phys_addr to ptw.c

2022-06-03 Thread Richard Henderson
Begin moving all of the page table walking functions out of helper.c, starting with get_phys_addr(). Create a temporary header file, "ptw.h", in which to share declarations between the two C files while we are moving functions. Move a few declarations to "internals.h", which will remain used by m

[PATCH 03/28] target/arm: Move get_phys_addr_v5 to ptw.c

2022-06-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/ptw.h| 15 +++-- target/arm/helper.c | 137 +++- target/arm/ptw.c| 123 +++ 3 files changed, 140 insertions(+), 135 deletions(-) diff --git a/target/arm/ptw.h b/ta

[PATCH 01/28] target/arm: Move stage_1_mmu_idx decl to internals.h

2022-06-03 Thread Richard Henderson
Move the decl from ptw.h to internals.h. Provide an inline version for user-only, just as we do for arm_stage1_mmu_idx. Move an endif down to make the definition in helper.c be system only. Signed-off-by: Richard Henderson --- target/arm/internals.h | 5 + target/arm/helper.c| 5 ++---

[PATCH 00/28] target/arm: Split out ptw.c from helper.c

2022-06-03 Thread Richard Henderson
The object here is to move 2500 lines out of helper.c. Yay! r~ Richard Henderson (28): target/arm: Move stage_1_mmu_idx decl to internals.h target/arm: Move get_phys_addr to ptw.c target/arm: Move get_phys_addr_v5 to ptw.c target/arm: Move get_phys_addr_v6 to ptw.c target/arm: Move g

[PATCH] test/tcg/arm: Use -mfloat-abi=soft for test-armv6m-undef

2022-06-03 Thread Richard Henderson
GCC11 from crossbuild-essential-armhf from ubuntu 22.04 errors: cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU Signed-off-by: Richard Henderson --- tests/tcg/arm/Makefile.softmmu-target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tcg/arm/Makefile

Re: [PULL 00/11] hw/nvme updates

2022-06-03 Thread Richard Henderson
On 6/3/22 12:53, Klaus Jensen wrote: From: Klaus Jensen Hi Peter, The following changes since commit 70e975203f366f2f30daaeb714bb852562b7b72f: Merge tag 'pull-request-2022-06-03' of https://gitlab.com/thuth/qemu into staging (2022-06-03 06:43:38 -0700) are available in the Git repository

[PATCH] linux-user/x86_64: Fix ELF_PLATFORM

2022-06-03 Thread Richard Henderson
We had been using the i686 platform string for x86_64. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1041 Signed-off-by: Richard Henderson --- linux-user/elfload.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/linux-user/elfload.c

[PATCH] hw/nvme: Fix deallocate when metadata is present

2022-06-03 Thread Jonathan Derrick
When metadata is present in the namespace and deallocates are issued, the first deallocate could fail to zero the block range, resulting in another deallocation to be issued. Normally after the deallocation completes and the range is checked for zeroes, a deallocation is then issued for the metadat

Re: [PATCH v2 08/16] ppc/pnv: user created pnv-phb for powernv9

2022-06-03 Thread Daniel Henrique Barboza
On 6/2/22 13:33, Frederic Barrat wrote: On 31/05/2022 23:49, Daniel Henrique Barboza wrote: To enable user creatable PnvPHB devices for powernv9 we'll revert the powernv9 related changes made in 9c10d86fee "ppc/pnv: Remove user-created PHB{3,4,5} devices". This change alone isn't enough to

Re: [PATCH] hw/nvme: clear aen mask on reset

2022-06-03 Thread Keith Busch
On Thu, May 12, 2022 at 11:30:55AM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > The internally maintained AEN mask is not cleared on reset. Fix this. Looks good. Reviewed-by: Keith Busch

Re: [PATCH v2 11/16] ppc/pnv: add pnv-phb-root-port device

2022-06-03 Thread Daniel Henrique Barboza
On 6/2/22 05:12, Mark Cave-Ayland wrote: On 31/05/2022 22:49, Daniel Henrique Barboza wrote: We have two very similar root-port devices, pnv-phb3-root-port and pnv-phb4-root-port. Both consist of a wrapper around the PCIESlot device that, until now, has no additional attributes. The main di

Re: [PATCH v2] hw/nvme: allow to pass a memory backend object for the CMB

2022-06-03 Thread Klaus Jensen
On Apr 19 07:20, Wertenbroek Rick wrote: > Adds the optional -cmbdev= option that takes a QEMU memory backend > -object to be used to for the CMB (Controller Memory Buffer). > This option takes precedence over cmb_size_mb= if both used. > (The size will be deduced from the memory backend option). >

Re: [PATCH] hw/nvme: clear aen mask on reset

2022-06-03 Thread Klaus Jensen
On May 12 11:30, Klaus Jensen wrote: > From: Klaus Jensen > > The internally maintained AEN mask is not cleared on reset. Fix this. > > Signed-off-by: Klaus Jensen > --- > hw/nvme/ctrl.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c > index 1e6e0fcad

Re: [PATCH v2 04/16] ppc/pnv: change PnvPHB3 to be a PnvPHB backend

2022-06-03 Thread Daniel Henrique Barboza
On 6/2/22 04:56, Mark Cave-Ayland wrote: On 31/05/2022 22:49, Daniel Henrique Barboza wrote: We need a handful of changes that needs to be done in a single swoop to turn PnvPHB3 into a PnvPHB backend. In the PnvPHB3, since the PnvPHB device implements PCIExpressHost and will hold the PCI bu

[PATCH] Revert "hw/block/nvme: add support for sgl bit bucket descriptor"

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen This reverts commit d97eee64fef35655bd06f5c44a07fdb83a6274ae. The emulated controller correctly accounts for not including bit buckets in the controller-to-host data transfer, however it doesn't correctly account for the holes for the on-disk data offsets. Reported-by: Keith

Re: [PATCH v2] hw/nvme: clean up CC register write logic

2022-06-03 Thread Klaus Jensen
On Jun 1 15:28, Lukasz Maniak wrote: > On Wed, May 25, 2022 at 09:35:24AM +0200, Klaus Jensen wrote: > > > > +stl_le_p(&n->bar.intms, 0); > > +stl_le_p(&n->bar.intmc, 0); > > +stl_le_p(&n->bar.cc, 0); > > Looks fine, though it seems the NVMe spec says the above registers

[PULL 10/11] hw/nvme: deprecate the use-intel-id compatibility parameter

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Since version 5.2 commit 6eb7a071292a ("hw/block/nvme: change controller pci id"), the emulated NVMe controller has defaulted to a non-Intel PCI identifier. Deprecate the compatibility parameter so we can get rid of it once and for all. Reviewed-by: Philippe Mathieu-Daudé Si

[PULL 09/11] hw/nvme: bump firmware revision

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen The Linux kernel quirks the QEMU NVMe controller pretty heavily because of the namespace identifier mess. Since this is now fixed, bump the firmware revision number to allow the quirk to be disabled for this revision. As of now, bump the firmware revision number to be equal to

Re: [PATCH] hw/nvme: Fix deallocate when metadata is present

2022-06-03 Thread Klaus Jensen
On Jun 3 13:14, Jonathan Derrick wrote: > When metadata is present in the namespace and deallocates are issued, the > first > deallocate could fail to zero the block range, resulting in another > deallocation to be issued. Normally after the deallocation completes and the > range is checked for z

[PULL 08/11] hw/nvme: do not report null uuid

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Do not report the "null uuid" (all zeros) in the namespace identification descriptors. Reported-by: Luis Chamberlain Reported-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 17 +++

[PULL 07/11] hw/nvme: do not auto-generate uuid

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Do not default to generate an UUID for namespaces if it is not explicitly specified. This is a technically a breaking change in behavior. However, since the UUID changes on every VM launch, it is not spec compliant and is of little use since the UUID cannot be used reliably an

[PULL 11/11] hw/nvme: add new command abort case

2022-06-03 Thread Klaus Jensen
From: Dmitry Tikhov NVMe command set specification for end-to-end data protection formatted namespace states: o If the Reference Tag Check bit of the PRCHK field is set to ‘1’ and the namespace is formatted for Type 3 protection, then the controller: ▪ should not compar

[PULL 04/11] hw/nvme: fix smart aen

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Pass the right constant to nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be in nvme_smart_event(). Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning") Acked-by

[PULL 02/11] hw/nvme: add missing return statement

2022-06-03 Thread Klaus Jensen
From: Dmitry Tikhov Since there is no return after nvme_dsm_cb invocation, metadata associated with non-zero block range is currently zeroed. Also this behaviour leads to segfault since we schedule iocb->bh two times. First when entering nvme_dsm_cb with iocb->idx == iocb->nr and second because o

[PULL 05/11] hw/nvme: enforce common serial per subsystem

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen The Identify Controller Serial Number (SN) is the serial number for the NVM subsystem and must be the same across all controller in the NVM subsystem. Enforce this. Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h |

[PULL 06/11] hw/nvme: do not auto-generate eui64

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen We cannot provide auto-generated unique or persistent namespace identifiers (EUI64, NGUID, UUID) easily. Since 6.1, namespaces have been assigned a generated EUI64 of the form "52:54:00:". This is will be unique within a QEMU instance, but not globally. Revert that this is ass

[PULL 01/11] hw/nvme: fix narrowing conversion

2022-06-03 Thread Klaus Jensen
From: Dmitry Tikhov Since nlbas is of type int, it does not work with large namespace size values, e.g., 9 TB size of file backing namespace and 8 byte metadata with 4096 bytes lbasz gives negative nlbas value, which is later promoted to negative int64_t type value and results in negative ns->mof

[PULL 00/11] hw/nvme updates

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, The following changes since commit 70e975203f366f2f30daaeb714bb852562b7b72f: Merge tag 'pull-request-2022-06-03' of https://gitlab.com/thuth/qemu into staging (2022-06-03 06:43:38 -0700) are available in the Git repository at: git://git.infradead.org/qemu-nvm

[PULL 03/11] hw/nvme: fix copy cmd for pi enabled namespaces

2022-06-03 Thread Klaus Jensen
From: Dmitry Tikhov Current implementation have problem in the read part of copy command. Because there is no metadata mangling before nvme_dif_check invocation, reftag error could be thrown for blocks of namespace that have not been previously written to. Signed-off-by: Dmitry Tikhov Reviewed-

Re: [PATCH] hw/nvme: Fix deallocate when metadata is present

2022-06-03 Thread Keith Busch
On Fri, Jun 03, 2022 at 01:14:40PM -0600, Jonathan Derrick wrote: > When metadata is present in the namespace and deallocates are issued, the > first > deallocate could fail to zero the block range, resulting in another > deallocation to be issued. Normally after the deallocation completes and the

[PATCH v4 07/11] hw/isa/piix4: Inline and remove piix4_create()

2022-06-03 Thread Bernhard Beschow
During the previous changesets piix4_create() became a trivial wrapper around more generic functions. Modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c| 13 - hw/mips/malta.c | 5 - include/h

[PATCH v4 11/11] hw/isa/piix3: Inline and remove piix3_create()

2022-06-03 Thread Bernhard Beschow
During the previous changesets piix3_create() became a trivial wrapper around more generic functions. Modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 6 +- hw/isa/piix3.c| 13 - include/

[PATCH v4 09/11] hw/isa/piix3: QOM'ify PCI device creation and wiring

2022-06-03 Thread Bernhard Beschow
PCI interrupt wiring was performed in create() functions which are obsolete. Move these tasks into QOM functions to modernize the code. In order to avoid duplicate checking for xen_enabled() the realize methods are now split. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 67 +

[PATCH v4 04/11] hw/isa/piix4: QOM'ify PCI device creation and wiring

2022-06-03 Thread Bernhard Beschow
PCI interrupt wiring and device creation were performed in create() functions which are obsolete. Move these tasks into QOM functions to modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 30 ++ 1 file changed

[PATCH v4 02/11] hw/isa/piix4: Use object_initialize_child() for embedded struct

2022-06-03 Thread Bernhard Beschow
Reported-by: Peter Maydell Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 9a6d981037..1d04fb6a55 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@

[PATCH v4 08/11] hw/isa/piix3: Move pci_map_irq_fn near pci_set_irq_fn

2022-06-03 Thread Bernhard Beschow
The pci_map_irq_fn was implemented below type_init() which made it inaccessible to QOM functions. So move it up. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 22 +++--- 1 file changed, 11 insertions(+), 1

[PATCH v4 06/11] hw/isa/piix4: QOM'ify PIIX4 PM creation

2022-06-03 Thread Bernhard Beschow
Just like the real hardware, create the PIIX4 ACPI controller as part of the PIIX4 southbridge. This also mirrors how the IDE and USB functions are already created. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c| 24 +--- hw/mips/malta.c | 5

[PATCH v4 10/11] hw/isa/piix3: Factor out ISABus retrieval from piix3_create()

2022-06-03 Thread Bernhard Beschow
Modernizes the code. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland --- hw/i386/pc_piix.c | 3 ++- hw/isa/piix3.c| 3 +-- include/hw/southbridge/piix.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/p

[PATCH v4 01/11] hw/southbridge/piix: Aggregate all PIIX southbridge type names

2022-06-03 Thread Bernhard Beschow
TYPE_PIIX3_PCI_DEVICE resides there as already, so add the remaining ones, too. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c| 3 --- include/hw/isa/isa.h | 2 -- include/hw/southbridge/piix.h | 4 +

[PATCH v4 05/11] hw/isa/piix4: Factor out ISABus retrieval from piix4_create()

2022-06-03 Thread Bernhard Beschow
Modernizes the code. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c| 6 +- hw/mips/malta.c | 3 ++- include/hw/southbridge/piix.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) di

[PATCH v4 03/11] hw/isa/piix4: Move pci_map_irq_fn' near pci_set_irq_fn

2022-06-03 Thread Bernhard Beschow
The pci_map_irq_fn was implemented below type_init() which made it inaccessible to QOM functions. So move it up. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 50 +- 1 file

[PATCH v4 00/11] QOM'ify PIIX southbridge creation

2022-06-03 Thread Bernhard Beschow
v4: * Rebase onto https://patchew.org/QEMU/20220530112718.26582-1-philippe.mathieu.da...@gmail.com/ * Cosmetics (fix typo, omit "include") (Mark, Philippe) * Split piix3 and piix4 (Philippe) * s/Found-by/Reported-by/ (Philippe) * Don't alias smbus (Mark) v3: * Rebase onto 'hw/acpi/piix4: remove l

Re: [PATCH RESEND v3 4/8] host-utils: Implemented unsigned 256-by-128 division

2022-06-03 Thread Richard Henderson
On 5/25/22 06:49, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" Based on already existing QEMU implementation, created an unsigned 256 bit by 128 bit division needed to implement the vector divide extended unsigned instruction from PowerISA3.1 Signed-off-by: Lucas Ma

Re: [PATCH RESEND v3 7/8] target/ppc: Implemented vector module word/doubleword

2022-06-03 Thread Richard Henderson
On 5/25/22 06:49, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" Implement the following PowerISA v3.1 instructions: vmodsw: Vector Modulo Signed Word vmoduw: Vector Modulo Unsigned Word vmodsd: Vector Modulo Signed Doubleword vmodud: Vector Modulo Unsigned Doubleword

Re: [PATCH RESEND v3 3/8] target/ppc: Implemented vector divide extended word

2022-06-03 Thread Richard Henderson
On 5/25/22 06:49, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" Implement the following PowerISA v3.1 instructions: vdivesw: Vector Divide Extended Signed Word vdiveuw: Vector Divide Extended Unsigned Word Signed-off-by: Lucas Mateus Castro (alqotel) --- target/ppc

Re: [PATCH RESEND v3 1/8] target/ppc: Implemented vector divide instructions

2022-06-03 Thread Richard Henderson
On 5/25/22 06:49, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" Implement the following PowerISA v3.1 instructions: vdivsw: Vector Divide Signed Word vdivuw: Vector Divide Unsigned Word vdivsd: Vector Divide Signed Doubleword vdivud: Vector Divide Unsigned Doubleword

Re: about the current status of Multi-process QEMU / out-of-process emulation

2022-06-03 Thread Jag Raman
On Jun 3, 2022, at 11:34 AM, Yu Zhang mailto:yu.zh...@ionos.com>> wrote: Hello Dongli, Elena, John, and Jagannathan, I'm interested in the "multi-process QEMU" feature and got the kind reply by Mr. Vivier that I may contact you for this. On one of the QEMU docs [1] I saw the command line: +

Re: [PATCH] disas: Remove libvixl disassembler

2022-06-03 Thread Thomas Huth
On 03/06/2022 19.26, Claudio Fontana wrote: On 6/3/22 18:42, Thomas Huth wrote: The disassembly via capstone should be superiour to our old vixl sources nowadays, so let's finally cut this old disassembler out of the QEMU source tree. Signed-off-by: Thomas Huth agreed, one thought: at the ti

Re: [PATCH] disas: Remove libvixl disassembler

2022-06-03 Thread Richard Henderson
On 6/3/22 09:42, Thomas Huth wrote: The disassembly via capstone should be superiour to our old vixl sources nowadays, so let's finally cut this old disassembler out of the QEMU source tree. Signed-off-by: Thomas Huth --- See also the discussions here: - https://lists.gnu.org/archive/html/q

Re: [PATCH v6 15/18] job: detect change of aiocontext within job coroutine

2022-06-03 Thread Kevin Wolf
Am 14.03.2022 um 14:37 hat Emanuele Giuseppe Esposito geschrieben: > From: Paolo Bonzini > > We want to make sure access of job->aio_context is always done > under either BQL or job_mutex. The problem is that using > aio_co_enter(job->aiocontext, job->co) in job_start and job_enter_cond > makes t

Re: [PATCH v6 40/43] hw/loongarch: Add LoongArch power manager support

2022-06-03 Thread Richard Henderson
On 6/1/22 03:25, Xiaojuan Yang wrote: Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 45 +++- 1 file changed, 44 insertions(+), 1 deletion(-) Acked-by: Richard Henderson +#define PM_BASE 0x1008 +#define PM_SIZ

Re: [PATCH v6 38/43] hw/loongarch: Add LoongArch ls7a rtc device support

2022-06-03 Thread Richard Henderson
On 6/1/22 03:25, Xiaojuan Yang wrote: This patch add ls7a rtc device support. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS| 1 + hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 3 + hw/rtc/Kconfig | 3 + hw/rtc/ls

Re: [PATCH v6 06/18] jobs: protect jobs with job_lock/unlock

2022-06-03 Thread Kevin Wolf
Am 14.03.2022 um 14:36 hat Emanuele Giuseppe Esposito geschrieben: > Introduce the job locking mechanism through the whole job API, > following the comments in job.h and requirements of job-monitor > (like the functions in job-qmp.c, assume lock is held) and > job-driver (like in mirror.c and all

Re: [PATCH v6 34/43] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-06-03 Thread Richard Henderson
On 6/1/22 03:25, Xiaojuan Yang wrote: +static uint64_t extioi_readw(void *opaque, hwaddr addr, unsigned size) +{ +LoongArchExtIOI *s = LOONGARCH_EXTIOI(opaque); +unsigned long offset = addr & 0x; +uint32_t index, cpu, ret = 0; + +switch (offset) { +case EXTIOI_NODETYPE_STA

Re: [PATCH] gitlab-ci: Fix the build-cfi-aarch64 and build-cfi-ppc64-s390x jobs

2022-06-03 Thread Thomas Huth
On 03/06/2022 18.17, Richard Henderson wrote: On 6/3/22 05:48, Thomas Huth wrote: The job definitions recently got a second "variables:" section by accident and thus are failing now if one tries to run them. Merge the two sections into one again to fix the issue. And while we're at it, bump the

Re: [PATCH v6 05/18] job.h: add _locked duplicates for job API functions called with and without job_mutex

2022-06-03 Thread Kevin Wolf
Am 14.03.2022 um 14:36 hat Emanuele Giuseppe Esposito geschrieben: > In preparation to the job_lock/unlock usage, create _locked > duplicates of some functions, since they will be sometimes called with > job_mutex held (mostly within job.c), > and sometimes without (mostly from JobDrivers using the

Re: Changes for building bits on newer gcc 9.4 compiler

2022-06-03 Thread Ani Sinha
On an additional note, my changes are not backward compatible with older compiler. The build will break when built with a centos 7 docker/vm/host: /home/anisinha/workspace/bits/build/grub/grub-core/contrib-deps/python/Modules/_ctypes/_ctypes.c: In function '_build_callargs': /home/anisinha/workspa

Re: [PATCH] gitlab-ci: Fix the build-cfi-aarch64 and build-cfi-ppc64-s390x jobs

2022-06-03 Thread Richard Henderson
On 6/3/22 05:48, Thomas Huth wrote: The job definitions recently got a second "variables:" section by accident and thus are failing now if one tries to run them. Merge the two sections into one again to fix the issue. And while we're at it, bump the timeout here (70 minutes are currently not eno

[RFC PATCH v5 2/4] target/riscv: smstateen check for h/senvcfg

2022-06-03 Thread Mayuresh Chitale
Accesses to henvcfg, henvcfgh and senvcfg are allowed only if corresponding bit in mstateen0/hstateen0 is enabled. Otherwise an illegal instruction trap is generated. Signed-off-by: Mayuresh Chitale --- target/riscv/csr.c | 84 ++ 1 file changed, 78 in

[RFC PATCH v5 4/4] target/riscv: smstateen check for AIA/IMSIC

2022-06-03 Thread Mayuresh Chitale
If smstateen is implemented then accesses to AIA registers CSRS, IMSIC CSRs and other IMSIC registers is controlled by setting of corresponding bits in mstateen/hstateen registers. Otherwise an illegal instruction trap or virtual instruction trap is generated. Signed-off-by: Mayuresh Chitale ---

[RFC PATCH v5 1/4] target/riscv: Add smstateen support

2022-06-03 Thread Mayuresh Chitale
Smstateen extension specifies a mechanism to close the potential covert channels that could cause security issues. This patch adds the CSRs defined in the specification and the corresponding predicates and read/write functions. Signed-off-by: Mayuresh Chitale --- target/riscv/cpu.c | 2 +

[RFC PATCH v5 0/4] RISC-V Smstateen support

2022-06-03 Thread Mayuresh Chitale
This series adds support for the Smstateen specification which provides a mechanism plug potential covert channels which are opened by extensions that add to processor state that may not get context-switched. Currently access to AIA registers, *envcfg registers and floating point(fcsr) is controlle

[RFC PATCH v5 3/4] target/riscv: smstateen check for fcsr

2022-06-03 Thread Mayuresh Chitale
If smstateen is implemented and sstateen0.fcsr is clear then the floating point operations must return illegal instruction exception. Signed-off-by: Mayuresh Chitale --- target/riscv/csr.c | 24 1 file changed, 24 insertions(+) diff --git a/target/riscv/csr.c b/target/r

Re: [PATCH v6 02/18] job.h: categorize fields in struct Job

2022-06-03 Thread Kevin Wolf
Am 14.03.2022 um 14:36 hat Emanuele Giuseppe Esposito geschrieben: > Categorize the fields in struct Job to understand which ones > need to be protected by the job mutex and which don't. > > Signed-off-by: Emanuele Giuseppe Esposito I suppose it might be a result of moving things back and forth

Fwd: about the current status of Multi-process QEMU / out-of-process emulation

2022-06-03 Thread Yu Zhang
Hello Dongli, Elena, John, and Jagannathan, I'm interested in the "multi-process QEMU" feature and got the kind reply by Mr. Vivier that I may contact you for this. On one of the QEMU docs [1] I saw the command line: + /usr/bin/qemu-system-x86_64\ +

Re: [PATCH] tests/avocado: Prefer max cpu type when using AArch64 virt machine

2022-06-03 Thread Richard Henderson
On 6/3/22 08:05, Andrew Jones wrote: On Fri, Jun 03, 2022 at 06:56:41AM -0700, Richard Henderson wrote: On 6/3/22 02:25, Andrew Jones wrote: The max cpu type is the best default cpu type for tests to use when specifying the cpu type for AArch64 mach-virt. Switch all tests to it. This won't wo

Re: [PULL 00/12] s390x and misc patches

2022-06-03 Thread Richard Henderson
On 6/2/22 23:58, Thomas Huth wrote: The following changes since commit 1e62a82574fc28e64deca589a23cf55ada2e1a7d: Merge tag 'm68k-for-7.1-pull-request' of https://github.com/vivier/qemu-m68k into staging (2022-06-02 06:30:24 -0700) are available in the Git repository at: https://gitlab.c

Re: [PATCH v2] tests: Prefer max cpu type when using AArch64 virt machine

2022-06-03 Thread Andrew Jones
On Fri, Jun 03, 2022 at 07:04:01AM -0700, Richard Henderson wrote: > On 6/3/22 04:18, Andrew Jones wrote: > > The max cpu type is the best default cpu type for tests to use > > when specifying the cpu type for AArch64 mach-virt. Switch all > > tests to it. > > > > Cc: Alex Bennée > > Signed-off-b

Re: [PATCH 3/3] capstone: Remove the capstone submodule

2022-06-03 Thread Thomas Huth
On 03/06/2022 15.48, Richard Henderson wrote: On 6/2/22 22:21, Thomas Huth wrote: So is capstone disassembly better now with Ubuntu 20.04 or should we still revert the submodule removal? It's better, yes.  At least it's giving me disassembly of the system registers. Also, if libvixl is so ba

Re: [PATCH] tests/avocado: Prefer max cpu type when using AArch64 virt machine

2022-06-03 Thread Andrew Jones
On Fri, Jun 03, 2022 at 06:56:41AM -0700, Richard Henderson wrote: > On 6/3/22 02:25, Andrew Jones wrote: > > The max cpu type is the best default cpu type for tests to use > > when specifying the cpu type for AArch64 mach-virt. Switch all > > tests to it. > > This won't work without further chang

Re: [PATCH] target/ppc: fix vbpermd in big endian hosts

2022-06-03 Thread Richard Henderson
On 6/1/22 05:53, matheus.fe...@eldorado.org.br wrote: From: Matheus Ferst The extract64 arguments are not endian dependent as they are only used for bitwise operations. The current behavior in little-endian hosts is correct; since the indexes in VRB are in PowerISA-ordering, we should always inv

Re: [PATCH v2] tests: Prefer max cpu type when using AArch64 virt machine

2022-06-03 Thread Richard Henderson
On 6/3/22 04:18, Andrew Jones wrote: The max cpu type is the best default cpu type for tests to use when specifying the cpu type for AArch64 mach-virt. Switch all tests to it. Cc: Alex Bennée Signed-off-by: Andrew Jones For avoidance of doubt, copying v1 comment to v2: diff --git a/tests/a

Re: [PATCH] tests/avocado: Prefer max cpu type when using AArch64 virt machine

2022-06-03 Thread Richard Henderson
On 6/3/22 02:25, Andrew Jones wrote: The max cpu type is the best default cpu type for tests to use when specifying the cpu type for AArch64 mach-virt. Switch all tests to it. This won't work without further changes. @@ -147,7 +147,7 @@ def test_aarch64_virt(self): """ :av

Re: [PATCH v2] tests: Prefer max cpu type when using AArch64 virt machine

2022-06-03 Thread Gavin Shan
On 6/3/22 7:18 PM, Andrew Jones wrote: The max cpu type is the best default cpu type for tests to use when specifying the cpu type for AArch64 mach-virt. Switch all tests to it. Cc: Alex Bennée Signed-off-by: Andrew Jones --- tests/avocado/boot_xen.py | 6 +++--- tests/avocado/rep

Re: [PATCH 3/3] capstone: Remove the capstone submodule

2022-06-03 Thread Richard Henderson
On 6/2/22 22:21, Thomas Huth wrote: So is capstone disassembly better now with Ubuntu 20.04 or should we still revert the submodule removal? It's better, yes. At least it's giving me disassembly of the system registers. Also, if libvixl is so bad, why do we still have that in the repo? Wel

  1   2   >