Re: [PATCH 00/24] Support VIRTIO_F_RING_RESET for virtio-net, vhost-user, vhost-kernel in virtio pci-modern

2022-08-16 Thread Kangjie Xu
在 2022/8/16 14:22, Michael S. Tsirkin 写道: On Tue, Aug 16, 2022 at 02:15:57PM +0800, Xuan Zhuo wrote: On Tue, 16 Aug 2022 02:14:10 -0400, "Michael S. Tsirkin" wrote: On Tue, Aug 16, 2022 at 09:06:12AM +0800, Kangjie Xu wrote: The virtio queue reset function has already been defined in the v

[PATCH] esp: Handle CMD_BUSRESET by resetting the SCSI bus

2022-08-16 Thread John Millikin
Per investigation on the linked ticket, SunOS issues a SCSI bus reset to the ESP as part of its boot sequence. If this ESP command doesn't cause devices to assert sense flag UNIT ATTENTION, SunOS will consider the CD-ROM device to be non-compliant with Common Command Set (CCS). In this condition, t

Re: [PATCH 1/4] hw/nvme: avoid unnecessary call to irq (de)assertion functions

2022-08-16 Thread Jinhao Fan
at 11:24 PM, Stefan Hajnoczi wrote: > Can the logic be moved into assert()/deassert() so callers don't need > to duplicate the checks? > > (I assume the optimization is that eventfd syscalls are avoided, not > that the function call is avoided.) I guess I can move the eventfd syscall into asser

Re: [PATCH 2/4] hw/nvme: add option to (de)assert irq with eventfd

2022-08-16 Thread Jinhao Fan
at 7:20 PM, Klaus Jensen wrote: > This option does not seem to change anything - the value is never used > ;) What a stupid mistake. I’ll fix this in the next version.

[PATCH 2/2] scsi: Reject commands if the CDB length exceeds buf_len

2022-08-16 Thread John Millikin
In scsi_req_parse_cdb(), if the CDB length implied by the command type exceeds the initialized portion of the command buffer, reject the request. Rejected requests are recorded by the `scsi_req_parse_bad` trace event. On example of a bug detected by this check is SunOS's use of interleaved DMA an

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

2022-08-16 Thread John Millikin
When a SCSI command is received from the guest, the CDB length implied by the first byte might exceed the number of bytes the guest sent. In this case scsi_req_new() will read uninitialized data, causing unpredictable behavior. Adds the buf_len parameter to scsi_req_new() and plumbs it through the

Re: [PATCH 4/4] hw/nvme: add MSI-x mask handlers for irqfd

2022-08-16 Thread Jinhao Fan
at 6:46 PM, Klaus Jensen wrote: > > Did qtest work out for you for testing? If so, it would be nice to add a > simple test case as well. I found MSI-x masking harder to test than we imagined. My plan is to only emulate IO queues in the IOthread and leave admin queue emulation in the main loop s

Re: Bluetooth support in QEMU

2022-08-16 Thread vaishu venkat
Hi Team, Could you have any thoughts or solutions for accessing the wireless adapter interface inside the QEMU. Thanks and regards, Vaishnavi On Tue, Aug 16, 2022 at 11:33 AM vaishu venkat wrote: > Thomas, > > Sure will try with the USB Passthrough. Do you have any thoughts on > accessing the

Re: [PATCH v13 0/6] Improve PMU support

2022-08-16 Thread Alistair Francis
On Wed, Aug 17, 2022 at 9:23 AM Atish Patra wrote: > > The latest version of the SBI specification includes a Performance Monitoring > Unit(PMU) extension[1] which allows the supervisor to start/stop/configure > various PMU events. The Sscofpmf ('Ss' for Privileged arch and > Supervisor-level > e

Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00"

2022-08-16 Thread maobibo
QEMU64 cpu model can be added, however la464 cpu model should be kept here still. Actually there is no formal micro-achitecture name for loongarch, I prefer to la464 still :) Also host cpu model can be added later, which has the same features with host processor. What is meaning for QEMU64/KVM64 c

[PATCH] .gitlab-ci.d/buildtest.yml: Increase the check-gprof-gcov job timeout

2022-08-16 Thread Bin Meng
Current project timeout is 1 hour, but the check-gprof-gcov job never completes within 1 hour. Increase the job timeout to 90 minutes. Signed-off-by: Bin Meng --- .gitlab-ci.d/buildtest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.y

Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00"

2022-08-16 Thread chen huacai
Hi, Richard and Xuerui, On Mon, Aug 15, 2022 at 4:54 AM Richard Henderson wrote: > > On 8/14/22 09:55, WANG Xuerui wrote: > > From: WANG Xuerui > > > > The only LoongArch CPU implemented is modeled after the Loongson 3A5000, > > but it is not the real thing, ... > > The 3A5000 is the SoC, as far

[PATCH v5 1/3] Update linux headers to 6.0-rc1

2022-08-16 Thread Chenyi Qiang
commit 568035b01cfb107af8d2e4bd2fb9aea22cf5b868 Signed-off-by: Chenyi Qiang --- include/standard-headers/asm-x86/bootparam.h | 7 +- include/standard-headers/drm/drm_fourcc.h | 73 +++- include/standard-headers/linux/ethtool.h | 29 +-- include/standard-headers/linux/input.h

[PATCH v5 0/3] Enable notify VM exit

2022-08-16 Thread Chenyi Qiang
Notify VM exit is introduced to mitigate the potential DOS attach from malicious VM. This series is the userspace part to enable this feature through a new KVM capability KVM_CAP_X86_NOTIFY_VMEXIT. The detailed info can be seen in Patch 3. The corresponding KVM support can be found in linux 6.0-rc

[PATCH v5 2/3] i386: kvm: extend kvm_{get, put}_vcpu_events to support pending triple fault

2022-08-16 Thread Chenyi Qiang
For the direct triple faults, i.e. hardware detected and KVM morphed to VM-Exit, KVM will never lose them. But for triple faults sythesized by KVM, e.g. the RSM path, if KVM exits to userspace before the request is serviced, userspace could migrate the VM and lose the triple fault. A new flag KVM_

[PATCH v5 3/3] i386: Add notify VM exit support

2022-08-16 Thread Chenyi Qiang
There are cases that malicious virtual machine can cause CPU stuck (due to event windows don't open up), e.g., infinite loop in microcode when nested #AC (CVE-2015-5307). No event window means no event (NMI, SMI and IRQ) can be delivered. It leads the CPU to be unavailable to host or other VMs. Not

Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup

2022-08-16 Thread Richard Henderson
On 8/16/22 18:43, Ilya Leoshkevich wrote: On Fri, 2022-08-12 at 11:07 -0700, Richard Henderson wrote: We will want to re-use the result of get_page_addr_code beyond the scope of tb_lookup. Signed-off-by: Richard Henderson ---  accel/tcg/cpu-exec.c | 34 --  1 f

[PATCH] esp: Handle CMD_BUSRESET by resetting the SCSI bus

2022-08-16 Thread John Millikin
Per investigation on the linked ticket, SunOS issues a SCSI bus reset to the ESP as part of its boot sequence. If this ESP command doesn't cause devices to assert sense flag UNIT ATTENTION, SunOS will consider the CD-ROM device to be non-compliant with Common Command Set (CCS). In this condition, t

Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup

2022-08-16 Thread Ilya Leoshkevich
On Fri, 2022-08-12 at 11:07 -0700, Richard Henderson wrote: > We will want to re-use the result of get_page_addr_code > beyond the scope of tb_lookup. > > Signed-off-by: Richard Henderson > --- >  accel/tcg/cpu-exec.c | 34 -- >  1 file changed, 24 insertions(+), 10

[PATCH v13 6/6] target/riscv: Remove additional priv version check for mcountinhibit

2022-08-16 Thread Atish Patra
With .min_priv_version, additiona priv version check is uncessary for mcountinhibit read/write functions. Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Reviewed-by: Alistair Francis Signed-off-by: Atish Patra --- target/riscv/csr.c | 8 1 file changed, 8 deletions(-) diff --

Re: [PATCH v12 0/6] Improve PMU support

2022-08-16 Thread Atish Kumar Patra
On Sun, Aug 14, 2022 at 5:02 PM Alistair Francis wrote: > On Fri, Aug 12, 2022 at 12:05 PM Atish Patra > wrote: > > > > On Tue, Aug 2, 2022 at 4:33 PM Atish Patra wrote: > > > > > > The latest version of the SBI specification includes a Performance > Monitoring > > > Unit(PMU) extension[1] whic

[PATCH v13 4/6] hw/riscv: virt: Add PMU DT node to the device tree

2022-08-16 Thread Atish Patra
Qemu virt machine can support few cache events and cycle/instret counters. It also supports counter overflow for these events. Add a DT node so that OpenSBI/Linux kernel is aware of the virt machine capabilities. There are some dummy nodes added for testing as well. Acked-by: Alistair Francis Si

[PATCH v13 1/6] target/riscv: Add sscofpmf extension support

2022-08-16 Thread Atish Patra
The Sscofpmf ('Ss' for Privileged arch and Supervisor-level extensions, and 'cofpmf' for Count OverFlow and Privilege Mode Filtering) extension allows the perf to handle overflow interrupts and filtering support. This patch provides a framework for programmable counters to leverage the extension. A

[PATCH v13 3/6] target/riscv: Add few cache related PMU events

2022-08-16 Thread Atish Patra
From: Atish Patra Qemu can monitor the following cache related PMU events through tlb_fill functions. 1. DTLB load/store miss 3. ITLB prefetch miss Increment the PMU counter in tlb_fill function. Reviewed-by: Alistair Francis Tested-by: Heiko Stuebner Signed-off-by: Atish Patra Signed-off-b

[PATCH v13 0/6] Improve PMU support

2022-08-16 Thread Atish Patra
The latest version of the SBI specification includes a Performance Monitoring Unit(PMU) extension[1] which allows the supervisor to start/stop/configure various PMU events. The Sscofpmf ('Ss' for Privileged arch and Supervisor-level extensions, and 'cofpmf' for Count OverFlow and Privilege Mode Fil

[PATCH v13 5/6] target/riscv: Update the privilege field for sscofpmf CSRs

2022-08-16 Thread Atish Patra
The sscofpmf extension was ratified as a part of priv spec v1.12. Mark the csr_ops accordingly. Reviewed-by: Weiwei Li Reviewed-by: Alistair Francis Signed-off-by: Atish Patra --- target/riscv/csr.c | 90 ++ 1 file changed, 60 insertions(+), 30 delet

[PATCH v13 2/6] target/riscv: Simplify counter predicate function

2022-08-16 Thread Atish Patra
All the hpmcounters and the fixed counters (CY, IR, TM) can be represented as a unified counter. Thus, the predicate function doesn't need handle each case separately. Simplify the predicate function so that we just handle things differently between RV32/RV64 and S/HS mode. Reviewed-by: Bin Meng

Re: [PATCH for-7.2 00/21] accel/tcg: minimize tlb lookups during translate + user-only PROT_EXEC fixes

2022-08-16 Thread Ilya Leoshkevich
On Fri, 2022-08-12 at 11:07 -0700, Richard Henderson wrote: > This is part of a larger body of work, but in the process of > reorganizing I was reminded that PROT_EXEC wasn't being enforced > properly for user-only.  As this has come up in the context of > some of Ilya's patches, I thought I'd go a

[PATCH v2 27/33] target/arm: Change gen_*set_pc_im to gen_*update_pc

2022-08-16 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values by passing in pc difference. Signed-off-by: Richard Henderson --- target/arm/translate-a32.h | 2 +- target/arm/translate.h | 6 ++-- target/arm/translate-a64.c | 32 +- target/arm/translate-vfp.c | 2 +

[PATCH v2 25/33] target/arm: Introduce curr_insn_len

2022-08-16 Thread Richard Henderson
A simple helper to retrieve the length of the current insn. Signed-off-by: Richard Henderson --- target/arm/translate.h | 5 + target/arm/translate-vfp.c | 2 +- target/arm/translate.c | 5 ++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/target/arm/translate.h b/

[PATCH v2 32/33] target/arm: Introduce gen_pc_plus_diff for aarch32

2022-08-16 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/arm/translate.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 4d13e365e2

[PATCH v2 22/33] accel/tcg: Introduce tb_pc and tb_pc_log

2022-08-16 Thread Richard Henderson
The availability of tb->pc will shortly be conditional. Introduce accessor functions to minimize ifdefs. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 12 ++ accel/tcg/cpu-exec.c| 20 - accel/tcg/translate-all.c

Re: [PATCH v2 33/33] target/arm: Enable TARGET_TB_PCREL

2022-08-16 Thread Richard Henderson
On 8/16/22 15:34, Richard Henderson wrote: Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 2 ++ target/arm/translate.h | 6 target/arm/cpu.c | 23 +++--- target/arm/translate-a64.c | 37 ++- target/arm/translate.c | 62

[PATCH v2 30/33] target/arm: Change gen_jmp* to work on displacements

2022-08-16 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/arm/translate.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 63a4

[PATCH v2 16/33] accel/tcg: Remove translator_ldsw

2022-08-16 Thread Richard Henderson
The only user can easily use translator_lduw and adjust the type to signed during the return. Signed-off-by: Richard Henderson --- include/exec/translator.h | 1 - target/i386/tcg/translate.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/exec/translator.h b/incl

[PATCH v2 19/33] accel/tcg: Use DisasContextBase in plugin_gen_tb_start

2022-08-16 Thread Richard Henderson
Use the pc coming from db->pc_first rather than the TB. Use the cached host_addr rather than re-computing for the first page. We still need a separate lookup for the second page because it won't be computed for DisasContextBase until the translator actually performs a read from the page. Signed-

[PATCH v2 26/33] target/arm: Change gen_goto_tb to work on displacements

2022-08-16 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 40 -- target/arm/translate.c | 10 ++ 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/target

[PATCH v2 20/33] accel/tcg: Do not align tb->page_addr[0]

2022-08-16 Thread Richard Henderson
Let tb->page_addr[0] contain the offset within the page of the start of the translation block. We need to recover this value anyway at various points, and it is easier to discard the page offset when it's not needed, which happens naturally via the existing find_page shift. Signed-off-by: Richard

[PATCH v2 28/33] target/arm: Change gen_exception_insn* to work on displacements

2022-08-16 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/arm/translate.h| 4 ++-- target/arm/translate-a64.c| 28 +++-- target/arm/translate-m-nocp.c | 6 +++--- target/arm/translate-mve.c| 2 +- ta

[PATCH v2 24/33] accel/tcg: Split log_cpu_exec into inline and slow path

2022-08-16 Thread Richard Henderson
Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index f7c82a8f2c..d758396bcd 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -283,12 +283,1

[PATCH v2 21/33] include/hw/core: Create struct CPUJumpCache

2022-08-16 Thread Richard Henderson
Wrap the bare TranslationBlock pointer into a structure. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 8 ++-- accel/tcg/cpu-exec.c | 9 ++--- accel/tcg/cputlb.c| 2 +- accel/tcg/translate-all.c | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-)

[PATCH v2 17/33] accel/tcg: Add pc and host_pc params to gen_intermediate_code

2022-08-16 Thread Richard Henderson
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 --- include/exec/exec-all.h | 1 - include/exec/translator.h | 24 accel/tcg/translate-a

[PATCH v2 29/33] target/arm: Change gen_exception_internal to work on displacements

2022-08-16 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 6 +++--- target/arm/translate.c | 10 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/

[PATCH v2 10/33] accel/tcg: Properly implement get_page_addr_code for user-only

2022-08-16 Thread Richard Henderson
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: Richard Henderson --- include/exec/exec-all.h | 85 ++-

[PATCH v2 31/33] target/arm: Introduce gen_pc_plus_diff for aarch64

2022-08-16 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 41 +++--- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a

[PATCH v2 18/33] accel/tcg: Add fast path for translator_ld*

2022-08-16 Thread Richard Henderson
Cache the translation from guest to host address, so we may use direct loads when we hit on the primary translation page. Look up the second translation page only once, during translation. This obviates another lookup of the second page within tb_gen_code after translation. Fixes a bug in that pl

[PATCH v2 33/33] target/arm: Enable TARGET_TB_PCREL

2022-08-16 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 2 ++ target/arm/translate.h | 6 target/arm/cpu.c | 23 +++--- target/arm/translate-a64.c | 37 ++- target/arm/translate.c | 62 ++ 5 files c

[PATCH v2 00/33] accel/tcg + target/arm: pc-relative translation

2022-08-16 Thread Richard Henderson
Supercedes: 20220812180806.2128593-1-richard.hender...@linaro.org ("accel/tcg: minimize tlb lookups during translate + user-only PROT_EXEC fixes") A few changes to the PROT_EXEC work that I posted last week, and then continuing to the main event. My initial goal was to reduce the overhead of TB f

[PATCH v2 15/33] accel/tcg: Introduce is_same_page()

2022-08-16 Thread Richard Henderson
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 Message-Id: <20220811095534.241224-3-...@linux.ibm.com> Reviewed-by: Richard

[PATCH v2 14/33] accel/tcg: Raise PROT_EXEC exception early

2022-08-16 Thread Richard Henderson
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 --- accel/tcg/cpu-exec.c | 2 +- accel/tcg/translate-all.c | 2 +- 2 files changed, 2 insertions(+),

[PATCH v2 11/33] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp

2022-08-16 Thread Richard Henderson
Simplify the implementation of get_page_addr_code_hostp by reusing the existing probe_access infrastructure. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 76 -- 1 file changed, 26 insertions(+), 50 deletions(-) diff --git a/accel/tcg/cput

[PATCH v2 13/33] accel/tcg: Unlock mmap_lock after longjmp

2022-08-16 Thread Richard Henderson
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. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 12 ++-- 1

[PATCH v2 23/33] accel/tcg: Introduce TARGET_TB_PCREL

2022-08-16 Thread Richard Henderson
Prepare for targets to be able to produce TBs that can run in more than one virtual context. Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h | 3 +++ include/exec/exec-all.h | 41 ++--- include/hw/core/cpu.h | 1 + accel/tcg/cpu-exec.c | 55 +++

[PATCH v2 04/33] linux-user: Honor PT_GNU_STACK

2022-08-16 Thread Richard Henderson
Map the stack executable if required by default or on demand. Signed-off-by: Richard Henderson --- include/elf.h| 1 + linux-user/qemu.h| 1 + linux-user/elfload.c | 19 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/elf.h b/include/elf.h

[PATCH v2 08/33] accel/tcg: Make tb_htable_lookup static

2022-08-16 Thread Richard Henderson
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 --- include/exec/exec-all.h | 3 - accel/tcg/cpu-exec.c| 122 2 files changed, 61 insertions(+), 64 d

[PATCH v2 12/33] accel/tcg: Add nofault parameter to get_page_addr_code_hostp

2022-08-16 Thread Richard Henderson
Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 10 +- accel/tcg/cputlb.c | 8 accel/tcg/plugin-gen.c | 4 ++-- accel/tcg/user-exec.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-a

[PATCH v2 09/33] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c

2022-08-16 Thread Richard Henderson
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 --- include/exec/cpu-common.h | 1 + accel/tcg/cputlb.c| 12 softmmu/physmem.c | 12 3 files changed, 13

[PATCH v2 02/33] linux-user/hppa: Allocate page zero as a commpage

2022-08-16 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to mark page zero executable. We had been special casing this entirely within translate. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 34 +++--- 1 file changed, 31 insertions(+), 3 d

[PATCH v2 07/33] accel/tcg: Use bool for page_find_alloc

2022-08-16 Thread Richard Henderson
Bool is more appropriate type for the alloc parameter. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 298277a590..596029b26d 100644 --- a

[PATCH v2 06/33] accel/tcg: Remove PageDesc code_bitmap

2022-08-16 Thread Richard Henderson
This bitmap is created and discarded immediately. We gain nothing by its existence. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 78 ++- 1 file changed, 4 insertions(+), 74 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/tr

[PATCH v2 05/33] tests/tcg/i386: Move smc_code2 to an executable section

2022-08-16 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to put this code into a section that is both writable and executable. Note that this test did not run on hardware beforehand either. Signed-off-by: Richard Henderson --- tests/tcg/i386/test-i386.c | 2 +- 1 file changed, 1 in

[PATCH v2 03/33] linux-user/x86_64: Allocate vsyscall page as a commpage

2022-08-16 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to the vsyscall page executable. We had been special casing this entirely within translate. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a

[PATCH v2 01/33] linux-user/arm: Mark the commpage executable

2022-08-16 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to mark the commpage executable. We had been placing the commpage outside of reserved_va, which was incorrect and lead to an abort. Signed-off-by: Richard Henderson --- linux-user/arm/target_cpu.h | 4 ++-- linux-user/elfload

Re: [PATCH for-7.2 v4 11/11] ppc/pnv: fix QOM parenting of user creatable root ports

2022-08-16 Thread Daniel Henrique Barboza
On 8/12/22 13:13, Frederic Barrat wrote: On 11/08/2022 18:39, Daniel Henrique Barboza wrote: User creatable root ports are being parented by the 'peripheral' or the 'peripheral-anon' container. This happens because this is the regular QOM schema for sysbus devices that are added via the com

Re: [PATCH v2] ci: Upgrade msys2 release to 20220603

2022-08-16 Thread Yonggang Luo
I have reason to think that's msys2-64 bit failed because out of memory I tried to show the memory size of the windows docker, it's result are 6224352KB, that's less than 6GB? https://gitlab.com/lygstate/qemu/-/jobs/2891399652 Can we increase the memory size to 16GB On Sat, Jul 30, 2022 at 3:24

Re: [PATCH v10 07/21] blockjob: introduce block_job _locked() APIs

2022-08-16 Thread Stefan Hajnoczi
On Mon, Jul 25, 2022 at 03:38:41AM -0400, Emanuele Giuseppe Esposito wrote: > Just as done with job.h, create _locked() functions in blockjob.h > > These functions will be later useful when caller has already taken > the lock. All blockjob _locked functions call job _locked functions. > > Note: a

Re: [PATCH v10 06/21] job: move and update comments from blockjob.c

2022-08-16 Thread Stefan Hajnoczi
On Mon, Jul 25, 2022 at 03:38:40AM -0400, Emanuele Giuseppe Esposito wrote: > This comment applies more on job, it was left in blockjob as in the past > the whole job logic was implemented there. > > Note: at this stage, job_{lock/unlock} and job lock guard macros > are *nop*. > > No functional c

Re: [PATCH v10 05/21] job.c: add job_lock/unlock while keeping job.h intact

2022-08-16 Thread Stefan Hajnoczi
On Mon, Jul 25, 2022 at 03:38:39AM -0400, Emanuele Giuseppe Esposito wrote: > With "intact" we mean that all job.h functions implicitly > take the lock. Therefore API callers are unmodified. > > This means that: > - many static functions that will be always called with job lock held > become _lo

Re: [PATCH v10 02/21] job.h: categorize fields in struct Job

2022-08-16 Thread Stefan Hajnoczi
On Mon, Jul 25, 2022 at 03:38:36AM -0400, Emanuele Giuseppe Esposito wrote: > Categorize the fields in struct Job to understand which ones > need to be protected by the job mutex and which don't. > > Signed-off-by: Emanuele Giuseppe Esposito > Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > i

Re: [PULL 0/2] Two small fixes for QEMU 7.1-rc3

2022-08-16 Thread Richard Henderson
On 8/16/22 04:58, Thomas Huth wrote: Hi Richard! Two minor fixes for rc3. If this is too late for rc3, please feel free to ignore, I think they are not severe enough to justify an rc4 later. The following changes since commit d102b8162a1e5fe8288d4d5c01801ce6536ac2d1: Merge tag 'pull-la-20

Re: [PATCH v7 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-16 Thread Damien Le Moal
On 2022/08/15 23:25, Sam Li wrote: > By adding zone management operations in BlockDriver, storage controller > emulation can use the new block layer APIs including Report Zone and > four zone management operations (open, close, finish, reset). > > Add zoned storage commands of the device: zone_rep

Re: [PATCH v7 3/8] file-posix: introduce get_sysfs_long_val for the long sysfs attribute

2022-08-16 Thread Sam Li
Damien Le Moal 于2022年8月17日周三 01:35写道: > > On 2022/08/15 23:25, Sam Li wrote: > > Use sysfs attribute files to get the long value of zoned device > > information. > > > > Signed-off-by: Sam Li > > Reviewed-by: Hannes Reinecke > > Reviewed-by: Stefan Hajnoczi > > --- > > block/file-posix.c | 27

[PATCH for-7.2 v3 18/20] device_node.c: enable 'info fdt' to print subnodes

2022-08-16 Thread Daniel Henrique Barboza
Printing subnodes of a given node will allow us to show a whole subtree, which the additional perk of 'info fdt /' being able to print the whole FDT. Since we're now printing more than one subnode, change 'fdt_info' to print the full path of the first node. This small tweak helps identifying which

[PATCH for-7.2 v3 20/20] hmp, device_tree.c: add 'info fdt ' support

2022-08-16 Thread Daniel Henrique Barboza
'info fdt' is only able to print full nodes so far. It would be good to be able to also print single properties, since ometimes we just want to verify a single value from the FDT. libfdt does not have support to find a property given its full path, but it does have a way to return a fdt_property g

Re: [RFC PATCH] tests/avocado: push default timeout to QemuBaseTest

2022-08-16 Thread Richard Henderson
On 8/16/22 08:38, Alex Bennée wrote: All of the QEMU tests eventually end up derrived from this class. Move the default timeout from LinuxTest to ensure we catch them all. Signed-off-by: Alex Bennée --- tests/avocado/avocado_qemu/__init__.py | 5 - 1 file changed, 4 insertions(+), 1 dele

[PATCH for-7.2 v3 17/20] device_tree.c: support remaining FDT prop types

2022-08-16 Thread Daniel Henrique Barboza
When printing a blob with 'dtc' using the '-O dts' option there are 3 distinct data types being printed: strings, arrays of uint32s and regular byte arrays. Previous patch added support to print strings. Let's add the remaining formats. We want to resemble the format that 'dtc -O dts' uses, so eve

Re: [PATCH v7 3/8] file-posix: introduce get_sysfs_long_val for the long sysfs attribute

2022-08-16 Thread Damien Le Moal
On 2022/08/15 23:25, Sam Li wrote: > Use sysfs attribute files to get the long value of zoned device > information. > > Signed-off-by: Sam Li > Reviewed-by: Hannes Reinecke > Reviewed-by: Stefan Hajnoczi > --- > block/file-posix.c | 27 +++ > 1 file changed, 27 insertio

[PATCH for-7.2 v3 12/20] hw/riscv: set machine->fdt in spike_board_init()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the spike machine. Cc: Palmer Dabbelt Cc: Alistair Francis Cc: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Daniel Henrique Barboza --- hw/riscv/spike.c | 9 + 1 file changed, 9 insertions(+) diff --git

Re: [PATCH v7 3/8] file-posix: introduce get_sysfs_long_val for the long sysfs attribute

2022-08-16 Thread Damien Le Moal
On 2022/08/16 10:53, Sam Li wrote: > Damien Le Moal 于2022年8月17日周三 01:35写道: >> >> On 2022/08/15 23:25, Sam Li wrote: >>> Use sysfs attribute files to get the long value of zoned device >>> information. >>> >>> Signed-off-by: Sam Li >>> Reviewed-by: Hannes Reinecke >>> Reviewed-by: Stefan Hajnoczi

[PATCH for-7.2 v3 13/20] hw/xtensa: set machine->fdt in xtfpga_init()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all xtensa machines that uses a FDT. Signed-off-by: Daniel Henrique Barboza --- hw/xtensa/meson.build | 2 +- hw/xtensa/xtfpga.c| 9 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/xtensa/meson

[PATCH for-7.2 v3 11/20] hw/riscv: set machine->fdt in sifive_u_machine_init()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the sifive_u machine. Cc: Alistair Francis Cc: Bin Meng Cc: Palmer Dabbelt Reviewed-by: Alistair Francis Signed-off-by: Daniel Henrique Barboza --- hw/riscv/sifive_u.c | 6 ++ 1 file changed, 6 insertions(+) diff --g

[PATCH for-7.2 v3 19/20] device_tree.c: add fdt_format_property() helper

2022-08-16 Thread Daniel Henrique Barboza
We want to be able to also print properties with 'info fdt'. Create a helper to format properties based on the already existing code from fdt_format_node(). Signed-off-by: Daniel Henrique Barboza --- softmmu/device_tree.c | 35 --- 1 file changed, 20 insertions(+

[PATCH for-7.2 v3 06/20] hw/ppc: set machine->fdt in sam460ex_load_device_tree()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the sam460ex machine. Cc: BALATON Zoltan Signed-off-by: Daniel Henrique Barboza --- hw/ppc/sam460ex.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 035

[PATCH for-7.2 v3 09/20] hw/ppc: set machine->fdt in pnv_reset()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all powernv machines. Cc: Cédric Le Goater Cc: Frederic Barrat Signed-off-by: Daniel Henrique Barboza --- hw/ppc/pnv.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c i

[PATCH for-7.2 v3 16/20] device_tree.c: support string array prop in fdt_format_node()

2022-08-16 Thread Daniel Henrique Barboza
To support printing string properties in 'info fdt' we need to determine whether a void data might contain a string array. We do that by casting the void data to a string array and: - check if the array finishes with a null character - check if there's no empty string in the middle of the array (

[PATCH for-7.2 v3 05/20] hw/ppc: set machine->fdt in bamboo_load_device_tree()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the bamboo machine. Cc: Cédric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/ppc/ppc440_bamboo.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc44

[PATCH for-7.2 v3 15/20] qmp/hmp, device_tree.c: introduce 'info fdt' command

2022-08-16 Thread Daniel Henrique Barboza
Reading the FDT requires that the user saves the fdt_blob and then use 'dtc' to read the contents. Saving the file and using 'dtc' is a strong use case when we need to compare two FDTs, but it's a lot of steps if you want to do quick check on a certain node or property. 'info fdt' retrieves FDT no

[PATCH for-7.2 v3 14/20] qmp/hmp, device_tree.c: introduce dumpdtb

2022-08-16 Thread Daniel Henrique Barboza
To save the FDT blob we have the '-machine dumpdtb=' property. With this property set, the machine saves the FDT in and exit. The created file can then be converted to plain text dts format using 'dtc'. There's nothing particularly sophisticated into saving the FDT that can't be done with the mac

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

2022-08-16 Thread Daniel Henrique Barboza
The pSeries machine never bothered with the common machine->fdt attribute. We do all the FDT related work using spapr->fdt_blob. We're going to introduce HMP commands to read and save the FDT, which will rely on setting machine->fdt properly to work across all machine archs/types. Let's set machi

[PATCH for-7.2 v3 08/20] hw/ppc: set machine->fdt in pegasos2_machine_reset()

2022-08-16 Thread Daniel Henrique Barboza
We'll introduce QMP/HMP commands that requires machine->fdt to be set properly. Cc: BALATON Zoltan Cc: qemu-...@nongnu.org Signed-off-by: Daniel Henrique Barboza --- hw/ppc/pegasos2.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index 61f42639

[PATCH for-7.2 v3 07/20] hw/ppc: set machine->fdt in xilinx_load_device_tree()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the virtex_ml507 machine. Cc: Edgar E. Iglesias Signed-off-by: Daniel Henrique Barboza --- hw/ppc/virtex_ml507.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/

[PATCH for-7.2 v3 04/20] hw/ppc: set machine->fdt in ppce500_load_device_tree()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the e500 machine. Cc: Cédric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/ppc/e500.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 32495d0123

[PATCH for-7.2 v3 02/20] hw/microblaze: set machine->fdt in microblaze_load_dtb()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all microblaze machines that uses microblaze_load_dtb(). Cc: Edgar E. Iglesias Signed-off-by: Daniel Henrique Barboza --- hw/microblaze/boot.c | 11 ++- hw/microblaze/meson.build | 2 +- 2 files changed, 11 ins

[PATCH for-7.2 v3 03/20] hw/nios2: set machine->fdt in nios2_load_dtb()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all nios2 machines that uses nios2_load_dtb(). Cc: Chris Wulff Cc: Marek Vasut Signed-off-by: Daniel Henrique Barboza --- hw/nios2/boot.c | 11 ++- hw/nios2/meson.build | 2 +- 2 files changed, 11 insertions(+

[PATCH for-7.2 v3 01/20] hw/arm: do not free machine->fdt in arm_load_dtb()

2022-08-16 Thread Daniel Henrique Barboza
At this moment, arm_load_dtb() can free machine->fdt when binfo->dtb_filename is NULL. If there's no 'dtb_filename', 'fdt' will be retrieved by binfo->get_dtb(). If get_dtb() returns machine->fdt, as is the case of machvirt_dtb() from hw/arm/virt.c, fdt now has a pointer to machine->fdt. And, in th

[PATCH for-7.2 v3 00/20] QMP/HMP: add 'dumpdtb' and 'info fdt' commands

2022-08-16 Thread Daniel Henrique Barboza
Hi, In this new version the most notable changes are: - removed fdt_pack() from machine specific code. As discussed in the previous version, the proper use of fdt_pack() would require more work/thought and, since it's not required for the work we're doing here, it was removed; - we're now handli

Re: [PATCH v7 2/8] file-posix: introduce get_sysfs_str_val for device zoned model

2022-08-16 Thread Damien Le Moal
On 2022/08/15 23:25, Sam Li wrote: > Use sysfs attribute files to get the string value of device > zoned model. Then get_sysfs_zoned_model can convert it to > BlockZoneModel type in QEMU. > > Signed-off-by: Sam Li > Reviewed-by: Hannes Reinecke > --- > block/file-posix.c | 93

Re: [PATCH v7 1/8] include: add zoned device structs

2022-08-16 Thread Damien Le Moal
On 2022/08/15 23:25, Sam Li wrote: > Signed-off-by: Sam Li > Reviewed-by: Stefan Hajnoczi Looks good. Reviewed-by: Damien Le Moal > --- > include/block/block-common.h | 43 > 1 file changed, 43 insertions(+) > > diff --git a/include/block/block-common.h

Re: [PATCH 00/24] Support VIRTIO_F_RING_RESET for virtio-net, vhost-user, vhost-kernel in virtio pci-modern

2022-08-16 Thread Xuan Zhuo
On Tue, 16 Aug 2022 02:22:16 -0400, "Michael S. Tsirkin" wrote: > On Tue, Aug 16, 2022 at 02:15:57PM +0800, Xuan Zhuo wrote: > > On Tue, 16 Aug 2022 02:14:10 -0400, "Michael S. Tsirkin" > > wrote: > > > On Tue, Aug 16, 2022 at 09:06:12AM +0800, Kangjie Xu wrote: > > > > The virtio queue reset f

Re: [PATCH 00/24] Support VIRTIO_F_RING_RESET for virtio-net, vhost-user, vhost-kernel in virtio pci-modern

2022-08-16 Thread Xuan Zhuo
On Tue, 16 Aug 2022 02:14:10 -0400, "Michael S. Tsirkin" wrote: > On Tue, Aug 16, 2022 at 09:06:12AM +0800, Kangjie Xu wrote: > > The virtio queue reset function has already been defined in the virtio spec > > 1.2. > > The relevant virtio spec information is here: > > > > https://github.com/

  1   2   >