Re: [PATCH v2 6/8] xen/riscv: introduce generic Xen page table handling

2024-07-22 Thread Jan Beulich
On 21.07.2024 11:02, Julien Grall wrote: > Hi, > > On 12/07/2024 17:22, Oleksii Kurochko wrote: >> At least, between Arm and RISC-V most of the code related to Xen page >> table handling are common. >> >> This GENERIC_PT code is based on Arm's arm/mmu/pt.c except some minor >> changes such as intr

Re: [linux-linus test] 186932: regressions - FAIL

2024-07-22 Thread Jan Beulich
On 22.07.2024 06:56, osstest service owner wrote: > flight 186932 linux-linus real [real] > http://logs.test-lab.xenproject.org/osstest/logs/186932/ > > Regressions :-( > > Tests which did not succeed and are blocking, > including tests which could not be run: > test-arm64-arm64-examine 8 r

Re: [PATCH v2] Mini-OS: add some macros for asm statements

2024-07-22 Thread Jan Beulich
On 19.07.2024 17:57, Juergen Gross wrote: > --- a/arch/x86/sched.c > +++ b/arch/x86/sched.c > @@ -60,16 +60,10 @@ void dump_stack(struct thread *thread) > unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE); > unsigned long *pointer = (unsigned long *)thread->sp; >

Re: [PATCH 4/4] arch/domain: Clean up the idle domain remnants in arch_domain_create()

2024-07-22 Thread Jan Beulich
On 18.07.2024 23:57, Andrew Cooper wrote: > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -791,23 +791,6 @@ int arch_domain_create(struct domain *d, > > spin_lock_init(&d->arch.e820_lock); > > -/* Minimal initialisation for the idle domain. */ > -if ( unlikely(is_i

Re: [PATCH v2] Mini-OS: add some macros for asm statements

2024-07-22 Thread Jürgen Groß
On 22.07.24 09:15, Jan Beulich wrote: On 19.07.2024 17:57, Juergen Gross wrote: --- a/arch/x86/sched.c +++ b/arch/x86/sched.c @@ -60,16 +60,10 @@ void dump_stack(struct thread *thread) unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE); unsigned long *pointer = (un

Re: [PATCH 14/17] xen: add SAF deviation for MISRA C Dir 4.10

2024-07-22 Thread Alessandro Zucchelli
On 2024-07-13 00:28, Stefano Stabellini wrote: On Wed, 3 Jul 2024, Jan Beulich wrote: public/x86: don't include common xen.h from arch-specific one No other arch-*.h does so, and arch-x86/xen.h really just takes the role of arch-x86_32.h and arch-x86_64.h (by those two forwarding there). With

Re: [PATCH 14/17] xen: add SAF deviation for MISRA C Dir 4.10

2024-07-22 Thread Jan Beulich
On 22.07.2024 10:54, Alessandro Zucchelli wrote: > On 2024-07-13 00:28, Stefano Stabellini wrote: >> On Wed, 3 Jul 2024, Jan Beulich wrote: >>> public/x86: don't include common xen.h from arch-specific one >>> >>> No other arch-*.h does so, and arch-x86/xen.h really just takes the >>> role >>> of

Re: [PATCH 1/6] tools/libxs: Fix length check in xs_talkv()

2024-07-22 Thread Jürgen Groß
On 19.07.24 23:14, Jason Andryuk wrote: On 2024-07-18 12:48, Andrew Cooper wrote: If the sum of iov element lengths overflows, the XENSTORE_PAYLOAD_MAX can pass, after which we'll write 4G of data with a good-looking length field, and the remainder of the payload will be interpreted as subsequen

Re: [PATCH v2 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Jan Beulich
On 26.06.2024 00:47, Tamas K Lengyel wrote: > This target enables integration into oss-fuzz. Changing invalid input return > to -1 as values other then 0/-1 are reserved by libfuzzer. Also adding the > missing __wrap_vsnprintf wrapper which is required for successful oss-fuzz > build. > > Signed-o

Re: [PATCH 1/6] tools/libxs: Fix length check in xs_talkv()

2024-07-22 Thread Andrew Cooper
On 22/07/2024 10:19 am, Jürgen Groß wrote: > On 19.07.24 23:14, Jason Andryuk wrote: >> On 2024-07-18 12:48, Andrew Cooper wrote: >>> If the sum of iov element lengths overflows, the >>> XENSTORE_PAYLOAD_MAX can >>> pass, after which we'll write 4G of data with a good-looking length >>> field, and

[PATCH 1/2] x86/efi: Simplify efi_arch_cpu() a little

2024-07-22 Thread Andrew Cooper
Make the "no extended leaves" case fatal and remove one level of indentation. Defer the max-leaf aquisition until it is first used. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Daniel P. Smith CC: Marek Marczykowski-Górecki CC: Alejandro Vall

[PATCH 2/2] x86/efi: Unlock NX if necessary

2024-07-22 Thread Andrew Cooper
EFI systems can run with NX disabled, as has been discovered on a Broadwell Supermicro X10SRM-TF system. Prior to commit fc3090a47b21 ("x86/boot: Clear XD_DISABLE from the early boot path"), the logic to unlock NX was common to all boot paths, but that commit moved it out of the native-EFI booth p

[PATCH 0/2] x86/efi: Fix booting when NX is disabled

2024-07-22 Thread Andrew Cooper
Bugfix from the XCP-ng forums. See patch 2 for details. Apparently the native path with NX disabled is broken too, but I've not had any time to look into that yet. Andrew Cooper (2): x86/efi: Simplify efi_arch_cpu() a little x86/efi: Unlock NX if necessary xen/arch/x86/efi/efi-boot.h | 56

[xen-unstable test] 186933: tolerable FAIL

2024-07-22 Thread osstest service owner
flight 186933 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/186933/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 186928 test-amd64-amd64-xl-qemut-win7-amd64

Re: [PATCH 2/2] x86/efi: Unlock NX if necessary

2024-07-22 Thread Jan Beulich
On 22.07.2024 12:18, Andrew Cooper wrote: > EFI systems can run with NX disabled, as has been discovered on a Broadwell > Supermicro X10SRM-TF system. > > Prior to commit fc3090a47b21 ("x86/boot: Clear XD_DISABLE from the early boot > path"), the logic to unlock NX was common to all boot paths, bu

Re: [PATCH v10 3/5] xen/riscv: introduce trap_init()

2024-07-22 Thread Jan Beulich
On 12.07.2024 18:18, Oleksii Kurochko wrote: > trap_init() wasn't declared with the __init attribute to avoid removing > __init when multi-CPU support for Xen is added. When you say "wasn't" one could easily take this as something you're correcting in the patch being described. Therefore perhaps b

Re: [PATCH v10 4/5] xen/riscv: enable GENERIC_BUG_FRAME

2024-07-22 Thread Jan Beulich
On 12.07.2024 18:18, Oleksii Kurochko wrote: > To have working BUG(), WARN(), ASSERT, run_in_exception_handler() > it is needed to enable GENERIC_BUG_FRAME. > > Also, is needed to be included for the reason that panic() and > printk() are used in common/bug.c and RISC-V fails if it is not include

Re: [PATCH v5 1/3] xen/list: add LIST_HEAD_RO_AFTER_INIT

2024-07-22 Thread Jan Beulich
On 19.07.2024 04:33, Marek Marczykowski-Górecki wrote: > Similar to LIST_HEAD_READ_MOSTLY. > > Signed-off-by: Marek Marczykowski-Górecki Acked-by: Jan Beulich

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

2024-07-22 Thread osstest service owner
flight 186935 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/186935/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64 6 xen-buildfail REGR. vs. 186913 Tests which

Re: [PATCH v2 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Tamas K Lengyel
On Mon, Jul 22, 2024 at 5:20 AM Jan Beulich wrote: > > On 26.06.2024 00:47, Tamas K Lengyel wrote: > > This target enables integration into oss-fuzz. Changing invalid input return > > to -1 as values other then 0/-1 are reserved by libfuzzer. Also adding the > > missing __wrap_vsnprintf wrapper wh

Re: [PATCH v2 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Jan Beulich
On 22.07.2024 13:03, Tamas K Lengyel wrote: > On Mon, Jul 22, 2024 at 5:20 AM Jan Beulich wrote: >> >> On 26.06.2024 00:47, Tamas K Lengyel wrote: >>> This target enables integration into oss-fuzz. Changing invalid input return >>> to -1 as values other then 0/-1 are reserved by libfuzzer. Also ad

Re: [PATCH v2 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Jan Beulich
On 22.07.2024 13:03, Tamas K Lengyel wrote: > On Mon, Jul 22, 2024 at 5:20 AM Jan Beulich wrote: >> >> On 26.06.2024 00:47, Tamas K Lengyel wrote: >>> This target enables integration into oss-fuzz. Changing invalid input return >>> to -1 as values other then 0/-1 are reserved by libfuzzer. Also ad

Re: [PATCH v10 5/5] xen/riscv: test basic exception handling stuff

2024-07-22 Thread Jan Beulich
On 12.07.2024 18:18, Oleksii Kurochko wrote: > Signed-off-by: Oleksii Kurochko > Acked-by: Alistair Francis As to the once again empty description and as to earlier comments of mine: > --- a/xen/arch/riscv/setup.c > +++ b/xen/arch/riscv/setup.c > @@ -19,6 +19,22 @@ void arch_get_xen_caps(xen_ca

[PATCH v3 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Tamas K Lengyel
This target enables integration into oss-fuzz. Changing invalid input return to -1 as values other then 0/-1 are reserved by libfuzzer. Also adding the missing __wrap_vsnprintf wrapper which is required for successful oss-fuzz build. Signed-off-by: Tamas K Lengyel --- v3: don't include libfuzzer-

[PATCH v3 2/2] Add tools/fuzz/oss-fuzz/build.sh

2024-07-22 Thread Tamas K Lengyel
The build integration script for oss-fuzz targets. Future fuzzing targets can be added to this script and those targets will be automatically picked up by oss-fuzz without having to open separate PRs on the oss-fuzz repo. Signed-off-by: Tamas K Lengyel --- v3: Add Apache-2.0 to LICENSES and use o

Re: [PATCH v2 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Tamas K Lengyel
On Mon, Jul 22, 2024 at 7:08 AM Jan Beulich wrote: > > On 22.07.2024 13:03, Tamas K Lengyel wrote: > > On Mon, Jul 22, 2024 at 5:20 AM Jan Beulich wrote: > >> > >> On 26.06.2024 00:47, Tamas K Lengyel wrote: > >>> This target enables integration into oss-fuzz. Changing invalid input > >>> return

Re: [PATCH] xen: PE/COFF image header

2024-07-22 Thread Jan Beulich
On 19.07.2024 14:31, Milan Djokic wrote: > --- /dev/null > +++ b/xen/include/efi/pe.h > @@ -0,0 +1,485 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Copyright 2011 Red Hat, Inc. > + * All rights reserved. > + * > + * Author(s): Peter Jones > + */ > +#ifndef __LINUX_PE_H > +#define

Re: [PATCH v2 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Jan Beulich
On 22.07.2024 13:29, Tamas K Lengyel wrote: > On Mon, Jul 22, 2024 at 7:08 AM Jan Beulich wrote: >> >> On 22.07.2024 13:03, Tamas K Lengyel wrote: >>> On Mon, Jul 22, 2024 at 5:20 AM Jan Beulich wrote: On 26.06.2024 00:47, Tamas K Lengyel wrote: > This target enables integration int

Re: [RFC XEN PATCH v2] x86/cpuid: Expose max_vcpus field in HVM hypervisor leaf

2024-07-22 Thread Jan Beulich
On 19.07.2024 16:21, Matthew Barnes wrote: > Currently, OVMF is hard-coded to set up a maximum of 64 vCPUs on > startup. > > There are efforts to support a maximum of 128 vCPUs, which would involve > bumping the OVMF constant from 64 to 128. > > However, it would be more future-proof for OVMF to

Re: [PATCH v2 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Tamas K Lengyel
On Mon, Jul 22, 2024 at 7:34 AM Jan Beulich wrote: > > On 22.07.2024 13:29, Tamas K Lengyel wrote: > > On Mon, Jul 22, 2024 at 7:08 AM Jan Beulich wrote: > >> > >> On 22.07.2024 13:03, Tamas K Lengyel wrote: > >>> On Mon, Jul 22, 2024 at 5:20 AM Jan Beulich wrote: > > On 26.06.2024 00:

Re: [XEN PATCH v4 10/14] x86/vmx: guard access to cpu_has_vmx_* in common code

2024-07-22 Thread Jan Beulich
On 09.07.2024 08:05, Sergiy Kibrik wrote: > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -5197,7 +5197,7 @@ int hvm_debug_op(struct vcpu *v, int32_t op) > { > case XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON: > case XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF: > -

Re: [XEN PATCH v4 11/14] x86/vpmu: guard calls to vmx/svm functions

2024-07-22 Thread Jan Beulich
On 09.07.2024 08:07, Sergiy Kibrik wrote: > @@ -363,7 +364,7 @@ static int cf_check amd_vpmu_do_wrmsr(unsigned int msr, > uint64_t msr_content) > return 0; > vpmu_set(vpmu, VPMU_RUNNING); > > -if ( is_hvm_vcpu(v) && is_msr_bitmap_on(vpmu) ) > +if ( is_svm_vc

Re: [PATCH v5 2/3] x86/mm: add API for marking only part of a MMIO page read only

2024-07-22 Thread Jan Beulich
On 19.07.2024 04:33, Marek Marczykowski-Górecki wrote: > @@ -4910,6 +4921,254 @@ long arch_memory_op(unsigned long cmd, > XEN_GUEST_HANDLE_PARAM(void) arg) > return rc; > } > > +static void __iomem *subpage_mmio_find_page(mfn_t mfn) > +{ > +struct subpage_ro_range *entry; With the fun

[PATCH 1/3] mini-os: apply coding style to arch/x86/time.c

2024-07-22 Thread Juergen Gross
Apply the preferred coding style to arch/x86/time.c. Signed-off-by: Juergen Gross --- arch/x86/time.c | 194 +++- 1 file changed, 93 insertions(+), 101 deletions(-) diff --git a/arch/x86/time.c b/arch/x86/time.c index 332c0260..a473a9e1 100644 --- a/a

[PATCH 0/3] Mini-OS: tidy up arch/x86/time.c

2024-07-22 Thread Juergen Gross
Make arch/x86/time.c coding style compliant, remove some unneeded cruft and simplify the time keeping logic. Juergen Gross (3): mini-os: apply coding style to arch/x86/time.c mini-os: remove some not needed stuff from arch/x86/time.c mini-os: simplify monotonic_clock() arch/x86/time.c | 18

[PATCH 3/3] mini-os: simplify monotonic_clock()

2024-07-22 Thread Juergen Gross
monotonic_clock() in arch/x86/time.c is more complex than needed: it has basically two nested loops making sure the time data obtained from Xen are valid. Simplify that by merging some of the used sub-functions into the main function and using only a single loop. Further simplify the code by using

[PATCH 2/3] mini-os: remove some not needed stuff from arch/x86/time.c

2024-07-22 Thread Juergen Gross
Remove unused or not needed stuff from arch/x86/time.c. Signed-off-by: Juergen Gross --- arch/x86/time.c | 16 1 file changed, 16 deletions(-) diff --git a/arch/x86/time.c b/arch/x86/time.c index a473a9e1..7fd7abef 100644 --- a/arch/x86/time.c +++ b/arch/x86/time.c @@ -48,7 +48

Re: [PATCH v3 2/2] Add tools/fuzz/oss-fuzz/build.sh

2024-07-22 Thread Jan Beulich
On 22.07.2024 13:27, Tamas K Lengyel wrote: > --- /dev/null > +++ b/LICENSES/Apache-2.0 > @@ -0,0 +1,202 @@ > + > + Apache License > + Version 2.0, January 2004 > +http://www.apache.org/licenses/ Better https:// (als

Re: [PATCH v3 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Jan Beulich
On 22.07.2024 13:27, Tamas K Lengyel wrote: > This target enables integration into oss-fuzz. Changing invalid input return > to -1 as values other then 0/-1 are reserved by libfuzzer. Also adding the > missing __wrap_vsnprintf wrapper which is required for successful oss-fuzz > build. > > Signed-o

Re: [PATCH v5 2/3] x86/mm: add API for marking only part of a MMIO page read only

2024-07-22 Thread Marek Marczykowski-Górecki
On Mon, Jul 22, 2024 at 02:09:15PM +0200, Jan Beulich wrote: > On 19.07.2024 04:33, Marek Marczykowski-Górecki wrote: > > @@ -4910,6 +4921,254 @@ long arch_memory_op(unsigned long cmd, > > XEN_GUEST_HANDLE_PARAM(void) arg) > > return rc; > > } > > > > +static void __iomem *subpage_mmio_fin

Re: [PATCH v2 4/8] xen/riscv: setup fixmap mapping

2024-07-22 Thread Jan Beulich
On 12.07.2024 18:22, Oleksii Kurochko wrote: > --- a/xen/arch/riscv/include/asm/config.h > +++ b/xen/arch/riscv/include/asm/config.h > @@ -74,11 +74,20 @@ > #error "unsupported RV_STAGE1_MODE" > #endif > > +#define XEN_SIZEMB(2) > +#define XEN_VIRT_END(XEN_VIRT_START

[PATCH] xen: Fix the figlet banner

2024-07-22 Thread Andrew Cooper
4.20 is just wide enough to cause figlet to split the banner onto two lines: __ __ \ \/ /___ _ __ \ // _ \ '_ \ / \ __/ | | | /_/\_\___|_| |_| _ _ ___ __ _ | || | |___ \ / _ \_ _ _ __ ___| |_ __ _| |__ | | ___ | || |_

Re: [PATCH v2 5/8] xen/riscv: introduce asm/pmap.h header

2024-07-22 Thread Jan Beulich
On 12.07.2024 18:22, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/arch/riscv/include/asm/pmap.h > @@ -0,0 +1,28 @@ > +#ifndef __ASM_PMAP_H__ > +#define __ASM_PMAP_H__ > + > +#include > +#include > + > +#include > + > +static inline void arch_pmap_map(unsigned int slot, mfn_t mfn) > +{ > +

Re: [PATCH v2 5/8] xen/riscv: introduce asm/pmap.h header

2024-07-22 Thread Jan Beulich
On 21.07.2024 10:51, Julien Grall wrote: > On 12/07/2024 17:22, Oleksii Kurochko wrote: >> +inline pte_t mfn_to_xen_entry(mfn_t mfn, unsigned int attr) >> +{ >> +/* there is no attr field in RISC-V's pte */ >> +(void) attr; > > Surely you have a way to say indicate whether an entry is read

Re: [PATCH v5 2/3] x86/mm: add API for marking only part of a MMIO page read only

2024-07-22 Thread Jan Beulich
On 22.07.2024 14:36, Marek Marczykowski-Górecki wrote: > On Mon, Jul 22, 2024 at 02:09:15PM +0200, Jan Beulich wrote: >> On 19.07.2024 04:33, Marek Marczykowski-Górecki wrote: >>> +int __init subpage_mmio_ro_add( >>> +paddr_t start, >>> +size_t size) >>> +{ >>> +mfn_t mfn_start = maddr_

Re: [linux-linus test] 186932: regressions - FAIL

2024-07-22 Thread Anthony PERARD
On Mon, Jul 22, 2024 at 09:05:43AM +0200, Jan Beulich wrote: > On 22.07.2024 06:56, osstest service owner wrote: > > flight 186932 linux-linus real [real] > > http://logs.test-lab.xenproject.org/osstest/logs/186932/ > > > > Regressions :-( > > > > Tests which did not succeed and are blocking, > >

Re: [PATCH] xen: Fix the figlet banner

2024-07-22 Thread Jan Beulich
On 22.07.2024 14:48, Andrew Cooper wrote: > 4.20 is just wide enough to cause figlet to split the banner onto two lines: > >__ __ >\ \/ /___ _ __ > \ // _ \ '_ \ > / \ __/ | | | >/_/\_\___|_| |_| > >_ _ ___ __ _ > | || | |_

Re: [linux-linus test] 186932: regressions - FAIL

2024-07-22 Thread Jan Beulich
On 22.07.2024 15:03, Anthony PERARD wrote: > On Mon, Jul 22, 2024 at 09:05:43AM +0200, Jan Beulich wrote: >> On 22.07.2024 06:56, osstest service owner wrote: >>> flight 186932 linux-linus real [real] >>> http://logs.test-lab.xenproject.org/osstest/logs/186932/ >>> >>> Regressions :-( >>> >>> Tests

Re: [PATCH v5 2/3] x86/mm: add API for marking only part of a MMIO page read only

2024-07-22 Thread Marek Marczykowski-Górecki
On Mon, Jul 22, 2024 at 03:01:45PM +0200, Jan Beulich wrote: > On 22.07.2024 14:36, Marek Marczykowski-Górecki wrote: > > On Mon, Jul 22, 2024 at 02:09:15PM +0200, Jan Beulich wrote: > >> On 19.07.2024 04:33, Marek Marczykowski-Górecki wrote: > >>> +int __init subpage_mmio_ro_add( > >>> +paddr_

Re: [linux-linus test] 186932: regressions - FAIL

2024-07-22 Thread Anthony PERARD
On Mon, Jul 22, 2024 at 03:06:07PM +0200, Jan Beulich wrote: > On 22.07.2024 15:03, Anthony PERARD wrote: > > On Mon, Jul 22, 2024 at 09:05:43AM +0200, Jan Beulich wrote: > >> On 22.07.2024 06:56, osstest service owner wrote: > >>> flight 186932 linux-linus real [real] > >>> http://logs.test-lab.xe

Re: [RFC PATCH 21/22] x86/AMD: fix CPUID for PerfCtr{4,5}

2024-07-22 Thread Jan Beulich
On 25.10.2023 21:29, Edwin Török wrote: > --- a/xen/arch/x86/cpu-policy.c > +++ b/xen/arch/x86/cpu-policy.c > @@ -340,9 +340,16 @@ static void recalculate_misc(struct cpu_policy *p) > p->extd.raw[0x1e] = EMPTY_LEAF; /* TopoExt APIC ID/Core/Node */ > p->extd.raw[0x1f] = EMPTY_LEAF;

Re: [PATCH v3 2/2] Add tools/fuzz/oss-fuzz/build.sh

2024-07-22 Thread Tamas K Lengyel
On Mon, Jul 22, 2024 at 8:20 AM Jan Beulich wrote: > > On 22.07.2024 13:27, Tamas K Lengyel wrote: > > --- /dev/null > > +++ b/LICENSES/Apache-2.0 > > @@ -0,0 +1,202 @@ > > + > > + Apache License > > + Version 2.0, January 2004 > > +

Re: [RFC PATCH 22/22] x86/AMD: add IRPerf support

2024-07-22 Thread Jan Beulich
On 25.10.2023 21:29, Edwin Török wrote: > --- a/xen/arch/x86/msr.c > +++ b/xen/arch/x86/msr.c > @@ -584,6 +584,13 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t > val) > } > break; > > +case MSR_K8_HWCR: > +if ( !(cp->x86_vendor & X86_VENDOR_AMD) || > +

Re: [PATCH v3 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Tamas K Lengyel
On Mon, Jul 22, 2024 at 8:24 AM Jan Beulich wrote: > > On 22.07.2024 13:27, Tamas K Lengyel wrote: > > This target enables integration into oss-fuzz. Changing invalid input return > > to -1 as values other then 0/-1 are reserved by libfuzzer. Also adding the > > missing __wrap_vsnprintf wrapper wh

Re: [PATCH v3 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Jan Beulich
On 22.07.2024 15:51, Tamas K Lengyel wrote: > On Mon, Jul 22, 2024 at 8:24 AM Jan Beulich wrote: >> >> On 22.07.2024 13:27, Tamas K Lengyel wrote: >>> This target enables integration into oss-fuzz. Changing invalid input return >>> to -1 as values other then 0/-1 are reserved by libfuzzer. Also ad

Re: [PATCH v3 2/2] Add tools/fuzz/oss-fuzz/build.sh

2024-07-22 Thread Anthony PERARD
On Mon, Jul 22, 2024 at 02:20:21PM +0200, Jan Beulich wrote: > On 22.07.2024 13:27, Tamas K Lengyel wrote: > > +# SPDX-License-Identifier: Apache-2.0 > > ... there wouldn't want to be an "-only" tag here. Yet I'm entirely uncertain > with this, as CC-BY-4.0 also has no such tag. FYI, all valid SP

Re: [PATCH v3 1/2] Add libfuzzer target to fuzz/x86_instruction_emulator

2024-07-22 Thread Tamas K Lengyel
On Mon, Jul 22, 2024 at 9:57 AM Jan Beulich wrote: > > On 22.07.2024 15:51, Tamas K Lengyel wrote: > > On Mon, Jul 22, 2024 at 8:24 AM Jan Beulich wrote: > >> > >> On 22.07.2024 13:27, Tamas K Lengyel wrote: > >>> This target enables integration into oss-fuzz. Changing invalid input > >>> return

Re: [PATCH v10 4/5] xen/riscv: enable GENERIC_BUG_FRAME

2024-07-22 Thread Oleksii
On Mon, 2024-07-22 at 13:02 +0200, Jan Beulich wrote: > On 12.07.2024 18:18, Oleksii Kurochko wrote: > > To have working BUG(), WARN(), ASSERT, run_in_exception_handler() > > it is needed to enable GENERIC_BUG_FRAME. > > > > Also, is needed to be included for the reason that > > panic() and > > p

[ovmf test] 186942: all pass - PUSHED

2024-07-22 Thread osstest service owner
flight 186942 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/186942/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 469f29fe7647c6dc8975a3c03ea7e181270d44d3 baseline version: ovmf 734aaff8625760fb5d380

Re: [PATCH v2 4/8] xen/riscv: setup fixmap mapping

2024-07-22 Thread Oleksii
Hi Julien, On Sun, 2024-07-21 at 09:46 +0100, Julien Grall wrote: > Hi Oleksii, > > On 12/07/2024 17:22, Oleksii Kurochko wrote: > > Introduce a function to set up fixmap mappings and L0 page > > table for fixmap. > > > > Additionally, defines were introduced in riscv/config.h to > > calculate t

Re: [PATCH v2 4/8] xen/riscv: setup fixmap mapping

2024-07-22 Thread Oleksii
On Mon, 2024-07-22 at 14:42 +0200, Jan Beulich wrote: > On 12.07.2024 18:22, Oleksii Kurochko wrote: > > --- a/xen/arch/riscv/include/asm/config.h > > +++ b/xen/arch/riscv/include/asm/config.h > > @@ -74,11 +74,20 @@ > >  #error "unsupported RV_STAGE1_MODE" > >  #endif > >   > > +#define XEN_SIZE  

Re: [PATCH v2 5/8] xen/riscv: introduce asm/pmap.h header

2024-07-22 Thread Oleksii
Hi Julien, On Sun, 2024-07-21 at 09:51 +0100, Julien Grall wrote: > Hi Oleksii, > > On 12/07/2024 17:22, Oleksii Kurochko wrote: > > Introduces arch_pmap_{un}map functions and select HAS_PMAP > > for CONFIG_RISCV. > > > > Additionaly it was necessary to introduce functions: > >   - mfn_to_xen_en

Re: [PATCH v2 4/8] xen/riscv: setup fixmap mapping

2024-07-22 Thread Julien Grall
On 22/07/2024 15:31, Oleksii wrote: Hi Julien, Hi Oleksii, On Sun, 2024-07-21 at 09:46 +0100, Julien Grall wrote: Hi Oleksii, On 12/07/2024 17:22, Oleksii Kurochko wrote: Introduce a function to set up fixmap mappings and L0 page table for fixmap. Additionally, defines were introduced

Re: [PATCH v2 5/8] xen/riscv: introduce asm/pmap.h header

2024-07-22 Thread Julien Grall
Hi, On 22/07/2024 15:44, Oleksii Kurochko wrote: On Mon, 2024-07-22 at 14:54 +0200, Jan Beulich wrote: On 12.07.2024 18:22, Oleksii Kurochko wrote: --- /dev/null +++ b/xen/arch/riscv/include/asm/pmap.h @@ -0,0 +1,28 @@ +#ifndef __ASM_PMAP_H__ +#define __ASM_PMAP_H__ + +#include +#include + +

Re: [PATCH v2 6/8] xen/riscv: introduce generic Xen page table handling

2024-07-22 Thread Oleksii
Hi Julien, On Sun, 2024-07-21 at 10:02 +0100, Julien Grall wrote: > Hi, > > On 12/07/2024 17:22, Oleksii Kurochko wrote: > > At least, between Arm and RISC-V most of the code related to Xen > > page > > table handling are common. > > > > This GENERIC_PT code is based on Arm's arm/mmu/pt.c except

Re: [PATCH v2 5/8] xen/riscv: introduce asm/pmap.h header

2024-07-22 Thread Oleksii Kurochko
On Mon, 2024-07-22 at 14:54 +0200, Jan Beulich wrote: > On 12.07.2024 18:22, Oleksii Kurochko wrote: > > --- /dev/null > > +++ b/xen/arch/riscv/include/asm/pmap.h > > @@ -0,0 +1,28 @@ > > +#ifndef __ASM_PMAP_H__ > > +#define __ASM_PMAP_H__ > > + > > +#include > > +#include > > + > > +#include >

Re: [PATCH v2 5/8] xen/riscv: introduce asm/pmap.h header

2024-07-22 Thread Julien Grall
On 22/07/2024 13:58, Jan Beulich wrote: On 21.07.2024 10:51, Julien Grall wrote: On 12/07/2024 17:22, Oleksii Kurochko wrote: +inline pte_t mfn_to_xen_entry(mfn_t mfn, unsigned int attr) +{ +/* there is no attr field in RISC-V's pte */ +(void) attr; Surely you have a way to say ind

[PATCH 1/4] mini-os: make mm.c coding style compliant

2024-07-22 Thread Juergen Gross
Apply the coding style to mm.c. No functional change. Signed-off-by: Juergen Gross --- mm.c | 191 ++- 1 file changed, 96 insertions(+), 95 deletions(-) diff --git a/mm.c b/mm.c index eb0e34de..1dcd954c 100644 --- a/mm.c +++ b/mm.c @@ -1,

[PATCH 0/4] mini-os: cleanup of mm.c

2024-07-22 Thread Juergen Gross
Some cleanups in mm.c: style, removal of unused stuff, optimizations. Juergen Gross (4): mini-os: make mm.c coding style compliant mini-os: mm: remove not needed struct chunk_tail_st mini-os: mm: reduce buddy allocator list administration data mini-os: remove sanity_check() include/lib.h

[PATCH 3/4] mini-os: mm: reduce buddy allocator list administration data

2024-07-22 Thread Juergen Gross
Today the administration data for the buddy allocator's lists consists of 2 arrays: one pointer array and one list element array for easier handling of the lists' tails. Those arrays can be combined into one by dropping the pointer array and using a different list end indicator. Add enqueue and d

[PATCH 2/4] mini-os: mm: remove not needed struct chunk_tail_st

2024-07-22 Thread Juergen Gross
The struct chunk_tail_st isn't really used other than writing to it. Remove it in order to simplify the code. Signed-off-by: Juergen Gross --- mm.c | 20 1 file changed, 20 deletions(-) diff --git a/mm.c b/mm.c index 1dcd954c..2cc49e94 100644 --- a/mm.c +++ b/mm.c @@ -123,

[PATCH 4/4] mini-os: remove sanity_check()

2024-07-22 Thread Juergen Gross
Remove the sanity_check() function, as it is used nowhere. Since any application linked with Mini-OS can't call sanity_check() either (there is no EXPORT_SYMBOL for it), there is zero chance of breaking any use case. Signed-off-by: Juergen Gross --- include/lib.h | 3 --- mm.c | 16 --

[PATCH] mini-os: mm: don't have two large arrays of the same kind

2024-07-22 Thread Juergen Gross
In the CONFIG_PARAVIRT case there are two identical static arrays of more than 8kB size with function scope. As the two functions never nest, a single array of file scope can replace the two existing instances. Signed-off-by: Juergen Gross --- arch/x86/mm.c | 6 -- 1 file changed, 4 insertio

Re: [PATCH v2 4/8] xen/riscv: setup fixmap mapping

2024-07-22 Thread Jan Beulich
On 22.07.2024 16:36, Oleksii wrote: > On Mon, 2024-07-22 at 14:42 +0200, Jan Beulich wrote: >> On 12.07.2024 18:22, Oleksii Kurochko wrote: >>> --- a/xen/arch/riscv/include/asm/config.h >>> +++ b/xen/arch/riscv/include/asm/config.h >>> @@ -74,11 +74,20 @@ >>>  #error "unsupported RV_STAGE1_MODE" >>

Re: [PATCH v10 4/5] xen/riscv: enable GENERIC_BUG_FRAME

2024-07-22 Thread Jan Beulich
On 22.07.2024 16:09, Oleksii wrote: > On Mon, 2024-07-22 at 13:02 +0200, Jan Beulich wrote: >> On 12.07.2024 18:18, Oleksii Kurochko wrote: >>> --- >>> Changes in V10: >>>  - put 'select GENERIC_BUG_FRAME' in "Config RISCV". >>>  - rework do_trap() to not fetch an instruction in case when the >>> c

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

2024-07-22 Thread osstest service owner
flight 186940 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/186940/ 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 1

[PATCH v1.1 5/6] tools/libxs: Use writev()/sendmsg() instead of write()

2024-07-22 Thread Andrew Cooper
With the input data now conveniently arranged, use writev()/sendmsg() instead of decomposing it into write() calls. This causes all requests to be submitted with a single system call, rather than at least two. While in principle short writes can occur, the chances of it happening are slim given t

Re: [PATCH v10 4/5] xen/riscv: enable GENERIC_BUG_FRAME

2024-07-22 Thread oleksii . kurochko
On Mon, 2024-07-22 at 17:32 +0200, Jan Beulich wrote: > On 22.07.2024 16:09, Oleksii wrote: > > On Mon, 2024-07-22 at 13:02 +0200, Jan Beulich wrote: > > > On 12.07.2024 18:18, Oleksii Kurochko wrote: > > > > --- > > > > Changes in V10: > > > >  - put 'select GENERIC_BUG_FRAME' in "Config RISCV". >

Re: [PATCH 2/2] x86/efi: Unlock NX if necessary

2024-07-22 Thread Andrew Cooper
On 22/07/2024 11:43 am, Jan Beulich wrote: > On 22.07.2024 12:18, Andrew Cooper wrote: >> EFI systems can run with NX disabled, as has been discovered on a Broadwell >> Supermicro X10SRM-TF system. >> >> Prior to commit fc3090a47b21 ("x86/boot: Clear XD_DISABLE from the early boot >> path"), the lo

Re: [PATCH v2 4/8] xen/riscv: setup fixmap mapping

2024-07-22 Thread oleksii . kurochko
On Mon, 2024-07-22 at 17:25 +0200, Jan Beulich wrote: > On 22.07.2024 16:36, Oleksii wrote: > > On Mon, 2024-07-22 at 14:42 +0200, Jan Beulich wrote: > > > On 12.07.2024 18:22, Oleksii Kurochko wrote: > > > > --- a/xen/arch/riscv/include/asm/config.h > > > > +++ b/xen/arch/riscv/include/asm/config.

Re: [PATCH v2 5/8] xen/riscv: introduce asm/pmap.h header

2024-07-22 Thread Oleksii Kurochko
On Mon, 2024-07-22 at 15:48 +0100, Julien Grall wrote: > Hi, > > On 22/07/2024 15:44, Oleksii Kurochko wrote: > > On Mon, 2024-07-22 at 14:54 +0200, Jan Beulich wrote: > > > On 12.07.2024 18:22, Oleksii Kurochko wrote: > > > > --- /dev/null > > > > +++ b/xen/arch/riscv/include/asm/pmap.h > > > > @

Re: [PATCH] CI: workaround broken selinux+docker interaction in yocto

2024-07-22 Thread Andrew Cooper
On 20/07/2024 1:15 am, Marek Marczykowski-Górecki wrote: > `cp --preserve=xattr` doesn't work in docker when SELinux is enabled. It > tries to set the "security.selinux" xattr, but SELinux (or overlay fs?) > denies it. > Workaround it by skipping selinux.selinux xattr copying. > > Signed-off-by: Ma

Re: [PATCH v2 5/8] xen/riscv: introduce asm/pmap.h header

2024-07-22 Thread Julien Grall
Hi, On 22/07/2024 18:09, Oleksii Kurochko wrote: On Mon, 2024-07-22 at 15:48 +0100, Julien Grall wrote: Hi, On 22/07/2024 15:44, Oleksii Kurochko wrote: On Mon, 2024-07-22 at 14:54 +0200, Jan Beulich wrote: On 12.07.2024 18:22, Oleksii Kurochko wrote: --- /dev/null +++ b/xen/arch/riscv/incl

Re: [PATCH 2/2] x86/efi: Unlock NX if necessary

2024-07-22 Thread Andrew Cooper
On 22/07/2024 6:04 pm, Andrew Cooper wrote: > On 22/07/2024 11:43 am, Jan Beulich wrote: >> On 22.07.2024 12:18, Andrew Cooper wrote: >>> --- a/xen/arch/x86/efi/efi-boot.h >>> +++ b/xen/arch/x86/efi/efi-boot.h >>> @@ -736,13 +736,33 @@ static void __init efi_arch_handle_module(const >>> struct fil

Re: [PATCH] CI: workaround broken selinux+docker interaction in yocto

2024-07-22 Thread Marek Marczykowski-Górecki
On Mon, Jul 22, 2024 at 06:16:51PM +0100, Andrew Cooper wrote: > On 20/07/2024 1:15 am, Marek Marczykowski-Górecki wrote: > > `cp --preserve=xattr` doesn't work in docker when SELinux is enabled. It > > tries to set the "security.selinux" xattr, but SELinux (or overlay fs?) > > denies it. > > Worka

Re: [PATCH 4/4] arch/domain: Clean up the idle domain remnants in arch_domain_create()

2024-07-22 Thread Andrew Cooper
On 22/07/2024 8:23 am, Jan Beulich wrote: > On 18.07.2024 23:57, Andrew Cooper wrote: >> --- a/xen/arch/x86/domain.c >> +++ b/xen/arch/x86/domain.c >> @@ -791,23 +791,6 @@ int arch_domain_create(struct domain *d, >> >> spin_lock_init(&d->arch.e820_lock); >> >> -/* Minimal initialisatio

[linux-linus test] 186934: regressions - FAIL

2024-07-22 Thread osstest service owner
flight 186934 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/186934/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-dom0pvh-xl-intel 8 xen-bootfail REGR. vs. 186827 test-amd64-amd64-do

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

2024-07-22 Thread osstest service owner
flight 186951 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/186951/ 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 1

Re: [PATCH] mini-os: mm: don't have two large arrays of the same kind

2024-07-22 Thread Samuel Thibault
Juergen Gross, le lun. 22 juil. 2024 17:08:43 +0200, a ecrit: > In the CONFIG_PARAVIRT case there are two identical static arrays of > more than 8kB size with function scope. As the two functions never > nest, a single array of file scope can replace the two existing > instances. > > Signed-off-by

Re: [XEN PATCH v9 3/5] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0

2024-07-22 Thread Stefano Stabellini
On Fri, 7 Jun 2024, Jiqian Chen wrote: > On PVH dom0, the gsis don't get registered, but > the gsi of a passthrough device must be configured for it to > be able to be mapped into a hvm domU. > On Linux kernel side, it calles PHYSDEVOP_setup_gsi for > passthrough devices to register gsi when dom0 i

Re: [PATCH 1/4] mini-os: make mm.c coding style compliant

2024-07-22 Thread Samuel Thibault
Juergen Gross, le lun. 22 juil. 2024 17:01:38 +0200, a ecrit: > @@ -63,8 +63,8 @@ unsigned long nr_free_pages; > > /* > * Hint regarding bitwise arithmetic in map_{alloc,free}: > - * -(1<= n. > - * (1< + * -(1 << n) sets all bits >= n. > + * (1 << n) - 1 sets all bits < n. Please keep

Re: [PATCH 2/4] mini-os: mm: remove not needed struct chunk_tail_st

2024-07-22 Thread Samuel Thibault
Juergen Gross, le lun. 22 juil. 2024 17:01:39 +0200, a ecrit: > The struct chunk_tail_st isn't really used other than writing to it. > > Remove it in order to simplify the code. > > Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault > --- > mm.c | 20 > 1 file cha

Re: [RFC KERNEL PATCH v8 3/3] xen/privcmd: Add new syscall to get gsi from dev

2024-07-22 Thread Stefano Stabellini
On Fri, 7 Jun 2024, Jiqian Chen wrote: > In PVH dom0, it uses the linux local interrupt mechanism, > when it allocs irq for a gsi, it is dynamic, and follow > the principle of applying first, distributing first. And > the irq number is alloced from small to large, but the > applying gsi number is n

Re: [PATCH 3/4] mini-os: mm: reduce buddy allocator list administration data

2024-07-22 Thread Samuel Thibault
Juergen Gross, le lun. 22 juil. 2024 17:01:40 +0200, a ecrit: > Today the administration data for the buddy allocator's lists consists > of 2 arrays: one pointer array and one list element array for easier > handling of the lists' tails. > > Those arrays can be combined into one by dropping the po

Re: [PATCH 4/4] mini-os: remove sanity_check()

2024-07-22 Thread Samuel Thibault
Juergen Gross, le lun. 22 juil. 2024 17:01:41 +0200, a ecrit: > Remove the sanity_check() function, as it is used nowhere. > > Since any application linked with Mini-OS can't call sanity_check() > either (there is no EXPORT_SYMBOL for it), there is zero chance of > breaking any use case. Don't we

Re: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH

2024-07-22 Thread Stefano Stabellini
On Mon, 8 Jul 2024, Jiqian Chen wrote: > If run Xen with PVH dom0 and hvm domU, hvm will map a pirq for > a passthrough device by using gsi, see qemu code > xen_pt_realize->xc_physdev_map_pirq and libxl code > pci_add_dm_done->xc_physdev_map_pirq. Then xc_physdev_map_pirq > will call into Xen, but

Re: [XEN PATCH v12 3/7] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0

2024-07-22 Thread Stefano Stabellini
On Mon, 8 Jul 2024, Jiqian Chen wrote: > The gsi of a passthrough device must be configured for it to be > able to be mapped into a hvm domU. > But When dom0 is PVH, the gsis may not get registered(see below > clarification), it causes the info of apic, pin and irq not be > added into irq_2_pin lis

Re: [PATCH 1/3] mini-os: apply coding style to arch/x86/time.c

2024-07-22 Thread Samuel Thibault
Juergen Gross, le lun. 22 juil. 2024 14:16:41 +0200, a ecrit: > Apply the preferred coding style to arch/x86/time.c. > > Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault > --- > arch/x86/time.c | 194 +++- > 1 file changed, 93 insertions(+)

Re: [PATCH 2/3] mini-os: remove some not needed stuff from arch/x86/time.c

2024-07-22 Thread Samuel Thibault
Juergen Gross, le lun. 22 juil. 2024 14:16:42 +0200, a ecrit: > Remove unused or not needed stuff from arch/x86/time.c. > > Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault > --- > arch/x86/time.c | 16 > 1 file changed, 16 deletions(-) > > diff --git a/arch/x86/tim

Re: [PATCH 3/3] mini-os: simplify monotonic_clock()

2024-07-22 Thread Samuel Thibault
Juergen Gross, le lun. 22 juil. 2024 14:16:43 +0200, a ecrit: > monotonic_clock() in arch/x86/time.c is more complex than needed: it > has basically two nested loops making sure the time data obtained from > Xen are valid. > > Simplify that by merging some of the used sub-functions into the main >

  1   2   >