Re: [PATCH v4 13/16] target/riscv: compressed encodings for sspush and sspopchk

2024-08-15 Thread Deepak Gupta
On Fri, Aug 16, 2024 at 03:09:10PM +1000, Richard Henderson wrote: On 8/16/24 11:07, Deepak Gupta wrote: sspush/sspopchk have compressed encodings carved out of zcmops. compressed sspush is designated as c.mop.1 while compressed sspopchk is designated as c.mop.5. Note that c.sspush x1 exists wh

Re: [PATCH 0/6] build contrib/plugins using meson

2024-08-15 Thread Philippe Mathieu-Daudé
On 15/8/24 20:04, Pierrick Bouvier wrote: On 8/14/24 23:00, Paolo Bonzini wrote: On Thu, Aug 15, 2024 at 1:37 AM Pierrick Bouvier wrote: Contrib plugins have been built out of tree so far, thanks to a Makefile. However, it is quite inconvenient for maintenance, as we may break them, especiall

Re: [PATCH v4 05/16] target/riscv: tracking indirect branches (fcfi) for zicfilp

2024-08-15 Thread Deepak Gupta
On Fri, Aug 16, 2024 at 01:41:51PM +1000, Richard Henderson wrote: On 8/16/24 11:06, Deepak Gupta wrote: @@ -1245,6 +1250,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) static void riscv_tr_tb_start(DisasContextBase *db, CPUState *cpu) { + } Watch the

Re: [PATCH v4 03/16] target/riscv: save and restore elp state on priv transitions

2024-08-15 Thread Deepak Gupta
On Fri, Aug 16, 2024 at 12:59:43PM +1000, Richard Henderson wrote: On 8/16/24 11:06, Deepak Gupta wrote: @@ -546,6 +575,15 @@ void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env) } bool current_virt = env->virt_enabled; +/* + * If zicfilp extension available and henvcfg.LPE

Re: [PATCH v2 3/4] target/m68k: Implement packed decimal real stores

2024-08-15 Thread Philippe Mathieu-Daudé
Hi Richard, On 12/8/24 02:44, Richard Henderson wrote: Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2488 Signed-off-by: Richard Henderson --- target/m68k/helper.h | 1 + target/m68k/fpu_helper.c | 112 +++ target/m68k/translate.c | 27 +

[PATCH v3] meson: Use -fno-sanitize=function when available

2024-08-15 Thread Akihiko Odaki
Commit 23ef50ae2d0c (".gitlab-ci.d/buildtest.yml: Use -fno-sanitize=function in the clang-system job") adds -fno-sanitize=function for the CI but doesn't add the flag in the other context. Add it to meson.build for such. It is not removed from .gitlab-ci.d/buildtest.yml because -fno-sanitize=functi

Re: [PATCH v3] kvm: replace fprintf with error_report/printf() in kvm_init()

2024-08-15 Thread Philippe Mathieu-Daudé
On 12/8/24 11:59, Ani Sinha wrote: On Mon, 12 Aug, 2024, 3:23 pm Ani Sinha, > wrote: On Fri, Aug 9, 2024 at 2:06 PM Philippe Mathieu-Daudé mailto:phi...@linaro.org>> wrote: > > Hi Ani, > > On 9/8/24 08:49, Ani Sinha wrote: > > error

Re: [PATCH-for-9.1? v2] hw/pci/pci-hmp-cmds: Avoid displaying bogus size in 'info pci'

2024-08-15 Thread Philippe Mathieu-Daudé
ping On 1/8/24 15:14, Philippe Mathieu-Daudé wrote: When BAR aren't mapped, we get: (qemu) info pci Bus 0, device 0, function 0: Host bridge: PCI device dead:beef ... BAR4: 32 bit memory at 0x [0x0ffe]. BAR5: I/O at 0x

[PATCH v3] contrib/plugins: Add a plugin to generate basic block vectors

2024-08-15 Thread Akihiko Odaki
in v3: - Protect the entire operation with bbs in vcpu_tb_trans(). - Reduce memory allocations. - Link to v2: https://lore.kernel.org/r/20240815-bb-v2-1-6222ee982...@daynix.com Changes in v2: - Merged files variable into the global scoreboard. - Added a lock for bbs. - Added a summary to contrib/plugins/

Re: [PATCH v2] meson: Use -fno-sanitize=function when available

2024-08-15 Thread Thomas Huth
On 29/07/2024 01.54, Richard Henderson wrote: On 7/29/24 01:44, Akihiko Odaki wrote: Commit 23ef50ae2d0c (".gitlab-ci.d/buildtest.yml: Use -fno-sanitize=function in the clang-system job") adds -fno-sanitize=function for the CI but doesn't add the flag in the other context. Add it to meson.build

Re: [PATCH v2] meson: Use -fno-sanitize=function when available

2024-08-15 Thread Thomas Huth
On 28/07/2024 17.44, Akihiko Odaki wrote: Commit 23ef50ae2d0c (".gitlab-ci.d/buildtest.yml: Use -fno-sanitize=function in the clang-system job") adds -fno-sanitize=function for the CI but doesn't add the flag in the other context. Add it to meson.build for such. It is not removed from .gitlab-ci.

Re: [PATCH for-9.1] linux-user: Handle short reads in mmap_h_gt_g

2024-08-15 Thread Philippe Mathieu-Daudé
On 15/8/24 23:32, Richard Henderson wrote: In particular, if an image has a large bss, we can hit EOF before reading all host_len bytes of the mapping. Cc: qemu-sta...@nongnu.org Fixes: eb5027ac618 ("linux-user: Split out mmap_h_gt_g") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2504

Re: [PATCH v4 16/16] target/riscv: add trace-hooks for each case of sw-check exception

2024-08-15 Thread Richard Henderson
On 8/16/24 11:07, Deepak Gupta wrote: Violations to control flow rules setup by zicfilp and zicfiss lead to software check exceptions. To debug and fix such sw check issues in guest , add trace-hooks for each case. Signed-off-by: Jim Shu Signed-off-by: Deepak Gupta --- target/riscv/helper.h

Re: [PATCH v7 01/10] acpi/generic_event_device: add an APEI error device

2024-08-15 Thread Mauro Carvalho Chehab
Em Wed, 14 Aug 2024 13:33:21 +0100 Jonathan Cameron escreveu: > On Wed, 14 Aug 2024 01:23:23 +0200 > Mauro Carvalho Chehab wrote: > > > Adds a generic error device to handle generic hardware error > > events as specified at ACPI 6.5 specification at 18.3.2.7.2: > > https://uefi.org/specs/ACPI/6

Re: [PATCH v7 05/10] acpi/ghes: rework the logic to handle HEST source ID

2024-08-15 Thread Mauro Carvalho Chehab
Em Wed, 14 Aug 2024 01:23:27 +0200 Mauro Carvalho Chehab escreveu: This hunk is wrong: > @@ -350,9 +380,10 @@ static void build_ghes_v2(GArray *table_data, int > source_id, BIOSLinker *linker) > build_append_gas(table_data, AML_AS_SYSTEM_MEMORY, 0x40, 0, > 4 /* QWord

Re: [PATCH v2 1/4] meson: hide tsan related warnings

2024-08-15 Thread Thomas Huth
On 15/08/2024 19.54, Peter Maydell wrote: On Thu, 15 Aug 2024 at 12:05, Daniel P. Berrangé wrote: On Thu, Aug 15, 2024 at 11:12:39AM +0100, Peter Maydell wrote: On Wed, 14 Aug 2024 at 23:42, Pierrick Bouvier wrote: When building with gcc-12 -fsanitize=thread, gcc reports some constructions

Re: [PATCH v4 12/16] target/riscv: implement zicfiss instructions

2024-08-15 Thread Richard Henderson
On 8/16/24 11:07, Deepak Gupta wrote: +static bool trans_ssamoswap_w(DisasContext *ctx, arg_amoswap_w *a) +{ +REQUIRE_A_OR_ZAAMO(ctx); +/* back cfi was not enabled, return false */ +if (!ctx->bcfi_enabled) { +return false; +} Please drop all of these comments which exact

Re: [PATCH v4 11/16] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-15 Thread Richard Henderson
On 8/16/24 11:07, Deepak Gupta wrote: zicfiss protects shadow stack using new page table encodings PTE.W=0, PTE.R=0 and PTE.X=0. This encoding is reserved if zicfiss is not implemented or if shadow stack are not enabled. Loads on shadow stack memory are allowed while stores to shadow stack memory

Re: [PATCH v2] contrib/plugins: Add a plugin to generate basic block vectors

2024-08-15 Thread Akihiko Odaki
On 2024/08/16 14:13, Akihiko Odaki wrote: On 2024/08/15 14:48, Pierrick Bouvier wrote: On 8/14/24 20:04, Akihiko Odaki wrote: SimPoint is a widely used tool to find the ideal microarchitecture simulation points so Valgrind[2] and Pin[3] support generating basic block vectors for use with them.

Re: [PATCH v2] contrib/plugins: Add a plugin to generate basic block vectors

2024-08-15 Thread Akihiko Odaki
On 2024/08/15 14:48, Pierrick Bouvier wrote: On 8/14/24 20:04, Akihiko Odaki wrote: SimPoint is a widely used tool to find the ideal microarchitecture simulation points so Valgrind[2] and Pin[3] support generating basic block vectors for use with them. Let's add a corresponding plugin to QEMU to

Re: [PATCH v4 13/16] target/riscv: compressed encodings for sspush and sspopchk

2024-08-15 Thread Richard Henderson
On 8/16/24 11:07, Deepak Gupta wrote: sspush/sspopchk have compressed encodings carved out of zcmops. compressed sspush is designated as c.mop.1 while compressed sspopchk is designated as c.mop.5. Note that c.sspush x1 exists while c.sspush x5 doesn't. Similarly c.sspopchk x5 exists while c.sspo

Re: [PATCH 3/6] contrib/plugins/hwprofile: fix warning when compiling on 32bits host

2024-08-15 Thread Pierrick Bouvier
On 8/15/24 10:40, Pierrick Bouvier wrote: On 8/15/24 05:03, Alex Bennée wrote: Thomas Huth writes: On 15/08/2024 01.36, Pierrick Bouvier wrote: Found on debian stable (i386). ../contrib/plugins/hwprofile.c: In function 'new_location': ../contrib/plugins/hwprofile.c:172:32: error: cast to poi

Re: [PATCH v2 08/17] intel_iommu: Set accessed and dirty bits during first stage translation

2024-08-15 Thread CLEMENT MATHIEU--DRIF
On 16/08/2024 04:37, Duan, Zhenzhong wrote: > Caution: External email. Do not open attachments or click links, unless this > email comes from a known sender and you know the content is safe. > > >> -Original Message- >> From: Liu, Yi L >> Subject: Re: [PATCH v2 08/17] intel_iommu: Set a

Re: [PATCH v2 08/17] intel_iommu: Set accessed and dirty bits during first stage translation

2024-08-15 Thread CLEMENT MATHIEU--DRIF
On 14/08/2024 13:45, Yi Liu wrote: > Caution: External email. Do not open attachments or click links, > unless this email comes from a known sender and you know the content > is safe. > > > On 2024/8/5 14:27, Zhenzhong Duan wrote: >> From: Clément Mathieu--Drif >> >> Signed-off-by: Clément Mat

Re: [PATCH v4 07/16] disas/riscv: enabled `lpad` disassembly

2024-08-15 Thread Richard Henderson
On 8/16/24 11:07, Deepak Gupta wrote: Signed-off-by: Deepak Gupta Co-developed-by: Jim Shu Co-developed-by: Andy Chiu Reviewed-by: Richard Henderson typo in subject: s/enabled/enable/ r~

Re: [PATCH v4 06/16] target/riscv: zicfilp `lpad` impl and branch tracking

2024-08-15 Thread Richard Henderson
On 8/16/24 11:07, Deepak Gupta wrote: Implements setting lp expected when `jalr` is encountered and implements `lpad` instruction of zicfilp. `lpad` instruction is taken out of auipc x0, . This is an existing HINTNOP space. If `lpad` is target of an indirect branch, cpu checks for 20 bit value in

Re: [PATCH v4 05/16] target/riscv: tracking indirect branches (fcfi) for zicfilp

2024-08-15 Thread Richard Henderson
On 8/16/24 11:06, Deepak Gupta wrote: @@ -1245,6 +1250,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) static void riscv_tr_tb_start(DisasContextBase *db, CPUState *cpu) { + } Watch the unrelated changes. @@ -1266,6 +1272,28 @@ static void riscv

Re: [RFC PATCH 0/6] Enable shared device assignment

2024-08-15 Thread Chenyi Qiang
Hi Paolo, Hope to draw your attention. As TEE I/O would depend on shared device assignment and we introduce this RDM solution in QEMU. Now, Observe the in-place private/shared conversion option mentioned by David, do you think we should continue to add pass-thru support for this in-qemu page conve

Re: [PATCH v4 03/16] target/riscv: save and restore elp state on priv transitions

2024-08-15 Thread Richard Henderson
On 8/16/24 11:06, Deepak Gupta wrote: @@ -546,6 +575,15 @@ void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env) } bool current_virt = env->virt_enabled; +/* + * If zicfilp extension available and henvcfg.LPE = 1, + * then apply SPELP mask on mstatus + */ +if

Re: [PATCH v4 02/16] target/riscv: Introduce elp state and enabling controls for zicfilp

2024-08-15 Thread Richard Henderson
On 8/16/24 11:06, Deepak Gupta wrote: zicfilp introduces a new state elp ("expected landing pad") in cpu. During normal execution, elp is idle (NO_LP_EXPECTED) i.e not expecting landing pad. On an indirect call, elp moves LP_EXPECTED. When elp is LP_EXPECTED, only a subsquent landing pad instruct

RE: [PATCH v2 08/17] intel_iommu: Set accessed and dirty bits during first stage translation

2024-08-15 Thread Duan, Zhenzhong
>-Original Message- >From: Liu, Yi L >Subject: Re: [PATCH v2 08/17] intel_iommu: Set accessed and dirty bits >during first stage translation > >On 2024/8/5 14:27, Zhenzhong Duan wrote: >> From: Clément Mathieu--Drif >> >> Signed-off-by: Clément Mathieu--Drif >> Signed-off-by: Zhenzhong

Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state

2024-08-15 Thread Jason Wang
On Thu, Aug 15, 2024 at 10:29 PM Michael S. Tsirkin wrote: > > On Thu, Aug 15, 2024 at 05:12:32PM +1000, Nicholas Piggin wrote: > > Could be a good idea. Although I'm not sure what to do with > > all types, maybe we can restrict what is supported. > > > > > Is this wider re-factoring something tha

Re: [PATCH v2 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state

2024-08-15 Thread Nicholas Piggin
On Fri Aug 16, 2024 at 12:28 AM AEST, Michael S. Tsirkin wrote: > On Thu, Aug 15, 2024 at 05:12:32PM +1000, Nicholas Piggin wrote: > > Could be a good idea. Although I'm not sure what to do with > > all types, maybe we can restrict what is supported. > > > > > Is this wider re-factoring something

Re: [RFC PATCH 0/2] async: rework async event API for replay

2024-08-15 Thread Nicholas Piggin
On Fri Aug 16, 2024 at 1:30 AM AEST, Michael S. Tsirkin wrote: > On Thu, Aug 15, 2024 at 11:28:35PM +1000, Nicholas Piggin wrote: > > Continuing the conversation from the thread about record/replay > > virtio fix. Here is a sketch of how we could improve the naming > > convention so users of bh don

Re: [PATCH v3] hw/ppc: Implement -dtb support for PowerNV

2024-08-15 Thread Nicholas Piggin
On Fri Aug 16, 2024 at 3:52 AM AEST, Cédric Le Goater wrote: > On 8/15/24 09:31, Nicholas Piggin wrote: > > On Tue Aug 13, 2024 at 11:45 PM AEST, Aditya Gupta wrote: > >> Currently any device tree passed with -dtb option in QEMU, was ignored > >> by the PowerNV code. > >> > >> Read and pass the pas

RE: [PATCH v2 07/17] intel_iommu: Check if the input address is canonical

2024-08-15 Thread Duan, Zhenzhong
>-Original Message- >From: Liu, Yi L >Subject: Re: [PATCH v2 07/17] intel_iommu: Check if the input address is >canonical > >On 2024/8/5 14:27, Zhenzhong Duan wrote: >> From: Clément Mathieu--Drif >> >> First stage translation must fail if the address to translate is >> not canonical. >

Re: [PATCH 2/6] contrib/plugins/cache: fix warning when compiling on 32bits host

2024-08-15 Thread Pierrick Bouvier
On 8/15/24 10:38, Pierrick Bouvier wrote: On 8/15/24 04:46, Alex Bennée wrote: Thomas Huth writes: On 15/08/2024 01.36, Pierrick Bouvier wrote: Found on debian stable (i386). ../contrib/plugins/cache.c: In function 'vcpu_tb_trans': ../contrib/plugins/cache.c:477:30: error: cast from pointer

Re: [PATCH for-9.1] linux-user: Handle short reads in mmap_h_gt_g

2024-08-15 Thread gaosong
在 2024/8/16 上午5:32, Richard Henderson 写道: In particular, if an image has a large bss, we can hit EOF before reading all host_len bytes of the mapping. Cc: qemu-sta...@nongnu.org Fixes: eb5027ac618 ("linux-user: Split out mmap_h_gt_g") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2504

[PATCH v4 13/16] target/riscv: compressed encodings for sspush and sspopchk

2024-08-15 Thread Deepak Gupta
sspush/sspopchk have compressed encodings carved out of zcmops. compressed sspush is designated as c.mop.1 while compressed sspopchk is designated as c.mop.5. Note that c.sspush x1 exists while c.sspush x5 doesn't. Similarly c.sspopchk x5 exists while c.sspopchk x1 doesn't. Signed-off-by: Deepak

[PATCH v4 12/16] target/riscv: implement zicfiss instructions

2024-08-15 Thread Deepak Gupta
zicfiss has following instructions - sspopchk: pops a value from shadow stack and compares with x1/x5. If they dont match, reports a sw check exception with tval = 3. - sspush: pushes value in x1/x5 on shadow stack - ssrdp: reads current shadow stack - ssamoswap: swaps contents of shadow sta

[PATCH v4 09/16] target/riscv: introduce ssp and enabling controls for zicfiss

2024-08-15 Thread Deepak Gupta
zicfiss introduces a new state ssp ("shadow stack register") in cpu. ssp is expressed as a new unprivileged csr (CSR_SSP=0x11) and holds virtual address for shadow stack as programmed by software. Shadow stack (for each mode) is enabled via bit3 in *envcfg CSRs. Shadow stack can be enabled for a m

[PATCH v4 07/16] disas/riscv: enabled `lpad` disassembly

2024-08-15 Thread Deepak Gupta
Signed-off-by: Deepak Gupta Co-developed-by: Jim Shu Co-developed-by: Andy Chiu Reviewed-by: Richard Henderson --- disas/riscv.c | 18 +- disas/riscv.h | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/disas/riscv.c b/disas/riscv.c index c8364c2b07..c7c92a

[PATCH v4 05/16] target/riscv: tracking indirect branches (fcfi) for zicfilp

2024-08-15 Thread Deepak Gupta
zicfilp protects forward control flow (if enabled) by enforcing all indirect call and jmp must land on a landing pad instruction `lpad`. If target of an indirect call or jmp is not `lpad` then cpu/hart must raise a sw check exception with tval = 2. This patch implements the mechanism using TCG. Ta

[PATCH v4 04/16] target/riscv: additional code information for sw check

2024-08-15 Thread Deepak Gupta
sw check exception support was recently added. This patch further augments sw check exception by providing support for additional code which is provided in *tval. Adds `sw_check_code` field in cpuarchstate. Whenever sw check exception is raised *tval gets the value deposited in `sw_check_code`. Si

[PATCH v4 14/16] disas/riscv: enable disassembly for zicfiss instructions

2024-08-15 Thread Deepak Gupta
Enable disassembly for sspush, sspopchk, ssrdp & ssamoswap. Disasembly is only enabled if zimop and zicfiss ext is set to true. Signed-off-by: Deepak Gupta --- disas/riscv.c | 40 +++- disas/riscv.h | 1 + 2 files changed, 40 insertions(+), 1 deletion(-) dif

[PATCH v4 11/16] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-15 Thread Deepak Gupta
zicfiss protects shadow stack using new page table encodings PTE.W=0, PTE.R=0 and PTE.X=0. This encoding is reserved if zicfiss is not implemented or if shadow stack are not enabled. Loads on shadow stack memory are allowed while stores to shadow stack memory leads to access faults. Shadow stack ac

[PATCH v4 16/16] target/riscv: add trace-hooks for each case of sw-check exception

2024-08-15 Thread Deepak Gupta
Violations to control flow rules setup by zicfilp and zicfiss lead to software check exceptions. To debug and fix such sw check issues in guest , add trace-hooks for each case. Signed-off-by: Jim Shu Signed-off-by: Deepak Gupta --- target/riscv/helper.h | 3 +++ target/

[PATCH v4 15/16] disas/riscv: enable disassembly for compressed sspush/sspopchk

2024-08-15 Thread Deepak Gupta
sspush and sspopchk have equivalent compressed encoding taken from zcmop. cmop.1 is sspush x1 while cmop.5 is sspopchk x5. Due to unusual encoding for both rs1 and rs2 from space bitfield, this required a new codec. Signed-off-by: Deepak Gupta --- disas/riscv.c | 19 ++- disas/ri

[PATCH v4 02/16] target/riscv: Introduce elp state and enabling controls for zicfilp

2024-08-15 Thread Deepak Gupta
zicfilp introduces a new state elp ("expected landing pad") in cpu. During normal execution, elp is idle (NO_LP_EXPECTED) i.e not expecting landing pad. On an indirect call, elp moves LP_EXPECTED. When elp is LP_EXPECTED, only a subsquent landing pad instruction can set state back to NO_LP_EXPECTED

[PATCH v4 10/16] target/riscv: tb flag for shadow stack instructions

2024-08-15 Thread Deepak Gupta
Shadow stack instructions can be decoded as zimop / zcmop or shadow stack instructions depending on whether shadow stack are enabled at current privilege. This requires a TB flag so that correct TB generation and correct TB lookup happens. `DisasContext` gets a field indicating whether bcfi is enab

[PATCH v4 08/16] target/riscv: Add zicfiss extension

2024-08-15 Thread Deepak Gupta
zicfiss [1] riscv cpu extension enables backward control flow integrity. This patch sets up space for zicfiss extension in cpuconfig. And imple- ments dependency on A, zicsr, zimop and zcmop extensions. [1] - https://github.com/riscv/riscv-cfi Signed-off-by: Deepak Gupta Co-developed-by: Jim Sh

[PATCH v4 03/16] target/riscv: save and restore elp state on priv transitions

2024-08-15 Thread Deepak Gupta
elp state is recorded in *status on trap entry (less privilege to higher privilege) and restored in elp from *status on trap exit (higher to less privilege). Additionally this patch introduces a forward cfi helper function to determine if current privilege has forward cfi is enabled or not based o

[PATCH v4 00/16] riscv support for control flow integrity extensions

2024-08-15 Thread Deepak Gupta
v4 for riscv zicfilp and zicfiss extensions support in qemu. Links for previous versions [1] - v1 https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg06017.html [2] - v2 https://lore.kernel.org/all/ed23bcbc-fdc4-4492-803c-daa958803...@linaro.org/T/ [3] - v3 https://lists.nongnu.org/archi

[PATCH v4 06/16] target/riscv: zicfilp `lpad` impl and branch tracking

2024-08-15 Thread Deepak Gupta
Implements setting lp expected when `jalr` is encountered and implements `lpad` instruction of zicfilp. `lpad` instruction is taken out of auipc x0, . This is an existing HINTNOP space. If `lpad` is target of an indirect branch, cpu checks for 20 bit value in x7 upper with 20 bit value embedded in

[PATCH v4 01/16] target/riscv: Add zicfilp extension

2024-08-15 Thread Deepak Gupta
zicfilp [1] riscv cpu extension enables forward control flow integrity. If enabled, all indirect calls must land on a landing pad instruction. This patch sets up space for zicfilp extension in cpuconfig. zicfilp is dependend on zicsr. [1] - https://github.com/riscv/riscv-cfi Signed-off-by: Deepa

[ANNOUNCE] QEMU 9.1.0-rc2 is now available

2024-08-15 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the third release candidate for the QEMU 9.1 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu.org/qemu-9.1.0-rc2.tar.xz http://download.qemu.

Re: [PATCH v2 9/9] Avocado tests: allow for parallel execution of tests

2024-08-15 Thread Richard Henderson
On 8/16/24 02:02, Thomas Huth wrote: that patch that I linked did not set the default number of parallel tests to $(nproc), it just used the value of the "-j" option of make. So if you just run "make check-avocado" there, you only get single threaded execution as before. You explicitely have to

Re: [PULL for 9.1 00/21] Some fixes for 9.1-rc3 (build, replay, docs, plugins)

2024-08-15 Thread Richard Henderson
On 8/16/24 00:48, Alex Bennée wrote: The following changes since commit b0d6c037ea0a825192285f149af72a73a1baaa04: Update version for v9.1.0-rc2 release (2024-08-15 20:32:37 +1000) are available in the Git repository at: https://gitlab.com/stsquad/qemu.git tags/pull-maintainer-9.1-rc3-150

Re: [PATCH 2/6] contrib/plugins/cache: fix warning when compiling on 32bits host

2024-08-15 Thread Richard Henderson
On 8/15/24 21:46, Alex Bennée wrote: Thomas Huth writes: On 15/08/2024 01.36, Pierrick Bouvier wrote: Found on debian stable (i386). ../contrib/plugins/cache.c: In function 'vcpu_tb_trans': ../contrib/plugins/cache.c:477:30: error: cast from pointer to integer of different size [-Werror=poin

Re: [PATCH for-9.2] accel/tcg: Remove dead code from rr_cpu_thread_fn()

2024-08-15 Thread Richard Henderson
On 8/16/24 00:36, Peter Maydell wrote: The main loop in rr_cpu_thread_fn() can never terminate, so the code at the end of the function to clean up the RCU subsystem is dead code. Replace it with g_assert_not_reached(). (This is different from the other cpu_thread_fn for e.g. MTTCG or for the KVM

[PATCH for-9.1] linux-user: Handle short reads in mmap_h_gt_g

2024-08-15 Thread Richard Henderson
In particular, if an image has a large bss, we can hit EOF before reading all host_len bytes of the mapping. Cc: qemu-sta...@nongnu.org Fixes: eb5027ac618 ("linux-user: Split out mmap_h_gt_g") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2504 Signed-off-by: Richard Henderson --- linux

Re: [RFC V1 1/6] migration: SCM_RIGHTS for QEMUFile

2024-08-15 Thread Peter Xu
On Sun, Jun 30, 2024 at 12:44:03PM -0700, Steve Sistare wrote: > Define functions to put/get file descriptors to/from a QEMUFile, for qio > channels that support SCM_RIGHTS. Maintain ordering such that > put(A), put(fd), put(B) > followed by > get(A), get(fd), get(B) > always succeeds. Other

Re: [PATCH V2 00/11] Live update: cpr-exec

2024-08-15 Thread Steven Sistare
On 8/13/2024 3:46 PM, Peter Xu wrote: On Tue, Aug 06, 2024 at 04:56:18PM -0400, Steven Sistare wrote: The flipside, however, is that localhost migration via 2 separate QEMU processes has issues where both QEMUs want to be opening the very same file, and only 1 of them can ever have them open.

Re: [PATCH V2 06/11] migration: fix mismatched GPAs during cpr

2024-08-15 Thread Steven Sistare
On 8/13/2024 4:43 PM, Peter Xu wrote: On Wed, Aug 07, 2024 at 05:04:26PM -0400, Steven Sistare wrote: On 7/19/2024 12:28 PM, Peter Xu wrote: On Sun, Jun 30, 2024 at 12:40:29PM -0700, Steve Sistare wrote: For new cpr modes, ramblock_is_ignored will always be true, because the memory is preserve

Re: [RFC V1 4/6] migration: cpr-uri parameter

2024-08-15 Thread Peter Xu
On Sun, Jun 30, 2024 at 12:44:06PM -0700, Steve Sistare wrote: > Define the cpr-uri migration parameter to specify the URI to which > CPR vmstate is saved for cpr-transfer mode. > > Signed-off-by: Steve Sistare So I left the idea in my reply to the cover letter to reuse "-cpr-uri" in qemu cmdlin

Re: [RFC V1 0/6] Live update: cpr-transfer

2024-08-15 Thread Peter Xu
On Sat, Jul 20, 2024 at 04:07:50PM -0400, Steven Sistare wrote: > > > The new user-visible interfaces are: > > >* cpr-transfer (MigMode migration parameter) > > >* cpr-uri (migration parameter) > > > > I wonder whether this parameter can be avoided already, maybe we can let > > cpr-transfe

Re: [PATCH 0/6] build contrib/plugins using meson

2024-08-15 Thread Peter Maydell
On Thu, 15 Aug 2024 at 19:38, Paolo Bonzini wrote: > > On Thu, Aug 15, 2024 at 8:04 PM Pierrick Bouvier > wrote: > > > One argument from moving contrib/plugins to meson is that the Windows > > > case depends on libqemu_plugin_api.a which is built with meson(*); > > > that said, libqemu_plugin_api

Re: [PATCH 1/2] hw/ppc: Consolidate e500 initial mapping creation functions

2024-08-15 Thread Bernhard Beschow
Am 16. Juli 2024 12:07:57 UTC schrieb BALATON Zoltan : >Add booke206_set_tlb() utility function and use it to replace very >similar create_initial_mapping functions in e500 machines. > >Signed-off-by: BALATON Zoltan >--- > hw/ppc/e500.c | 41 +++-- > h

Re: [PATCH 0/6] build contrib/plugins using meson

2024-08-15 Thread Paolo Bonzini
On Thu, Aug 15, 2024 at 8:04 PM Pierrick Bouvier wrote: > > One argument from moving contrib/plugins to meson is that the Windows > > case depends on libqemu_plugin_api.a which is built with meson(*); > > that said, libqemu_plugin_api.a should be installed - which would > > justify it being used f

Re: [PATCH 0/6] build contrib/plugins using meson

2024-08-15 Thread Pierrick Bouvier
On 8/14/24 23:00, Paolo Bonzini wrote: On Thu, Aug 15, 2024 at 1:37 AM Pierrick Bouvier wrote: Contrib plugins have been built out of tree so far, thanks to a Makefile. However, it is quite inconvenient for maintenance, as we may break them, especially for specific architectures. First patches

Re: [PATCH 2/5] hw/char/serial: Remove unused funtion

2024-08-15 Thread Bernhard Beschow
Am 15. August 2024 09:26:38 UTC schrieb "Philippe Mathieu-Daudé" : >On 15/8/24 10:24, Mark Cave-Ayland wrote: >> On 14/08/2024 22:38, BALATON Zoltan wrote: >> >>> On Wed, 14 Aug 2024, Bernhard Beschow wrote: The serial port's frequency is set via the "baudbase" property nowadays. >>> >>>

Re: [PATCH v2 1/4] meson: hide tsan related warnings

2024-08-15 Thread Pierrick Bouvier
On 8/15/24 10:54, Peter Maydell wrote: On Thu, 15 Aug 2024 at 12:05, Daniel P. Berrangé wrote: On Thu, Aug 15, 2024 at 11:12:39AM +0100, Peter Maydell wrote: On Wed, 14 Aug 2024 at 23:42, Pierrick Bouvier wrote: When building with gcc-12 -fsanitize=thread, gcc reports some constructions no

Re: [PATCH v2 1/4] meson: hide tsan related warnings

2024-08-15 Thread Pierrick Bouvier
On 8/15/24 02:50, Thomas Huth wrote: On 15/08/2024 00.41, Pierrick Bouvier wrote: When building with gcc-12 -fsanitize=thread, gcc reports some constructions not supported with tsan. Found on debian stable. qemu/include/qemu/atomic.h:36:52: error: ‘atomic_thread_fence’ is not supported with ‘-

Re: [PATCH v2 1/4] meson: hide tsan related warnings

2024-08-15 Thread Peter Maydell
On Thu, 15 Aug 2024 at 12:05, Daniel P. Berrangé wrote: > > On Thu, Aug 15, 2024 at 11:12:39AM +0100, Peter Maydell wrote: > > On Wed, 14 Aug 2024 at 23:42, Pierrick Bouvier > > wrote: > > > > > > When building with gcc-12 -fsanitize=thread, gcc reports some > > > constructions not supported with

Re: [PATCH v2 2/4] target/i386: fix build warning (gcc-12 -fsanitize=thread)

2024-08-15 Thread Pierrick Bouvier
On 8/14/24 15:47, Richard Henderson wrote: On 8/15/24 08:41, Pierrick Bouvier wrote: Found on debian stable. ../target/i386/kvm/kvm.c: In function ‘kvm_handle_rdmsr’: ../target/i386/kvm/kvm.c:5345:1: error: control reaches end of non-void function [-Werror=return-type] 5345 | } | ^

Re: [PATCH v3] hw/ppc: Implement -dtb support for PowerNV

2024-08-15 Thread Cédric Le Goater
On 8/15/24 09:31, Nicholas Piggin wrote: On Tue Aug 13, 2024 at 11:45 PM AEST, Aditya Gupta wrote: Currently any device tree passed with -dtb option in QEMU, was ignored by the PowerNV code. Read and pass the passed -dtb to the kernel, thus enabling easier debugging with custom DTBs. The exist

Re: [PATCH v2 1/4] meson: hide tsan related warnings

2024-08-15 Thread Pierrick Bouvier
On 8/15/24 04:05, Daniel P. Berrangé wrote: On Thu, Aug 15, 2024 at 11:12:39AM +0100, Peter Maydell wrote: On Wed, 14 Aug 2024 at 23:42, Pierrick Bouvier wrote: When building with gcc-12 -fsanitize=thread, gcc reports some constructions not supported with tsan. Found on debian stable. qemu/i

Re: [PATCH 0/6] build contrib/plugins using meson

2024-08-15 Thread Pierrick Bouvier
On 8/15/24 04:42, Alex Bennée wrote: Paolo Bonzini writes: On Thu, Aug 15, 2024 at 1:37 AM Pierrick Bouvier wrote: Contrib plugins have been built out of tree so far, thanks to a Makefile. However, it is quite inconvenient for maintenance, as we may break them, especially for specific archit

Re: [PATCH 3/6] contrib/plugins/hwprofile: fix warning when compiling on 32bits host

2024-08-15 Thread Pierrick Bouvier
On 8/15/24 05:03, Alex Bennée wrote: Thomas Huth writes: On 15/08/2024 01.36, Pierrick Bouvier wrote: Found on debian stable (i386). ../contrib/plugins/hwprofile.c: In function 'new_location': ../contrib/plugins/hwprofile.c:172:32: error: cast to pointer from integer of different size [-Werr

Re: [PATCH 2/6] contrib/plugins/cache: fix warning when compiling on 32bits host

2024-08-15 Thread Pierrick Bouvier
On 8/15/24 04:46, Alex Bennée wrote: Thomas Huth writes: On 15/08/2024 01.36, Pierrick Bouvier wrote: Found on debian stable (i386). ../contrib/plugins/cache.c: In function 'vcpu_tb_trans': ../contrib/plugins/cache.c:477:30: error: cast from pointer to integer of different size [-Werror=poin

Re: [PATCH RFC/RFT] vfio/pci-quirks: Quirk for ath wireless

2024-08-15 Thread Jason Gunthorpe
On Thu, Aug 15, 2024 at 10:59:05AM -0600, Alex Williamson wrote: > > This is probably the only way to approach this, trap and emulate the > > places in the device that program additional interrupt sources and do > > a full MSI-like flow to set them up in the kernel. > > Your last sentence here se

Re: [PATCH v7 0/7] Add Rust build support, ARM PL011 device impl

2024-08-15 Thread Peter Maydell
On Thu, 15 Aug 2024 at 12:42, Manos Pitsidianakis wrote: > Outstanding issues that are not blocking for merge are: > > - Cross-compilation for aarch64 is not possible out-of-the-box because of > this bug: > in llvm which when > fixed, must be

Re: [PATCH RFC/RFT] vfio/pci-quirks: Quirk for ath wireless

2024-08-15 Thread Alex Williamson
On Tue, 13 Aug 2024 20:37:24 -0300 Jason Gunthorpe wrote: > On Tue, Aug 13, 2024 at 03:03:20PM -0600, Alex Williamson wrote: > > > How does the guest know to write a remappable vector format? How does > > the guest know the host interrupt architecture? For example why would > > an aarch64 gues

[RFC] Virtualizing tagged disaggregated memory capacity (app specific, multi host shared)

2024-08-15 Thread Jonathan Cameron
Introduction If we think application specific memory (including inter-host shared memory) is a thing, it will also be a thing people want to use with virtual machines, potentially nested. So how do we present it at the Host to VM boundary? This RFC is perhaps premature given we haven

Re: [PATCH v2 9/9] Avocado tests: allow for parallel execution of tests

2024-08-15 Thread Thomas Huth
On 15/08/2024 16.08, Cleber Rosa wrote: On Mon, Aug 12, 2024 at 6:17 AM Thomas Huth wrote: ... diff --git a/tests/Makefile.include b/tests/Makefile.include index 537804d101..545b5155f9 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -94,6 +94,9 @@ TESTS_RESULTS_DIR=$(BUILD_

Re: [PATCH] meson: add 'qemuutil' dependency for block.c

2024-08-15 Thread Daniel P . Berrangé
On Wed, Aug 14, 2024 at 12:00:52PM +0200, Fiona Ebner wrote: > The macro block_module_load() used by block.c is a wrapper around > module_load(), which is implemented in util/module.c. > > Fixes linking for a future binary or downstream binary that does not > depend on 'qemuutil' directly, but doe

Re: [RFC PATCH 0/2] async: rework async event API for replay

2024-08-15 Thread Michael S. Tsirkin
On Thu, Aug 15, 2024 at 11:28:35PM +1000, Nicholas Piggin wrote: > Continuing the conversation from the thread about record/replay > virtio fix. Here is a sketch of how we could improve the naming > convention so users of bh don't have to know about record/replay. > > Thanks, > Nick The API looks

Re: [PATCH] meson: add 'qemuutil' dependency for block.c

2024-08-15 Thread Thomas Huth
On 14/08/2024 12.00, Fiona Ebner wrote: The macro block_module_load() used by block.c is a wrapper around module_load(), which is implemented in util/module.c. Fixes linking for a future binary or downstream binary that does not depend on 'qemuutil' directly, but does depend on 'block'. Signed-

Re: [PATCH v7 6/7] rust: add crate to expose bindings and interfaces

2024-08-15 Thread Daniel P . Berrangé
On Thu, Aug 15, 2024 at 04:01:17PM +0200, Philippe Mathieu-Daudé wrote: > Hi Manos, > > On 15/8/24 13:42, Manos Pitsidianakis wrote: > > Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and > > provides some declaration macros for symbols visible to the rest of > > QEMU. > > >

[PULL 18/21] savevm: Fix load_snapshot error path crash

2024-08-15 Thread Alex Bennée
From: Nicholas Piggin An error path missed setting *errp, which can cause a NULL deref. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-11-npig...@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-19-alex.ben...@linaro.org> d

[PULL 17/21] virtio-net: Use virtual time for RSC timers

2024-08-15 Thread Alex Bennée
From: Nicholas Piggin Receive coalescing is visible to the target machine, so its timers should use virtual time like other timers in virtio-net, to be compatible with record-replay. Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-10-npig...@gmail.com> Acked-by: Michael S. Tsi

[PULL 20/21] docs/devel: update tcg-plugins page

2024-08-15 Thread Alex Bennée
From: Pierrick Bouvier Reflect recent changes on API (inline ops) and new plugins. Signed-off-by: Pierrick Bouvier Message-Id: <20240812231945.169310-1-pierrick.bouv...@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-21-alex.ben...@linaro.org> diff --git a/docs/abou

[PULL 13/21] Revert "replay: stop us hanging in rr_wait_io_event"

2024-08-15 Thread Alex Bennée
From: Nicholas Piggin This reverts commit 1f881ea4a444ef36a8b6907b0b82be4b3af253a2. That commit causes reverse_debugging.py test failures, and does not seem to solve the root cause of the problem x86-64 still hangs in record/replay tests. The problem with short-cutting the iowait that was taken

Re: [PATCH v7 6/7] rust: add crate to expose bindings and interfaces

2024-08-15 Thread Manos Pitsidianakis
On Thu, 15 Aug 2024 17:01, Philippe Mathieu-Daudé wrote: Hi Manos, On 15/8/24 13:42, Manos Pitsidianakis wrote: Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and provides some declaration macros for symbols visible to the rest of QEMU. Co-authored-by: Junjie Mao Co-aut

[PULL 12/21] replay: allow runstate shutdown->running when replaying trace

2024-08-15 Thread Alex Bennée
From: Nicholas Piggin When replaying a trace, it is possible to go from shutdown to running with a reverse-debugging step. This can be useful if the problem being debugged triggers a reset or shutdown. This can be tested by making a recording of a machine that shuts down, then using -action shut

[PULL 10/21] scripts/replay-dump.py: rejig decoders in event number order

2024-08-15 Thread Alex Bennée
From: Nicholas Piggin Sort decoder functions to be ascending in order of event number, same as the decoder tables. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-3-npig...@gmail.com> Signed-off-by: Alex Bennée Message-Id: <20240813202329.1237572-11-

[PULL 06/21] scripts/checkpatch: more checks on files imported from Linux

2024-08-15 Thread Alex Bennée
From: Stefano Garzarella If a file imported from Linux is touched, emit a warning and suggest using scripts/update-linux-headers.sh. Also check that updating imported files from Linux are not mixed with other changes, in which case emit an error. Signed-off-by: Stefano Garzarella Reviewed-by:

[PULL 15/21] chardev: set record/replay on the base device of a muxed device

2024-08-15 Thread Alex Bennée
From: Nicholas Piggin chardev events to a muxed device don't get recorded because e.g., qemu_chr_be_write() checks whether the base device has the record flag set. This can be seen when replaying a trace that has characters typed into the console, an examination of the log shows they are not rec

[PULL 16/21] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state

2024-08-15 Thread Alex Bennée
From: Nicholas Piggin The regular qemu_bh_schedule() calls result in non-deterministic execution of the bh in record-replay mode, which causes replay failure. Reviewed-by: Alex Bennée Reviewed-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-9-npig...@gmai

[PULL 14/21] tests/avocado: replay_kernel.py add x86-64 q35 machine test

2024-08-15 Thread Alex Bennée
From: Nicholas Piggin The x86-64 pc machine is flaky with record/replay, but q35 is more stable. Add a q35 test to replay_kernel.py. Reviewed-by: Alex Bennée Tested-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-7-npig...@gmail.com> Signed-off-by: Alex Benné

  1   2   >