Re: [XEN PATCH v4] xen/arm: ffa: reclaim shared memory on guest destroy

2024-02-05 Thread Jens Wiklander
On Mon, Feb 5, 2024 at 5:54 PM Andrew Cooper wrote: > > On 05/02/2024 3:49 pm, Jens Wiklander wrote: > > diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c > > index 0793c1c7585d..bbb6b819ee2b 100644 > > --- a/xen/arch/arm/tee/ffa.c > > +++ b/xen/arch/arm/tee/ffa.c > > @@ -992,53

[PATCH] Mini-OS: fix 9pfs frontend error path

2024-02-05 Thread Juergen Gross
The early error exit in p9_stat() returns without zeroing the p9_stat buffer, resulting in free() being called with an uninitialized pointer. Fix that by doing the zeroing first. Reported-by: Julien Grall Fixes: 2d1dfccd3aa3 ("Mini-OS: add read and write support to 9pfsfront") Signed-off-by:

Re: [XEN PATCH] golang: Regen binding

2024-02-05 Thread George Dunlap
On Tue, Feb 6, 2024 at 12:53 AM Anthony PERARD wrote: > > Fixes: 024e7131be5c ("tools: don't expose XENFEAT_hvm_pirqs by default") > Signed-off-by: Anthony PERARD Acked-by: George Dunlap

[linux-6.1 test] 184595: tolerable FAIL - PUSHED

2024-02-05 Thread osstest service owner
flight 184595 linux-6.1 real [real] http://logs.test-lab.xenproject.org/osstest/logs/184595/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stopfail like 184570 test-armhf-armhf-libvirt-qcow2 15

[xen-unstable-smoke test] 184599: tolerable all pass - PUSHED

2024-02-05 Thread osstest service owner
flight 184599 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/184599/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm

Re: [PATCH 6/6] svm/nestedvm: Introduce nested capabilities bit

2024-02-05 Thread George Dunlap
On Tue, Feb 6, 2024 at 9:20 AM George Dunlap wrote: > @@ -655,6 +658,12 @@ static inline bool hvm_altp2m_supported(void) > return hvm_funcs.caps.altp2m; > } > > +/* Returns true if we have the minimum hardware requirements for nested virt > */ > +static inline bool

[PATCH 6/6] svm/nestedvm: Introduce nested capabilities bit

2024-02-05 Thread George Dunlap
In order to make implementation and testing tractable, we will require specific host functionality. Add a nested_virt bit to hvm_funcs.caps, and return an error if a domain is created with nested virt and this bit isn't set. For VMX, start with always enabling it if HAP is present; this

[PATCH 2/6] svm: Improve type of cpu_has_svm_feature

2024-02-05 Thread George Dunlap
The "effective type" of the cpu_has_svm_feature macro is effectively an unsigned log with one bit set (or not); at least one place someone felt compelled to do a !! to make sure that they got a boolean out of it. Ideally the whole of this would be folded into the cpufeature.h infrastructure. But

[PATCH 0/6] AMD Nested Virt Preparation

2024-02-05 Thread George Dunlap
This series lays the groundwork for revamp of the AMD nested virt functionality. The first five patches are clean-ups or reorganizations of existing code. The final patch is the first major step towards making the feature supportable: allowing Xen to refuse nested virt support if certain

[PATCH 5/6] nestedsvm: Remove bogus debug message from nestedsvm_check_intercepts

2024-02-05 Thread George Dunlap
Changeset ef3e8db8068 ("x86/hvm: Corrections and improvements to unhandled vmexit logging") introduced a printk to the default path of the switch statement in nestedsvm_check_intercepts(), complaining of an unknown exit reason. Unfortunately, the "core" switch statement which is meant to handle

[PATCH 4/6] nestedsvm: Disable TscRateMSR

2024-02-05 Thread George Dunlap
The primary purpose of TSC scaling, from our perspective, is to maintain the fiction of an "invariant TSC" across migrates between platforms with different clock speeds. On AMD, the TscRateMSR CPUID bit is unconditionally enabled in the "host cpuid", even if the hardware doesn't actually support

[PATCH 1/6] xen/hvm: Convert hap_capabilities into a bitfield

2024-02-05 Thread George Dunlap
hvm_function_table is an internal structure; rather than manually |-ing and &-ing bits, just make it a boolean bitfield and let the compiler do all the work. This makes everything easier to read, and presumably allows the compiler more flexibility in producing efficient code. No functional

[PATCH 3/6] xen/hvm: Move other hvm_function_table booleans into the caps bitfield

2024-02-05 Thread George Dunlap
Moving them all together has several advantages: * Collects them all in one part of the struct * The `caps` field means that we can drop the "_supported" suffix, as it's clear what is meant. Signed-off-by: George Dunlap --- CC: Jan Beulich CC: Andrew Cooper CC: "Roger Pau Monné" CC: Wei

[xen-unstable-smoke test] 184596: regressions - FAIL

2024-02-05 Thread osstest service owner
flight 184596 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/184596/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-xsm 6 xen-buildfail REGR. vs. 184593 Tests which

Re: [PATCH v2 (resend) 02/27] x86/setup: Move vm_init() before acpi calls

2024-02-05 Thread Stefano Stabellini
On Thu, 25 Jan 2024, Jan Beulich wrote: > On 16.01.2024 20:25, Elias El Yandouzi wrote: > > From: Wei Liu > > > > After the direct map removal, pages from the boot allocator are not > > going to be mapped in the direct map. Although we have map_domain_page, > > they are ephemeral and are less

[xen-unstable test] 184591: tolerable FAIL - PUSHED

2024-02-05 Thread osstest service owner
flight 184591 xen-unstable real [real] flight 184594 xen-unstable real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/184591/ http://logs.test-lab.xenproject.org/osstest/logs/184594/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking):

Re: [PATCH 2/5] Remove useless assignment

2024-02-05 Thread Julien Grall
Hi, The tag says '2/5' but I don't see a thread. Is the series meant to contain more patches? Also, the title is not very specific about where the assignment is removed. I have committed with the following title: xen/evtchn: Remove useful assignment in evtchn_alloc_unbound On 05/02/2024

Re: [PATCH v4 00/32] tools: enable xenstore-stubdom to use 9pfs

2024-02-05 Thread Julien Grall
On 05/02/2024 17:18, Julien Grall wrote: Hi Juergen, On 05/02/2024 11:08, Jürgen Groß wrote: On 05.02.24 11:55, Julien Grall wrote: Hi Juergen, On 05/02/2024 10:49, Juergen Gross wrote: This series is adding 9pfs support to Xenstore-stubdom, enabling it to do logging to a dom0 directory.

Re: [PATCH 2/5] Remove useless assignment

2024-02-05 Thread Stefano Stabellini
On Mon, 5 Feb 2024, Frediano Ziglio wrote: > The variable is assigned later, that value is never used. > > Signed-off-by: Frediano Ziglio Reviewed-by: Stefano Stabellini > --- > xen/common/event_channel.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/xen/common/event_channel.c

[xen-unstable-smoke test] 184593: tolerable all pass - PUSHED

2024-02-05 Thread osstest service owner
flight 184593 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/184593/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm

Re: Ping: Ping: [PATCH] Argo: drop meaningless mfn_valid() check

2024-02-05 Thread Christopher Clark
On Mon, Feb 5, 2024 at 4:17 AM Jan Beulich wrote: > > On 04.01.2024 09:12, Jan Beulich wrote: > > On 23.12.2023 22:35, Christopher Clark wrote: > >> On Sat, Dec 23, 2023 at 12:47 PM Christopher Clark > >> wrote: > >>> > >>> On Sun, Dec 17, 2023 at 11:55 PM Jan Beulich wrote: > >

Xen 4.19 release status tracking list

2024-02-05 Thread Oleksii Kurochko
Hello everyone, I would like to share with you a list for status tracking based on Xen ML: Arm: * [PATCH v5 00/13] Arm cache coloring [ https://lore.kernel.org/xen-devel/20240102095138.17933-1-carlo.non...@minervasys.tech/ ] * [PATCH v1 repost 0/4] xen/arm64: Rework the MMU-off code (idmap)

Re: [PATCH] tools/xentop: fix sorting bug for some columns

2024-02-05 Thread Andrew Cooper
On 05/02/2024 5:37 pm, Anthony PERARD wrote: > On Sun, Feb 04, 2024 at 11:19:40AM +0100, zithro / Cyril Rébert wrote: >> From: Cyril Rébert >> >> Sort doesn't work on columns VBD_OO, VBD_RD, VBD_WR and VBD_RSECT. >> Fix by adjusting variables names in compare functions. >> Bug fix only. No

Re: [PATCH] tools/xentop: fix sorting bug for some columns

2024-02-05 Thread Anthony PERARD
On Sun, Feb 04, 2024 at 11:19:40AM +0100, zithro / Cyril Rébert wrote: > From: Cyril Rébert > > Sort doesn't work on columns VBD_OO, VBD_RD, VBD_WR and VBD_RSECT. > Fix by adjusting variables names in compare functions. > Bug fix only. No functional change. > > Signed-off-by: Cyril Rébert

[xen-unstable-smoke test] 184592: tolerable all pass - PUSHED

2024-02-05 Thread osstest service owner
flight 184592 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/184592/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm

Re: [PATCH] tools/xentop: add option to display dom0 first

2024-02-05 Thread Anthony PERARD
On Wed, Jan 31, 2024 at 06:51:34PM +0100, Cyril Rébert wrote: > Add a command line option to xentop to be able to display dom0 first, on top > of the list. > This is unconditional, so sorting domains with the S option will also ignore > dom0. > > Signed-off-by: Cyril Rébert (zithro) Hi Cyril,

Re: [PATCH v4 00/32] tools: enable xenstore-stubdom to use 9pfs

2024-02-05 Thread Julien Grall
Hi Juergen, On 05/02/2024 11:08, Jürgen Groß wrote: On 05.02.24 11:55, Julien Grall wrote: Hi Juergen, On 05/02/2024 10:49, Juergen Gross wrote: This series is adding 9pfs support to Xenstore-stubdom, enabling it to do logging to a dom0 directory. This is a prerequisite for the final goal

Re: [XEN PATCH v4] xen/arm: ffa: reclaim shared memory on guest destroy

2024-02-05 Thread Andrew Cooper
On 05/02/2024 3:49 pm, Jens Wiklander wrote: > diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c > index 0793c1c7585d..bbb6b819ee2b 100644 > --- a/xen/arch/arm/tee/ffa.c > +++ b/xen/arch/arm/tee/ffa.c > @@ -992,53 +1008,75 @@ static void put_shm_pages(struct ffa_shm_mem *shm) > } >

[XEN PATCH] golang: Regen binding

2024-02-05 Thread Anthony PERARD
Fixes: 024e7131be5c ("tools: don't expose XENFEAT_hvm_pirqs by default") Signed-off-by: Anthony PERARD --- tools/golang/xenlight/helpers.gen.go | 6 ++ tools/golang/xenlight/types.gen.go | 1 + 2 files changed, 7 insertions(+) diff --git a/tools/golang/xenlight/helpers.gen.go

Re: [PATCH] libxl: Add "grant_usage" parameter for virtio disk devices

2024-02-05 Thread Oleksandr Tyshchenko
On 05.02.24 17:10, Anthony PERARD wrote: Hello Anthony > On Fri, Feb 02, 2024 at 12:49:03PM +0200, Oleksandr Tyshchenko wrote: >> diff --git a/tools/libs/util/libxlu_disk_l.l >> b/tools/libs/util/libxlu_disk_l.l >> index 6d53c093a3..f37dd443bd 100644 >> --- a/tools/libs/util/libxlu_disk_l.l

Re: [PATCH] x86/cpu: Fix mixed tabs/spaces

2024-02-05 Thread Andrew Cooper
On 05/02/2024 2:33 pm, Jan Beulich wrote: > On 05.02.2024 15:14, Andrew Cooper wrote: >> Fixes: 660f8a75013c ("x86/CPU: convert vendor hook invocations to altcall") >> Signed-off-by: Andrew Cooper > Without the (or at least this very) Fixes: tag > Acked-by: Jan Beulich > The patch you mention

Re: [PATCH] x86/bitmap: Even more signed-ness fixes

2024-02-05 Thread Julien Grall
Hi Andrew, title: s/x86// as this is common code. On 05/02/2024 15:14, Andrew Cooper wrote: Further to commit 558e84b7ffec ("xen/bitmap: Consistently use unsigned bits values"), it turns out that GCC's range analysis isn't good enough to notice that 'bits / BITS_PER_LONG' is always within the

Re: [PATCH] x86/bitmap: Compile with -Wsign-conversion

2024-02-05 Thread Julien Grall
Hi Andrew, Title: You seem to change common code. So s/x86// On 05/02/2024 15:14, Andrew Cooper wrote: Use pragmas to able the warning in this file only. All supported versions of Clang understand this, while older GCCs simply ignore it. bitmap_find_free_region() is the only function which

[PATCH v4 28/30] xen/rirscv: add minimal amount of stubs to build full Xen

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V4: - added new stubs which are necessary for compilation after rebase: __cpu_up(), __cpu_disable(), __cpu_die() from smpboot.c - back changes related to printk() in early_printk() as they should be removed in the next patch to avoid

[PATCH v4 30/30] xen/README: add compiler and binutils versions for RISC-V64

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V4: - Update version of GCC (12.2) and GNU Binutils (2.39) to the version which are in Xen's contrainter for RISC-V --- Changes in V3: - new patch --- README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README b/README index

[XEN PATCH v4] xen/arm: ffa: reclaim shared memory on guest destroy

2024-02-05 Thread Jens Wiklander
When an FF-A enabled guest is destroyed it may leave behind memory shared with SPs. This memory must be reclaimed before it's reused or an SP may make changes to memory used by a new unrelated guest. So when the domain is teared down add FF-A requests to reclaim all remaining shared memory. SPs

[PATCH v4 24/30] xen/riscv: add minimal stuff to page.h to build full Xen

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: --- - Change message -> subject in "Changes in V3" - s/BUG/BUG_ON("...") - Do proper rebase ( pfn_to_paddr() and paddr_to_pfn() aren't removed ). --- Changes in V3: - update the commit subject - add implemetation of

Re: [PATCH v2 1/2] x86/IOMMU: address violations of MISRA C:2012 Rule 14.4

2024-02-05 Thread Jan Beulich
On 05.02.2024 16:36, Nicola Vetrini wrote: > On 2023-12-13 17:10, Simone Ballarin wrote: >> From: Maria Celeste Cesario >> >> The xen sources contain violations of MISRA C:2012 Rule 14.4 whose >> headline states: >> "The controlling expression of an if statement and the controlling >> expression

[PATCH v4 29/30] xen/riscv: enable full Xen build

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich --- Changes in V4: - drop stubs for irq_actor_none() and irq_actor_none() as common/irq.c is compiled now. - drop defintion of max_page in stubs.c as common/page_alloc.c is compiled now. - drop printk() related changes in

[PATCH v4 27/30] xen/riscv: introduce vm_event_*() functions

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V4: - New patch. --- xen/arch/riscv/Makefile | 1 + xen/arch/riscv/vm_event.c | 19 +++ 2 files changed, 20 insertions(+) create mode 100644 xen/arch/riscv/vm_event.c diff --git a/xen/arch/riscv/Makefile

[PATCH v4 22/30] xen/riscv: define an address of frame table

2024-02-05 Thread Oleksii Kurochko
Also, the patch adds some helpful macros that assist in avoiding the redefinition of memory layout for each MMU mode. Signed-off-by: Oleksii Kurochko --- Changes in V4: - move "#define VPN_BITS (9)" inside CONFIG_RISCV_64 as for SV32 it should be defined differently. - drop SLOTN_ENTRY_SIZE

[PATCH v4 23/30] xen/riscv: add required things to current.h

2024-02-05 Thread Oleksii Kurochko
Add minimal requied things to be able to build full Xen. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - BUG() was changed to BUG_ON("unimplemented"); - Change "xen/bug.h" to "xen/lib.h" as BUG_ON is defined in xen/lib.h. - Add Acked-by: Jan Beulich --- Changes in

[PATCH v4 26/30] xen/riscv: add minimal stuff to mm.h to build full Xen

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V4: - update an argument name of PFN_ORDERN macros. - drop pad at the end of 'struct page_info'. - Change message -> subject in "Changes in V3" - delete duplicated macros from riscv/mm.h - fix identation in struct page_info - align comment for

[PATCH v4 18/30] xen/riscv: introduce time.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - s/BUG()/BUG_ON("unimplemented") --- Changes in V3: - Acked-by: Jan Beulich - add SPDX - Add new line --- Changes in V2: - change xen/lib.h to xen/bug.h - remove inclusion of as it's not needed. ---

[PATCH v4 25/30] xen/riscv: add minimal stuff to processor.h to build full Xen

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V4: - Change message -> subject in "Changes in V3" - Documentation about system requirement was added. In the future, it can be checked if the extension is supported by system __riscv_isa_extension_available() (

[PATCH v4 21/30] xen/riscv: add definition of __read_mostly

2024-02-05 Thread Oleksii Kurochko
The definition of __read_mostly should be removed in: https://lore.kernel.org/xen-devel/f25eb5c9-7c14-6e23-8535-2c66772b3...@suse.com/ The patch introduces it in arch-specific header to not block enabling of full Xen build for RISC-V. Signed-off-by: Oleksii Kurochko --- - [PATCH] move

Re: [PATCH v2 1/2] x86/IOMMU: address violations of MISRA C:2012 Rule 14.4

2024-02-05 Thread Nicola Vetrini
On 2023-12-13 17:10, Simone Ballarin wrote: From: Maria Celeste Cesario The xen sources contain violations of MISRA C:2012 Rule 14.4 whose headline states: "The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean

[PATCH v4 20/30] xen/riscv: introduce monitor.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Taking into account conversion in [PATCH v6 0/9] Introduce generic headers (https://lore.kernel.org/xen-devel/cover.1703072575.git.oleksii.kuroc...@gmail.com/) this patch can be changed --- Changes in V4: - Nothing changed. Only rebase. --- Changes in V3:

[PATCH v4 15/30] xen/riscv: introduce irq.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - Change BUG to BUG_ON("unimplemented"). - Add Acked-by: Jan Beulich --- Changes in V3: - add SPDX - remove all that was wraped to HAS_DEVICETREE_... as for RISC-V it is going to be always selected. - update the

[PATCH v4 17/30] xen/riscv: introduce regs.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich -- Changes in V4: - add Acked-by: Jan Beulich - s/BUG()/BUG_ON("unimplemented") --- Changes in V3: - update the commit message - add Acked-by: Jan Beulich - remove "include " and use a forward declaration instead. --- Changes in

[PATCH v4 09/30] xen/riscv: introduce bitops.h

2024-02-05 Thread Oleksii Kurochko
Taken from Linux-6.4.0-rc1 Xen's bitops.h consists of several Linux's headers: * linux/arch/include/asm/bitops.h: * The following function were removed as they aren't used in Xen: * test_and_set_bit_lock * clear_bit_unlock * __clear_bit_unlock * The following

[PATCH v4 00/30] Enable build of full Xen for RISC-V

2024-02-05 Thread Oleksii Kurochko
This patch series performs all of the additions necessary to drop the build overrides for RISCV and enable the full Xen build. Except in cases where compatibile implementations already exist (e.g. atomic.h and bitops.h), the newly added definitions are simple. The patch series is based on the

[PATCH v4 14/30] xen/riscv: introduce atomic.h

2024-02-05 Thread Oleksii Kurochko
From: Bobby Eshleman Additionally, this patch introduces macros in fence.h, which are utilized in atomic.h. atomic##prefix##_*xchg_*(atomic##prefix##_t *v, c_t n) were updated to use __*xchg_generic(). Signed-off-by: Oleksii Kurochko --- Changes in V4: - do changes related to the updates of

[PATCH v4 06/30] xen: avoid generation of empty asm/iommu.h

2024-02-05 Thread Oleksii Kurochko
asm/iommu.h shouldn't be included when CONFIG_HAS_PASSTHROUGH isn't enabled. As is ifdef-ed by CONFIG_HAS_PASSTHROUGH it should be also ifdef-ed field "struct arch_iommu arch" in struct domain_iommu as definition of arch_iommu is located in . These amount of changes are enough to avoid

[PATCH v4 19/30] xen/riscv: introduce event.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V4: - s/BUG()/BUG_ON("unimplemented") - s/xen\/bug.h/xen\/lib.h as BUG_ON is defined in xen/lib.h. --- Changes in V3: - add SPDX - add BUG() inside stubs. - update the commit message --- Changes in V2: - Nothing changed. Only rebase. ---

[PATCH v4 11/30] xen/riscv: introduce smp.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V4: - update the V3 changes ( remove that cpu_is_offline() was droped and instead of message used subject ) - drop cpu_is_offline() as it was moved to xen/smp.h. --- Changes in V3: - add SPDX. - drop unnessary #ifdef. - fix "No new line" -

[PATCH v4 16/30] xen/riscv: introduce p2m.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V4: - update the comment above p2m_type_t. RISC-V has only 2 free for use bits in PTE, not 4 as Arm. - update the comment after p2m_ram_rw: s/guest/domain/ as this also applies for dom0. - return INVALID_MFN in gfn_to_mfn() instead of mfn(0). -

[PATCH v4 04/30] xen/riscv: introduce cpufeature.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - Nothing changed. Only rebase --- Changes in V3: - add SPDX and footer - update declaration of cpu_nr_siblings() to return unsigned int instead of int. - add Acked-by: Jan Beulich --- Changes in V2: - Nothing

[PATCH v4 12/30] xen/riscv: introduce cmpxchg.h

2024-02-05 Thread Oleksii Kurochko
The header was taken from Linux kernl 6.4.0-rc1. Addionally, were updated: * add emulation of {cmp}xchg for 1/2 byte types * replace tabs with spaces * replace __* varialbed with *__ * introduce generic version of xchg_* and cmpxchg_*. Signed-off-by: Oleksii Kurochko --- Changes in V4: - Code

[PATCH v4 01/30] xen/riscv: disable unnecessary configs

2024-02-05 Thread Oleksii Kurochko
This patch disables unnecessary configs for two cases: 1. By utilizing EXTRA_FIXED_RANDCONFIG and risc-fixed-randconfig.yaml file for randconfig builds (GitLab CI jobs). 2. By using tiny64_defconfig for non-randconfig builds. Signed-off-by: Oleksii Kurochko --- Changes in V4: - Nothing

[PATCH v4 07/30] xen/asm-generic: introdure nospec.h

2024-02-05 Thread Oleksii Kurochko
The header is similar between Arm, PPC, and RISC-V, so it has been moved to asm-generic. Arm's nospec.h was taken as a base with updated guards: _ASM_ARM_NOSPEC_H -> _ASM_GENERIC_NOSPEC_H Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - Rebase the patch. It was

[PATCH v4 13/30] xen/riscv: introduce io.h

2024-02-05 Thread Oleksii Kurochko
The header taken form Linux 6.4.0-rc1 and is based on arch/riscv/include/asm/mmio.h. Addionally, to the header was added definions of ioremap_*(). Signed-off-by: Oleksii Kurochko --- Changes in V4: - delete inner parentheses in macros. - s/u/uint. --- Changes in V3: - re-sync with linux

[PATCH v4 10/30] xen/riscv: introduce flushtlb.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - s/BUG/BUG_ON(...) --- Changes in V3: - add SPDX & footer - add Acked-by: Jan Beulich --- Changes in V2: - Nothing changed. Only rebase. --- xen/arch/riscv/include/asm/flushtlb.h | 34 +++ 1

[PATCH v4 02/30] xen/riscv: use some asm-generic headers

2024-02-05 Thread Oleksii Kurochko
Some headers are the same as asm-generic verions of them so use them instead of arch-specific headers. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- As [PATCH v6 0/9] Introduce generic headers (https://lore.kernel.org/xen-devel/cover.1703072575.git.oleksii.kuroc...@gmail.com/)

[PATCH v4 08/30] xen/riscv: introduce setup.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - Nothing changed. Only rebase --- Changes in V3: - add SPDX - add Acked-by: Jan Beulich --- Changes in V2: - Nothing changed. Only rebase. --- xen/arch/riscv/include/asm/setup.h | 17 + 1 file

[PATCH v4 05/30] xen/riscv: introduce guest_atomics.h

2024-02-05 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V4: - Drop in guest_testop() and guest_bitop() casts of function arguments. - Change "commit message" to "commit title" in "Changes in V3" to be more precise about what was changed. - use BUG_ON("unimplemented") instead of ASSERT_UNREACHABLE

[PATCH v4 03/30] xen: add support in public/hvm/save.h for PPC and RISC-V

2024-02-05 Thread Oleksii Kurochko
No specific header is needed to include in public/hvm/save.h for PPC and RISC-V for now. Code related to PPC was changed based on the comment: https://lore.kernel.org/xen-devel/c2f3280e-2208-496b-a0b5-fda1a2076...@raptorengineering.com/ Signed-off-by: Oleksii Kurochko --- Changes in V4: -

Re: [XEN PATCH v3] xen/arm: ffa: reclaim shared memory on guest destroy

2024-02-05 Thread Bertrand Marquis
Hi Jens, > On 5 Feb 2024, at 14:39, Jens Wiklander wrote: > > Hi Bertrand, > > On Thu, Feb 1, 2024 at 2:57 PM Bertrand Marquis > wrote: >> >> Hi Jens, >> >>> On 17 Jan 2024, at 12:06, Jens Wiklander wrote: >>> >>> When an FF-A enabled guest is destroyed it may leave behind memory >>>

[PATCH] x86/bitmap: Compile with -Wsign-conversion

2024-02-05 Thread Andrew Cooper
Use pragmas to able the warning in this file only. All supported versions of Clang understand this, while older GCCs simply ignore it. bitmap_find_free_region() is the only function which isn't sign-convert clean. This highlights a latent bug in that it can't return successfully for a bitmap

[PATCH] x86/bitmap: Even more signed-ness fixes

2024-02-05 Thread Andrew Cooper
Further to commit 558e84b7ffec ("xen/bitmap: Consistently use unsigned bits values"), it turns out that GCC's range analysis isn't good enough to notice that 'bits / BITS_PER_LONG' is always within the unsigned range of k. As a consequence, it re-sign-extends 'k' when calculating the pointer

Re: [PATCH] libxl: Add "grant_usage" parameter for virtio disk devices

2024-02-05 Thread Anthony PERARD
On Fri, Feb 02, 2024 at 12:49:03PM +0200, Oleksandr Tyshchenko wrote: > diff --git a/tools/libs/util/libxlu_disk_l.l b/tools/libs/util/libxlu_disk_l.l > index 6d53c093a3..f37dd443bd 100644 > --- a/tools/libs/util/libxlu_disk_l.l > +++ b/tools/libs/util/libxlu_disk_l.l > @@ -220,6 +220,9 @@

Re: [PATCH v4 23/32] tools/xenstored: move all log-pipe handling into posix.c

2024-02-05 Thread Julien Grall
Hi Juergen, On 05/02/2024 14:36, Jürgen Groß wrote: On 05.02.24 15:33, Julien Grall wrote: Hi Juergen, On 05/02/2024 10:49, Juergen Gross wrote: All of the log-pipe handling is needed only when running as daemon. Move it into posix.c. This requires to have a service function in the main

Re: [PATCH v3 31/34] xen/riscv: add minimal stuff to mm.h to build full Xen

2024-02-05 Thread Oleksii
On Mon, 2024-02-05 at 15:05 +0100, Jan Beulich wrote: > On 05.02.2024 13:49, Oleksii wrote: > > On Mon, 2024-02-05 at 08:46 +0100, Jan Beulich wrote: > > > On 02.02.2024 18:30, Oleksii wrote: > > > > On Tue, 2024-01-23 at 14:03 +0100, Jan Beulich wrote: > > > > > On 22.12.2023 16:13, Oleksii

Re: [XEN PATCH v3] xen/arm: ffa: reclaim shared memory on guest destroy

2024-02-05 Thread Jens Wiklander
Hi Bertrand, On Thu, Feb 1, 2024 at 2:57 PM Bertrand Marquis wrote: > > Hi Jens, > > > On 17 Jan 2024, at 12:06, Jens Wiklander wrote: > > > > When an FF-A enabled guest is destroyed it may leave behind memory > > shared with SPs. This memory must be reclaimed before it's reused or an > > SP

Re: [PATCH v4 24/32] tools/xenstored: move all socket handling into posix.c

2024-02-05 Thread Julien Grall
Hi Juergen, On 05/02/2024 10:49, Juergen Gross wrote: All of the socket handling is needed only when running as daemon. Move it into posix.c, allowing to remove the NO_SOCKETS macro. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall Cheers, -- Julien Grall

Re: [PATCH v4 23/32] tools/xenstored: move all log-pipe handling into posix.c

2024-02-05 Thread Jürgen Groß
On 05.02.24 15:33, Julien Grall wrote: Hi Juergen, On 05/02/2024 10:49, Juergen Gross wrote: All of the log-pipe handling is needed only when running as daemon. Move it into posix.c. This requires to have a service function in the main event loop for handling the related requests and one for

Re: [PATCH] x86/cpu: Fix mixed tabs/spaces

2024-02-05 Thread Jan Beulich
On 05.02.2024 15:14, Andrew Cooper wrote: > Fixes: 660f8a75013c ("x86/CPU: convert vendor hook invocations to altcall") > Signed-off-by: Andrew Cooper Without the (or at least this very) Fixes: tag Acked-by: Jan Beulich The patch you mention didn't touch the padding at all. (It also didn't

Re: [PATCH v4 23/32] tools/xenstored: move all log-pipe handling into posix.c

2024-02-05 Thread Julien Grall
Hi Juergen, On 05/02/2024 10:49, Juergen Gross wrote: All of the log-pipe handling is needed only when running as daemon. Move it into posix.c. This requires to have a service function in the main event loop for handling the related requests and one for setting the fds[] array. Use a generic

Re: [PATCH v6 10/15] xen: add cache coloring allocator for domains

2024-02-05 Thread Jan Beulich
On 05.02.2024 15:10, Carlo Nonato wrote: > On Mon, Feb 5, 2024 at 1:38 PM Jan Beulich wrote: >> On 05.02.2024 12:59, Carlo Nonato wrote: >>> On Thu, Feb 1, 2024 at 4:53 PM Jan Beulich wrote: On 29.01.2024 18:18, Carlo Nonato wrote: > @@ -2458,7 +2626,14 @@ struct page_info

[PATCH] x86/cpu: Fix mixed tabs/spaces

2024-02-05 Thread Andrew Cooper
Fixes: 660f8a75013c ("x86/CPU: convert vendor hook invocations to altcall") Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu --- xen/arch/x86/cpu/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/cpu/common.c

Re: [PATCH v6 10/15] xen: add cache coloring allocator for domains

2024-02-05 Thread Carlo Nonato
Hi Jan, On Mon, Feb 5, 2024 at 1:38 PM Jan Beulich wrote: > > On 05.02.2024 12:59, Carlo Nonato wrote: > > On Thu, Feb 1, 2024 at 4:53 PM Jan Beulich wrote: > >> On 29.01.2024 18:18, Carlo Nonato wrote: > >>> @@ -157,7 +158,11 @@ > >>> #define PGC_static 0 > >>> #endif > >>> > >>> -#define

Re: [PATCH v3 31/34] xen/riscv: add minimal stuff to mm.h to build full Xen

2024-02-05 Thread Jan Beulich
On 05.02.2024 13:49, Oleksii wrote: > On Mon, 2024-02-05 at 08:46 +0100, Jan Beulich wrote: >> On 02.02.2024 18:30, Oleksii wrote: >>> On Tue, 2024-01-23 at 14:03 +0100, Jan Beulich wrote: On 22.12.2023 16:13, Oleksii Kurochko wrote: > +/* Convert between Xen-heap virtual addresses and

Re: [PATCH v3 8/8] consolidate do_bug_frame() / bug_fn_t

2024-02-05 Thread Jan Beulich
On 05.02.2024 14:51, Andrew Cooper wrote: > On 05/02/2024 1:32 pm, Jan Beulich wrote: >> The type not being used in do_bug_frame() is suspicious. Apparently >> that's solely because the type uses a pointer-to-const parameter, >> when so far run_in_exception_handler() wanted functions taking

[PATCH 7/7] VT-d: move {,un}map_vtd_domain_page()

2024-02-05 Thread Jan Beulich
..., thus allowing them to become static. There's nothing x86-specific about these functions anyway. Since only the "iommu_inclusive_mapping" parameter declaration would be left in the file, move that as well. There's nothing VT-d specific about it (anymore?): "dom0-iommu=map-inclusive" is

[PATCH 6/7] VT-d: move dev_invalidate_iotlb() to the sole file it's used from

2024-02-05 Thread Jan Beulich
..., thus allowing it and qinval_device_iotlb_sync() to become static. There's nothing x86-specific about the function anyway. While moving, adjust types to better match ./CODING_STYLE (albeit use of fixed-width types for parameters is retained to limit the effective change). Signed-off-by: Jan

[PATCH 5/7] VT-d: move ats_device() to the sole file it's used from

2024-02-05 Thread Jan Beulich
..., thus allowing it to become static, and thus reducing scope overlap between it and pci_ats_device(). There's nothing x86-specific about this function anyway. Signed-off-by: Jan Beulich --- a/xen/drivers/passthrough/vtd/extern.h +++ b/xen/drivers/passthrough/vtd/extern.h @@ -65,8 +65,6 @@

[PATCH 4/7] VT-d: replace find_ats_dev_drhd()

2024-02-05 Thread Jan Beulich
All callers only care about boolean outcome. For this there's no point in allocating a duplicate of the respective DRHD structure; a simple boolean suffices (which eventually may wantg to become a count, such that the "any ATS devices assigned state" can also clear again). With that boolean,

[PATCH 3/7] VT-d: respect ACPI SATC's ATC_REQUIRED flag

2024-02-05 Thread Jan Beulich
When the flag is set, permit Dom0 to control the device (no worse than what we had before and in line with other "best effort" behavior we use when it comes to Dom0), but suppress passing through to DomU-s unless ATS can actually be enabled for such devices. Signed-off-by: Jan Beulich --- Is

[PATCH 2/7] IOMMU: rename and re-type ats_enabled

2024-02-05 Thread Jan Beulich
Make the variable a tristate, with (as done elsewhere) a negative value meaning "default". Since all use sites need looking at, also rename it to match our usual "opt_*" pattern. While touching it, also move it to .data.ro_after_init. The only place it retains boolean nature is pci_ats_device(),

[PATCH 1/7] VT-d: parse ACPI "SoC Integrated Address Translation Cache Reporting Structure"s

2024-02-05 Thread Jan Beulich
This is a prereq to us, in particular, respecting the "ATC required" flag. Signed-off-by: Jan Beulich --- Should we check scope entries for appropriate types? (If so, then also for e.g. ATSR.) --- a/xen/drivers/passthrough/vtd/dmar.c +++ b/xen/drivers/passthrough/vtd/dmar.c @@ -47,6 +47,7 @@

[PATCH 0/7] VT-d: SATC handling and ATS tidying

2024-02-05 Thread Jan Beulich
On a Sapphire Rapids system I noticed a line in the serial log indicating a DMAR entry type we're not recognizing. While arranging for it to be both recognized and respected, I noticed some further potential for cleaning up. 1: VT-d: parse ACPI "SoC Integrated Address Translation Cache Reporting

Re: [PATCH v3 8/8] consolidate do_bug_frame() / bug_fn_t

2024-02-05 Thread Andrew Cooper
On 05/02/2024 1:32 pm, Jan Beulich wrote: > The type not being used in do_bug_frame() is suspicious. Apparently > that's solely because the type uses a pointer-to-const parameter, > when so far run_in_exception_handler() wanted functions taking pointer- > to-non-const. Expand use of const, in turn

Re: [PATCH v3 5/8] serial: drop serial_[rt]x_interrupt()'s regs parameter

2024-02-05 Thread Andrew Cooper
On 05/02/2024 1:30 pm, Jan Beulich wrote: > They're simply not needed anymore. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper

[PATCH v4.5 3/8] VMX: tertiary execution control infrastructure

2024-02-05 Thread Jan Beulich
This is a prereq to enabling e.g. the MSRLIST feature. Note that the PROCBASED_CTLS3 MSR is different from other VMX feature reporting MSRs, in that all 64 bits report allowed 1-settings. vVMX code is left alone, though, for the time being. Signed-off-by: Jan Beulich --- v4.5: Bump

Re: [PATCH v3 3/8] serial: drop serial_rx_fn's regs parameter

2024-02-05 Thread Andrew Cooper
On 05/02/2024 1:28 pm, Jan Beulich wrote: > It's simply not needed anymore. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper

[PATCH v3 8/8] consolidate do_bug_frame() / bug_fn_t

2024-02-05 Thread Jan Beulich
The type not being used in do_bug_frame() is suspicious. Apparently that's solely because the type uses a pointer-to-const parameter, when so far run_in_exception_handler() wanted functions taking pointer- to-non-const. Expand use of const, in turn requiring common code's do_bug_frame() as well as

[PATCH v3 7/8] x86/APIC: drop regs parameter from direct vector handler functions

2024-02-05 Thread Jan Beulich
The only place it was needed is in the spurious handler, and there we can use get_irq_regs() instead. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -1322,7 +1322,7 @@ int reprogram_timer(s_time_t timeout) return apic_tmict ||

[PATCH v3 6/8] IRQ: drop regs parameter from handler functions

2024-02-05 Thread Jan Beulich
It's simply not needed anymore. Note how Linux made this change many years ago already, in 2.6.19 (late 2006, see [1]). Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Acked-by: Julien Grall [1] https://git.kernel.org/torvalds/c/7d12e780e003f93433d49ce78cfedf4b4c52adc5 --- v2: Arm build

[PATCH v3 5/8] serial: drop serial_[rt]x_interrupt()'s regs parameter

2024-02-05 Thread Jan Beulich
They're simply not needed anymore. Signed-off-by: Jan Beulich --- v2: Setting of IRQ regs split off to an earlier patch. --- a/xen/drivers/char/cadence-uart.c +++ b/xen/drivers/char/cadence-uart.c @@ -51,7 +51,7 @@ static void cuart_interrupt(int irq, voi /* ACK. */ if (

[PATCH v3 4/8] PV-shim: drop pv_console_rx()'s regs parameter

2024-02-05 Thread Jan Beulich
It's not needed anymore. This is in preparation of dropping the register parameters from IRQ handler functions. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/guest/xen/xen.c +++ b/xen/arch/x86/guest/xen/xen.c @@ -181,7 +181,7 @@ static void cf_check

  1   2   >