Re: [PATCH v4] riscv: Allow user to set the satp mode

2023-01-05 Thread Alexandre Ghiti
On Fri, Dec 16, 2022 at 2:03 PM Alexandre Ghiti wrote: > > Hi Frank, > > On Fri, Dec 16, 2022 at 10:32 AM Frank Chang wrote: > > > > Hi Alexandre, > > > > Thanks for the contribution. This is really helpful. > > > > It seems like if we want to specify the SATP mode for the "named" CPUs, > > we

[PATCH v2 3/4] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-05 Thread Cédric Le Goater
From: Cédric Le Goater If a secure kernel is started in a non-protected VM, the OS will hang during boot without giving a proper error message to the user. Perform the checks on Confidential Guest support at runtime with an helper called from the service call switching the guest to protected

[PATCH v2 0/4] s390x/pv: Improve protected VM support

2023-01-05 Thread Cédric Le Goater
Hello, Here is a little series improving error reporting of protected VMs. Thanks, C. Changes in v2: - dropped ConfidentialGuestSupportClass handler. The check is now done from s390_pv_init() which is called after memory and CPU initialization. This gives us a better chance to tune the

[PATCH v2 2/4] s390x/pv: Check for support on the host

2023-01-05 Thread Cédric Le Goater
From: Cédric Le Goater Support for protected VMs should have been enabled on the host with the kernel parameter 'prot_virt=1'. If the hardware supports the feature, it is reflected under sysfs. Reviewed-by: Thomas Huth Signed-off-by: Cédric Le Goater --- hw/s390x/pv.c | 23

[PATCH v2 4/4] s390x/pv: Move check on hugepage under s390_pv_guest_check()

2023-01-05 Thread Cédric Le Goater
From: Cédric Le Goater Such conditions on Protected Virtualization can now be checked at init time. Reviewed-by: Thomas Huth Signed-off-by: Cédric Le Goater --- hw/s390x/pv.c | 14 +- target/s390x/diag.c | 7 --- 2 files changed, 13 insertions(+), 8 deletions(-) diff

[PATCH v2 1/4] s390x/pv: Implement a CGS check helper

2023-01-05 Thread Cédric Le Goater
From: Cédric Le Goater When a protected VM is started with the maximum number of CPUs (248), the service call providing information on the CPUs requires more buffer space than allocated and QEMU disgracefully aborts : LOADPARM=[] Using virtio-blk. Using SCSI scheme.

Re: [RFC PATCH 13/40] hw/arm/bcm2836: Set mp-affinity property in realize

2023-01-05 Thread Philippe Mathieu-Daudé
On 5/1/23 22:48, Philippe Mathieu-Daudé wrote: On 3/1/23 19:16, Richard Henderson wrote: There was even a TODO comment that we ought to be using a cpu property, but we failed to update when the property was added. Use ARM_AFF1_SHIFT instead of the bare constant 8. Signed-off-by: Richard

Re: [PATCH] .gitlab-ci.d/windows: Do not run the qtests in the msys2-32bit job

2023-01-05 Thread Thomas Huth
On 05/01/2023 22.42, Philippe Mathieu-Daudé wrote: On 5/1/23 21:48, Thomas Huth wrote: The qtests are not stable in the msys2-32bit job yet - especially the test-hmp and the qom-test are failing randomly. Until this is fixed, Who is gonna look after this? It certainly has to be someone

Re: [PATCH] semihosting: add O_BINARY flag in host_open for NT compatibility

2023-01-05 Thread Philippe Mathieu-Daudé
On 5/1/23 22:19, Evgeny Iakovlev wrote: Windows open(2) implementations opens files in text mode by default and needs a Windows-only O_BINARY flag to open files as binary. Qemu already s/Qemu/QEMU/ knows about that flag in osdep.h, so we can just add it to the host_flags for better

Re: [RFC PATCH 11/40] target/arm: Copy features from ARMCPUClass

2023-01-05 Thread Philippe Mathieu-Daudé
On 6/1/23 03:19, Richard Henderson wrote: On 1/5/23 14:04, Philippe Mathieu-Daudé wrote: On 3/1/23 19:16, Richard Henderson wrote: Create a features member in ARMCPUClass and copy to the instance in arm_cpu_init.  Settings of this value will come in a future patch. Signed-off-by: Richard

[PULL 0/3] loongarch-to-apply queue

2023-01-05 Thread Song Gao
The following changes since commit d1852caab131ea898134fdcea8c14bc2ee75fbe9: Merge tag 'python-pull-request' of https://gitlab.com/jsnow/qemu into staging (2023-01-05 16:59:22 +) are available in the Git repository at: https://gitlab.com/gaosong/qemu.git pull-loongarch-20230106 for

[PULL 1/3] hw/intc/loongarch_pch_msi: add irq number property

2023-01-05 Thread Song Gao
From: Tianrui Zhao This patch adds irq number property for loongarch msi interrupt controller, and remove hard coding irq number macro. Signed-off-by: Tianrui Zhao Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230104020518.2564263-2-zhaotian...@loongson.cn> Signed-off-by: Song Gao ---

[PULL 3/3] hw/intc/loongarch_pch: Change default irq number of pch irq controller

2023-01-05 Thread Song Gao
From: Tianrui Zhao Change the default irq number of pch pic to 32, so that the irq number of pch msi is 224(256 - 32), and move the 'PCH_PIC_IRQ_NUM' macro to pci-host/ls7a.h and add prefix 'VIRT' on it to keep standard format. Signed-off-by: Tianrui Zhao Reviewed-by: Philippe Mathieu-Daudé

[PULL 2/3] hw/intc/loongarch_pch_pic: add irq number property

2023-01-05 Thread Song Gao
From: Tianrui Zhao With loongarch 7A1000 manual, irq number supported can be set in PCH_PIC_INT_ID_HI register. This patch adds irq number property for loongarch_pch_pic, so that virt machine can set different irq number when pch_pic intc is added. Signed-off-by: Tianrui Zhao Reviewed-by: Song

Re: [PATCH v10 9/9] KVM: Enable and expose KVM_MEM_PRIVATE

2023-01-05 Thread Chao Peng
On Thu, Jan 05, 2023 at 12:38:30PM -0800, Vishal Annapurve wrote: > On Thu, Dec 1, 2022 at 10:20 PM Chao Peng wrote: > > > > +#ifdef CONFIG_HAVE_KVM_RESTRICTED_MEM > > +static bool restrictedmem_range_is_valid(struct kvm_memory_slot *slot, > > +pgoff_t

[PULL v2 47/47] tests/tcg/multiarch: add vma-pthread.c

2023-01-05 Thread Richard Henderson
From: Ilya Leoshkevich Add a test that locklessly changes and exercises page protection bits from various threads. This helps catch race conditions in the VMA handling. Acked-by: Alex Bennée Signed-off-by: Ilya Leoshkevich Message-Id: <20221223120252.513319-1-...@linux.ibm.com> Signed-off-by:

[PULL v3 40/43] hw/riscv: virt: Fix the value of "riscv, ndev" in the dtb

2023-01-05 Thread Alistair Francis
From: Bin Meng Commit 28d8c281200f ("hw/riscv: virt: Add optional AIA IMSIC support to virt machine") changed the value of VIRT_IRQCHIP_NUM_SOURCES from 127 to 53, which is VIRTIO_NDEV and also used as the value of "riscv,ndev" property in the dtb. Unfortunately this is wrong as

[PULL v3 43/43] hw/intc: sifive_plic: Fix the pending register range check

2023-01-05 Thread Alistair Francis
From: Bin Meng The pending register upper limit is currently set to plic->num_sources >> 3, which is wrong, e.g.: considering plic->num_sources is 7, the upper limit becomes 0 which fails the range check if reading the pending register at pending_base. Fixes: 1e24429e40df ("SiFive RISC-V PLIC

[PULL v3 35/43] hw/intc: sifive_plic: Use error_setg() to propagate the error up via errp in sifive_plic_realize()

2023-01-05 Thread Alistair Francis
From: Bin Meng The realize() callback has an errp for us to propagate the error up. While we are here, correct the wrong multi-line comment format. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PULL v2 00/47] tcg misc queue

2023-01-05 Thread Richard Henderson
of the MSYS2 jobs (2023-01-04 18:58:33 +) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230105 for you to fetch changes up to d4846c33ebe04d2141dcc613b5558d2f1d8077af: tests/tcg/multiarch: add vma-pthread.c (2023-01-05 11:41:29 -0800

[PULL v3 27/43] RISC-V: Add Zawrs ISA extension support

2023-01-05 Thread Alistair Francis
From: Christoph Muellner This patch adds support for the Zawrs ISA extension. Given the current (incomplete) implementation of reservation sets there seems to be no way to provide a full emulation of the WRS instruction (wake on reservation set invalidation or timeout or interrupt). Therefore,

[PULL v3 34/43] hw/intc: sifive_plic: Improve robustness of the PLIC config parser

2023-01-05 Thread Alistair Francis
From: Bin Meng At present the PLIC config parser can only handle legal config string like "MS,MS". However if a config string like ",MS,MS,,MS,MS,," is given the parser won't get the correct configuration. This commit improves the config parser to make it more robust. Signed-off-by: Bin Meng

[PULL v3 22/43] hw/intc: sifive_plic: fix out-of-bound access of source_priority array

2023-01-05 Thread Alistair Francis
From: Jim Shu If the number of interrupt is not multiple of 32, PLIC will have out-of-bound access to source_priority array. Compute the number of interrupt in the last word to avoid this out-of-bound access of array. Signed-off-by: Jim Shu Reviewed-by: Bin Meng Message-Id:

[PULL v3 32/43] hw/riscv: spike: Remove misleading comments

2023-01-05 Thread Alistair Francis
From: Bin Meng PLIC is not included in the 'spike' machine. Signed-off-by: Bin Meng Reviewed-by: Wilfred Mallawa Reviewed-by: Alistair Francis Message-Id: <20221211030829.802437-5-bm...@tinylab.org> Signed-off-by: Alistair Francis --- hw/riscv/spike.c | 1 - 1 file changed, 1 deletion(-)

[PULL v3 04/43] tcg/riscv: Fix base register for user-only qemu_ld/st

2023-01-05 Thread Alistair Francis
From: Richard Henderson When guest_base != 0, we were not coordinating the usage of TCG_REG_TMP0 as base properly, leading to a previous zero-extend of the input address being discarded. Shuffle the alignment check to the front, because that does not depend on the zero-extend, and it keeps the

[PULL v2 19/47] tcg: Introduce paired register allocation

2023-01-05 Thread Richard Henderson
There are several instances where we need to be able to allocate a pair of registers to related inputs/outputs. Add 'p' and 'm' register constraints for this, in order to be able to allocate the even/odd register first or second. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +

[PULL v3 25/43] target/riscv: Simplify helper_sret() a little bit

2023-01-05 Thread Alistair Francis
From: Bin Meng There are 2 paths in helper_sret() and the same mstatus update codes are replicated. Extract the common parts to simplify it a little bit. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Message-Id: <20221207090037.281452-1-bm...@tinylab.org> Signed-off-by: Alistair

[PULL v3 15/43] target/riscv: Typo fix in sstc() predicate

2023-01-05 Thread Alistair Francis
From: Anup Patel We should use "&&" instead of "&" when checking hcounteren.TM and henvcfg.STCE bits. Fixes: 3ec0fe18a31f ("target/riscv: Add vstimecmp suppor") Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Message-Id: <20221108125703.1463577-2-apa...@ventanamicro.com>

[PULL v3 36/43] hw/intc: sifive_plic: Update "num-sources" property default value

2023-01-05 Thread Alistair Francis
From: Bin Meng At present the default value of "num-sources" property is zero, which does not make a lot of sense, as in sifive_plic_realize() we see s->bitfield_words is calculated by: s->bitfield_words = (s->num_sources + 31) >> 5; if the we don't configure "num-sources" property its

[PULL v3 37/43] hw/riscv: microchip_pfsoc: Fix the number of interrupt sources of PLIC

2023-01-05 Thread Alistair Francis
From: Bin Meng Per chapter 6.5.2 in [1], the number of interupt sources including interrupt source 0 should be 187. [1] PolarFire SoC MSS TRM:

[PULL v3 28/43] hw/riscv: Select MSI_NONBROKEN in SIFIVE_PLIC

2023-01-05 Thread Alistair Francis
From: Bin Meng hw/pci/Kconfig says MSI_NONBROKEN should be selected by interrupt controllers regardless of how MSI is implemented. msi_nonbroken is initialized to true in sifive_plic_realize(). Let SIFIVE_PLIC select MSI_NONBROKEN and drop the selection from RISC-V machines. Signed-off-by: Bin

[PULL v3 17/43] target/riscv: support cache-related PMU events in virtual mode

2023-01-05 Thread Alistair Francis
From: Jim Shu let tlb_fill() function also increments PMU counter when it is from two-stage translation, so QEMU could also monitor these PMU events when CPU runs in VS/VU mode (like running guest OS). Signed-off-by: Jim Shu Reviewed-by: Alistair Francis Message-Id:

[PULL v3 39/43] hw/riscv: sifive_u: Avoid using magic number for "riscv, ndev"

2023-01-05 Thread Alistair Francis
From: Bin Meng At present magic number is used to create "riscv,ndev" property in the dtb. Let's use the macro SIFIVE_U_PLIC_NUM_SOURCES that is used to instantiate the PLIC model instead. Signed-off-by: Bin Meng Reviewed-by: Wilfred Mallawa Reviewed-by: Alistair Francis Message-Id:

[PULL v3 24/43] target/riscv: Set pc_succ_insn for !rvc illegal insn

2023-01-05 Thread Alistair Francis
From: Richard Henderson Failure to set pc_succ_insn may result in a TB covering zero bytes, which triggers an assert within the code generator. Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1224 Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis

[PULL v3 20/43] hw/riscv: pfsoc: add missing FICs as unimplemented

2023-01-05 Thread Alistair Francis
From: Conor Dooley The Fabric Interconnect Controllers provide interfaces between the FPGA fabric and the core complex. There are 5 FICs on PolarFire SoC, numbered 0 through 4. FIC2 is an AXI4 slave interface from the FPGA fabric and does not show up on the MSS memory map. FIC4 is dedicated to

[PULL v3 21/43] hw/{misc, riscv}: pfsoc: add system controller as unimplemented

2023-01-05 Thread Alistair Francis
From: Conor Dooley The system controller on PolarFire SoC is access via a mailbox. The control registers for this mailbox lie in the "IOSCB" region & the interrupt is cleared via write to the "SYSREG" region. It also has a QSPI controller, usually connected to a flash chip, that is used for

[PULL v3 18/43] target/riscv: Add some comments for sstatus CSR in riscv_cpu_dump_state()

2023-01-05 Thread Alistair Francis
From: Bin Meng sstatus register dump is currently missing in riscv_cpu_dump_state(). As sstatus is a copy of mstatus, which is described in the priv spec, it seems redundant to print the same information twice. Add some comments for this to let people know this is intentional. Signed-off-by:

[PULL v3 38/43] hw/riscv: sifive_e: Fix the number of interrupt sources of PLIC

2023-01-05 Thread Alistair Francis
From: Bin Meng Per chapter 10 in Freedom E310 manuals [1][2][3], E310 G002 and G003 supports 52 interrupt sources while G000 supports 51 interrupt sources. We use the value of G002 and G003, so it is 53 (including source 0). [1] G000 manual:

[PULL v3 01/43] target/riscv: Fix PMP propagation for tlb

2023-01-05 Thread Alistair Francis
From: LIU Zhiwei Only the pmp index that be checked by pmp_hart_has_privs can be used by pmp_get_tlb_size to avoid an error pmp index. Before modification, we may use an error pmp index. For example, we check address 0x4fc, and the size 0x4 in pmp_hart_has_privs. If there is an pmp rule, valid

[PULL v3 41/43] hw/intc: sifive_plic: Change "priority-base" to start from interrupt source 0

2023-01-05 Thread Alistair Francis
From: Bin Meng At present the SiFive PLIC model "priority-base" expects interrupt priority register base starting from source 1 instead source 0, that's why on most platforms "priority-base" is set to 0x04 except 'opentitan' machine. 'opentitan' should have set "priority-base" to 0x04 too. Note

[PULL v3 19/43] hw/misc: pfsoc: add fabric clocks to ioscb

2023-01-05 Thread Alistair Francis
From: Conor Dooley On PolarFire SoC, some peripherals (eg the PCI root port) are clocked by "Clock Conditioning Circuitry" in the FPGA. The specific clock depends on the FPGA bitstream & can be locked to one particular {D,P}LL - in the Icicle Kit Reference Design v2022.09 or later this is/will

[PULL v3 12/43] target/riscv: Enable native debug itrigger

2023-01-05 Thread Alistair Francis
From: LIU Zhiwei When QEMU is not in icount mode, execute instruction one by one. The tdata1 can be read directly. When QEMU is in icount mode, use a timer to simulate the itrigger. The tdata1 may be not right because of lazy update of count in tdata1. Thus, We should pack the adjusted count

[PULL v3 29/43] hw/intc: Select MSI_NONBROKEN in RISC-V AIA interrupt controllers

2023-01-05 Thread Alistair Francis
From: Bin Meng hw/pci/Kconfig says MSI_NONBROKEN should be selected by interrupt controllers regardless of how MSI is implemented. msi_nonbroken is initialized to true in both riscv_aplic_realize() and riscv_imsic_realize(). Select MSI_NONBROKEN in RISCV_APLIC and RISCV_IMSIC. Signed-off-by:

[PULL v3 09/43] target/riscv: generate virtual instruction exception

2023-01-05 Thread Alistair Francis
From: Mayuresh Chitale This patch adds a mechanism to generate a virtual instruction instruction exception instead of an illegal instruction exception during instruction decode when virt is enabled. Signed-off-by: Mayuresh Chitale Reviewed-by: Weiwei Li Reviewed-by: Alistair Francis

[PULL v3 16/43] hw/riscv: virt: Remove the redundant ipi-id property

2023-01-05 Thread Alistair Francis
From: Atish Patra The imsic DT binding[1] has changed and no longer require an ipi-id. The latest IMSIC driver dynamically allocates ipi id if slow-ipi is not defined. Get rid of the unused dt property which may lead to confusion. [1]

[PULL v3 42/43] hw/riscv: opentitan: Drop "hartid-base" and "priority-base" initialization

2023-01-05 Thread Alistair Francis
From: Bin Meng "hartid-base" and "priority-base" are zero by default. There is no need to initialize them to zero again. Signed-off-by: Bin Meng Reviewed-by: Wilfred Mallawa Reviewed-by: Alistair Francis Message-Id: <20221211030829.802437-15-bm...@tinylab.org> Signed-off-by: Alistair Francis

[PULL v3 30/43] hw/riscv: Fix opentitan dependency to SIFIVE_PLIC

2023-01-05 Thread Alistair Francis
From: Bin Meng Since commit ef6310064820 ("hw/riscv: opentitan: Update to the latest build") the IBEX PLIC model was replaced with the SiFive PLIC model in the 'opentitan' machine but we forgot the add the dependency there. Signed-off-by: Bin Meng Reviewed-by: Wilfred Mallawa Reviewed-by:

[PULL v3 23/43] target/riscv: Fix mret exception cause when no pmp rule is configured

2023-01-05 Thread Alistair Francis
From: Bin Meng The priv spec v1.12 says: If no PMP entry matches an M-mode access, the access succeeds. If no PMP entry matches an S-mode or U-mode access, but at least one PMP entry is implemented, the access fails. Failed accesses generate an instruction, load, or store access-fault

[PULL v3 26/43] target/riscv: Clear mstatus.MPRV when leaving M-mode for priv spec 1.12+

2023-01-05 Thread Alistair Francis
From: Bin Meng Since priv spec v1.12, MRET and SRET now clear mstatus.MPRV when leaving M-mode. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Message-Id: <20221207090037.281452-2-bm...@tinylab.org> Signed-off-by: Alistair Francis --- target/riscv/op_helper.c | 6 ++ 1 file

[PULL v3 31/43] hw/riscv: Sort machines Kconfig options in alphabetical order

2023-01-05 Thread Alistair Francis
From: Bin Meng SHAKTI_C machine Kconfig option was inserted in disorder. Fix it. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Wilfred Mallawa Message-Id: <20221211030829.802437-4-bm...@tinylab.org> Signed-off-by: Alistair Francis

[PULL v3 10/43] target/riscv: Add itrigger support when icount is not enabled

2023-01-05 Thread Alistair Francis
From: LIU Zhiwei When icount is not enabled, there is no API in QEMU that can get the guest instruction number. Translate the guest code in a way that each TB only has one instruction. After executing the instruction, decrease the count by 1 until it reaches 0 where the itrigger fires. Note

[PULL v3 13/43] target/riscv: Add itrigger_enabled field to CPURISCVState

2023-01-05 Thread Alistair Francis
From: LIU Zhiwei Avoid calling riscv_itrigger_enabled() when calculate the tbflags. As the itrigger enable status can only be changed when write tdata1, migration load or itrigger fire, update env->itrigger_enabled at these places. Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis

[PULL v3 05/43] hw/riscv/opentitan: bump opentitan

2023-01-05 Thread Alistair Francis
From: Wilfred Mallawa This patch updates the OpenTitan model to match the specified register layout as per [1]. Which is also the latest commit of OpenTitan supported by TockOS. Note: Pinmux and Padctrl has been merged into Pinmux [2][3], this patch removes any references to Padctrl. Note:

[PULL v3 08/43] target/riscv: smstateen check for h/s/envcfg

2023-01-05 Thread Alistair Francis
From: Mayuresh Chitale Accesses to henvcfg, henvcfgh and senvcfg are allowed only if the corresponding bit in mstateen0/hstateen0 is enabled. Otherwise an illegal instruction trap is generated. Signed-off-by: Mayuresh Chitale Reviewed-by: Weiwei Li Reviewed-by: Alistair Francis Message-Id:

[PULL v3 11/43] target/riscv: Add itrigger support when icount is enabled

2023-01-05 Thread Alistair Francis
From: LIU Zhiwei The max count in itrigger can be 0x3FFF, which will cause a no trivial translation and execution overload. When icount is enabled, QEMU provides API that can fetch guest instruction number. Thus, we can set an timer for itrigger with the count as deadline. Only when timer

[PULL v3 02/43] tcg/riscv: Fix range matched by TCG_CT_CONST_M12

2023-01-05 Thread Alistair Francis
From: Richard Henderson We were matching a signed 13-bit range, not a 12-bit range. Expand the commentary within the function and be explicit about all of the ranges. Reported-by: LIU Zhiwei Signed-off-by: Richard Henderson Reviewed-by: LIU Zhiwei Reviewed-by: Alistair Francis Message-Id:

[PULL v3 33/43] hw/intc: sifive_plic: Drop PLICMode_H

2023-01-05 Thread Alistair Francis
From: Bin Meng H-mode has been removed since priv spec 1.10. Drop it. Signed-off-by: Bin Meng Reviewed-by: Wilfred Mallawa Reviewed-by: Alistair Francis Message-Id: <20221211030829.802437-6-bm...@tinylab.org> Signed-off-by: Alistair Francis --- include/hw/intc/sifive_plic.h | 1 -

[PULL v3 14/43] hw/intc: sifive_plic: Renumber the S irqs for numa support

2023-01-05 Thread Alistair Francis
From: Frédéric Pétrot Commit 40244040a7a changed the way the S irqs are numbered. This breaks when using numa configuration, e.g.: ./qemu-system-riscv64 -nographic -machine virt,dumpdtb=numa-tree.dtb \ -m 2G -smp cpus=16 \ -object

[PULL v3 03/43] tcg/riscv: Fix reg overlap case in tcg_out_addsub2

2023-01-05 Thread Alistair Francis
From: Richard Henderson There was a typo using opc_addi instead of opc_add with the two registers. While we're at it, simplify the gating test to al == bl to improve dynamic scheduling even when the output register does not overlap the inputs. Reported-by: LIU Zhiwei Signed-off-by: Richard

[PULL v3 07/43] target/riscv: Add smstateen support

2023-01-05 Thread Alistair Francis
From: Mayuresh Chitale Smstateen extension specifies a mechanism to close the potential covert channels that could cause security issues. This patch adds the CSRs defined in the specification and the corresponding predicates and read/write functions. Signed-off-by: Mayuresh Chitale

[PULL v3 06/43] hw/riscv/opentitan: add aon_timer base unimpl

2023-01-05 Thread Alistair Francis
From: Wilfred Mallawa Adds the updated `aon_timer` base as an unimplemented device. This is used by TockOS, patch ensures the guest doesn't hit load faults. Signed-off-by: Wilfred Mallawa Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Message-Id:

[PULL v3 00/43] riscv-to-apply queue

2023-01-05 Thread Alistair Francis
From: Alistair Francis The following changes since commit d1852caab131ea898134fdcea8c14bc2ee75fbe9: Merge tag 'python-pull-request' of https://gitlab.com/jsnow/qemu into staging (2023-01-05 16:59:22 +) are available in the Git repository at: https://github.com/alistair23/qemu.git

Re: [RFC PATCH 21/40] target/arm: Remove aarch64 check from aarch64_host_object_init

2023-01-05 Thread Richard Henderson
On 1/5/23 14:08, Philippe Mathieu-Daudé wrote: On 3/1/23 19:16, Richard Henderson wrote: Since kvm32 was removed Maybe add here:   (see commit 82bf7ae84c: "target/arm: Remove KVM support for 32-bit   Arm hosts") , all kvm hosts support aarch64. Signed-off-by: Richard Henderson ---  

Re: [RFC PATCH 11/40] target/arm: Copy features from ARMCPUClass

2023-01-05 Thread Richard Henderson
On 1/5/23 14:04, Philippe Mathieu-Daudé wrote: On 3/1/23 19:16, Richard Henderson wrote: Create a features member in ARMCPUClass and copy to the instance in arm_cpu_init.  Settings of this value will come in a future patch. Signed-off-by: Richard Henderson ---   target/arm/cpu-qom.h | 18

Re: Re: [PING PATCH 0/1] Fix some typos

2023-01-05 Thread Dongdong Zhang
Hi John, Could you help me relay these fixes? If I submit a pull request, I will go through company's internal review process again. Thanks a lot! Dongdong > -原始邮件-发件人:"John Snow" 发送时间:2023-01-06 07:25:43 > (星期五)收件人:"Dongdong Zhang" > 抄送:qemu-devel@nongnu.org, cr...@redhat.com,

Re: [PATCH v5 2/3] hw/intc/loongarch_pch_pic: add irq number property

2023-01-05 Thread gaosong
在 2023/1/4 上午10:05, Tianrui Zhao 写道: With loongarch 7A1000 manual, irq number supported can be set in PCH_PIC_INT_ID_HI register. This patch adds irq number property for loongarch_pch_pic, so that virt machine can set different irq number when pch_pic intc is added. Signed-off-by: Tianrui

RE: ARM: ptw.c:S1_ptw_translate

2023-01-05 Thread Sid Manning
> -Original Message- > From: Richard Henderson > Sent: Wednesday, January 4, 2023 11:42 PM > To: Sid Manning ; qemu-devel@nongnu.org > Cc: phi...@linaro.org; Mark Burton > Subject: Re: ARM: ptw.c:S1_ptw_translate > > WARNING: This email originated from outside of Qualcomm. Please be

Re: [PATCH v2 2/2] hw/arm: Add Olimex H405

2023-01-05 Thread Alistair Francis
On Sat, Dec 31, 2022 at 1:01 AM Felipe Balbi wrote: > > Olimex makes a series of low-cost STM32 boards. This commit introduces > the minimum setup to support SMT32-H405. See [1] for details > > [1] https://www.olimex.com/Products/ARM/ST/STM32-H405/ > > Signed-off-by: Felipe Balbi Reviewed-by:

Re: [PATCH 1/1] Fix some typos

2023-01-05 Thread Max Filippov
On Tue, Nov 29, 2022 at 6:08 PM Dongdong Zhang wrote: > diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py > index 1a1fc6c9b0..906bd13298 100644 > --- a/python/qemu/machine/qtest.py > +++ b/python/qemu/machine/qtest.py > @@ -42,7 +42,7 @@ class QEMUQtestProtocol: >

Re: [PING PATCH 0/1] Fix some typos

2023-01-05 Thread John Snow
On Thu, Dec 15, 2022 at 10:22 PM Dongdong Zhang wrote: > > Hi all, > > I would like to ping a patch > > https://lists.nongnu.org/archive/html/qemu-devel/2022-11/msg04568.html > https://lists.nongnu.org/archive/html/qemu-devel/2022-11/msg04570.html > > > > -Original Messages-From:"Dongdong

[PATCH] semihosting: add O_BINARY flag in host_open for NT compatibility

2023-01-05 Thread Evgeny Iakovlev
Windows open(2) implementations opens files in text mode by default and needs a Windows-only O_BINARY flag to open files as binary. Qemu already knows about that flag in osdep.h, so we can just add it to the host_flags for better compatibility when running qemu on Windows. Signed-off-by: Evgeny

[PATCH 1/3] target/arm: implement DBGCLAIM registers

2023-01-05 Thread Evgeny Iakovlev
The architecture does not define any functionality for the CLAIM tag bits. So we will just keep the raw bits, as per spec. Helps Hyper-V boot on aarch64-tcg because it context-switches DBGCLAIM on EL2 entry/exit. Signed-off-by: Evgeny Iakovlev --- target/arm/cpu.h | 1 +

[PATCH 3/3] target/arm: allow writes to SCR_EL3.HXEn bit when FEAT_HCX is enabled

2023-01-05 Thread Evgeny Iakovlev
ARM trusted firmware, when built with FEAT_HCX support, sets SCR_EL3.HXEn bit to allow EL2 to modify HCRX_EL2 register without trapping it in EL3. Qemu uses a valid mask to clear unsupported SCR_EL3 bits when emulating SCR_EL3 write, and that mask doesn't include SCR_EL3.HXEn bit even if FEAT_HCX

[PATCH 2/3] target/arm: provide RAZ/WI stubs for more DCC registers

2023-01-05 Thread Evgeny Iakovlev
Qemu doesn't implement Debug Communication Channel, however when running Microsoft Hyper-V in software-emulated ARM64 as a guest, it tries to access some of the DCM registers during an EL2 context switch. Provide RAZ/WI stubs for OSDTRRX_EL1, OSDTRTX_EL1 and OSECCR_EL1 registers in the same way

[PATCH 0/3] various aarch64 fixes for running Hyper-V on TCG

2023-01-05 Thread Evgeny Iakovlev
Small series of changes to aarch64 emulation to better support running Hyper-V as a TCG guest wtih EL3 firmware. Evgeny Iakovlev (3): target/arm: implement DBGCLAIM registers target/arm: provide RAZ/WI stubs for more DCC registers target/arm: allow writes to SCR_EL3.HXEn bit when FEAT_HCX

[PATCH v3 7/9] Hexagon (tests/tcg/hexagon) Update preg_alias.c

2023-01-05 Thread Taylor Simpson
Add control registers (c4, c5) to clobbers list Made possible by new toolchain container Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/preg_alias.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/tcg/hexagon/preg_alias.c

[PATCH v3 9/9] Hexagon (tests/tcg/hexagon) Enable HVX tests

2023-01-05 Thread Taylor Simpson
Made possible by new toolchain container Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/Makefile.target | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/tcg/hexagon/Makefile.target b/tests/tcg/hexagon/Makefile.target index 9ee1faa1e1..adca8326bf

[PATCH v3 5/9] Hexagon (target/hexagon) Analyze packet before generating TCG

2023-01-05 Thread Taylor Simpson
We create a new generator that creates an analyze_ function for each instruction. Currently, these functions record the writes to R, P, and C registers by calling ctx_log_reg_write[_pair] or ctx_log_pred_write. During gen_start_packet, we invoke the analyze_ function for each instruction in the

[PATCH v3 6/9] Hexagon (target/hexagon) Analyze packet for HVX

2023-01-05 Thread Taylor Simpson
Signed-off-by: Taylor Simpson --- target/hexagon/translate.h | 14 -- target/hexagon/translate.c | 30 + target/hexagon/gen_analyze_funcs.py | 17 +--- target/hexagon/gen_tcg_funcs.py | 18 - 4 files

[PATCH v3 8/9] Hexagon (tests/tcg/hexagon) Remove __builtin from scatter_gather

2023-01-05 Thread Taylor Simpson
Replace __builtin_* with inline assembly The __builtin's are subject to change with different compiler releases, so might break Mark arrays as aligned when accessed as HVX vectors Clean up comments Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/scatter_gather.c | 513

Re: [PATCH] hw/dma/rc4030: Move RC4030 declarations to its own 'rc4030.h' header

2023-01-05 Thread Bernhard Beschow
Am 5. Januar 2023 13:10:38 UTC schrieb "Philippe Mathieu-Daudé" : >RC4030 declarations are not MIPS specific, no need to >have them in all MIPS boards. > >Signed-off-by: Philippe Mathieu-Daudé >--- >Based-on: <20230105130710.49264-1-phi...@linaro.org> > "hw/pci-host/bonito:

Re: [RFC PATCH 37/40] target/arm: Move "cfgend" to class property

2023-01-05 Thread Philippe Mathieu-Daudé
On 3/1/23 19:16, Richard Henderson wrote: Remove the cfgend variable entirely and reuse the property accessor functions created for reset-hivecs. This removes the last setting of cpu->reset_sctlr, to we can remove that s/to/so/? as well, using only the class value. Signed-off-by: Richard

[PATCH v3 1/9] Hexagon (target/hexagon) Add overrides for jumpr31 instructions

2023-01-05 Thread Taylor Simpson
Add overrides for SL2_jumpr31Unconditional SL2_jumpr31_t Predicated true (old value) SL2_jumpr31_f Predicated false (old value) SL2_jumpr31_tnew Predicated true (new value) SL2_jumpr31_fnew Predicated false (new value) Signed-off-by:

Re: [RFC PATCH 32/40] target/arm: Move "midr" to class property

2023-01-05 Thread Philippe Mathieu-Daudé
On 3/1/23 19:16, Richard Henderson wrote: With the movement of the property, we can remove the field from the cpu entirely, using only the class. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 1 - hw/arm/xilinx_zynq.c | 9 ++--- hw/intc/armv7m_nvic.c | 2 +-

[PATCH v3 4/9] Hexagon (target/hexagon) Add overrides for dealloc-return instructions

2023-01-05 Thread Taylor Simpson
These instructions perform a deallocframe+return (jumpr r31) Add overrides for L4_return SL2_return L4_return_t L4_return_f L4_return_tnew_pt L4_return_fnew_pt L4_return_tnew_pnt L4_return_fnew_pnt SL2_return_t SL2_return_f SL2_return_tnew

Re: [PATCH v5 2/2] tpm: add backend for mssim

2023-01-05 Thread Stefan Berger
On 1/5/23 17:02, James Bottomley wrote: On Thu, 2023-01-05 at 11:20 -0500, Stefan Berger wrote: On 1/5/23 08:00, James Bottomley wrote: [...] +The mssim backend supports snapshotting and migration, but the state +of the Microsoft Simulator server must be preserved (or the server +kept

Re: [RFC PATCH 33/40] target/arm: Move "cntfrq" to class property

2023-01-05 Thread Philippe Mathieu-Daudé
On 3/1/23 19:16, Richard Henderson wrote: With the movement of the property, we can remove the field from the cpu entirely, using only the class. Signed-off-by: Richard Henderson --- target/arm/cpu-qom.h| 3 +++ target/arm/cpu.h| 3 --- hw/arm/aspeed_ast2600.c | 6 +++--

[PATCH v3 2/9] Hexagon (target/hexagon) Add overrides for callr

2023-01-05 Thread Taylor Simpson
Add overrides for J2_callr J2_callrt J2_callrf Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg.h | 6 ++ target/hexagon/macros.h | 12 +--- target/hexagon/genptr.c | 20 3 files changed, 27 insertions(+), 11 deletions(-) diff --git

[PATCH v3 0/9] Hexagon: COF overrides, new generator, test update

2023-01-05 Thread Taylor Simpson
The idef-parser skips the change-of-flow (COF) instructions, so add overrides Changes in v2 Add a new generator for analyze_ instructions. Pouplate the DisasContext ahead of generating code. Changes in v3 Cleanup of analysis code Added test updates enabled by new toolchain

[PATCH v3 3/9] Hexagon (target/hexagon) Add overrides for endloop1/endloop01

2023-01-05 Thread Taylor Simpson
Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg.h | 4 ++ target/hexagon/genptr.c | 79 2 files changed, 83 insertions(+) diff --git a/target/hexagon/gen_tcg.h b/target/hexagon/gen_tcg.h index 9e8f3373ad..6267f51ccc 100644 ---

Re: [PATCH v2] hw/pci-host: Use register definitions from PCI standard

2023-01-05 Thread Bernhard Beschow
Am 5. Januar 2023 17:37:02 UTC schrieb "Philippe Mathieu-Daudé" : >No need to document magic values when the definition names >from "standard-headers/linux/pci_regs.h" are self-explicit. > >Signed-off-by: Philippe Mathieu-Daudé >--- > hw/pci-host/grackle.c | 2 +- > hw/pci-host/raven.c|

Re: [RFC PATCH 28/40] target/arm: Split out xscale*_class_init

2023-01-05 Thread Philippe Mathieu-Daudé
On 3/1/23 19:16, Richard Henderson wrote: Use two intermediate functions to share code between the 13 variants of pxa*_class_init. Signed-off-by: Richard Henderson --- target/arm/cpu_tcg.c | 81 +--- 1 file changed, 23 insertions(+), 58 deletions(-)

Re: [RFC PATCH 27/40] target/arm: Split out strongarm_class_init

2023-01-05 Thread Philippe Mathieu-Daudé
On 3/1/23 19:16, Richard Henderson wrote: Use an intermediate function to share code between sa1100_class_init and sa1110_class_init. Signed-off-by: Richard Henderson --- target/arm/cpu_tcg.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) Reviewed-by: Philippe

Re: [PATCH] hw/dma/rc4030: Move RC4030 declarations to its own 'rc4030.h' header

2023-01-05 Thread Hervé Poussineau
Le 05/01/2023 à 14:10, Philippe Mathieu-Daudé a écrit : RC4030 declarations are not MIPS specific, no need to have them in all MIPS boards. Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20230105130710.49264-1-phi...@linaro.org> "hw/pci-host/bonito: Housekeeping" ---

Re: [RFC PATCH 24/40] target/arm/hvf: Probe host into ARMCPUClass

2023-01-05 Thread Philippe Mathieu-Daudé
On 3/1/23 19:16, Richard Henderson wrote: We can now store these values into ARMCPUClass instead of into a temporary ARMHostCPUFeatures structure. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 5 target/arm/hvf_arm.h | 2 +- target/arm/cpu.c | 13 --

Re: [RFC PATCH 21/40] target/arm: Remove aarch64 check from aarch64_host_object_init

2023-01-05 Thread Philippe Mathieu-Daudé
On 3/1/23 19:16, Richard Henderson wrote: Since kvm32 was removed Maybe add here: (see commit 82bf7ae84c: "target/arm: Remove KVM support for 32-bit Arm hosts") , all kvm hosts support aarch64. Signed-off-by: Richard Henderson --- target/arm/cpu64.c | 6 ++ 1 file changed, 2

Re: [PATCH v2] hw/i386/pc: Remove unused 'owner' argument from pc_pci_as_mapping_init

2023-01-05 Thread Bernhard Beschow
Am 5. Januar 2023 17:38:26 UTC schrieb "Philippe Mathieu-Daudé" : >This argument was added 9 years ago in commit 83d08f2673 >("pc: map PCI address space as catchall region for not mapped >addresses") and has never been used since, so remove it. > >Signed-off-by: Philippe Mathieu-Daudé

Re: [RFC PATCH 11/40] target/arm: Copy features from ARMCPUClass

2023-01-05 Thread Philippe Mathieu-Daudé
On 3/1/23 19:16, Richard Henderson wrote: Create a features member in ARMCPUClass and copy to the instance in arm_cpu_init. Settings of this value will come in a future patch. Signed-off-by: Richard Henderson --- target/arm/cpu-qom.h | 18 ++ target/arm/cpu.c | 1 + 2

Re: [PATCH v5 2/2] tpm: add backend for mssim

2023-01-05 Thread James Bottomley
On Thu, 2023-01-05 at 11:20 -0500, Stefan Berger wrote: > > > On 1/5/23 08:00, James Bottomley wrote: [...] > > +The mssim backend supports snapshotting and migration, but the > > state > > +of the Microsoft Simulator server must be preserved (or the server > > +kept running) outside of QEMU for

Re: [RFC PATCH 08/40] target/arm: Pass ARMCPUClass to ARMCPUInfo.class_init

2023-01-05 Thread Philippe Mathieu-Daudé
On 3/1/23 19:16, Richard Henderson wrote: Streamline new instances of this hook, so that we always go through arm_cpu_leaf_class_init first, performing common tasks, and have resolved the ARMCPUClass. Signed-off-by: Richard Henderson --- target/arm/cpu-qom.h | 2 +- target/arm/cpu.c |

  1   2   3   4   5   >