Re: [PATCH 5/8] Adds basic CPU hot-(un)plug support for Loongarch

2023-08-09 Thread lixianglai
Hi Igor Mammedov: On 7/28/23 9:21 PM, Igor Mammedov wrote: On Thu, 20 Jul 2023 15:15:10 +0800 xianglai li wrote: 1.Add CPU topology related functions 2.Add CPU hot-plug related hook functions 3.Update the in-place CPU creation process at machine initialization patch is to large, split it at

Re: [PATCH v4 11/11] target/loongarch: Add loongarch32 cpu la132

2023-08-09 Thread Jiajie Chen
On 2023/8/9 03:26, Richard Henderson wrote: On 8/7/23 18:54, Jiajie Chen wrote: +static void loongarch_la464_initfn(Object *obj) +{ +    LoongArchCPU *cpu = LOONGARCH_CPU(obj); +    CPULoongArchState *env = &cpu->env; + +    loongarch_cpu_initfn_common(env); + +    cpu->dtb_compatible = "loong

Re: [PATCH v4 1/9] virtio: Add shared memory capability

2023-08-09 Thread Huang Rui
On Wed, Aug 09, 2023 at 10:11:00AM +0800, Gurchetan Singh wrote: > From: "Dr. David Alan Gilbert" > > Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG' to allow > defining shared memory regions with sizes and offsets of 2^32 and more. > Multiple instances of the capability are allow

[PATCH for-8.2] dockerfiles: bump tricore cross compiler container to Debian 11

2023-08-09 Thread Paolo Bonzini
With the release of version 12 on June 10, 2023, Debian 10 is not supported anymore. Modify the cross compiler container to build on a newer version. Signed-off-by: Paolo Bonzini --- tests/docker/dockerfiles/debian-tricore-cross.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH for-8.2] configure: fix and complete detection of tricore tools

2023-08-09 Thread Paolo Bonzini
The tricore tools are not detected when they are installed in the host system, only if they are taken from an external container. For this reason the build-tricore-softmmu job was not running the TCG tests. In addition the container provides all tools, not just as/ld/gcc, so there is no need to s

[PATCH v5 01/11] target/loongarch: Add function to check current arch

2023-08-09 Thread Jiajie Chen
Add is_la64 function to check if the current cpucfg[1].arch equals to 2(LA64). Signed-off-by: Jiajie Chen Co-authored-by: Richard Henderson Reviewed-by: Richard Henderson --- target/loongarch/cpu.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/target/loongarch/cpu.h b/target/

[PATCH v5 08/11] target/loongarch: Reject la64-only instructions in la32 mode

2023-08-09 Thread Jiajie Chen
LoongArch64-only instructions are marked with regard to the instruction manual Table 2. LSX instructions are not marked for now for lack of public manual. Signed-off-by: Jiajie Chen --- target/loongarch/insn_trans/trans_arith.c.inc | 30 .../loongarch/insn_trans/trans_atomic.c.inc | 7

[PATCH v5 00/11] Add la32 & va32 support for loongarch64-softmmu

2023-08-09 Thread Jiajie Chen
This patch series allow qemu-system-loongarch64 to emulate a LoongArch32 machine. A new CPU model (la132) is added for loongarch32, however due to lack of public documentation, details will need to be added in the future. Initial GDB support is added. At the same time, VA32(32-bit virtual address)

[PATCH v5 02/11] target/loongarch: Add new object class for loongarch32 cpus

2023-08-09 Thread Jiajie Chen
Add object class for future loongarch32 cpus. It is derived from the loongarch64 object class. Signed-off-by: Jiajie Chen --- target/loongarch/cpu.c | 19 +++ target/loongarch/cpu.h | 1 + 2 files changed, 20 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/

[PATCH v5 03/11] target/loongarch: Add GDB support for loongarch32 mode

2023-08-09 Thread Jiajie Chen
GPRs and PC are 32-bit wide in loongarch32 mode. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson --- configs/targets/loongarch64-softmmu.mak | 2 +- gdb-xml/loongarch-base32.xml| 45 + target/loongarch/cpu.c | 10 +- target/loo

[PATCH v5 05/11] target/loongarch: Support LoongArch32 DMW

2023-08-09 Thread Jiajie Chen
LA32 uses a different encoding for CSR.DMW and a new direct mapping mechanism. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson --- target/loongarch/cpu-csr.h| 7 +++ target/loongarch/tlb_helper.c | 26 +++--- 2 files changed, 26 insertions(+), 7 deletions(

[PATCH v5 06/11] target/loongarch: Support LoongArch32 VPPN

2023-08-09 Thread Jiajie Chen
VPPN of TLBEHI/TLBREHI is limited to 19 bits in LA32. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson --- target/loongarch/cpu-csr.h| 6 -- target/loongarch/tlb_helper.c | 23 ++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/target/loong

[PATCH v5 11/11] target/loongarch: Add loongarch32 cpu la132

2023-08-09 Thread Jiajie Chen
Add la132 as a loongarch32 cpu type and allow virt machine to be used with la132 instead of la464. Due to lack of public documentation of la132, it is currently a synthetic loongarch32 cpu model. Details need to be added in the future. Signed-off-by: Jiajie Chen --- hw/loongarch/virt.c| 5

[PATCH v5 07/11] target/loongarch: Add LA64 & VA32 to DisasContext

2023-08-09 Thread Jiajie Chen
Add LA64 and VA32(32-bit Virtual Address) to DisasContext to allow the translator to reject doubleword instructions in LA32 mode for example. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson --- target/loongarch/cpu.h | 13 + target/loongarch/translate.c | 3 +++ tar

[PATCH v5 04/11] target/loongarch: Support LoongArch32 TLB entry

2023-08-09 Thread Jiajie Chen
The TLB entry of LA32 lacks NR, NX and RPLV and they are hardwired to zero in LoongArch32. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson --- target/loongarch/cpu-csr.h| 9 + target/loongarch/tlb_helper.c | 17 - 2 files changed, 17 insertions(+), 9 delet

[PATCH v5 10/11] target/loongarch: Sign extend results in VA32 mode

2023-08-09 Thread Jiajie Chen
In VA32 mode, BL, JIRL and PC* instructions should sign-extend the low 32 bit result to 64 bits. Signed-off-by: Jiajie Chen --- target/loongarch/insn_trans/trans_arith.c.inc | 2 +- target/loongarch/insn_trans/trans_branch.c.inc | 4 ++-- target/loongarch/translate.c | 8 +

[PATCH v5 09/11] target/loongarch: Truncate high 32 bits of address in VA32 mode

2023-08-09 Thread Jiajie Chen
When running in VA32 mode(!LA64 or VA32L[1-3] matching PLV), virtual address is truncated to 32 bits before address mapping. Signed-off-by: Jiajie Chen Co-authored-by: Richard Henderson --- target/loongarch/cpu.c| 16 target/loongarch/cpu.h

Re: [RFC v4 10/11] tests/tcg/multiarch: Add nativecall.c test

2023-08-09 Thread Alex Bennée
Yeqi Fu writes: > Introduce a new test for native calls to ensure their functionality. > The process involves cross-compiling the test cases, building them > as dynamically linked binaries, and running these binaries which > necessitates the addition of the appropriate interpreter prefix. > > S

Re: [PATCH for-8.2] dockerfiles: bump tricore cross compiler container to Debian 11

2023-08-09 Thread Alex Bennée
Paolo Bonzini writes: > With the release of version 12 on June 10, 2023, Debian 10 is > not supported anymore. Modify the cross compiler container to > build on a newer version. > > Signed-off-by: Paolo Bonzini > --- > tests/docker/dockerfiles/debian-tricore-cross.docker | 2 +- > 1 file cha

Re: [PATCH v2 1/7] tcg/ppc: Untabify tcg-target.c.inc

2023-08-09 Thread Nicholas Piggin
Acked-by: Nicholas Piggin On Tue Aug 8, 2023 at 1:02 PM AEST, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > tcg/ppc/tcg-target.c.inc | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc > index 5

Re: [PATCH] block-migration: Ensure we don't crash during migration cleanup

2023-08-09 Thread Claudio Fontana
On 8/8/23 19:08, Stefan Hajnoczi wrote: > On Mon, Jul 31, 2023 at 05:33:38PM -0300, Fabiano Rosas wrote: >> We can fail the blk_insert_bs() at init_blk_migration(), leaving the >> BlkMigDevState without a dirty_bitmap and BlockDriverState. Account >> for the possibly missing elements when doing cle

Re: [PATCH v2 2/7] tcg/ppc: Use PADDI in tcg_out_movi

2023-08-09 Thread Nicholas Piggin
On Tue Aug 8, 2023 at 1:02 PM AEST, Richard Henderson wrote: > PADDI can load 34-bit immediates and 34-bit pc-relative addresses. > Reviewed-by: Nicholas Piggin > Reviewed-by: Jordan Niethe > Signed-off-by: Richard Henderson > --- > tcg/ppc/tcg-target.c.inc | 51 ++

Re: [PATCH] vfio/pci: hide ROM BAR on SFC9220 10/40G Ethernet Controller PF

2023-08-09 Thread Laszlo Ersek
On 8/8/23 17:40, Alex Williamson wrote: > On Tue, 8 Aug 2023 16:59:16 +0200 > Laszlo Ersek wrote: > >> The Solarflare Communications SFC9220 NIC's physical function (PF) appears >> to expose an expansion ROM with the following characteristics: >> >> (1) Single-image ROM, with only a legacy BIOS

Re: [PATCH 2/2] linux-user: Use ARRAY_SIZE with bitmask_transtbl

2023-08-09 Thread Alex Bennée
Richard Henderson writes: > Rather than using a zero tuple to end the table, use a macro > to apply ARRAY_SIZE and pass that on to the convert functions. > > This fixes two bugs in which the conversion functions required > that both the target and host masks be non-zero in order to > continue,

Re: [PATCH 1/2] linux-user: Split out do_mmap

2023-08-09 Thread Alex Bennée
Richard Henderson writes: > New function that rejects unsupported map types and flags. > In 4b840f96 we should not have accepted MAP_SHARED_VALIDATE > without actually validating the rest of the flags. > > Fixes: 4b840f96 ("linux-user: Populate more bits in mmap_flags_tbl") > Signed-off-by: Ric

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-09 Thread David Hildenbrand
Hi Peter! -fd = file_ram_open(mem_path, memory_region_name(mr), readonly, &created, - errp); +fd = file_ram_open(mem_path, memory_region_name(mr), readonly, &created); +if (fd == -EACCES && !(ram_flags & RAM_SHARED) && !readonly) { +/* + * We can

Re: [PATCH 4/7] spapr: Fix record-replay machine reset consuming too many events

2023-08-09 Thread Nicholas Piggin
On Tue Aug 8, 2023 at 1:52 PM AEST, Pavel Dovgalyuk wrote: > On 08.08.2023 06:09, Nicholas Piggin wrote: > > On Sun Aug 6, 2023 at 9:46 PM AEST, Nicholas Piggin wrote: > >> On Fri Aug 4, 2023 at 6:50 PM AEST, Pavel Dovgalyuk wrote: > >>> BTW, there is a function qemu_register_reset_nosnapshotload t

[PATCH 1/9] python: mkvenv: tweak the matching of --diagnose to depspecs

2023-08-09 Thread Paolo Bonzini
Move the matching between the "absent" array and dep_specs[0] inside the loop, preparing for the possibility of having multiple canaries among the installed packages. Signed-off-by: Paolo Bonzini --- python/scripts/mkvenv.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a

[PATCH 2/9] python: mkvenv: introduce TOML-like representation of dependencies

2023-08-09 Thread Paolo Bonzini
We would like to place all Python dependencies in the same file, so that we can add more information without having long and complex command lines. The plan is to have a TOML file with one entry per package, for example [avocado] avocado-framework = { accepted = "(>=88.1, <93.0)", inst

[PATCH 4/9] lcitool: bump libvirt-ci submodule and regenerate

2023-08-09 Thread Paolo Bonzini
This brings in a newer version of the pipewire mapping, so rename it. Python 3.9 and 3.10 do not seem to work in OpenSUSE LEAP 15.5 (weird, because 3.9 persisted from 15.3 to 15.4) so bump the Python runtime version to 3.11. Signed-off-by: Paolo Bonzini --- .../dockerfiles/debian-amd64-cross.do

[PATCH 8/9] Revert "tests: Use separate virtual environment for avocado"

2023-08-09 Thread Paolo Bonzini
This reverts commit e8e4298feadae7924cf7600bb3bcc5b0a8d7cbe9. ensuregroup allows to specify both the acceptable versions of avocado, and a locked version to be used when avocado is not installed as a system pacakge. This lets us install avocado in pyvenv/ using "mkvenv.py" and reuse the distro pa

[PATCH 0/9] Use known good releases when installing in pyvenv

2023-08-09 Thread Paolo Bonzini
This series introduce a new installation command for mkvenv.py that retrieves the packages to be installed from a TOML file. This allows being more flexible in using the system version of a package, while at the same time using a known-good version when installing the package. This is important for

[PATCH 6/9] python: use vendored tomli

2023-08-09 Thread Paolo Bonzini
Debian only introduced tomli in the bookworm release. Use a vendored wheel to avoid requiring a package that is only in bullseye-backports and is also absent in Ubuntu 20.04. While at it, fix an issue in the vendor.py scripts which does not add a newline after each package and hash. Signed-off-b

[PATCH 9/9] tests/docker: add python3-tomli dependency to containers

2023-08-09 Thread Paolo Bonzini
Instead of having CI pick tomli from the vendored wheel at configure time, place it in the containers. Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/cirrus/freebsd-13.vars | 2 +- .gitlab-ci.d/cirrus/macos-12.vars | 2 +- tests/docker/dockerfiles/centos8.docker

[PATCH 3/9] python: mkvenv: add ensuregroup command

2023-08-09 Thread Paolo Bonzini
Introduce a new subcommand that retrieves the packages to be installed from a TOML file. This allows being more flexible in using the system version of a package, while at the same time using a known-good version when installing the package. This is important for packages that sometimes have backw

[PATCH 5/9] configure: never use PyPI for Meson

2023-08-09 Thread Paolo Bonzini
Since there is a vendored copy, there is no point in choosing online operation. Signed-off-by: Paolo Bonzini --- configure | 6 -- 1 file changed, 6 deletions(-) diff --git a/configure b/configure index f2bd8858d6c..f13f0662b98 100755 --- a/configure +++ b/configure @@ -1018,13 +1018,7 @@ f

[PATCH 7/9] configure: switch to ensuregroup

2023-08-09 Thread Paolo Bonzini
Using the new ensuregroup command, the desired versions of meson and sphinx can be placed in pythondeps.toml rather than configure. The meson.install entry in pythondeps.toml matches the version that is found in python/wheels. This ensures that mkvenv.py uses the bundled wheel even if PyPI is ena

[PATCH] hw/ppc/e500: fix broken snapshot replay

2023-08-09 Thread Maksim Kostin
ppce500_reset_device_tree is registered for system reset, but after c4b075318eb1 this function rerandomizes rng-seed via qemu_guest_getrandom_nofail. And when loading a snapshot, it tries to read EVENT_RANDOM that doesn't exist, so we have an error: qemu-system-ppc: Missing random event in the r

[PATCH v2] target/i386: Avoid cpu number overflow in legacy topology

2023-08-09 Thread Qian Wen
The legacy topology enumerated by CPUID.1.EBX[23:16] is defined in SDM Vol2: Bits 23-16: Maximum number of addressable IDs for logical processors in this physical package. When launching the VM with -smp 256, the value written to EBX[23:16] is 0 because of data overflow. If the guest only support

[PATCH] hw/pci-host: Allow extended config space access for Designware PCIe host

2023-08-09 Thread Jason Chien
In pcie_bus_realize(), a root bus is realized as a PCIe bus and a non-root bus is realized as a PCIe bus if its parent bus is a PCIe bus. However, the child bus "dw-pcie" is realized before the parent bus "pcie" which is the root PCIe bus. Thus, the extended configuration space is not accessible on

Re: [PATCH 0/2] hw/nvme: two fixes

2023-08-09 Thread Jesper Devantier
On Tue, Aug 08, 2023 at 05:16:12PM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Fix two potential accesses to null pointers. > > Klaus Jensen (2): > hw/nvme: fix null pointer access in directive receive > hw/nvme: fix null pointer access in ruh update > > hw/nvme/ctrl.c | 10 +++

Re: [PATCH for-8.1] tests/tcg: Disable filename test for info proc mappings

2023-08-09 Thread Ilya Leoshkevich
On Tue, 2023-08-08 at 16:49 -0700, Richard Henderson wrote: > This test fails when host page size != guest page size, > because qemu may not be able to directly map the file. > > Fixes: a6341482695 ("tests/tcg: Add a test for info proc mappings") > Signed-off-by: Richard Henderson > --- >  tests/

Re: [PATCH v2 3/7] tcg/ppc: Use prefixed instructions in tcg_out_mem_long

2023-08-09 Thread Nicholas Piggin
On Tue Aug 8, 2023 at 1:02 PM AEST, Richard Henderson wrote: > When the offset is out of range of the non-prefixed insn, but > fits the 34-bit immediate of the prefixed insn, use that. > The switch will fall through in some cases (at least opi == 0). Should it have a default: break; to make that o

Re: [PATCH v2] target/i386: Avoid cpu number overflow in legacy topology

2023-08-09 Thread Igor Mammedov
On Wed, 9 Aug 2023 18:27:32 +0800 Qian Wen wrote: > The legacy topology enumerated by CPUID.1.EBX[23:16] is defined in SDM > Vol2: > > Bits 23-16: Maximum number of addressable IDs for logical processors in > this physical package. > > When launching the VM with -smp 256, the value written to

Re: [PATCH v2 4/7] tcg/ppc: Use PLD in tcg_out_movi for constant pool

2023-08-09 Thread Nicholas Piggin
On Tue Aug 8, 2023 at 1:02 PM AEST, Richard Henderson wrote: > The prefixed instruction has a pc-relative form to use here. I don't understand this code very well but going by existing relocs it looks okay. Reviewed-by: Nicholas Piggin > > Signed-off-by: Richard Henderson > --- > tcg/ppc/tcg-

Re: [PATCH v2 6/7] tcg/ppc: Disable USE_REG_TB for Power v3.1

2023-08-09 Thread Nicholas Piggin
On Tue Aug 8, 2023 at 1:02 PM AEST, Richard Henderson wrote: > With Power v3.1, we have pc-relative addressing and so > do not require a register holding the current TB. > Acked-by: Nicholas Piggin > Signed-off-by: Richard Henderson > --- > tcg/ppc/tcg-target.c.inc | 2 +- > 1 file changed, 1

Re: [PATCH v2 7/7] tcg/ppc: Use prefixed instructions for tcg_out_goto_tb

2023-08-09 Thread Nicholas Piggin
On Tue Aug 8, 2023 at 1:02 PM AEST, Richard Henderson wrote: > When a direct branch is out of range, we can load the destination for > the indirect branch using PLA (for 16GB worth of buffer) and PLD from > the TranslationBlock for everything larger. > > This means the patch affects exactly one ins

Re: [PATCH] vfio/pci: hide ROM BAR on SFC9220 10/40G Ethernet Controller PF

2023-08-09 Thread Laszlo Ersek
On 8/8/23 17:40, Alex Williamson wrote: > On Tue, 8 Aug 2023 16:59:16 +0200 > Laszlo Ersek wrote: > >> The Solarflare Communications SFC9220 NIC's physical function (PF) appears >> to expose an expansion ROM with the following characteristics: >> >> (1) Single-image ROM, with only a legacy BIOS

Re: [RFC v1 0/3] Initial support for SPDM

2023-08-09 Thread Jonathan Cameron via
On Tue, 8 Aug 2023 11:51:21 -0400 Alistair Francis wrote: > The Security Protocol and Data Model (SPDM) Specification defines > messages, data objects, and sequences for performing message exchanges > over a variety of transport and physical media. > - > https://www.dmtf.org/sites/default/file

[PATCH v3 1/6] target/arm/ptw: Load stage-2 tables from realm physical space

2023-08-09 Thread Jean-Philippe Brucker
In realm state, stage-2 translation tables are fetched from the realm physical address space (R_PGRQD). Signed-off-by: Jean-Philippe Brucker Reviewed-by: Peter Maydell --- target/arm/ptw.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/target/arm

[PATCH v3 4/6] target/arm: Pass security space rather than flag for AT instructions

2023-08-09 Thread Jean-Philippe Brucker
At the moment we only handle Secure and Nonsecure security spaces for the AT instructions. Add support for Realm and Root. For AArch64, arm_security_space() gives the desired space. ARM DDI0487J says (R_NYXTL): If EL3 is implemented, then when an address translation instruction that applies t

[PATCH v3 3/6] target/arm: Skip granule protection checks for AT instructions

2023-08-09 Thread Jean-Philippe Brucker
GPC checks are not performed on the output address for AT instructions, as stated by ARM DDI 0487J in D8.12.2: When populating PAR_EL1 with the result of an address translation instruction, granule protection checks are not performed on the final output address of a successful translation.

[PATCH v3 6/6] target/arm/helper: Implement CNTHCTL_EL2.CNT[VP]MASK

2023-08-09 Thread Jean-Philippe Brucker
When FEAT_RME is implemented, these bits override the value of CNT[VP]_CTL_EL0.IMASK in Realm and Root state. Move the IRQ state update into a new gt_update_irq() function and test those bits every time we recompute the IRQ state. Since we're removing the IRQ state from some trace events, add a ne

[PATCH v3 0/6] target/arm: Fixes for RME

2023-08-09 Thread Jean-Philippe Brucker
A few patches to fix RME support and allow booting a realm guest, based on "[PATCH v2 00/15] target/arm/ptw: Cleanups and a few bugfixes" https://lore.kernel.org/all/20230807141514.19075-1-peter.mayd...@linaro.org/ Since v2: * Updated the comment in patch 5. I also removed the check for FEAT_RME,

[PATCH v3 2/6] target/arm/helper: Fix tlbmask and tlbbits for TLBI VAE2*

2023-08-09 Thread Jean-Philippe Brucker
When HCR_EL2.E2H is enabled, TLB entries are formed using the EL2&0 translation regime, instead of the EL2 translation regime. The TLB VAE2* instructions invalidate the regime that corresponds to the current value of HCR_EL2.E2H. At the moment we only invalidate the EL2 translation regime. This ca

[PATCH v3 5/6] target/arm/helper: Check SCR_EL3.{NSE, NS} encoding for AT instructions

2023-08-09 Thread Jean-Philippe Brucker
The AT instruction is UNDEFINED if the {NSE,NS} configuration is invalid. Add a function to check this on all AT instructions that apply to an EL lower than 3. Suggested-by: Peter Maydell Signed-off-by: Jean-Philippe Brucker --- target/arm/helper.c | 38 +++--- 1

Re: [RFC v4 01/11] build: Implement logic for sharing cross-building config files

2023-08-09 Thread Manos Pitsidianakis
This patch needs a detailed commit message, since it's not obvious why these changes are made at all. It'd also be helpful for reviewing. General style comment for shell scripts: Always put curly braces around variables even if they are unnecessary. a $source_path could become $source_pathPREF

Re: [RFC v4 11/11] docs/user: Add doc for native library calls

2023-08-09 Thread Manos Pitsidianakis
On Tue, 08 Aug 2023 16:17, Yeqi Fu wrote: +arm and aarch64 +--- +HLT is an invalid instruction for userspace and usefully has 16 +bits of spare immeadiate data which we can stuff data in. s/immeadiate/immediate With that fix, you can add Reviewed-by: Emmanouil Pitsidianakis

Re: [PATCH v2 10/19] target/ppc: Migrate DECR SPR

2023-08-09 Thread Cédric Le Goater
Hello Nick, On 8/8/23 06:19, Nicholas Piggin wrote: TCG does not maintain the DEC reigster in the SPR array, so it does get migrated. TCG also needs to re-start the decrementer timer on the destination machine. Load and store the decrementer into the SPR when migrating. This works for the level

RE: [PATCH] Fix SEGFAULT on getting physical address of MMIO region.

2023-08-09 Thread Mikhail Tyutin
> On 8/2/23 06:08, Mikhail Tyutin wrote: > > The fix is to clear TLB_INVALID_MASK bit in tlb_addr, as it happens in > > other places e.g. > > load_helper(). > > > > Signed-off-by: Dmitriy Solovev > > Signed-off-by: Mikhail Tyutin > > --- > > accel/tcg/cputlb.c | 2 +- > > 1 file changed, 1 in

Re: [PATCH v2] target/i386: Avoid cpu number overflow in legacy topology

2023-08-09 Thread Wen, Qian
On 8/9/2023 7:14 PM, Igor Mammedov wrote: > On Wed, 9 Aug 2023 18:27:32 +0800 > Qian Wen wrote: > >> The legacy topology enumerated by CPUID.1.EBX[23:16] is defined in SDM >> Vol2: >> >> Bits 23-16: Maximum number of addressable IDs for logical processors in >> this physical package. >> >> When l

[PULL 0/2] hw/nvme: more fixes

2023-08-09 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit a8fc5165aab02f328ccd148aafec1e59fd1426eb: Merge tag 'nvme-next-pull-request' of https://gitlab.com/birkelund/qemu into staging (2023-08-08 16:39:20 -0700) are available in the Git repository at: https://gitlab.com/birkelund/qemu.g

Re: [PATCH v2 2/3] hw/smbios: Fix thread count in type4

2023-08-09 Thread Igor Mammedov
On Mon, 7 Aug 2023 22:31:35 +0800 Zhao Liu wrote: > Hi Igor, > > On Mon, Aug 07, 2023 at 12:11:29PM +0200, Igor Mammedov wrote: > > Date: Mon, 7 Aug 2023 12:11:29 +0200 > > From: Igor Mammedov > > Subject: Re: [PATCH v2 2/3] hw/smbios: Fix thread count in type4 > > X-Mailer: Claws Mail 4.1.1 (G

[PULL 2/2] hw/nvme: fix null pointer access in ruh update

2023-08-09 Thread Klaus Jensen
From: Klaus Jensen The Reclaim Unit Update operation in I/O Management Receive does not verify the presence of a configured endurance group prior to accessing it. Fix this. Cc: qemu-sta...@nongnu.org Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation") Reviewed-by: Jesper Wendel D

[PULL 1/2] hw/nvme: fix null pointer access in directive receive

2023-08-09 Thread Klaus Jensen
From: Klaus Jensen nvme_directive_receive() does not check if an endurance group has been configured (set) prior to testing if flexible data placement is enabled or not. Fix this. Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1815 Fixes: 73064edfb864 ("hw/nv

Re: [PATCH v2] target/i386: Avoid cpu number overflow in legacy topology

2023-08-09 Thread Igor Mammedov
On Wed, 9 Aug 2023 21:20:48 +0800 "Wen, Qian" wrote: > On 8/9/2023 7:14 PM, Igor Mammedov wrote: > > On Wed, 9 Aug 2023 18:27:32 +0800 > > Qian Wen wrote: > > > >> The legacy topology enumerated by CPUID.1.EBX[23:16] is defined in SDM > >> Vol2: > >> > >> Bits 23-16: Maximum number of address

Re: [PATCH for-8.2] configure: fix and complete detection of tricore tools

2023-08-09 Thread Bastian Koppelmann
On Wed, Aug 09, 2023 at 10:29:44AM +0200, Paolo Bonzini wrote: > The tricore tools are not detected when they are installed in > the host system, only if they are taken from an external > container. For this reason the build-tricore-softmmu job > was not running the TCG tests. > > In addition the

Re: [PATCH for-8.2] configure: fix and complete detection of tricore tools

2023-08-09 Thread Bastian Koppelmann
On Wed, Aug 09, 2023 at 03:49:01PM +0200, Bastian Koppelmann wrote: > On Wed, Aug 09, 2023 at 10:29:44AM +0200, Paolo Bonzini wrote: > > The tricore tools are not detected when they are installed in > > the host system, only if they are taken from an external > > container. For this reason the bui

Re: [PATCH for-8.2] dockerfiles: bump tricore cross compiler container to Debian 11

2023-08-09 Thread Bastian Koppelmann
On Wed, Aug 09, 2023 at 10:29:45AM +0200, Paolo Bonzini wrote: > With the release of version 12 on June 10, 2023, Debian 10 is > not supported anymore. Modify the cross compiler container to > build on a newer version. > > Signed-off-by: Paolo Bonzini > --- > tests/docker/dockerfiles/debian-tri

Re: [PATCH v2] migration/calc-dirty-rate: millisecond-granularity period

2023-08-09 Thread gudkov . andrei--- via
On Sun, Aug 06, 2023 at 02:31:43PM +0800, Yong Huang wrote: > On Sat, Aug 5, 2023 at 2:05 AM Markus Armbruster wrote: > > > Andrei Gudkov writes: > > > > > Introduces alternative argument calc-time-ms, which is the > > > the same as calc-time but accepts millisecond value. > > > Millisecond gran

Re: [PATCH for-8.2] dockerfiles: bump tricore cross compiler container to Debian 11

2023-08-09 Thread Paolo Bonzini
On Wed, Aug 9, 2023 at 3:53 PM Bastian Koppelmann wrote: > > diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker > > b/tests/docker/dockerfiles/debian-tricore-cross.docker > > index 269bfa8d423..5bd1963fb55 100644 > > --- a/tests/docker/dockerfiles/debian-tricore-cross.docker > > ++

Re: [PATCH] Fix SEGFAULT on getting physical address of MMIO region.

2023-08-09 Thread Richard Henderson
On 8/9/23 06:17, Mikhail Tyutin wrote: Would not be better to get back to initial v1 approach when we clean TLB_INVALID_MASK flag in tlb_plugin_lookup()? It works well for those regions. You're just as likely to get invalid data. r~

Re: [PATCH v5 02/11] target/loongarch: Add new object class for loongarch32 cpus

2023-08-09 Thread Richard Henderson
On 8/9/23 01:26, Jiajie Chen wrote: Add object class for future loongarch32 cpus. It is derived from the loongarch64 object class. Signed-off-by: Jiajie Chen --- target/loongarch/cpu.c | 19 +++ target/loongarch/cpu.h | 1 + 2 files changed, 20 insertions(+) Reviewed-by: R

Re: [RFC v4 01/11] build: Implement logic for sharing cross-building config files

2023-08-09 Thread Alex Bennée
Yeqi Fu writes: > Signed-off-by: Yeqi Fu > --- > configure | 57 +-- > 1 file changed, 34 insertions(+), 23 deletions(-) > > diff --git a/configure b/configure > index 2b41c49c0d..a076583141 100755 > --- a/configure > +++ b/configure > @@ -1

Re: [PATCH for-8.2 2/3] pnv/lpc: Hook up xscom region for P9/P10

2023-08-09 Thread Frederic Barrat
Hello Joel, So we're re-using the same xscom ops as on P8. A quick look at the definition of those 4 registers on P8 (0xb0020) and on P9/P10 (0x00090040) seem to show they are not the same though. Am i missing something? Fred On 08/08/2023 10:34, Joel Stanley wrote: From P9 on the LPC

Re: [PATCH v5 08/11] target/loongarch: Reject la64-only instructions in la32 mode

2023-08-09 Thread Richard Henderson
On 8/9/23 01:26, Jiajie Chen wrote: LoongArch64-only instructions are marked with regard to the instruction manual Table 2. LSX instructions are not marked for now for lack of public manual. I would expect LSX not to be affected by CPUCFG.1.ARCH, but only by CPUCFG.2.LSX. Note that there appe

Re: [PATCH v2] migration/calc-dirty-rate: millisecond-granularity period

2023-08-09 Thread gudkov . andrei--- via
On Sun, Aug 06, 2023 at 02:16:34PM +0800, Yong Huang wrote: > On Fri, Aug 4, 2023 at 11:03 PM Andrei Gudkov > wrote: > > > Introduces alternative argument calc-time-ms, which is the > > the same as calc-time but accepts millisecond value. > > Millisecond granularity allows to make predictions whe

Re: [PATCH v5 09/11] target/loongarch: Truncate high 32 bits of address in VA32 mode

2023-08-09 Thread Richard Henderson
On 8/9/23 01:26, Jiajie Chen wrote: When running in VA32 mode(!LA64 or VA32L[1-3] matching PLV), virtual address is truncated to 32 bits before address mapping. Signed-off-by: Jiajie Chen Co-authored-by: Richard Henderson --- target/loongarch/cpu.c| 16 target

Re: [PATCH v5 10/11] target/loongarch: Sign extend results in VA32 mode

2023-08-09 Thread Richard Henderson
On 8/9/23 01:26, Jiajie Chen wrote: In VA32 mode, BL, JIRL and PC* instructions should sign-extend the low 32 bit result to 64 bits. Signed-off-by: Jiajie Chen --- target/loongarch/insn_trans/trans_arith.c.inc | 2 +- target/loongarch/insn_trans/trans_branch.c.inc | 4 ++-- target/loongarch

Fix interval_tree_iter_first() to check root node value

2023-08-09 Thread Helge Deller
Fix a crash in qemu-user when running cat /proc/self/maps in a chroot, where /proc isn't mounted. The problem was introduced by commit 3ce3dd8ca965 ("util/selfmap: Rewrite using qemu/interval-tree.h") where in open_self_maps_1() the function read_self_maps() is called and which returns NULL

Re: [PATCH v5 11/11] target/loongarch: Add loongarch32 cpu la132

2023-08-09 Thread Richard Henderson
On 8/9/23 01:26, Jiajie Chen wrote: Add la132 as a loongarch32 cpu type and allow virt machine to be used with la132 instead of la464. Due to lack of public documentation of la132, it is currently a synthetic loongarch32 cpu model. Details need to be added in the future. Signed-off-by: Jiajie C

Re: [PATCH v1 1/3] softmmu/physmem: fallback to opening guest RAM file as readonly in a MAP_PRIVATE mapping

2023-08-09 Thread Peter Xu
On Wed, Aug 09, 2023 at 11:20:11AM +0200, David Hildenbrand wrote: > Hi Peter! Hi, David, > > > > -fd = file_ram_open(mem_path, memory_region_name(mr), readonly, > > > &created, > > > - errp); > > > +fd = file_ram_open(mem_path, memory_region_name(mr), readonly, >

Re: Fix interval_tree_iter_first() to check root node value

2023-08-09 Thread Richard Henderson
On 8/9/23 08:11, Helge Deller wrote: Fix a crash in qemu-user when running cat /proc/self/maps in a chroot, where /proc isn't mounted. The problem was introduced by commit 3ce3dd8ca965 ("util/selfmap: Rewrite using qemu/interval-tree.h") where in open_self_maps_1() the function read_self_

Re: [RFC v4 02/11] build: Implement libnative library and the build machinery for libnative

2023-08-09 Thread Alex Bennée
Yeqi Fu writes: > This commit implements a shared library, where native functions are > rewritten as special instructions. At runtime, user programs load > the shared library, and special instructions are executed when > native functions are called. > > Signed-off-by: Yeqi Fu > --- > Makefile

Re: [RFC PATCH 15/19] kvm: handle KVM_EXIT_MEMORY_FAULT

2023-08-09 Thread Xu Yilun
On 2023-07-31 at 12:21:57 -0400, Xiaoyao Li wrote: > From: Chao Peng > > Currently only KVM_MEMORY_EXIT_FLAG_PRIVATE in flags is valid when > KVM_EXIT_MEMORY_FAULT happens. It indicates userspace needs to do > the memory conversion on the RAMBlock to turn the memory into desired > attribute, i.e.

Re: [RFC v4 01/11] build: Implement logic for sharing cross-building config files

2023-08-09 Thread Alex Bennée
Alex Bennée writes: > Yeqi Fu writes: > >> Signed-off-by: Yeqi Fu >> --- >> configure | 57 +-- >> 1 file changed, 34 insertions(+), 23 deletions(-) >> >> diff --git a/configure b/configure >> index 2b41c49c0d..a076583141 100755 >> --- a/co

Re: [PATCH v2] migration/calc-dirty-rate: millisecond-granularity period

2023-08-09 Thread Peter Xu
On Wed, Aug 09, 2023 at 06:02:52PM +0300, gudkov.and...@huawei.com wrote: > > Not for the patch, I'm just curious about how the predication > > decides the network throughput, I mean QEMU predicts > > if migration will converge based on how fast it sends the data, > > not the actual bandwidth of th

[PATCH QEMU] docs/migration: Add the dirty limit section

2023-08-09 Thread ~hyman
From: Hyman Huang(黄勇) The dirty limit feature has been introduced since the 8.1 QEMU release but has not reflected in the document, add a section for that. Signed-off-by: Hyman Huang(黄勇) --- docs/devel/migration.rst | 70 1 file changed, 70 insertions(+

Re: [RFC v4 04/11] linux-user: Implement native-bypass option support

2023-08-09 Thread Richard Henderson
On 8/8/23 07:17, Yeqi Fu wrote: +#define native_bypass_enabled() native_lib_path ? true : false Need parenthesis for the expression, and possibly better as (native_lib_path != NULL) rather than ternary expression. +#if defined(CONFIG_NATIVE_CALL) +/* Set the library for native bypas

Re: [RFC v4 03/11] linux-user: Implement envlist_appendenv and add tests for envlist

2023-08-09 Thread Richard Henderson
On 8/8/23 07:17, Yeqi Fu wrote: Signed-off-by: Yeqi Fu --- include/qemu/envlist.h| 13 ++ tests/unit/meson.build| 1 + tests/unit/test-envlist.c | 94 +++ util/envlist.c| 71 - 4 files changed, 169 ins

Re: [RFC v4 03/11] linux-user: Implement envlist_appendenv and add tests for envlist

2023-08-09 Thread Alex Bennée
Yeqi Fu writes: > Signed-off-by: Yeqi Fu > --- > include/qemu/envlist.h| 13 ++ > tests/unit/meson.build| 1 + > tests/unit/test-envlist.c | 94 +++ > util/envlist.c| 71 - > 4 files changed, 169 insertio

Re: [RFC v4 04/11] linux-user: Implement native-bypass option support

2023-08-09 Thread Alex Bennée
Yeqi Fu writes: > This commit implements the -native-bypass support in linux-user. The > native_calls_enabled() function can be true only when the > '-native-bypass' option is given. > > Signed-off-by: Yeqi Fu > --- > include/native/native.h | 9 + > linux-user/main.c | 38

Re: Fix interval_tree_iter_first() to check root node value

2023-08-09 Thread Helge Deller
On 8/9/23 17:23, Richard Henderson wrote: On 8/9/23 08:11, Helge Deller wrote: Fix a crash in qemu-user when running cat /proc/self/maps in a chroot, where /proc isn't mounted. The problem was introduced by commit 3ce3dd8ca965 ("util/selfmap: Rewrite using qemu/interval-tree.h") where in

Re: [RFC v4 03/11] linux-user: Implement envlist_appendenv and add tests for envlist

2023-08-09 Thread Richard Henderson
On 8/8/23 07:17, Yeqi Fu wrote: +char *new_env_value = NULL; +size_t new_env_len = strlen(entry->ev_var) + strlen(eq_sign) ++ strlen(separator) + 1; +new_env_value = g_malloc(new_env_len); +strcpy(new_env_value, entry->ev_var); +strcat(new_env_v

Re: [RFC v4 02/11] build: Implement libnative library and the build machinery for libnative

2023-08-09 Thread Richard Henderson
On 8/8/23 07:17, Yeqi Fu wrote: +#if defined(i386) || defined(x86_64) +/* + * An unused instruction is utilized to mark a native call. + */ +#define __CALL_EXPR ".byte 0x0f, 0xff;" +#endif This is 2 of the 3 (or more) bytes of the UD0 instruction. At minimum you should include a third byte for

Re: [RFC v4 05/11] linux-user/elfload: Add support for parsing symbols of native libraries.

2023-08-09 Thread Richard Henderson
On 8/8/23 07:17, Yeqi Fu wrote: This commit addresses the need to parse symbols of native libraries. The base address of a shared library is determined by the dynamic linker. To simplify the process, we focus on the last three digits, which reside within the same page and remain unaffected by the

Re: Fix interval_tree_iter_first() to check root node value

2023-08-09 Thread Richard Henderson
On 8/9/23 08:53, Helge Deller wrote: On 8/9/23 17:23, Richard Henderson wrote: On 8/9/23 08:11, Helge Deller wrote: Fix a crash in qemu-user when running cat /proc/self/maps in a chroot, where /proc isn't mounted. The problem was introduced by commit 3ce3dd8ca965 ("util/selfmap: Rewrite

Re: [RFC v4 07/11] target/i386: Add support for native library calls

2023-08-09 Thread Richard Henderson
On 8/8/23 07:17, Yeqi Fu wrote: This commit introduces support for native library calls on the i386 target. When special instructions reserved for native calls are encountered, the code now performs address translation and generates the corresponding native call. Signed-off-by: Yeqi Fu --- co

Re: [PATCH for-8.2] dockerfiles: bump tricore cross compiler container to Debian 11

2023-08-09 Thread Bastian Koppelmann
On Wed, Aug 09, 2023 at 04:33:37PM +0200, Paolo Bonzini wrote: > On Wed, Aug 9, 2023 at 3:53 PM Bastian Koppelmann > wrote: > > > diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker > > > b/tests/docker/dockerfiles/debian-tricore-cross.docker > > > index 269bfa8d423..5bd1963fb55 100

Re: [RFC v1 0/3] Initial support for SPDM

2023-08-09 Thread Alistair Francis
On Wed, Aug 9, 2023 at 8:11 AM Jonathan Cameron wrote: > > On Tue, 8 Aug 2023 11:51:21 -0400 > Alistair Francis wrote: > > > The Security Protocol and Data Model (SPDM) Specification defines > > messages, data objects, and sequences for performing message exchanges > > over a variety of transpor

  1   2   >