Re: [PATCH v3 2/4] hw/ssi: ibex_spi: fixup coverity issue

2022-08-21 Thread Wilfred Mallawa
On Mon, 2022-08-22 at 13:42 +1000, Alistair Francis wrote: > On Mon, Aug 22, 2022 at 9:53 AM Wilfred Mallawa > wrote: > > > > From: Wilfred Mallawa > > > > This patch addresses the coverity issues specified in [1], > > as suggested, `FIELD_DP32()`/`FIELD_EX32()` macros have been > >

Re: [PATCH v3] target/riscv: Use official extension names for AIA CSRs

2022-08-21 Thread Alistair Francis
On Sat, Aug 20, 2022 at 2:30 PM Anup Patel wrote: > > The arch review of AIA spec is completed and we now have official > extension names for AIA: Smaia (M-mode AIA CSRs) and Ssaia (S-mode > AIA CSRs). > > Refer, section 1.6 of the latest AIA v0.3.1 stable specification at >

Re: [PATCH v3 2/4] hw/ssi: ibex_spi: fixup coverity issue

2022-08-21 Thread Alistair Francis
On Mon, Aug 22, 2022 at 9:53 AM Wilfred Mallawa wrote: > > From: Wilfred Mallawa > > This patch addresses the coverity issues specified in [1], > as suggested, `FIELD_DP32()`/`FIELD_EX32()` macros have been > implemented to clean up the code. > > [1]

Re: [PATCH v1] target/riscv: Add xicondops in ISA entry

2022-08-21 Thread Alistair Francis
On Tue, Aug 16, 2022 at 2:54 PM Rahul Pathak wrote: > > XVentanaCondOps is Ventana custom extension. Add > its extension entry in the ISA Ext array > > Signed-off-by: Rahul Pathak Thanks! Applied to riscv-to-apply.next Alistair > --- > > This patch is based on branch riscv-to-apply.next

Re: [PATCH v3 0/4] QEMU: Fix RISC-V virt & spike machines' dtbs

2022-08-21 Thread Alistair Francis
On Thu, Aug 11, 2022 at 5:09 AM Conor Dooley wrote: > > From: Conor Dooley > > The device trees produced automatically for the virt and spike machines > fail dt-validate on several grounds. Some of these need to be fixed in > the linux kernel's dt-bindings, but others are caused by bugs in QEMU.

Re: [PATCH] include/hw/riscv/sifive_e.h: Fix the type of parent_obj of SiFiveEState.

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 5:12 PM Tommy Wu wrote: > > Fix the type of parent_obj of SiFiveEState from 'SysBusDevice' > to 'MachineState'. Because the parent of SiFiveEState is 'MachineState'. > > Signed-off-by: Tommy Wu Reviewed-by: Alistair Francis Alistair > --- >

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-21 Thread Alexey Kardashevskiy
On 22/08/2022 13:05, David Gibson wrote: On Fri, Aug 19, 2022 at 06:42:34AM -0300, Daniel Henrique Barboza wrote: On 8/18/22 23:11, Alexey Kardashevskiy wrote: On 05/08/2022 19:39, Daniel Henrique Barboza wrote: The pSeries machine never bothered with the common machine->fdt attribute.

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-21 Thread David Gibson
On Fri, Aug 19, 2022 at 06:42:34AM -0300, Daniel Henrique Barboza wrote: > > > On 8/18/22 23:11, Alexey Kardashevskiy wrote: > > > > > > On 05/08/2022 19:39, Daniel Henrique Barboza wrote: > > > The pSeries machine never bothered with the common machine->fdt > > > attribute. We do all the FDT

Re: [PATCH] include/hw/riscv/sifive_e.h: Fix the type of parent_obj of SiFiveEState.

2022-08-21 Thread Jim Shu
Reviewed-by: Jim Shu On Fri, Aug 19, 2022 at 3:11 PM Tommy Wu wrote: > > Fix the type of parent_obj of SiFiveEState from 'SysBusDevice' > to 'MachineState'. Because the parent of SiFiveEState is 'MachineState'. > > Signed-off-by: Tommy Wu > --- > include/hw/riscv/sifive_e.h | 2 +- > 1 file

Re: [PATCH v6 21/21] target/riscv: Make translator stop before the end of a page

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:39 PM Richard Henderson wrote: > > Right now the translator stops right *after* the end of a page, which > breaks reporting of fault locations when the last instruction of a > multi-insn translation block crosses a page boundary. > > Resolves:

[PATCH v3 2/4] hw/ssi: ibex_spi: fixup coverity issue

2022-08-21 Thread Wilfred Mallawa
From: Wilfred Mallawa This patch addresses the coverity issues specified in [1], as suggested, `FIELD_DP32()`/`FIELD_EX32()` macros have been implemented to clean up the code. [1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg887713.html Fixes: Coverity CID 1488107 Signed-off-by:

Re: [PATCH v6 20/21] target/riscv: Add MAX_INSN_LEN and insn_len

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:42 PM Richard Henderson wrote: > > These will be useful in properly ending the TB. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > target/riscv/translate.c | 10 +- > 1 file changed, 9 insertions(+), 1 deletion(-) > >

Re: [PATCH v6 16/21] accel/tcg: Add pc and host_pc params to gen_intermediate_code

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:42 PM Richard Henderson wrote: > > Pass these along to translator_loop -- pc may be used instead > of tb->pc, and host_pc is currently unused. Adjust all targets > at one time. > > Signed-off-by: Richard Henderson Acked-by: Alistair Francis Alistair > --- >

[PATCH v3 4/4] hw/ssi: ibex_spi: update reg addr

2022-08-21 Thread Wilfred Mallawa
From: Wilfred Mallawa Updates the `EVENT_ENABLE` register to offset `0x34` as per OpenTitan spec [1]. [1] https://docs.opentitan.org/hw/ip/spi_host/doc/#Reg_event_enable Signed-off-by: Wilfred Mallawa Reviewed-by: Alistair Francis --- hw/ssi/ibex_spi_host.c | 2 +- 1 file changed, 1

[PATCH v3 0/4] hw/ssi: ibex_spi: cleanup and fixup bugs

2022-08-21 Thread Wilfred Mallawa
From: Wilfred Mallawa This patch series cleans up the ibex_spi driver, fixes the specified coverity issue, implements register rw1c functionality and updates an incorrect register offset. Patch V3 fixes up: - Style errors (excess indentation on multi-line) - Remove patch note from

[PATCH v3 3/4] hw/ssi: ibex_spi: fixup/add rw1c functionality

2022-08-21 Thread Wilfred Mallawa
From: Wilfred Mallawa This patch adds the `rw1c` functionality to the respective registers. The status fields are cleared when the respective field is set. Signed-off-by: Wilfred Mallawa Reviewed-by: Alistair Francis --- hw/ssi/ibex_spi_host.c | 34 --

[PATCH v3 1/4] hw/ssi: ibex_spi: fixup typos in ibex_spi_host

2022-08-21 Thread Wilfred Mallawa
From: Wilfred Mallawa This patch fixes up minor typos in ibex_spi_host Signed-off-by: Wilfred Mallawa Reviewed-by: Alistair Francis Reviewed-by: Andrew Jones --- hw/ssi/ibex_spi_host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ssi/ibex_spi_host.c

Re: [PATCH v6 15/21] accel/tcg: Remove translator_ldsw

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:36 PM Richard Henderson wrote: > > The only user can easily use translator_lduw and > adjust the type to signed during the return. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > include/exec/translator.h | 1 - >

Re: [PATCH v6 14/21] accel/tcg: Raise PROT_EXEC exception early

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:40 PM Richard Henderson wrote: > > We currently ignore PROT_EXEC on the initial lookup, and > defer raising the exception until cpu_ld*_code(). > It makes more sense to raise the exception early. > > Signed-off-by: Richard Henderson Acked-by: Alistair Francis

Re: [PATCH v6 08/21] accel/tcg: Properly implement get_page_addr_code for user-only

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:40 PM Richard Henderson wrote: > > The current implementation is a no-op, simply returning addr. > This is incorrect, because we ought to be checking the page > permissions for execution. > > Make get_page_addr_code inline for both implementations. > > Signed-off-by:

Re: [PATCH v6 13/21] accel/tcg: Add nofault parameter to get_page_addr_code_hostp

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:36 PM Richard Henderson wrote: > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > include/exec/exec-all.h | 10 +- > accel/tcg/cputlb.c | 8 > accel/tcg/plugin-gen.c | 4 ++-- > accel/tcg/user-exec.c | 4

Re: [PATCH v6 11/21] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:34 PM Richard Henderson wrote: > > The base qemu_ram_addr_from_host function is already in > softmmu/physmem.c; move the nofail version to be adjacent. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > include/exec/cpu-common.h |

Re: [PATCH v6 10/21] accel/tcg: Make tb_htable_lookup static

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:33 PM Richard Henderson wrote: > > The function is not used outside of cpu-exec.c. Move it and > its subroutines up in the file, before the first use. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > include/exec/exec-all.h | 3

Re: [PATCH v6 09/21] accel/tcg: Unlock mmap_lock after longjmp

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:29 PM Richard Henderson wrote: > > The mmap_lock is held around tb_gen_code. While the comment > is correct that the lock is dropped when tb_gen_code runs out > of memory, the lock is *not* dropped when an exception is > raised reading code for translation. > >

Re: [PATCH v6 07/21] accel/tcg: Introduce is_same_page()

2022-08-21 Thread Alistair Francis
On Fri, Aug 19, 2022 at 1:26 PM Richard Henderson wrote: > > From: Ilya Leoshkevich > > Introduce a function that checks whether a given address is on the same > page as where disassembly started. Having it improves readability of > the following patches. > > Signed-off-by: Ilya Leoshkevich >

[PATCH v2] net: tulip: Restrict DMA engine to memories

2022-08-21 Thread Zheyu Ma
The DMA engine is started by I/O access and then itself accesses the I/O registers, triggering a reentrancy bug. The following log can reveal it: ==5637==ERROR: AddressSanitizer: stack-overflow #0 0x5595435f6078 in tulip_xmit_list_update qemu/hw/net/tulip.c:673 #1 0x5595435f204a in

[PATCH] net: tulip: Restrict DMA engine to memories

2022-08-21 Thread Zheyu Ma
The DMA engine is started by I/O access and then itself accesses the I/O registers, triggering a reentrancy bug. The following log can reveal it: ==5637==ERROR: AddressSanitizer: stack-overflow #0 0x5595435f6078 in tulip_xmit_list_update qemu/hw/net/tulip.c:673 #1 0x5595435f204a in

Re: [PATCH 1/2] scsi: Add buf_len parameter to scsi_req_new()

2022-08-21 Thread John Millikin
Thank you for the suggestions for CDB sizes! Especially the tricky ones in spapr_vscsi.c and dev-uas.c. v2: https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg02997.html On Fri, Aug 19, 2022 at 06:06:13PM +0200, Paolo Bonzini wrote: > On 8/17/22 07:34, John Millikin wrote: > > The sigil

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-21 Thread Matthew Wilcox
On Thu, Aug 18, 2022 at 08:00:41PM -0700, Hugh Dickins wrote: > tmpfs and hugetlbfs and page cache are designed around sharing memory: > TDX is designed around absolutely not sharing memory; and the further > uses which Sean foresees appear not to need it as page cache either. > > Except perhaps

[PATCH] disas/riscv.c: rvv: Add disas support for vector instructions

2022-08-21 Thread Yang Liu
Tested with https://github.com/ksco/rvv-decoder-tests Expected checkpatch errors for consistency and brevity reasons: ERROR: line over 90 characters ERROR: trailing statements should be on next line ERROR: braces {} are necessary for all arms of this statement Signed-off-by: Yang Liu ---