[PATCH RFC 0/1] tcg: add perfmap and jitdump

2022-10-11 Thread Ilya Leoshkevich
Hi, This is a rework of jitdump and perfmap patches from Vanderson and Alex: - jitdump: https://wiki.qemu.org/Features/TCGCodeQuality v1: https://lists.gnu.org/archive/html/qemu-devel/2019-08/msg02676.html v2:

[PATCH 1/1] tcg: add perfmap and jitdump

2022-10-11 Thread Ilya Leoshkevich
Add ability to dump /tmp/perf-.map and jit-.dump. The first one allows the perf tool to map samples to each individual translation block. The second one adds the ability to resolve symbol names, line numbers and inspect JITed code. Example of use: perf record qemu-x86_64 -perfmap ./a.out

Re: [PATCH v2 3/8] riscv: re-randomize rng-seed on reboot

2022-10-11 Thread Alistair Francis
On Wed, Oct 12, 2022 at 6:55 AM Jason A. Donenfeld wrote: > > When the system reboots, the rng-seed that the FDT has should be > re-randomized, so that the new boot gets a new seed. Since the FDT is in > the ROM region at this point, we add a hook right after the ROM has been > added, so that we

Re: [PATCH v2 1/8] device-tree: add re-randomization helper function

2022-10-11 Thread Alistair Francis
On Wed, Oct 12, 2022 at 6:57 AM Jason A. Donenfeld wrote: > > When the system reboots, the rng-seed that the FDT has should be > re-randomized, so that the new boot gets a new seed. Several > architectures require this functionality, so export a function for > injecting a new seed into the given

Re: [PATCH 1/4] tests/acpi: virt: allow acpi MADT and FADT changes

2022-10-11 Thread Ani Sinha
On Tue, 11 Oct 2022, Miguel Luis wrote: > Step 3 from bios-tables-test.c documented procedure. > > Signed-off-by: Miguel Luis Acked-by: Ani Sinha > --- > tests/qtest/bios-tables-test-allowed-diff.h | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git

Re: [PATCH 4/4] tests/acpi: virt: update ACPI MADT and FADT binaries

2022-10-11 Thread Ani Sinha
On Tue, 11 Oct 2022, Miguel Luis wrote: > Step 6 & 7 of the bios-tables-test.c documented procedure. > > Differences between disassembled ASL files for MADT: > > @@ -11,9 +11,9 @@ > */ > > [000h 4]Signature : "APIC"[Multiple APIC > Description Table (MADT)] >

Re: [PATCH v2] vhost-vdpa: allow passing opened vhostfd to vhost-vdpa

2022-10-11 Thread Jason Wang
On Tue, Oct 11, 2022 at 1:18 AM Si-Wei Liu wrote: > > > > On 10/8/2022 10:43 PM, Jason Wang wrote: > > On Sat, Oct 8, 2022 at 5:04 PM Si-Wei Liu wrote: > > Similar to other vhost backends, vhostfd can be passed to vhost-vdpa > backend as another parameter to instantiate vhost-vdpa net client. >

Re: [PATCH] target/riscv: pmp: Fixup TLB size calculation

2022-10-11 Thread Alistair Francis
On Wed, Oct 12, 2022 at 12:50 PM LIU Zhiwei wrote: > > Reviewed-by: LIU Zhiwei Thanks! > > By the way, we missed one related patch that once had been picked to > riscv-next patch. > > The patch v3: >

Re: [PATCH] target/riscv: pmp: Fixup TLB size calculation

2022-10-11 Thread LIU Zhiwei
Reviewed-by: LIU Zhiwei By the way, we missed one related patch that once had been picked to riscv-next patch. The patch v3: https://lore.kernel.org/all/ceeb4037-6d17-0a09-f35a-eaf328033...@c-sky.com/T/#m183e4430bda408bc3a2b2751aa94eff7fc02e23c The patch v4:

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-10-11 Thread Chao Peng
On Tue, Oct 11, 2022 at 10:48:58AM +0100, Fuad Tabba wrote: > Hi, > > On Thu, Sep 15, 2022 at 3:38 PM Chao Peng wrote: > > > > If CONFIG_HAVE_KVM_PRIVATE_MEM=y, userspace can register/unregister the > > guest private memory regions through KVM_MEMORY_ENCRYPT_{UN,}REG_REGION > > ioctls. The patch

Re: [PATCH 1/4] hw/acpi/aml-build: Only generate cluster node in PPTT when specified

2022-10-11 Thread Yicong Yang via
On 2022/10/7 21:48, Michael S. Tsirkin wrote: > On Thu, Sep 22, 2022 at 09:11:40PM +0800, Yicong Yang wrote: >> From: Yicong Yang >> >> Currently we'll always generate a cluster node no matter user has >> specified '-smp clusters=X' or not. Cluster is an optional level >> and it's unncessary to

Re: [PATCH 1/4] hw/acpi/aml-build: Only generate cluster node in PPTT when specified

2022-10-11 Thread Yicong Yang via
On 2022/10/9 14:46, wangyanan (Y) wrote: > Hi Yicong, > > On 2022/9/22 21:11, Yicong Yang wrote: >> From: Yicong Yang >> >> Currently we'll always generate a cluster node no matter user has >> specified '-smp clusters=X' or not. Cluster is an optional level >> and it's unncessary to build it if

[PATCH] semihosting: Write back semihosting data before completion callback

2022-10-11 Thread Keith Packard via
'lock_user' allocates a host buffer to shadow a target buffer, 'unlock_user' copies that host buffer back to the target and frees the host memory. If the completion function uses the target buffer, it must be called after unlock_user to ensure the data are present. This caused the arm-compatible

Re: [PATCH v10 00/17] qapi: net: add unix socket type support to netdev backend

2022-10-11 Thread Jason Wang
On Wed, Oct 12, 2022 at 4:05 AM Laurent Vivier wrote: > > On 10/9/22 07:52, Jason Wang wrote: > > On Thu, Oct 6, 2022 at 7:21 PM Michael S. Tsirkin wrote: > >> > >> On Wed, Oct 05, 2022 at 06:20:34PM +0200, Laurent Vivier wrote: > >>> "-netdev socket" only supports inet sockets. > >>> > >>> It's

[PATCH] target/riscv: pmp: Fixup TLB size calculation

2022-10-11 Thread Alistair Francis
From: Alistair Francis Since commit 4047368938f6 "accel/tcg: Introduce tlb_set_page_full" we have been seeing this assert ../accel/tcg/cputlb.c:1294: tlb_set_page_with_attrs: Assertion `is_power_of_2(size)' failed. When running Tock on the OpenTitan machine. The issue is that

[PATCH v5 5/6] hw/arm/virt: Improve high memory region address assignment

2022-10-11 Thread Gavin Shan
There are three high memory regions, which are VIRT_HIGH_REDIST2, VIRT_HIGH_PCIE_ECAM and VIRT_HIGH_PCIE_MMIO. Their base addresses are floating on highest RAM address. However, they can be disabled in several cases. (1) One specific high memory region is disabled by developer by toggling

[PATCH v5 2/6] hw/arm/virt: Rename variable size to region_size in virt_set_high_memmap()

2022-10-11 Thread Gavin Shan
This renames variable 'size' to 'region_size' in virt_set_high_memmap(). Its counterpart ('region_base') will be introduced in next patch. No functional change intended. Signed-off-by: Gavin Shan Reviewed-by: Eric Auger Reviewed-by: Cornelia Huck Tested-by: Zhenyu Zhang --- hw/arm/virt.c |

[PATCH v5 4/6] hw/arm/virt: Introduce virt_get_high_memmap_enabled() helper

2022-10-11 Thread Gavin Shan
This introduces virt_get_high_memmap_enabled() helper, which returns the pointer to vms->highmem_{redists, ecam, mmio}. The pointer will be used in the subsequent patches. No functional change intended. Signed-off-by: Gavin Shan Tested-by: Zhenyu Zhang --- hw/arm/virt.c | 32

[PATCH v5 6/6] hw/arm/virt: Add 'compact-highmem' property

2022-10-11 Thread Gavin Shan
After the improvement to high memory region address assignment is applied, the memory layout can be changed, introducing possible migration breakage. For example, VIRT_HIGH_PCIE_MMIO memory region is disabled or enabled when the optimization is applied or not, with the following configuration.

[PATCH v5 3/6] hw/arm/virt: Introduce variable region_base in virt_set_high_memmap()

2022-10-11 Thread Gavin Shan
This introduces variable 'region_base' for the base address of the specific high memory region. It's the preparatory work to optimize high memory region address assignment. No functional change intended. Signed-off-by: Gavin Shan Reviewed-by: Eric Auger Reviewed-by: Cornelia Huck Tested-by:

[PATCH v5 1/6] hw/arm/virt: Introduce virt_set_high_memmap() helper

2022-10-11 Thread Gavin Shan
This introduces virt_set_high_memmap() helper. The logic of high memory region address assignment is moved to the helper. The intention is to make the subsequent optimization for high memory region address assignment easier. No functional change intended. Signed-off-by: Gavin Shan Reviewed-by:

[PATCH v5 0/6] hw/arm/virt: Improve address assignment for high memory regions

2022-10-11 Thread Gavin Shan
There are three high memory regions, which are VIRT_HIGH_REDIST2, VIRT_HIGH_PCIE_ECAM and VIRT_HIGH_PCIE_MMIO. Their base addresses are floating on highest RAM address. However, they can be disabled in several cases. (1) One specific high memory region is disabled by developer by toggling

Re: [PATCH v4 4/6] hw/arm/virt: Introduce virt_get_high_memmap_enabled() helper

2022-10-11 Thread Gavin Shan
On 10/12/22 12:45 AM, Eric Auger wrote: On 10/5/22 00:47, Gavin Shan wrote: On 10/4/22 6:41 PM, Cornelia Huck wrote: On Tue, Oct 04 2022, Gavin Shan wrote: This introduces virt_get_high_memmap_enabled() helper, which returns the pointer to vms->highmem_{redists, ecam, mmio}. The pointer

Re: [PATCH v3 0/2] Enhance maximum priority support of PLIC

2022-10-11 Thread Alistair Francis
On Mon, Oct 3, 2022 at 2:18 PM Jim Shu wrote: > > This patchset fixes hard-coded maximum priority of interrupt priority > register and also changes this register to WARL field to align the PLIC > spec. > > Changelog: > > v3: > * fix opposite of power-of-2 max priority checking expression. > >

Re: [PATCH v5 0/2] hw/ssi/ibex_spi: bug fixes

2022-10-11 Thread Alistair Francis
On Fri, Sep 30, 2022 at 1:34 PM Wilfred Mallawa wrote: > > From: Wilfred Mallawa > > The remaining patches in this series address: > - Coverity issues for `ibex_spi` > - Adds rw1c functionality > > Changes since V4: > - Fixup compiler warning for unused variable `data` in

[PATCH RFC 2/2] qemu-thread: Fail hard for suspecious mutex unlocks

2022-10-11 Thread Peter Xu
Add a field for QemuMutex to remember the locked status, then assert properly when CONFIG_DEBUG_MUTEX enabled on illegal unlocks. The pthread library is by default quite loose on this by allowing the unlock to quietly succeed. But that could cause the follow up things very unpredictable so if

[PATCH RFC 1/2] qemu-thread: Enable the new timedwait to use DEBUG_MUTEX too

2022-10-11 Thread Peter Xu
The new _timedwait() version of qemu cond/mutex doesn't trigger the DEBUG_MUTEX paths; enable it too. Cc: Yury Kotov Signed-off-by: Peter Xu --- util/qemu-thread-posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c

[PATCH RFC 0/2] qemu-thread: Strict unlock check

2022-10-11 Thread Peter Xu
NOTE: mark patchset RFC because "make check" will easily fail; but I didn't yet dig into why as I'm not familiar with the code paths that triggers, it can be bugs hidden or something I missed. So RFC to just have some thoughts. The first patch converts the new timedwait to use DEBUG_MUTEX paths

Re: [PATCH V5 0/3] hw/riscv: virt: Enable booting S-mode firmware from pflash

2022-10-11 Thread Alistair Francis
On Tue, Oct 4, 2022 at 7:25 PM Sunil V L wrote: > > This series adds the support to boot S-mode FW like EDK2 from the flash. The > S-mode firmware should be kept in pflash unit 1. > > When -kernel (and -initrd) option is also provided along with the flash, > the kernel (and initrd) will be loaded

Re: [PATCH] gitmodules: recurse by default

2022-10-11 Thread Michael S. Tsirkin
On Fri, Oct 07, 2022 at 12:09:40PM +0100, Daniel P. Berrangé wrote: > On Fri, Oct 07, 2022 at 11:45:56AM +0100, Daniel P. Berrangé wrote: > > On Fri, Oct 07, 2022 at 06:11:25AM -0400, Michael S. Tsirkin wrote: > > > On Fri, Oct 07, 2022 at 09:07:17AM +0100, Daniel P. Berrangé wrote: > > > > On

Re: [PATCH 0/5] Multi-Region and Volatile Memory support for CXL Type-3 Devices

2022-10-11 Thread Michael S. Tsirkin
On Tue, Oct 11, 2022 at 05:19:11PM -0400, Gregory Price wrote: > Summary of Changes: > 1) Correction of PCI_CLASS from STORAGE_EXPRESS to MEMORY_CXL on init > 2) Add CXL_CAPACITY_MULTIPLIER definition to replace magic numbers > 3) Refactor CDAT DSMAS Initialization for multi-region initialization

[PATCH v2 14/15] migration: Remove old preempt code around state maintainance

2022-10-11 Thread Peter Xu
With the new code to send pages in rp-return thread, there's little help to keep lots of the old code on maintaining the preempt state in migration thread, because the new way should always be faster.. Then if we'll always send pages in the rp-return thread anyway, we don't need those logic to

[PATCH v2 13/15] migration: Send requested page directly in rp-return thread

2022-10-11 Thread Peter Xu
With all the facilities ready, send the requested page directly in the rp-return thread rather than queuing it in the request queue, if and only if postcopy preempt is enabled. It can achieve so because it uses separate channel for sending urgent pages. The only shared data is bitmap and it's

Re: [PATCH V5 3/3] hw/riscv: virt: Enable booting S-mode firmware from pflash

2022-10-11 Thread Bernhard Beschow
Am 4. Oktober 2022 09:23:51 UTC schrieb Sunil V L : >To boot S-mode firmware payload like EDK2 from persistent >flash storage, qemu needs to pass the flash address as the >next_addr in fw_dynamic_info to the opensbi. > >When both -kernel and -pflash options are provided in command line, >the

[PATCH v2 10/15] migration: Add pss_init()

2022-10-11 Thread Peter Xu
Helper to init PSS structures. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/ram.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index d81dd3fdac..44967e72b2 100644 --- a/migration/ram.c +++

[PATCH v2 05/15] migration: Remove RAMState.f references in compression code

2022-10-11 Thread Peter Xu
Removing referencing to RAMState.f in compress_page_with_multi_thread() and flush_compressed_data(). Compression code by default isn't compatible with having >1 channels (or it won't currently know which channel to flush the compressed data), so to make it simple we always flush on the default

[PATCH v2 08/15] migration: Teach PSS about host page

2022-10-11 Thread Peter Xu
Migration code has a lot to do with host pages. Teaching PSS core about the idea of host page helps a lot and makes the code clean. Meanwhile, this prepares for the future changes that can leverage the new PSS helpers that this patch introduces to send host page in another thread. Three more

[PATCH v2 12/15] migration: Move last_sent_block into PageSearchStatus

2022-10-11 Thread Peter Xu
Since we use PageSearchStatus to represent a channel, it makes perfect sense to keep last_sent_block (aka, leverage RAM_SAVE_FLAG_CONTINUE) to be per-channel rather than global because each channel can be sending different pages on ramblocks. Hence move it from RAMState into PageSearchStatus.

[PATCH v2 15/15] migration: Drop rs->f

2022-10-11 Thread Peter Xu
Now with rs->pss we can already cache channels in pss->pss_channels. That pss_channel contains more infromation than rs->f because it's per-channel. So rs->f could be replaced by rss->pss[RAM_CHANNEL_PRECOPY].pss_channel, while rs->f itself is a bit vague now. Note that vanilla postcopy still

[PATCH 5/5] cxl: update tests and documentation for new cxl properties

2022-10-11 Thread Gregory Price
Adds explicit examples for --persistent-memdev and --volatile-memdev Signed-off-by: Gregory Price --- docs/system/devices/cxl.rst | 53 ++-- tests/qtest/cxl-test.c | 81 +++-- 2 files changed, 110 insertions(+), 24 deletions(-) diff

[PATCH v2 04/15] migration: Trivial cleanup save_page_header() on same block check

2022-10-11 Thread Peter Xu
The 2nd check on RAM_SAVE_FLAG_CONTINUE is a bit redundant. Use a boolean to be clearer. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/ram.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index

[PATCH v2 09/15] migration: Introduce pss_channel

2022-10-11 Thread Peter Xu
Introduce pss_channel for PageSearchStatus, define it as "the migration channel to be used to transfer this host page". We used to have rs->f, which is a mirror to MigrationState.to_dst_file. After postcopy preempt initial version, rs->f can be dynamically changed depending on which channel we

[PATCH v2 11/15] migration: Make PageSearchStatus part of RAMState

2022-10-11 Thread Peter Xu
We used to allocate PSS structure on the stack for precopy when sending pages. Make it static, so as to describe per-channel ram migration status. Here we declared RAM_CHANNEL_MAX instances, preparing for postcopy to use it, even though this patch has not yet to start using the 2nd instance.

[PATCH 4/5] hw/cxl: Multi-Region CXL Type-3 Devices (Volatile and Persistent)

2022-10-11 Thread Gregory Price
This commit enables each CXL Type-3 device to contain one volatile memory region and one persistent region. Two new properties have been added to cxl-type3 device initialization: [volatile-memdev] and [persistent-memdev] The existing [memdev] property has been deprecated and will default the

[PATCH v2 07/15] migration: Use atomic ops properly for page accountings

2022-10-11 Thread Peter Xu
To prepare for thread-safety on page accountings, at least below counters need to be accessed only atomically, they are: ram_counters.transferred ram_counters.duplicate ram_counters.normal ram_counters.postcopy_bytes There are a lot of other counters but they

[PATCH v2 00/15] migration: Postcopy Preempt-Full

2022-10-11 Thread Peter Xu
Based-on: <20221004182430.97638-1-pet...@redhat.com> [PATCH v2 0/5] migration: Bug fixes (prepare for preempt-full) Tree is here: https://github.com/xzpeter/qemu/tree/preempt-full RFC: https://lore.kernel.org/r/20220829165659.96046-1-pet...@redhat.com v1:

[PATCH v2 06/15] migration: Yield bitmap_mutex properly when sending/sleeping

2022-10-11 Thread Peter Xu
Don't take the bitmap mutex when sending pages, or when being throttled by migration_rate_limit() (which is a bit tricky to call it here in ram code, but seems still helpful). It prepares for the possibility of concurrently sending pages in >1 threads using the function ram_save_host_page()

[PATCH 2/5] hw/cxl: Add CXL_CAPACITY_MULTIPLIER definition

2022-10-11 Thread Gregory Price
Remove usage of magic numbers when accessing capacity fields and replace with CXL_CAPACITY_MULTIPLIER, matching the kernel definition. Signed-off-by: Gregory Price Reviewed-by: Davidlohr Bueso --- hw/cxl/cxl-mailbox-utils.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-)

[PATCH v2 03/15] migration: Cleanup xbzrle zero page cache update logic

2022-10-11 Thread Peter Xu
The major change is to replace "!save_page_use_compression()" with "xbzrle_enabled" to make it clear. Reasonings: (1) When compression enabled, "!save_page_use_compression()" is exactly the same as checking "xbzrle_enabled". (2) When compression disabled, "!save_page_use_compression()"

[PATCH 0/5] Multi-Region and Volatile Memory support for CXL Type-3 Devices

2022-10-11 Thread Gregory Price
Summary of Changes: 1) Correction of PCI_CLASS from STORAGE_EXPRESS to MEMORY_CXL on init 2) Add CXL_CAPACITY_MULTIPLIER definition to replace magic numbers 3) Refactor CDAT DSMAS Initialization for multi-region initialization 4) Multi-Region and Volatile Memory support for CXL Type-3 Devices 5)

[PATCH v2 02/15] migration: Add postcopy_preempt_active()

2022-10-11 Thread Peter Xu
Add the helper to show that postcopy preempt enabled, meanwhile active. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/ram.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index cfeb571800..7aaa843a21

[PATCH v2 01/15] migration: Take bitmap mutex when completing ram migration

2022-10-11 Thread Peter Xu
Any call to ram_find_and_save_block() needs to take the bitmap mutex. We used to not take it for most of ram_save_complete() because we thought we're the only one left using the bitmap, but it's not true after the preempt full patchset applied, since the return path can be taking it too.

[PATCH 3/5] hw/mem/cxl_type: Generalize CDATDsmas initialization for Memory Regions

2022-10-11 Thread Gregory Price
This is a preparatory commit for enabling multiple memory regions within a single CXL Type-3 device. We will need to initialize multiple CDAT DSMAS regions (and subsequent DSLBIS, and DSEMTS entries), so generalize the intialization into a function. Signed-off-by: Gregory Price ---

[PATCH v3 28/29] target/ppc: unify cpu->has_work based on cs->interrupt_request

2022-10-11 Thread Matheus Ferst
Now that cs->interrupt_request indicates if there is any unmasked interrupt, checking if the CPU has work to do can be simplified to a single check that works for all CPU models. Reviewed-by: Fabiano Rosas Signed-off-by: Matheus Ferst --- target/ppc/cpu_init.c | 94

[PATCH v3 26/29] target/ppc: remove ppc_store_lpcr from CONFIG_USER_ONLY builds

2022-10-11 Thread Matheus Ferst
Writes to LPCR are hypervisor privileged. Signed-off-by: Matheus Ferst --- target/ppc/cpu.c | 2 ++ target/ppc/cpu.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c index 0ebac04bc4..e95b4c5ee1 100644 --- a/target/ppc/cpu.c +++

[PATCH 1/5] hw/cxl: set cxl-type3 device type to PCI_CLASS_MEMORY_CXL

2022-10-11 Thread Gregory Price
Current code sets to STORAGE_EXPRESS and then overrides it. Signed-off-by: Gregory Price Reviewed-by: Davidlohr Bueso Reviewed-by: Jonathan Cameron --- hw/mem/cxl_type3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index

[PATCH v3 19/29] target/ppc: create an interrupt masking method for POWER7

2022-10-11 Thread Matheus Ferst
The new method is identical to ppc_next_unmasked_interrupt_generic, processor-specific code will be added/removed in the following patches. Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 114 +++ 1 file changed, 114 insertions(+) diff --git

[PATCH v3 27/29] target/ppc: introduce ppc_maybe_interrupt

2022-10-11 Thread Matheus Ferst
This new method will check if any pending interrupt was unmasked and then call cpu_interrupt/cpu_reset_interrupt accordingly. Code that raises/lowers or masks/unmasks interrupts should call this method to keep CPU_INTERRUPT_HARD coherent with env->pending_interrupts. Signed-off-by: Matheus Ferst

Re: [PATCH v3] m68k: write bootinfo as rom section and re-randomize on reboot

2022-10-11 Thread Laurent Vivier
Le 11/10/2022 à 16:56, Jason A. Donenfeld a écrit : On Tue, Oct 11, 2022 at 10:29:45AM +0100, Peter Maydell wrote: On Tue, 11 Oct 2022 at 09:41, Laurent Vivier wrote: Le 03/10/2022 à 13:02, Jason A. Donenfeld a écrit : Rather than poking directly into RAM, add the bootinfo block as a proper

[PATCH v3 17/29] target/ppc: move power-saving interrupt masking out of cpu_has_work_POWER8

2022-10-11 Thread Matheus Ferst
Move the interrupt masking logic out of cpu_has_work_POWER8 in a new method, p8_interrupt_powersave, that only returns an interrupt if it can wake the processor from power-saving mode. Signed-off-by: Matheus Ferst --- target/ppc/cpu_init.c | 61 +++ 1

[PATCH v3 22/29] target/ppc: remove unused interrupts from p7_deliver_interrupt

2022-10-11 Thread Matheus Ferst
Remove the following unused interrupts from the POWER7 interrupt processing method: - PPC_INTERRUPT_RESET: only raised for 6xx, 7xx, 970 and POWER5p; - Hypervisor Virtualization: introduced in Power ISA v3.0; - Hypervisor Doorbell and Event-Based Branch: introduced in Power ISA v2.07; - Critical

[PATCH v3 24/29] target/ppc: move power-saving interrupt masking out of cpu_has_work_POWER7

2022-10-11 Thread Matheus Ferst
Move the interrupt masking logic out of cpu_has_work_POWER7 in a new method, p7_interrupt_powersave, that only returns an interrupt if it can wake the processor from power-saving mode. Signed-off-by: Matheus Ferst --- target/ppc/cpu_init.c | 45 --- 1

[PATCH v3 16/29] target/ppc: remove generic architecture checks from p8_deliver_interrupt

2022-10-11 Thread Matheus Ferst
Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 662daad796..aaf1c95087 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -2004,9 +2004,6 @@ static void

[PATCH v3 29/29] target/ppc: move the p*_interrupt_powersave methods to excp_helper.c

2022-10-11 Thread Matheus Ferst
Move the methods to excp_helper.c and make them static. Reviewed-by: Fabiano Rosas Signed-off-by: Matheus Ferst --- target/ppc/cpu_init.c| 102 --- target/ppc/excp_helper.c | 102 +++ target/ppc/internal.h| 6 ---

[PATCH v3 21/29] target/ppc: create an interrupt deliver method for POWER7

2022-10-11 Thread Matheus Ferst
The new method is identical to ppc_deliver_interrupt, processor-specific code will be added/removed in the following patches. Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 113 +++ 1 file changed, 113 insertions(+) diff --git

[PATCH v3 23/29] target/ppc: remove generic architecture checks from p7_deliver_interrupt

2022-10-11 Thread Matheus Ferst
Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 055f1de20e..1c373c1a7c 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -2077,9 +2077,6 @@ static void

[PATCH v3 15/29] target/ppc: remove unused interrupts from p8_deliver_interrupt

2022-10-11 Thread Matheus Ferst
Remove the following unused interrupts from the POWER8 interrupt processing method: - PPC_INTERRUPT_RESET: only raised for 6xx, 7xx, 970 and POWER5p; - Debug Interrupt: removed in Power ISA v2.07; - Hypervisor Virtualization: introduced in Power ISA v3.0; - Critical Input, Watchdog Timer, and

[PATCH v3 25/29] target/ppc: add power-saving interrupt masking logic to p7_next_unmasked_interrupt

2022-10-11 Thread Matheus Ferst
Export p7_interrupt_powersave and use it in p7_next_unmasked_interrupt. Signed-off-by: Matheus Ferst --- target/ppc/cpu_init.c| 2 +- target/ppc/excp_helper.c | 24 target/ppc/internal.h| 1 + 3 files changed, 14 insertions(+), 13 deletions(-) diff --git

[PATCH v3 20/29] target/ppc: remove unused interrupts from p7_next_unmasked_interrupt

2022-10-11 Thread Matheus Ferst
Remove the following unused interrupts from the POWER7 interrupt masking method: - PPC_INTERRUPT_RESET: only raised for 6xx, 7xx, 970 and POWER5p; - Hypervisor Virtualization: introduced in Power ISA v3.0; - Hypervisor Doorbell and Event-Based Branch: introduced in Power ISA v2.07; - Critical

[PATCH v3 13/29] target/ppc: remove unused interrupts from p8_next_unmasked_interrupt

2022-10-11 Thread Matheus Ferst
Remove the following unused interrupts from the POWER8 interrupt masking method: - PPC_INTERRUPT_RESET: only raised for 6xx, 7xx, 970, and POWER5p; - Debug Interrupt: removed in Power ISA v2.07; - Hypervisor Virtualization: introduced in Power ISA v3.0; - Critical Input, Watchdog Timer, and Fixed

[PATCH v3 14/29] target/ppc: create an interrupt deliver method for POWER8

2022-10-11 Thread Matheus Ferst
The new method is identical to ppc_deliver_interrupt, processor-specific code will be added/removed in the following patches. Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 113 +++ 1 file changed, 113 insertions(+) diff --git

[PATCH v3 18/29] target/ppc: add power-saving interrupt masking logic to p8_next_unmasked_interrupt

2022-10-11 Thread Matheus Ferst
Export p8_interrupt_powersave and use it in p8_next_unmasked_interrupt. Signed-off-by: Matheus Ferst --- target/ppc/cpu_init.c| 2 +- target/ppc/excp_helper.c | 24 target/ppc/internal.h| 1 + 3 files changed, 14 insertions(+), 13 deletions(-) diff --git

[PATCH v3 10/29] target/ppc: move power-saving interrupt masking out of cpu_has_work_POWER9

2022-10-11 Thread Matheus Ferst
Move the interrupt masking logic out of cpu_has_work_POWER9 in a new method, p9_interrupt_powersave, that only returns an interrupt if it can wake the processor from power-saving mode. Signed-off-by: Matheus Ferst --- target/ppc/cpu_init.c | 126 +- 1

[PATCH v3 12/29] target/ppc: create an interrupt masking method for POWER8

2022-10-11 Thread Matheus Ferst
The new method is identical to ppc_next_unmasked_interrupt_generic, processor-specific code will be added/removed in the following patches. Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 114 +++ 1 file changed, 114 insertions(+) diff --git

[PATCH v3 11/29] target/ppc: add power-saving interrupt masking logic to p9_next_unmasked_interrupt

2022-10-11 Thread Matheus Ferst
Export p9_interrupt_powersave and use it in p9_next_unmasked_interrupt. Signed-off-by: Matheus Ferst --- Putting the prototype in internal.h for a lack of better place. However, we will un-export p9_interrupt_powersave in future patches, so it's only temporary. --- target/ppc/cpu_init.c| 2

[PATCH v3 07/29] target/ppc: create an interrupt deliver method for POWER9/POWER10

2022-10-11 Thread Matheus Ferst
The new method is identical to ppc_deliver_interrupt, processor-specific code will be added/removed in the following patches. Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 118 +++ 1 file changed, 118 insertions(+) diff --git

[PATCH v3 09/29] target/ppc: remove generic architecture checks from p9_deliver_interrupt

2022-10-11 Thread Matheus Ferst
Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index fb946385cc..fd9745c37e 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -1919,18

[PATCH v3 06/29] target/ppc: remove unused interrupts from p9_next_unmasked_interrupt

2022-10-11 Thread Matheus Ferst
Remove the following unused interrupts from the POWER9 interrupt masking method: - PPC_INTERRUPT_RESET: only raised for 6xx, 7xx, 970 and POWER5p; - Debug Interrupt: removed in Power ISA v2.07; - Critical Input, Watchdog Timer, and Fixed Interval Timer: only defined for embedded CPUs; - Critical

[PATCH v3 04/29] target/ppc: prepare to split interrupt masking and delivery by excp_model

2022-10-11 Thread Matheus Ferst
Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index f92b6c2b18..7d196d1581 100644 --- a/target/ppc/excp_helper.c +++

[PATCH v3 08/29] target/ppc: remove unused interrupts from p9_deliver_interrupt

2022-10-11 Thread Matheus Ferst
Remove the following unused interrupts from the POWER9 interrupt processing method: - PPC_INTERRUPT_RESET: only raised for 6xx, 7xx, 970 and POWER5p; - Debug Interrupt: removed in Power ISA v2.07; - Critical Input, Watchdog Timer, and Fixed Interval Timer: only defined for embedded CPUs; -

[PATCH v3 05/29] target/ppc: create an interrupt masking method for POWER9/POWER10

2022-10-11 Thread Matheus Ferst
The new method is identical to ppc_next_unmasked_interrupt_generic, processor-specific code will be added/removed in the following patches. Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 119 +++ 1 file changed, 119 insertions(+) diff --git

[PATCH v3 03/29] target/ppc: split interrupt masking and delivery from ppc_hw_interrupt

2022-10-11 Thread Matheus Ferst
Split ppc_hw_interrupt into an interrupt masking method, ppc_next_unmasked_interrupt, and an interrupt processing method, ppc_deliver_interrupt. Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 207 +-- 1 file changed, 131 insertions(+), 76

[PATCH v2 8/8] reset: do not re-randomize RNG seed on snapshot load

2022-10-11 Thread Jason A. Donenfeld
Snapshot loading is supposed to be deterministic, so we shouldn't re-randomize the various seeds used. Signed-off-by: Jason A. Donenfeld --- hw/arm/boot.c | 3 ++- hw/i386/x86.c | 2 +- hw/mips/boston.c | 2 +- hw/openrisc/boot.c | 2 +- hw/riscv/boot.c| 2 +- hw/rx/rx-gdbsim.c

[PATCH v2 5/8] rx: re-randomize rng-seed on reboot

2022-10-11 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Yoshinori Sato

[PATCH v2 2/8] arm: re-randomize rng-seed on reboot

2022-10-11 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Peter Maydell Cc:

[PATCH v3 01/29] target/ppc: define PPC_INTERRUPT_* values directly

2022-10-11 Thread Matheus Ferst
This enum defines the bit positions in env->pending_interrupts for each interrupt. However, except for the comparison in kvmppc_set_interrupt, the values are always used as (1 << PPC_INTERRUPT_*). Define them directly like that to save some clutter. No functional change intended. Reviewed-by:

[PATCH v3 02/29] target/ppc: always use ppc_set_irq to set env->pending_interrupts

2022-10-11 Thread Matheus Ferst
Use ppc_set_irq to raise/clear interrupts to ensure CPU_INTERRUPT_HARD will be set/reset accordingly. Reviewed-by: Fabiano Rosas Signed-off-by: Matheus Ferst --- target/ppc/excp_helper.c | 17 +++-- target/ppc/misc_helper.c | 9 ++--- 2 files changed, 9 insertions(+), 17

[PATCH v3 00/29] PowerPC interrupt rework

2022-10-11 Thread Matheus Ferst
Link to v2: https://lists.gnu.org/archive/html/qemu-ppc/2022-09/msg00556.html This series is also available as a git branch: https://github.com/PPC64/qemu/tree/ferst-interrupt-fix-v3 Patches without review: 3-27 This new version rebases the patch series on the current master and fixes some

[PATCH v2 6/8] mips: re-randomize rng-seed on reboot

2022-10-11 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Aleksandar Rikalo Cc:

[PATCH v2 1/8] device-tree: add re-randomization helper function

2022-10-11 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Several architectures require this functionality, so export a function for injecting a new seed into the given FDT. Cc: Alistair Francis Cc: David Gibson Signed-off-by: Jason A.

[PATCH v2 3/8] riscv: re-randomize rng-seed on reboot

2022-10-11 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Palmer Dabbelt Cc:

[PATCH v2 7/8] reset: allow registering handlers that aren't called by snapshot loading

2022-10-11 Thread Jason A. Donenfeld
Snapshot loading only expects to call deterministic handlers, not non-deterministic ones. So introduce a way of registering handlers that won't be called when reseting for snapshots. Signed-off-by: Jason A. Donenfeld --- hw/arm/aspeed.c| 4 ++-- hw/arm/mps2-tz.c | 4 ++--

[PATCH v2 0/8] rerandomize RNG seeds on reboot and handle record

2022-10-11 Thread Jason A. Donenfeld
When the system reboots, the rng seed that QEMU passes should be re-randomized, so that the new boot gets a new seed. This series wires that up for FDT. Then, since the record subsystem makes use of reset as well, we add a new reset cause for record, so that we can avoid re-randomizing in these

Re: [PATCH 1/6] device-tree: add re-randomization helper function

2022-10-11 Thread Jason A. Donenfeld
On Tue, Oct 11, 2022 at 2:06 PM Jason A. Donenfeld wrote: > > On Tue, Oct 11, 2022 at 09:46:01AM +0300, Pavel Dovgalyuk wrote: > > On 10.10.2022 18:32, Peter Maydell wrote: > > > On Mon, 10 Oct 2022 at 16:21, Jason A. Donenfeld wrote: > > >> > > >> On Mon, Oct 10, 2022 at 11:54:50AM +0100, Peter

[PATCH v2 4/8] openrisc: re-randomize rng-seed on reboot

2022-10-11 Thread Jason A. Donenfeld
When the system reboots, the rng-seed that the FDT has should be re-randomized, so that the new boot gets a new seed. Since the FDT is in the ROM region at this point, we add a hook right after the ROM has been added, so that we have a pointer to that copy of the FDT. Cc: Stafford Horne

Re: [PATCH 1/6] device-tree: add re-randomization helper function

2022-10-11 Thread Jason A. Donenfeld
On Tue, Oct 11, 2022 at 09:46:01AM +0300, Pavel Dovgalyuk wrote: > On 10.10.2022 18:32, Peter Maydell wrote: > > On Mon, 10 Oct 2022 at 16:21, Jason A. Donenfeld wrote: > >> > >> On Mon, Oct 10, 2022 at 11:54:50AM +0100, Peter Maydell wrote: > >>> The error is essentially the record-and-replay

[PATCH v11 17/17] net: stream: add QAPI events to report connection state

2022-10-11 Thread Laurent Vivier
The netdev reports NETDEV_STREAM_CONNECTED event when the backend is connected, and NETDEV_STREAM_EOC when it is disconnected. The NETDEV_STREAM_CONNECTED event includes the URI of the destination address. Signed-off-by: Laurent Vivier Acked-by: Michael S. Tsirkin --- net/stream.c | 11

[PATCH v11 15/17] net: stream: move to QIO to enable additional parameters

2022-10-11 Thread Laurent Vivier
Use QIOChannel, QIOChannelSocket and QIONetListener. This allows net/stream to use all the available parameters provided by SocketAddress. Signed-off-by: Laurent Vivier Acked-by: Michael S. Tsirkin --- meson | 2 +- net/stream.c| 493

[PATCH v11 13/17] qemu-sockets: move and rename SocketAddress_to_str()

2022-10-11 Thread Laurent Vivier
Rename SocketAddress_to_str() to socket_uri() and move it to util/qemu-sockets.c close to socket_parse(). socket_uri() generates a string from a SocketAddress while socket_parse() generates a SocketAddress from a string. Signed-off-by: Laurent Vivier Reviewed-by: David Gibson Reviewed-by: Dr.

[PATCH v11 16/17] tests/qtest: netdev: test stream and dgram backends

2022-10-11 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Acked-by: Michael S. Tsirkin --- tests/qtest/meson.build | 1 + tests/qtest/netdev-socket.c | 417 2 files changed, 418 insertions(+) create mode 100644 tests/qtest/netdev-socket.c diff --git a/tests/qtest/meson.build

  1   2   3   >