Re: [PULL v2 00/19] riscv-to-apply queue

2022-07-02 Thread Richard Henderson
On 7/3/22 05:42, Alistair Francis wrote: From: Alistair Francis The following changes since commit d495e432c04a6394126c35cf96517749708b410f: Merge tag 'pull-aspeed-20220630' of https://github.com/legoater/qemu into staging (2022-06-30 22:04:12 +0530) are available in the Git repository at

Re: [PULL 00/11] Bsd user syscall 2022q2b patches

2022-07-02 Thread Richard Henderson
On 7/2/22 19:26, Warner Losh wrote: The following changes since commit d495e432c04a6394126c35cf96517749708b410f: Merge tag 'pull-aspeed-20220630' of https://github.com/legoater/qemu into staging (2022-06-30 22:04:12 +0530) are available in the Git repository at: ssh://g...@github.com/qe

[PULL v2 18/19] target/riscv: Remove CSRs that set/clear an IMSIC interrupt file bits

2022-07-02 Thread Alistair Francis
From: Anup Patel Based on architecture review committee feedback, the [m|s|vs]seteienum, [m|s|vs]clreienum, [m|s|vs]seteipnum, and [m|s|vs]clreipnum CSRs are removed in the latest AIA draft v0.3.0 specification. (Refer, https://github.com/riscv/riscv-aia/releases/tag/0.3.0-draft.31) These CSRs w

[PULL v2 16/19] hw/riscv: boot: Reduce FDT address alignment constraints

2022-07-02 Thread Alistair Francis
From: Alistair Francis We previously stored the device tree at a 16MB alignment from the end of memory (or 3GB). This means we need at least 16MB of memory to be able to do this. We don't actually need the FDT to be 16MB aligned, so let's drop it down to 2MB so that we can support systems with le

[PULL v2 14/19] target/riscv: Ibex: Support priv version 1.11

2022-07-02 Thread Alistair Francis
From: Alistair Francis The Ibex CPU supports version 1.11 of the priv spec [1], so let's correct that in QEMU as well. 1: https://ibex-core.readthedocs.io/en/latest/01_overview/compliance.html Signed-off-by: Alistair Francis Reviewed-by: Bin Meng Message-Id: <20220629233102.275181-3-alistair.

[PULL v2 13/19] target/riscv: Fixup MSECCFG minimum priv check

2022-07-02 Thread Alistair Francis
From: Alistair Francis There is nothing in the RISC-V spec that mandates version 1.12 is required for ePMP and there is currently hardware [1] that implements ePMP (a draft version though) with the 1.11 priv spec. 1: https://ibex-core.readthedocs.io/en/latest/01_overview/compliance.html Fixes:

[PULL v2 10/19] target/riscv: Implement mcountinhibit CSR

2022-07-02 Thread Alistair Francis
From: Atish Patra As per the privilege specification v1.11, mcountinhibit allows to start/stop a pmu counter selectively. Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Atish Patra Signed-off-by: Atish Patra Message-Id: <20220620231603.2547260-6-ati...@rivosinc.com> Signe

[PULL v2 12/19] target/riscv: Support mcycle/minstret write operation

2022-07-02 Thread Alistair Francis
From: Atish Patra mcycle/minstret are actually WARL registers and can be written with any given value. With SBI PMU extension, it will be used to store a initial value provided from supervisor OS. The Qemu also need prohibit the counter increment if mcountinhibit is set. Support mcycle/minstret

[PULL v2 19/19] target/riscv: Update default priority table for local interrupts

2022-07-02 Thread Alistair Francis
From: Anup Patel The latest AIA draft v0.3.0 defines a relatively simpler scheme for default priority assignments where: 1) local interrupts 24 to 31 and 48 to 63 are reserved for custom use and have implementation specific default priority. 2) remaining local interrupts 0 to 23 and 32 to 47 h

[PULL v2 07/19] target/riscv: Implement PMU CSR predicate function for S-mode

2022-07-02 Thread Alistair Francis
From: Atish Patra Currently, the predicate function for PMU related CSRs only works if virtualization is enabled. It also does not check mcounteren bits before before cycle/minstret/hpmcounterx access. Support supervisor mode access in the predicate function as well. Reviewed-by: Alistair Franc

[PULL v2 11/19] target/riscv: Add support for hpmcounters/hpmevents

2022-07-02 Thread Alistair Francis
From: Atish Patra With SBI PMU extension, user can use any of the available hpmcounters to track any perf events based on the value written to mhpmevent csr. Add read/write functionality for these csrs. Reviewed-by: Alistair Francis Reviewed-by: Bin Meng Signed-off-by: Atish Patra Signed-off-

[PULL v2 08/19] target/riscv: pmu: Rename the counters extension to pmu

2022-07-02 Thread Alistair Francis
From: Atish Patra The PMU counters are supported via cpu config "Counters" which doesn't indicate the correct purpose of those counters. Rename the config property to pmu to indicate that these counters are performance monitoring counters. This aligns with cpu options for ARM architecture as wel

[PULL v2 05/19] target/riscv/pmp: guard against PMP ranges with a negative size

2022-07-02 Thread Alistair Francis
From: Nicolas Pitre For a TOR entry to match, the stard address must be lower than the end address. Normally this is always the case, but correct code might still run into the following scenario: Initial state: pmpaddr3 = 0x2000 pmp3cfg = OFF pmpaddr4 = 0x3000 pmp4cf

[PULL v2 09/19] target/riscv: pmu: Make number of counters configurable

2022-07-02 Thread Alistair Francis
From: Atish Patra The RISC-V privilege specification provides flexibility to implement any number of counters from 29 programmable counters. However, the QEMU implements all the counters. Make it configurable through pmu config parameter which now will indicate how many programmable counters sho

[PULL v2 01/19] target/riscv: Remove condition guarding register zero for auipc and lui

2022-07-02 Thread Alistair Francis
From: Víctor Colombo Commit 57c108b8646 introduced gen_set_gpri(), which already contains a check for if the destination register is 'zero'. The check in auipc and lui are then redundant. This patch removes those checks. Signed-off-by: Víctor Colombo Reviewed-by: Richard Henderson Reviewed-by:

[PULL v2 06/19] target/riscv: Fix PMU CSR predicate function

2022-07-02 Thread Alistair Francis
From: Atish Patra The predicate function calculates the counter index incorrectly for hpmcounterx. Fix the counter index to reflect correct CSR number. Fixes: e39a8320b088 ("target/riscv: Support the Virtual Instruction fault") Reviewed-by: Alistair Francis Reviewed-by: Bin Meng Signed-off-by:

[PULL v2 17/19] target/riscv: Set minumum priv spec version for mcountinhibit

2022-07-02 Thread Alistair Francis
From: Anup Patel The minimum priv spec versino for mcountinhibit to v1.11 so that it is not available for v1.10 (or lower). Fixes: eab4776b2bad ("target/riscv: Add support for hpmcounters/hpmevents") Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Message-Id: <20220628101737.786681-3-a

[PULL v2 03/19] target/riscv: Remove generate_exception_mtval

2022-07-02 Thread Alistair Francis
From: Richard Henderson The function doesn't set mtval, it sets badaddr. Move the set of badaddr directly into gen_exception_inst_addr_mis and use generate_exception. Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Message-Id: <20220604231004.49990-3-richard.hender...@linaro.org

[PULL v2 15/19] target/riscv: Don't force update priv spec version to latest

2022-07-02 Thread Alistair Francis
From: Anup Patel The riscv_cpu_realize() sets priv spec version to v1.12 when it is when "env->priv_ver == 0" (i.e. default v1.10) because the enum value of priv spec v1.10 is zero. Due to above issue, the sifive_u machine will see priv spec v1.12 instead of priv spec v1.10. To fix this issue,

[PULL 06/19] target/riscv: Fix PMU CSR predicate function

2022-07-02 Thread Alistair Francis
From: Atish Patra The predicate function calculates the counter index incorrectly for hpmcounterx. Fix the counter index to reflect correct CSR number. Fixes: e39a8320b088 ("target/riscv: Support the Virtual Instruction fault") Reviewed-by: Alistair Francis Reviewed-by: Bin Meng Signed-off-by:

[PULL v2 02/19] target/riscv: Set env->bins in gen_exception_illegal

2022-07-02 Thread Alistair Francis
From: Richard Henderson While we set env->bins when unwinding for ILLEGAL_INST, from e.g. csrrw, we weren't setting it for immediately illegal instructions. Add a testcase for mtval via both exception paths. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1060 Signed-off-by: Richard Hen

[PULL v2 04/19] target/riscv: Minimize the calls to decode_save_opc

2022-07-02 Thread Alistair Francis
From: Richard Henderson The set of instructions that require decode_save_opc for unwinding is really fairly small -- only insns that can raise ILLEGAL_INSN at runtime. This includes CSR, anything that uses a *new* fp rounding mode, and many privileged insns. Since unwind info is stored as the d

[PULL 03/19] target/riscv: Remove generate_exception_mtval

2022-07-02 Thread Alistair Francis
From: Richard Henderson The function doesn't set mtval, it sets badaddr. Move the set of badaddr directly into gen_exception_inst_addr_mis and use generate_exception. Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Message-Id: <20220604231004.49990-3-richard.hender...@linaro.org

[PULL v2 00/19] riscv-to-apply queue

2022-07-02 Thread Alistair Francis
From: Alistair Francis The following changes since commit d495e432c04a6394126c35cf96517749708b410f: Merge tag 'pull-aspeed-20220630' of https://github.com/legoater/qemu into staging (2022-06-30 22:04:12 +0530) are available in the Git repository at: g...@github.com:alistair23/qemu.git tag

Re: [PULL 00/19] riscv-to-apply queue

2022-07-02 Thread Alistair Francis
On Sun, Jul 3, 2022 at 10:09 AM Alistair Francis wrote: > > From: Alistair Francis > > The following changes since commit d495e432c04a6394126c35cf96517749708b410f: > > Merge tag 'pull-aspeed-20220630' of https://github.com/legoater/qemu into > staging (2022-06-30 22:04:12 +0530) > > are availa

[PULL 05/19] target/riscv/pmp: guard against PMP ranges with a negative size

2022-07-02 Thread Alistair Francis
From: Nicolas Pitre For a TOR entry to match, the stard address must be lower than the end address. Normally this is always the case, but correct code might still run into the following scenario: Initial state: pmpaddr3 = 0x2000 pmp3cfg = OFF pmpaddr4 = 0x3000 pmp4cf

[PULL 04/19] target/riscv: Minimize the calls to decode_save_opc

2022-07-02 Thread Alistair Francis
From: Richard Henderson The set of instructions that require decode_save_opc for unwinding is really fairly small -- only insns that can raise ILLEGAL_INSN at runtime. This includes CSR, anything that uses a *new* fp rounding mode, and many privileged insns. Since unwind info is stored as the d

[PULL 01/19] target/riscv: Remove condition guarding register zero for auipc and lui

2022-07-02 Thread Alistair Francis
From: Víctor Colombo Commit 57c108b8646 introduced gen_set_gpri(), which already contains a check for if the destination register is 'zero'. The check in auipc and lui are then redundant. This patch removes those checks. Signed-off-by: Víctor Colombo Reviewed-by: Richard Henderson Reviewed-by:

[PULL 02/19] target/riscv: Set env->bins in gen_exception_illegal

2022-07-02 Thread Alistair Francis
From: Richard Henderson While we set env->bins when unwinding for ILLEGAL_INST, from e.g. csrrw, we weren't setting it for immediately illegal instructions. Add a testcase for mtval via both exception paths. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1060 Signed-off-by: Richard Hen

[PULL 00/19] riscv-to-apply queue

2022-07-02 Thread Alistair Francis
From: Alistair Francis The following changes since commit d495e432c04a6394126c35cf96517749708b410f: Merge tag 'pull-aspeed-20220630' of https://github.com/legoater/qemu into staging (2022-06-30 22:04:12 +0530) are available in the Git repository at: g...@github.com:alistair23/qemu.git tag

[PATCH] avocado: Fix BUILD_DIR if it's equal to SOURCE_DIR

2022-07-02 Thread Peter Delevoryas
I like to build QEMU from the root source directory, rather than cd'ing into the build directory. This code may as well include a search path for that, so that you can run avocado tests individually without specifying "-p qemu_bin=build/qemu-system-arm" manually. Signed-off-by: Peter Delevoryas -

[PATCH v2] aspeed: Create SRAM name from first CPU index

2022-07-02 Thread Peter Delevoryas
From: Peter Delevoryas To support multiple SoC's running simultaneously, we need a unique name for each RAM region. DRAM is created by the machine, but SRAM is created by the SoC, since in hardware it is part of the SoC's internals. We need a way to uniquely identify each SRAM region though, for

Re: [PATCH] aspeed: Create SRAM name from first CPU index

2022-07-02 Thread Peter Delevoryas
On Sat, Jul 02, 2022 at 12:36:46AM -0700, Peter Delevoryas wrote: > On Sat, Jul 02, 2022 at 12:01:48AM -0700, Peter Delevoryas wrote: > > On Sat, Jul 02, 2022 at 08:01:14AM +0200, Cédric Le Goater wrote: > > > On 7/1/22 20:06, Peter Delevoryas wrote: > > > > To support multiple SoC's running simult

Re: [PATCH] ui/cocoa: Fix switched_to_fullscreen warning

2022-07-02 Thread Akihiko Odaki
Reviewed-by: Akihiko Odaki On 2022/07/02 13:43, Peter Delevoryas wrote: I noticed this error while building QEMU on Mac OS X: [1040/1660] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o ../ui/cocoa.m:803:17: warning: variable 'switched_to_fullscreen' set but not used [-Wunu

[PATCH v4] ui/cocoa: Take refresh rate into account

2022-07-02 Thread Akihiko Odaki
Retreieve the refresh rate of the display and reflect it with dpy_set_ui_info() and update_displaychangelistener(), allowing the guest and DisplayChangeListener to consume the information. The information will be used as a hint how often the display should be updated. For example, when we run 30 H

Re: [PATCH 5/5] target/arm: Correctly implement Feat_DoubleLock

2022-07-02 Thread Richard Henderson
On 7/1/22 01:11, Peter Maydell wrote: +static inline bool isar_feature_any_doublelock(const ARMISARegisters *id) +{ +/* + * We can't just OR together the aa32 and aa64 checks, because + * if there is no AArch64 support the aa64 function will default + * to returning true for a zer

Re: [RFC 0/8] Introduce an extensible static analyzer

2022-07-02 Thread Paolo Bonzini
On 7/2/22 13:33, Alberto Faria wrote: The current primary motivation for this work is enforcing rules around block layer coroutines, which is why most of the series focuses on that. However, the static analyzer is intended to be sufficiently generic to satisfy other present and future QEMU static

Re: [RFC 4/8] Fix some direct calls from non-coroutine_fn to coroutine_fn

2022-07-02 Thread Paolo Bonzini
On 7/2/22 13:33, Alberto Faria wrote: @@ -1537,8 +1537,9 @@ static void blk_aio_read_entry(void *opaque) QEMUIOVector *qiov = rwco->iobuf; assert(qiov->size == acb->bytes); -rwco->ret = blk_co_do_preadv(rwco->blk, rwco->offset, acb->bytes, - qio

Re: [PATCH v5 00/10] Implement bdrv_{pread, pwrite, pwrite_sync, pwrite_zeroes}() using generated_co_wrapper

2022-07-02 Thread Paolo Bonzini
On 6/23/22 22:20, Alberto Faria wrote: On Thu, Jun 9, 2022 at 4:27 PM Alberto Faria wrote: Start by making the interfaces of analogous non-coroutine and coroutine functions consistent with each other, then implement the non-coroutine ones using generated_co_wrapper. For the bdrv_pwrite_sync()

Re: [PATCH 00/18] Make block-backend-io.h API more consistent

2022-07-02 Thread Paolo Bonzini
On 5/17/22 13:35, Alberto Faria wrote: Adjust existing pairs of non-coroutine and coroutine functions to share the same calling convention, and add non-coroutine/coroutine counterparts where they don't exist. Also make the non-coroutine versions generated_co_wrappers. This series sits on top of

Re: [PATCH 2/5] target/arm: Move define_debug_regs() to debug_helper.c

2022-07-02 Thread Richard Henderson
On 7/1/22 01:11, Peter Maydell wrote: The target/arm/helper.c file is very long and is a grabbag of all kinds of functionality. We have already a debug_helper.c which has code for implementing architectural debug. Move the code which defines the debug-related system registers out to this file a

[PULL 11/11] bsd-user: Remove stray 'inline' from do_bsd_close

2022-07-02 Thread Warner Losh
In the last series, I inadvertantly didn't remove this inline, but did all the others. Remove it for consistency. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/bsd-file.h b/bsd-user/

Re: [PATCH 3/5] target/arm: Suppress debug exceptions when OS Lock set

2022-07-02 Thread Richard Henderson
On 7/1/22 01:11, Peter Maydell wrote: The "OS Lock" in the Arm debug architecture is a way for software to suppress debug exceptions while it is trying to power down a CPU and save the state of the breakpoint and watchpoint registers. In QEMU we implemented the support for writing the OS Lock bit

Re: [PATCH 4/5] target/arm: Implement AArch32 DBGDEVID, DBGDEVID1, DBGDEVID2

2022-07-02 Thread Richard Henderson
On 7/1/22 01:11, Peter Maydell wrote: Starting with v7 of the debug architecture, there are three extra ID registers that add information on top of that provided in DBGDIDR. These are DBGDEVID, DBGDEVID1 and DBGDEVID2. In the v7 debug architecture, DBGDEVID is optional, present only of s/of/if/

[PULL 08/11] bsd-user: Implement mkfifo and mkfifoat

2022-07-02 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 27 +++ bsd-user/freebsd/os-syscall.c | 8 2 files changed, 35 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index c2

[PULL 10/11] bsd-user: Implement undelete

2022-07-02 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 13 + bsd-user/freebsd/os-syscall.c | 4 2 files changed, 17 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 065f576dfe8..108a506

[PULL 04/11] bsd-user: Implement freebsd11_mknod, freebsd11_mknodat and mknodat

2022-07-02 Thread Warner Losh
These implement both the old-pre INO64 mknod variations, as well as the now current INO64 variant. Make direct syscall calls for these older syscalls to avloid too many dependencies. Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Warner Losh Reviewed-by: Richard Henderson

[PULL 07/11] bsd-user: Implement chroot and flock

2022-07-02 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 19 +++ bsd-user/freebsd/os-syscall.c | 8 2 files changed, 27 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index a1c80428d9

[PULL 06/11] bsd-user: Implement chflags, lchflags and fchflags

2022-07-02 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 32 bsd-user/freebsd/os-syscall.c | 12 2 files changed, 44 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h

[PULL 02/11] bsd-user: Implement symlink, symlinkat, readlink and readlinkat

2022-07-02 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Jung-uk Kim Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 74 +++ bsd-user/freebsd/os-syscall.c | 16 2 files changed, 90 insertions(+) diff --git a/bsd-user/bsd-f

[PULL 00/11] Bsd user syscall 2022q2b patches

2022-07-02 Thread Warner Losh
The following changes since commit d495e432c04a6394126c35cf96517749708b410f: Merge tag 'pull-aspeed-20220630' of https://github.com/legoater/qemu into staging (2022-06-30 22:04:12 +0530) are available in the Git repository at: ssh://g...@github.com/qemu-bsd-user/qemu-bsd-user.git tags/bsd-

[PULL 09/11] bsd-user: Implement pathconf, lpathconf and fpathconf

2022-07-02 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 32 bsd-user/freebsd/os-syscall.c | 12 2 files changed, 44 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h

[PULL 05/11] bsd-user: Implement chown, fchown, lchown and fchownat

2022-07-02 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 48 +++ bsd-user/freebsd/os-syscall.c | 16 2 files changed, 64 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-fil

[PULL 03/11] bsd-user: implement chmod, fchmod, lchmod and fchmodat

2022-07-02 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 46 +++ bsd-user/freebsd/os-syscall.c | 16 2 files changed, 62 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-fil

[PULL 01/11] bsd-user: Implement mount, umount and nmount

2022-07-02 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Jung-uk Kim Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 52 +++ bsd-user/freebsd/os-syscall.c | 13 + 2 files changed, 65 insertions(+) diff --git a/bsd-user/bsd-

Re: [PATCH 1/5] target/arm: Fix code style issues in debug helper functions

2022-07-02 Thread Richard Henderson
On 7/1/22 01:11, Peter Maydell wrote: Before moving debug system register helper functions to a different file, fix the code style issues (mostly block comment syntax) so checkpatch doesn't complain about the code-motion patch. Signed-off-by: Peter Maydell --- target/arm/helper.c | 58

[PATCH] target/riscv: fix csr check for cycle{h}, instret{h}, time{h}, hpmcounter3~31{h}

2022-07-02 Thread Weiwei Li
- improve the field extract progress - add stand-alone check for mcuonteren when in less-privileged mode - add check for scounteren when 'S' is enabled and current priv is PRV_U Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang --- target/riscv/csr.c | 76 ++-

Re: [PATCH 2/9] target/ppc: add errp to kvmppc_read_int_cpu_dt()

2022-07-02 Thread Daniel Henrique Barboza
On 7/2/22 03:24, Cédric Le Goater wrote: On 6/30/22 21:42, Daniel Henrique Barboza wrote: The function can't just return 0 whether an error happened and call it a day. We must provide a way of letting callers know if the zero return is legitimate or due to an error. Add an Error pointer to k

Re: [PATCH v2] target/ppc: Return default CPU for max CPU

2022-07-02 Thread Daniel Henrique Barboza
On 6/28/22 17:55, Murilo Opsfelder Araujo wrote: All ppc CPUs represent hardware that exists in the real world, i.e.: we do not have a "max" CPU with all possible emulated features enabled. Return the default CPU type for the machine because that has greater chance of being useful as the "max"

Re: [PATCH v3 00/11] target/ppc: BCDA and mffscdrn implementations

2022-07-02 Thread Daniel Henrique Barboza
On 6/29/22 13:28, Víctor Colombo wrote: Hello everyone, Set of patches containing implementations for some instructions that were missing before. Also, moves some related instructions to decodetree. Add mffsce test. Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks, Daniel v3: -

Re: [PATCH qemu v3] ppc/spapr: Implement H_WATCHDOG

2022-07-02 Thread Daniel Henrique Barboza
Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks, Daniel On 6/22/22 02:10, Alexey Kardashevskiy wrote: The new PAPR 2.12 defines a watchdog facility managed via the new H_WATCHDOG hypercall. This adds H_WATCHDOG support which a proposed driver for pseries uses: https://patchwork.ozlab

Re: [PATCH qemu v3] ppc: Define SETFIELD for the ppc target

2022-07-02 Thread Daniel Henrique Barboza
On 6/28/22 05:05, Alexey Kardashevskiy wrote: It keeps repeating, move it to the header. This uses __builtin_ffsll() to allow using the macros in #define. This is not using the QEMU's FIELD macros as this would require changing all such macros found in skiboot (the PPC PowerNV firmware). Sig

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

2022-07-02 Thread angell1518
At 2022-06-04 00:04:23, "Mayuresh Chitale" wrote: >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 +

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

2022-07-02 Thread angell1518
At 2022-06-04 00:04:22, "Mayuresh Chitale" wrote: >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

[PATCH] hw/i2c/pca954x: Add method to get channels

2022-07-02 Thread Peter Delevoryas
I added this helper in the Aspeed machine file a while ago to help initialize fuji-bmc i2c devices. This moves it to the official pca954x file so that other files can use it. This does something very similar to pca954x_i2c_get_bus, but I think this is useful when you have a very complicated dts wi

[RFC 8/8] Avoid calls from coroutine_fn to no_coroutine_fn

2022-07-02 Thread Alberto Faria
These calls were found by static-analyzer.py. Signed-off-by: Alberto Faria --- block/block-backend.c | 2 +- block/io.c | 10 +- block/parallels.c | 4 ++-- block/qcow2-refcount.c | 2 +- block/qed-table.c | 2 +- block/qed.c| 2 +- block/vmdk.c

[RFC 7/8] block: Add no_coroutine_fn marker

2022-07-02 Thread Alberto Faria
When applied to a function, it advertises that it should not be called from coroutine_fn functions. Make generated_co_wrapper evaluate to no_coroutine_fn, as coroutine_fn functions should instead directly call the coroutine_fn that backs the generated_co_wrapper. Extend static-analyzer.py's "coro

[RFC 3/8] static-analyzer: Enforce coroutine_fn restrictions for direct calls

2022-07-02 Thread Alberto Faria
Add a static-analyzer.py check ensuring that non-coroutine_fn functions don't perform direct calls to coroutine_fn functions. For the few cases where this must happen, introduce an __allow_coroutine_fn_call() macro that wraps offending calls and overrides the static analyzer. Signed-off-by: Alber

[RFC 5/8] static-analyzer: Enforce coroutine_fn restrictions on function pointers

2022-07-02 Thread Alberto Faria
Extend static-analyzer.py to enforce coroutine_fn restrictions on function pointer operations. Invalid operations include assigning a coroutine_fn value to a non-coroutine_fn function pointer, and invoking a coroutine_fn function pointer from a non-coroutine_fn function. Signed-off-by: Alberto Fa

[RFC 6/8] Fix some coroutine_fn indirect calls and pointer assignments

2022-07-02 Thread Alberto Faria
These problems were found by static-analyzer.py. Only a few of the reported cases were fixed. Signed-off-by: Alberto Faria --- include/block/block_int-common.h | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/block/block_int-common.h b/include/block/block_

[RFC 2/8] Drop some unused static function return values

2022-07-02 Thread Alberto Faria
Make some non-void static functions whose return values are ignored by all callers return void instead. These functions were found by the shiny new static-analyzer.py. Only a few of the reported cases were fixed. Signed-off-by: Alberto Faria --- block/file-posix.c | 6 +- block/io.c

[RFC 4/8] Fix some direct calls from non-coroutine_fn to coroutine_fn

2022-07-02 Thread Alberto Faria
These problems were found by static-analyzer.py. Only a few of the reported cases were fixed. Signed-off-by: Alberto Faria --- block/block-backend.c | 13 - block/copy-before-write.c | 3 ++- block/dirty-bitmap.c | 6 -- block/iscsi.c | 3 ++- block/qcow2.

[RFC 1/8] Add an extensible static analyzer

2022-07-02 Thread Alberto Faria
Add a static-analyzer.py script that uses libclang's Python bindings to provide a common framework on which arbitrary static analysis checks can be developed and run against QEMU's code base. As an example, a simple check is included that verifies that the return value of static, non-void function

[RFC 0/8] Introduce an extensible static analyzer

2022-07-02 Thread Alberto Faria
This series introduces a static analyzer for QEMU. It consists of a single static-analyzer.py script that relies on libclang's Python bindings, and provides a common framework on which arbitrary static analysis checks can be developed and run against QEMU's code base. Summary of the series: - P

Re: [PATCH v2 0/3] CanoKey: Fix xHCI compatibility and CCID ZLP

2022-07-02 Thread Hongren (Zenithal) Zheng
On Fri, Jul 01, 2022 at 12:51:06PM +0200, Gerd Hoffmann wrote: > On Thu, Jun 23, 2022 at 11:16:39PM +0800, Hongren (Zenithal) Zheng wrote: > > On Mon, Jun 13, 2022 at 08:12:38PM +0800, Hongren (Zenithal) Zheng wrote: > > > > > --- > > > v2: > > > * use usb_ep_get instead of recording ep_in_poi

[PATCH] tcg/tci: Fix enable-debug got an error

2022-07-02 Thread Song Gao
When building tcg configure with --enable-tcg-interpreter and --enable-debug, We may got an error: In file included from ../tcg/tcg.c:432: /root/code/github/soft-qemu/qemu/tcg/tci/tcg-target.c.inc: In function 'tcg_target_init': /root/code/github/soft-qemu/qemu/tcg/tci/tcg-target.c.inc:829:9: err

Re: [PATCH v2 0/4] target/s390x: Exit tb after executing ex_value

2022-07-02 Thread Sven Schnelle
Hi Richard, Richard Henderson writes: > Ok, version 1 didn't work, so once more with feeling. > Can you give it a try, Sven? This seems to work. Thanks a lot! Regards Sven

Re: [PATCH] aspeed: Create SRAM name from first CPU index

2022-07-02 Thread Peter Delevoryas
On Sat, Jul 02, 2022 at 12:01:48AM -0700, Peter Delevoryas wrote: > On Sat, Jul 02, 2022 at 08:01:14AM +0200, Cédric Le Goater wrote: > > On 7/1/22 20:06, Peter Delevoryas wrote: > > > To support multiple SoC's running simultaneously, we need a unique name > > > for > > > each RAM region. DRAM is

Re: [PATCH] aspeed: Create SRAM name from first CPU index

2022-07-02 Thread Peter Delevoryas
On Sat, Jul 02, 2022 at 08:01:14AM +0200, Cédric Le Goater wrote: > On 7/1/22 20:06, Peter Delevoryas wrote: > > To support multiple SoC's running simultaneously, we need a unique name for > > each RAM region. DRAM is created by the machine, but SRAM is created by the > > SoC, since in hardware it