Re: [PATCH v8 12/13] xen/arm: translate virtual PCI bus topology for guests

2023-07-19 Thread Jan Beulich
On 20.07.2023 02:32, Volodymyr Babchuk wrote: > --- a/xen/drivers/vpci/vpci.c > +++ b/xen/drivers/vpci/vpci.c > @@ -177,6 +177,30 @@ static int add_virtual_device(struct pci_dev *pdev) > return 0; > } > > +/* > + * Find the physical device which is mapped to the virtual device > + * and tra

Re: [PATCH v4 0/8] Allow dynamic allocation of software IO TLB bounce buffers

2023-07-19 Thread Christoph Hellwig
Just to add a highlevel comment here after I feel like I need a little more time to review the guts. I'm still pretty concerned about the extra list that needs to be consulted in is_swiotlb_buffer, but I can't really think of anything better. Maybe an xarray has better cache characteristics, but

Re: [PATCH v8 11/13] vpci: add initial support for virtual PCI bus topology

2023-07-19 Thread Jan Beulich
On 20.07.2023 02:32, Volodymyr Babchuk wrote: > --- a/xen/drivers/vpci/vpci.c > +++ b/xen/drivers/vpci/vpci.c > @@ -46,6 +46,16 @@ void vpci_remove_device(struct pci_dev *pdev) > return; > > spin_lock(&pdev->vpci->lock); > + > +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT > +if ( pdev->

[qemu-mainline test] 181901: regressions - FAIL

2023-07-19 Thread osstest service owner
flight 181901 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/181901/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-libvirt-pair 10 xen-install/src_host fail REGR. vs. 180691 test-amd64-i386-l

Re: [PATCH v4 8/8] swiotlb: search the software IO TLB only if a device makes use of it

2023-07-19 Thread Christoph Hellwig
Any reason this can't just do a list_empty_careful on the list instead of adding yet another field that grows struct device?

Re: [PATCH v4 2/8] swiotlb: add documentation and rename swiotlb_do_find_slots()

2023-07-19 Thread Christoph Hellwig
On Thu, Jul 13, 2023 at 05:23:13PM +0200, Petr Tesarik wrote: > From: Petr Tesarik > > Add some kernel-doc comments and move the existing documentation of struct > io_tlb_slot to its correct location. The latter was forgotten in commit > 942a8186eb445 ("swiotlb: move struct io_tlb_slot to swiotlb

Re: [PATCH v4 1/8] swiotlb: make io_tlb_default_mem local to swiotlb.c

2023-07-19 Thread Christoph Hellwig
On Thu, Jul 13, 2023 at 05:23:12PM +0200, Petr Tesarik wrote: > From: Petr Tesarik > > SWIOTLB implementation details should not be exposed to the rest of the > kernel. This will allow to make changes to the implementation without > modifying non-swiotlb code. > > To avoid breaking existing user

Re: [PATCH v2 2/5] x86/ioapic: RTE modifications must use ioapic_write_entry

2023-07-19 Thread Jan Beulich
On 19.07.2023 17:20, Roger Pau Monné wrote: > On Tue, Jul 18, 2023 at 05:40:18PM +0200, Jan Beulich wrote: >> On 18.07.2023 14:43, Roger Pau Monne wrote: >>> --- a/xen/arch/x86/io_apic.c >>> +++ b/xen/arch/x86/io_apic.c >>> @@ -269,15 +269,15 @@ void __ioapic_write_entry( >>> { >>> union entr

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Jan Beulich
On 19.07.2023 18:35, Oleksii wrote: > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: >>> +    unsigned long load_end = LINK_TO_LOAD(_end); >>> +    unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i - >>> 1); >>> +    unsigned long xen_size = ROUNDUP(load_end - >>> loa

[ovmf test] 181916: all pass - PUSHED

2023-07-19 Thread osstest service owner
flight 181916 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/181916/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 6510dcf6f71adbe282bff0ba2b236f1d074f819f baseline version: ovmf a52044a9e602bc168cdf5

[libvirt test] 181890: tolerable FAIL - PUSHED

2023-07-19 Thread osstest service owner
flight 181890 libvirt real [real] flight 181915 libvirt real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/181890/ http://logs.test-lab.xenproject.org/osstest/logs/181915/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-amd64-li

Re: [PATCH LINUX v5 2/2] xen: add support for initializing xenstore later as HVM domain

2023-07-19 Thread Stefano Stabellini
On Wed, 19 Jul 2023, Petr Mladek wrote: > On Fri 2022-05-13 14:19:38, Stefano Stabellini wrote: > > From: Luca Miccio > > > > When running as dom0less guest (HVM domain on ARM) the xenstore event > > channel is available at domain creation but the shared xenstore > > interface page only becomes a

Re: [PATCH 2/2] xen/misra: diff-report.py: fix function invocation

2023-07-19 Thread Stefano Stabellini
On Tue, 18 Jul 2023, Luca Fancellu wrote: > Fix the invocation of invoke_command() that takes an optional > parameter for the exception type, but in the code the error > message template was passed instead, so fix it passing a new > exception type. > > Fixes: 1d7c45f895b6 ("xen/misra: diff-report.

Re: [PATCH 1/2] xen/misra: diff-report.py: Fix UnifiedFormatParser change line registration

2023-07-19 Thread Stefano Stabellini
On Tue, 18 Jul 2023, Luca Fancellu wrote: > Fix the line number on the registration of a 'remove' change type when > consecutive 'remove' changes are registered. > > Currently the algorithm registers consecutive 'remove' changes at the same > line it encounter the first one, 'add' changes type are

Re: [PATCH v8 00/13] PCI devices passthrough on Arm, part 3

2023-07-19 Thread Volodymyr Babchuk
Volodymyr Babchuk writes: Hello again, Looks like I messed up with add_maintainers script and sent this series without proper CCs. So I am CCing all interested persons only in this cover letter only. Sorry for the noise. > Hello, > > This is next version of vPCI rework. Aim of this series is

Re: [XEN PATCH v2] x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3

2023-07-19 Thread Stefano Stabellini
On Wed, 19 Jul 2023, Federico Serafini wrote: > Give a name to unnamed parameters thus addressing violations of > MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with > named parameters"). > Keep consistency between parameter names and types used in function > declarations and the

[PATCH v8 07/13] vpci/header: handle p2m range sets per BAR

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko Instead of handling a single range set, that contains all the memory regions of all the BARs and ROM, have them per BAR. As the range sets are now created when a PCI device is added and destroyed when it is removed so make them named and accounted. Note that rangese

[PATCH v8 12/13] xen/arm: translate virtual PCI bus topology for guests

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko There are three originators for the PCI configuration space access: 1. The domain that owns physical host bridge: MMIO handlers are there so we can update vPCI register handlers with the values written by the hardware domain, e.g. physical view of the registers vs g

[PATCH v8 13/13] xen/arm: account IO handlers for emulated PCI MSI-X

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko At the moment, we always allocate an extra 16 slots for IO handlers (see MAX_IO_HANDLER). So while adding IO trap handlers for the emulated MSI-X registers we need to explicitly tell that we have additional IO handlers, so those are accounted. Signed-off-by: Oleksan

[PATCH v8 08/13] vpci/header: program p2m with guest BAR view

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko Take into account guest's BAR view and program its p2m accordingly: gfn is guest's view of the BAR and mfn is the physical BAR value as set up by the PCI bus driver in the hardware domain. This way hardware domain sees physical BAR values and guest sees emulated ones

[PATCH v8 03/13] vpci: restrict unhandled read/write operations for guests

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko A guest would be able to read and write those registers which are not emulated and have no respective vPCI handlers, so it will be possible for it to access the hardware directly. In order to prevent a guest from reads and writes from/to the unhandled registers make

[PATCH v8 10/13] vpci/header: reset the command register when adding devices

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko Reset the command register when assigning a PCI device to a guest: according to the PCI spec the PCI_COMMAND register is typically all 0's after reset, but this might not be true for the guest as it needs to respect host's settings. For that reason, do not write 0 to

[PATCH v8 11/13] vpci: add initial support for virtual PCI bus topology

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko Assign SBDF to the PCI devices being passed through with bus 0. The resulting topology is where PCIe devices reside on the bus 0 of the root complex itself (embedded endpoints). This implementation is limited to 32 devices which are allowed on a single PCI bus. Plea

[PATCH v8 09/13] vpci/header: emulate PCI_COMMAND register for guests

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko Xen and/or Dom0 may have put values in PCI_COMMAND which they expect to remain unaltered. PCI_COMMAND_SERR bit is a good example: while the guest's view of this will want to be zero initially, the host having set it to 1 may not easily be overwritten with 0, or else

[PATCH v8 05/13] vpci/header: implement guest BAR register handlers

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko Add relevant vpci register handlers when assigning PCI device to a domain and remove those when de-assigning. This allows having different handlers for different domains, e.g. hwdom and other guests. Emulate guest BAR register values: this allows creating a guest vi

[PATCH v8 04/13] vpci: add hooks for PCI device assign/de-assign

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko When a PCI device gets assigned/de-assigned some work on vPCI side needs to be done for that device. Introduce a pair of hooks so vPCI can handle that. Signed-off-by: Oleksandr Andrushchenko --- Since v8: - removed vpci_deassign_device Since v6: - do not pass struc

[PATCH v8 02/13] vpci: use per-domain PCI lock to protect vpci structure

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko Use a previously introduced per-domain read/write lock to check whether vpci is present, so we are sure there are no accesses to the contents of the vpci struct if not. This lock can be used (and in a few cases is used right away) so that vpci removal can be performe

[PATCH v8 01/13] pci: introduce per-domain PCI rwlock

2023-07-19 Thread Volodymyr Babchuk
Add per-domain d->pci_lock that protects access to d->pdev_list. Purpose of this lock is to give guarantees to VPCI code that underlying pdev will not disappear under feet. This is a rw-lock, but this patch adds only write_lock()s. There will be read_lock() users in the next patches. This lock sho

[PATCH v8 06/13] rangeset: add RANGESETF_no_print flag

2023-07-19 Thread Volodymyr Babchuk
From: Oleksandr Andrushchenko There are range sets which should not be printed, so introduce a flag which allows marking those as such. Implement relevant logic to skip such entries while printing. While at it also simplify the definition of the flags by directly defining those without helpers.

[PATCH v8 00/13] PCI devices passthrough on Arm, part 3

2023-07-19 Thread Volodymyr Babchuk
Hello, This is next version of vPCI rework. Aim of this series is to prepare ground for introducing PCI support on ARM platform. The biggest change from previous, mistakenly named, v7 series is how locking is implemented. Instead of d->vpci_rwlock we introduce d->pci_lock which has broader scope,

Re: [XEN PATCH] xen: address MISRA C:2012 Rule 4.1

2023-07-19 Thread Stefano Stabellini
On Wed, 19 Jul 2023, Nicola Vetrini wrote: > MISRA C:2012 Rule 4.1 has the following headline: > "Octal and hexadecimal escape sequences shall be terminated." > > The string literals modified by this patch contain octal or > hexadecimal escape sequences that are neither terminated by the > end of

Re: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static evtchn

2023-07-19 Thread Stefano Stabellini
On Tue, 18 Jul 2023, Oleksandr Tyshchenko wrote: > On 18.07.23 14:31, Rahul Singh wrote: > > > Hello Rahul > > > > Xen 4.17 supports the creation of static evtchns. To allow user space > > application to bind static evtchns introduce new ioctl > > "IOCTL_EVTCHN_BIND_STATIC". Existing IOCTL doin

Re: [XEN PATCH] x86: change parameter name of hvm_monitor_msr() declaration

2023-07-19 Thread Stefano Stabellini
On Tue, 18 Jul 2023, Federico Serafini wrote: > Change the parameter name of hvm_monitor_msr() declaration from > 'value' to 'new_value' to match the corresponding defintion. > This fixes a violation of MISRA C:2012 Rule 8.3 ("All declarations of > an object or function shall use the same names and

[qemu-upstream-4.17-testing test] 181889: regressions - trouble: fail/pass/starved

2023-07-19 Thread osstest service owner
flight 181889 qemu-upstream-4.17-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/181889/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-pvops 6 kernel-build fail in 181841 REGR. vs. 175008 Test

Re: [XEN PATCH] docs/misc: fix document typo

2023-07-19 Thread Stefano Stabellini
On Tue, 18 Jul 2023, yang...@mediatek.com wrote: > From: Yang Xu > > Fix document typo for more accurate meaning > > Signed-off-by: Yang Xu Reviewed-by: Stefano Stabellini > --- > docs/misc/xen-makefiles/makefiles.rst | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: Experiments with clang-format and exclude-list.json

2023-07-19 Thread Stefano Stabellini
On Tue, 18 Jul 2023, Jan Beulich wrote: > On 18.07.2023 11:13, Luca Fancellu wrote: > > I’ve done some experiment with clang-format and the hypervisor code > > (xen/xen/**), I had the need to exclude some files from the tool > > and I thought to use the exclude-list.json, but since it was intended

Re: [PATCH 4/7] tools/utils: introduce xlu_cfg_printf() function

2023-07-19 Thread Elliott Mitchell
On Thu, Jul 13, 2023 at 07:01:19PM -0700, Elliott Mitchell wrote: > > diff --git a/tools/libs/util/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c > index 874f5abfb9..b2947cbfc9 100644 > --- a/tools/libs/util/libxlu_cfg.c > +++ b/tools/libs/util/libxlu_cfg.c > @@ -18,12 +18,19 @@ > #include "libxlu_c

[linux-linus test] 181888: regressions - FAIL

2023-07-19 Thread osstest service owner
flight 181888 linux-linus real [real] flight 181908 linux-linus real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/181888/ http://logs.test-lab.xenproject.org/osstest/logs/181908/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run

[ovmf test] 181907: all pass - PUSHED

2023-07-19 Thread osstest service owner
flight 181907 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/181907/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf a52044a9e602bc168cdf5d73a48952bfc9edb521 baseline version: ovmf 08aacbf0560d98929d402

[PATCH 7/7] tools/utils: move remaining lower-layer data from libxlu_internal.h

2023-07-19 Thread Elliott Mitchell
Correcting the order of #includes and data type declarations allows the remaining lower-layer structures to move to libxlu_cfg_i.h. Now libxlu_internal.h is purely generalized routines meant to be shared between all layers. Signed-off-by: Elliott Mitchell --- tools/libs/util/libxlu_cfg.c |

[PATCH 3/7] tools/utils: move XLU_Operation to libxlu_cfg_i.h.h

2023-07-19 Thread Elliott Mitchell
This enumerated value is never used outside of the lowest layer of the configuration parser. As such, move to the internal header. Fixes: a30910bfd7 ("libxlu: Handle += in config files") Signed-off-by: Elliott Mitchell --- I'm unsure whether this is fixing a30910bfd7. Placing XLU_Operation in l

[PATCH 4/7] tools/utils: introduce xlu_cfg_printf() function

2023-07-19 Thread Elliott Mitchell
Isolate the lower layer configuration handling from the upper layer. Now only the lowest layer of configuration handling looks inside XLU_Config. Also make error messages a bit more consistent. Now PCI device parsing will report filename. Signed-off-by: Elliott Mitchell --- Someone else can de

[PATCH 6/7] tools/utils: remove libxlu_cfg_i.h from libxlu_disk.c

2023-07-19 Thread Elliott Mitchell
The upper layer disk string parser doesn't need the internals of the lower layer file parser. Split the layers apart. This is viable due to the lower-layer internals having been removed from libxlu_internals.h. Signed-off-by: Elliott Mitchell --- tools/libs/util/libxlu_disk.c | 1 - 1 file cha

[PATCH 5/7] tools/utils: move XLU_ConfigSetting & xlu__cfg_set_free() to libxl_cfg.c

2023-07-19 Thread Elliott Mitchell
XLU_ConfigSetting is only used inside libxl_cfg.c, so no need for it in the internal header. Similarly, xlu__cfg_set_free() is no longer used outside libxl_cfg.c, so remove from header and redeclare static. Signed-off-by: Elliott Mitchell --- tools/libs/util/libxlu_cfg.c | 10 +- t

[PATCH 2/7] tools/utils: rename "n" arguments to "key"

2023-07-19 Thread Elliott Mitchell
Hopefully make it clearer to others this is the key associated with the storage value to retrieve. Signed-off-by: Elliott Mitchell --- tools/include/libxlutil.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/include/libxlutil.h b/tools/include/libxlutil.

[PATCH 1/7] tools/utils: cleanup formatting of libxlutil.h

2023-07-19 Thread Elliott Mitchell
Some arguments included a name, but not all did. Now use "cfg" for all uses of XLU_Config * and "list" for uses of XLU_ConfigList *. Also fix some spaces missing from xlu_cfg_get_defbool()'s prototype. Rename the "b" argument of xlu_cfg_get_defbool() to "value_r". Similar to other functions thi

[PATCH 0/7] Reducing visibility and cleanup of .cfg parsing symbols

2023-07-19 Thread Elliott Mitchell
These patches started as an effort to try to isolate the layers of the domain configuration file parsing. Theory being it might be possible to replace the lowest layer with something better. I noticed libxlutil.h isn't very consistent. Some functions were naming the configuration argument "cfg"

Re: [PATCH] docs/xen-tscmode: remove mention of numeric tsc_mode= values

2023-07-19 Thread Elliott Mitchell
On Wed, Jul 19, 2023 at 08:24:15AM +0200, Jan Beulich wrote: > On 18.07.2023 22:58, Elliott Mitchell wrote: > > On Fri, Jul 14, 2023 at 09:21:59AM +0200, Jan Beulich wrote: > >> On 14.07.2023 05:44, Elliott Mitchell wrote: > >>> On Fri, Jul 14, 2023 at 03:24:59AM +0200, Marek Marczykowski-Górecki

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Oleksii
On Wed, 2023-07-19 at 13:38 +0200, Jan Beulich wrote: > On 19.07.2023 12:39, Oleksii wrote: > > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: > > > On 17.07.2023 16:40, Oleksii Kurochko wrote: > > > > @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset; > > > >   * > > > >   * It m

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Oleksii
On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: > > +    unsigned long load_end = LINK_TO_LOAD(_end); > > +    unsigned long pt_level_size = XEN_PT_LEVEL_SIZE(i - > > 1); > > +    unsigned long xen_size = ROUNDUP(load_end - > > load_start, pt_level_size); > > +

[ARM][xencons] PV Console hangs due to illegal ring buffer accesses

2023-07-19 Thread Andrei Cherechesu (OSS)
Hello, As we're running Xen 4.17 (with platform-related support added) on NXP S32G SoCs (ARMv8), with a custom Linux distribution built through Yocto, and we've set some Xen-based demos up, we encountered some issues which we think might not be related to our hardware. For additional context, t

Re: [PATCH v2 5/5] amd/iommu: force atomic updates of remapping entries

2023-07-19 Thread Roger Pau Monné
On Wed, Jul 19, 2023 at 02:46:49PM +0200, Jan Beulich wrote: > On 18.07.2023 14:43, Roger Pau Monne wrote: > > Disable XT (x2APIC) support and thus 128 IRTE entries if cmpxchg16b is > > not available, do so in order to avoid having to disable the IRTE (and > > possibly loose interrupts) when updati

[xen-4.16-testing test] 181882: tolerable trouble: fail/pass/starved - PUSHED

2023-07-19 Thread osstest service owner
flight 181882 xen-4.16-testing real [real] flight 181900 xen-4.16-testing real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/181882/ http://logs.test-lab.xenproject.org/osstest/logs/181900/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): t

Re: [XEN PATCH v10 20/24] xen/arm: ffa: support sharing large memory ranges

2023-07-19 Thread Jens Wiklander
Hi Bertrand, On Wed, Jul 19, 2023 at 11:37 AM Bertrand Marquis wrote: > > Hi Jens, > > > On 17 Jul 2023, at 09:21, Jens Wiklander wrote: > > > > Adds support for sharing large memory ranges transmitted in fragments > > using FFA_MEM_FRAG_TX. > > > > The implementation is the bare minimum to be a

Re: [PATCH LINUX v5 2/2] xen: add support for initializing xenstore later as HVM domain

2023-07-19 Thread Petr Mladek
On Fri 2022-05-13 14:19:38, Stefano Stabellini wrote: > From: Luca Miccio > > When running as dom0less guest (HVM domain on ARM) the xenstore event > channel is available at domain creation but the shared xenstore > interface page only becomes available later on. > > In that case, wait for a not

Re: [PATCH v2 2/5] x86/ioapic: RTE modifications must use ioapic_write_entry

2023-07-19 Thread Roger Pau Monné
On Tue, Jul 18, 2023 at 05:40:18PM +0200, Jan Beulich wrote: > On 18.07.2023 14:43, Roger Pau Monne wrote: > > --- a/xen/arch/x86/io_apic.c > > +++ b/xen/arch/x86/io_apic.c > > @@ -269,15 +269,15 @@ void __ioapic_write_entry( > > { > > union entry_union eu = { .entry = e }; > > > > -if

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

2023-07-19 Thread osstest service owner
flight 181875 xen-unstable real [real] flight 181899 xen-unstable real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/181875/ http://logs.test-lab.xenproject.org/osstest/logs/181899/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd6

[ovmf test] 181896: all pass - PUSHED

2023-07-19 Thread osstest service owner
flight 181896 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/181896/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 08aacbf0560d98929d402af029ac010d35abb3d6 baseline version: ovmf 4d1014093fbf1ae2788ca

Re: [PATCH RFC] x86/boot: Update construct_dom0() to take a const char *cmdline

2023-07-19 Thread Jan Beulich
On 19.07.2023 15:18, Andrew Cooper wrote: > With hvm_copy_to_guest_*() able to use const sources, update construct_dom0() > and friends to pass a const cmdline pointer. Nothing in these paths have a > reason to be modifying the command line passed in. > > Signed-off-by: Andrew Cooper > --- > CC:

Re: [RFC PATCH 3/4] xen/arm: initialize conditionally uninitialized local variables

2023-07-19 Thread Julien Grall
Hi, On 19/07/2023 14:27, Nicola Vetrini wrote: On 14/07/23 15:21, Julien Grall wrote: Hi, On 14/07/2023 12:49, Nicola Vetrini wrote: This patch aims to fix some occurrences of possibly uninitialized variables, that may be read before being written. This behaviour would violate MISRA C:2012 Ru

Re: [PATCH v4 3/4] xen/ppc: Implement early serial printk on pseries

2023-07-19 Thread Jan Beulich
On 18.07.2023 22:20, Shawn Anastasio wrote: > +void __init boot_of_init(unsigned long vec) > +{ > +int bof_chosen; > + > +of_vec = vec; > + > +/* Get a handle to the default console */ > +bof_chosen = of_finddevice("/chosen"); > +of_getprop(bof_chosen, "stdout", &of_out, sizeof(

Re: [PATCH v2 18/18] tools/xenstore: add nocopy flag to node read functions

2023-07-19 Thread Juergen Gross
On 19.07.23 14:02, Julien Grall wrote: On 19/07/2023 07:49, Juergen Gross wrote: On 18.07.23 23:35, Julien Grall wrote: Hi Juergen, On 10/07/2023 07:59, Juergen Gross wrote: Today when reading a node from the data base through read_node(), the node data is copied in order to avoid modifying

[XEN PATCH v2] x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3

2023-07-19 Thread Federico Serafini
Give a name to unnamed parameters thus addressing violations of MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with named parameters"). Keep consistency between parameter names and types used in function declarations and the ones used in the corresponding function definitions, th

Re: [PATCH v4 2/4] xen/ppc: Set up a basic C environment

2023-07-19 Thread Jan Beulich
On 18.07.2023 22:20, Shawn Anastasio wrote: > Update ppc64/head.S to set up an initial boot stack, zero the .bss > section, and jump to C. > > Also refactor the endian fixup trampoline into its own macro, since it > will need to be used in multiple places, including every time we make a > call int

[XEN PATCH] xen: address MISRA C:2012 Rule 4.1

2023-07-19 Thread Nicola Vetrini
MISRA C:2012 Rule 4.1 has the following headline: "Octal and hexadecimal escape sequences shall be terminated." The string literals modified by this patch contain octal or hexadecimal escape sequences that are neither terminated by the end of the literal, nor by the beginning of another escape seq

Re: [XEN PATCH] x86/hpet: Disable legacy replacement mode after IRQ test if not needed

2023-07-19 Thread Jan Beulich
On 18.07.2023 23:51, Simon Gaiser wrote: > Roger Pau Monné: >> On Tue, Jul 18, 2023 at 02:26:03PM +0200, Simon Gaiser wrote: >>> As far as I understand the HPET legacy mode is not required on systems >>> with ARAT after the timer IRQ test. >> >> What's the relation with ARAT here? >> >> It would se

Re: [RFC PATCH 3/4] xen/arm: initialize conditionally uninitialized local variables

2023-07-19 Thread Nicola Vetrini
Sorry for the late reply. On 14/07/23 15:21, Julien Grall wrote: Hi, On 14/07/2023 12:49, Nicola Vetrini wrote: This patch aims to fix some occurrences of possibly uninitialized variables, that may be read before being written. This behaviour would violate MISRA C:2012 Rule 9.1, besides being

[PATCH RFC] x86/boot: Update construct_dom0() to take a const char *cmdline

2023-07-19 Thread Andrew Cooper
With hvm_copy_to_guest_*() able to use const sources, update construct_dom0() and friends to pass a const cmdline pointer. Nothing in these paths have a reason to be modifying the command line passed in. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Dani

Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible

2023-07-19 Thread Jan Beulich
On 19.07.2023 14:54, Alejandro Vallejo wrote: > On Wed, Jul 19, 2023 at 02:09:55PM +0200, Jan Beulich wrote: >>> [1] The hand-crafted alignment there is going to collide with the efforts >>> to integrate automatic style checkers. It's also not conveying critical >>> information, so I'd argue for it

Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible

2023-07-19 Thread Jan Beulich
On 19.07.2023 14:54, Alejandro Vallejo wrote: > On Wed, Jul 19, 2023 at 02:09:55PM +0200, Jan Beulich wrote: >>> [1] The hand-crafted alignment there is going to collide with the efforts >>> to integrate automatic style checkers. It's also not conveying critical >>> information, so I'd argue for it

Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible

2023-07-19 Thread Alejandro Vallejo
On Wed, Jul 19, 2023 at 02:09:55PM +0200, Jan Beulich wrote: > > [1] The hand-crafted alignment there is going to collide with the efforts > > to integrate automatic style checkers. It's also not conveying critical > > information, so I'd argue for its removal in the spirit of making future > > dif

Re: [PATCH v2 5/5] amd/iommu: force atomic updates of remapping entries

2023-07-19 Thread Jan Beulich
On 18.07.2023 14:43, Roger Pau Monne wrote: > Disable XT (x2APIC) support and thus 128 IRTE entries if cmpxchg16b is > not available, do so in order to avoid having to disable the IRTE (and > possibly loose interrupts) when updating the entry. Note this also > removes the usage of a while loop in

Re: [PATCH] x86/hvm: Allow hvm_copy_to_guest_*() to come from const sources

2023-07-19 Thread Jan Beulich
On 19.07.2023 14:24, Andrew Cooper wrote: > The work to fix MISRA rule 7.4 (using mutable pointers to string literals) > identifies that string literals do indeed get passed into > hvm_copy_to_guest_linear() by way of the PVH dom0 command line. > > This higlights that the copy_to_* helpers really

Re: [PATCH v2 2/4] x86: allow Kconfig control over psABI level

2023-07-19 Thread Jan Beulich
On 19.07.2023 12:04, Andrew Cooper wrote: > On 19/07/2023 10:44 am, Jan Beulich wrote: >> --- a/xen/arch/x86/Kconfig >> +++ b/xen/arch/x86/Kconfig >> @@ -118,6 +118,36 @@ config HVM >> >>If unsure, say Y. >> >> +choice >> +prompt "base psABI level" >> +default X86_64_BASELINE >>

[PATCH] x86/hvm: Allow hvm_copy_to_guest_*() to come from const sources

2023-07-19 Thread Andrew Cooper
The work to fix MISRA rule 7.4 (using mutable pointers to string literals) identifies that string literals do indeed get passed into hvm_copy_to_guest_linear() by way of the PVH dom0 command line. This higlights that the copy_to_* helpers really ought to take a const source. Update the function t

Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible

2023-07-19 Thread Jan Beulich
On 19.07.2023 13:35, Alejandro Vallejo wrote: > On Wed, Jul 19, 2023 at 11:08:08AM +0100, Andrew Cooper wrote: >> Introduce a ROUND() macro to mirror ROUNDUP(). Use both to remove all the >> opencoded rounding in mem_hotadd_check(). Fix other minor style issues. >> >> No functional change. >> >>

Re: [PATCH v2 18/18] tools/xenstore: add nocopy flag to node read functions

2023-07-19 Thread Julien Grall
On 19/07/2023 07:49, Juergen Gross wrote: On 18.07.23 23:35, Julien Grall wrote: Hi Juergen, On 10/07/2023 07:59, Juergen Gross wrote: Today when reading a node from the data base through read_node(), the node data is copied in order to avoid modifying the data base when preparing a node up

Re: [RFC REPOST] xen: Enable -Wwrite-strings

2023-07-19 Thread Jan Beulich
On 19.07.2023 13:38, Andrew Cooper wrote: > This is the remainder change to get x86 compiling with -Wwrite-strings. ARM > still has some cleanup to go. > > There are two swamps left. > > 1) efi_arch_handle_cmdline(). Swapping name.s for name.cs makes the code > compile, but only because

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

2023-07-19 Thread osstest service owner
flight 181893 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/181893/ 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] xen/x86: Use const char * for string literals (2)

2023-07-19 Thread Jan Beulich
On 19.07.2023 13:02, Andrew Cooper wrote: > This hunk was accidentally missing from a previous change. > > Fixes: d642c0706678 ("xen/x86: Use const char * for string literals") > Signed-off-by: Andrew Cooper Acked-by: Jan Beulich

Re: [XEN PATCH] x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3

2023-07-19 Thread Jan Beulich
On 19.07.2023 12:38, Federico Serafini wrote: > On 19/07/23 12:23, Andrew Cooper wrote: >> On 19/07/2023 11:07 am, Federico Serafini wrote: >>> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c >>> index 57363c2ae1..8f19a79f6f 100644 >>> --- a/xen/arch/x86/hvm/hvm.c >>> +++ b/xen/arch/x8

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Jan Beulich
On 19.07.2023 12:39, Oleksii wrote: > On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: >> On 17.07.2023 16:40, Oleksii Kurochko wrote: >>> @@ -35,8 +41,10 @@ unsigned long __ro_after_init phys_offset; >>>   * >>>   * It might be needed one more page table in case when Xen load >>> address >>>

[RFC REPOST] xen: Enable -Wwrite-strings

2023-07-19 Thread Andrew Cooper
This is the remainder change to get x86 compiling with -Wwrite-strings. ARM still has some cleanup to go. There are two swamps left. 1) efi_arch_handle_cmdline(). Swapping name.s for name.cs makes the code compile, but only because the underlying union launders the pointer back to b

Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible

2023-07-19 Thread Alejandro Vallejo
On Wed, Jul 19, 2023 at 11:08:08AM +0100, Andrew Cooper wrote: > Introduce a ROUND() macro to mirror ROUNDUP(). Use both to remove all the > opencoded rounding in mem_hotadd_check(). Fix other minor style issues. > > No functional change. > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulic

Re: [PATCH v3 3/3] x86: Add Kconfig option to require NX bit support

2023-07-19 Thread Alejandro Vallejo
On Wed, Jul 19, 2023 at 08:13:27AM +0200, Jan Beulich wrote: > On 18.07.2023 15:19, Jan Beulich wrote: > > On 29.06.2023 14:17, Alejandro Vallejo wrote: > >> --- a/xen/arch/x86/boot/head.S > >> +++ b/xen/arch/x86/boot/head.S > >> @@ -123,6 +123,7 @@ multiboot2_header: > >> .Lbad_ldr_nih: .asciz "E

[PATCH] xen/x86: Use const char * for string literals (2)

2023-07-19 Thread Andrew Cooper
This hunk was accidentally missing from a previous change. Fixes: d642c0706678 ("xen/x86: Use const char * for string literals") Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu This was missed because it was mixed up in cmdline mess in __start_xen(). --- xen/

Re: [PATCH v3 3/3] xen/riscv: introduce identity mapping

2023-07-19 Thread Oleksii
On Tue, 2023-07-18 at 17:03 +0200, Jan Beulich wrote: > On 17.07.2023 16:40, Oleksii Kurochko wrote: > > The way how switch to virtual address was implemented in the > > commit e66003e7be ("xen/riscv: introduce setup_initial_pages") > > isn't safe enough as: > > * enable_mmu() depends on hooking al

Re: [XEN PATCH] x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3

2023-07-19 Thread Federico Serafini
On 19/07/23 12:23, Andrew Cooper wrote: On 19/07/2023 11:07 am, Federico Serafini wrote: diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 57363c2ae1..8f19a79f6f 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -319,7 +319,7 @@ static bool pat_valid(uint64_

Re: [PATCH v2 4/5] x86/iommu: pass full IO-APIC RTE for remapping table update

2023-07-19 Thread Jan Beulich
On 18.07.2023 14:43, Roger Pau Monne wrote: > So that the remapping entry can be updated atomically when possible. > > Doing such update atomically will avoid Xen having to mask the IO-APIC > pin prior to performing any interrupt movements (ie: changing the > destination and vector fields), as the

Re: [XEN PATCH] x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3

2023-07-19 Thread Andrew Cooper
On 19/07/2023 11:07 am, Federico Serafini wrote: > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c > index 57363c2ae1..8f19a79f6f 100644 > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -319,7 +319,7 @@ static bool pat_valid(uint64_t val) > return !(any_gt_7 | an

[XEN PATCH] x86/HVM: address violations of MISRA C:2012 Rules 8.2 and 8.3

2023-07-19 Thread Federico Serafini
Give a name to unnamed parameters thus addressing violations of MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with named parameters"). Keep consistency between parameter names and types used in function declarations and the ones used in the corresponding function definitions thu

[PATCH] x86/mem: Make mem_hotadd_check() more legible

2023-07-19 Thread Andrew Cooper
Introduce a ROUND() macro to mirror ROUNDUP(). Use both to remove all the opencoded rounding in mem_hotadd_check(). Fix other minor style issues. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu The compiled binary is identical. --- xe

Re: [PATCH v2 2/4] x86: allow Kconfig control over psABI level

2023-07-19 Thread Andrew Cooper
On 19/07/2023 10:44 am, Jan Beulich wrote: > --- a/xen/arch/x86/Kconfig > +++ b/xen/arch/x86/Kconfig > @@ -118,6 +118,36 @@ config HVM > > If unsure, say Y. > > +choice > + prompt "base psABI level" > + default X86_64_BASELINE > + help > + The psABI defines 4 levels of

Re: [XEN PATCH v10 14/24] xen/arm: ffa: support guest FFA_PARTITION_INFO_GET

2023-07-19 Thread Jens Wiklander
On Tue, Jul 18, 2023 at 12:22 PM Bertrand Marquis wrote: > > Hi Jens, > > > On 17 Jul 2023, at 09:20, Jens Wiklander wrote: > > > > Adds support in the mediator to handle FFA_PARTITION_INFO_GET requests > > from a guest. The requests are forwarded to the SPMC and the response is > > translated ac

Re: [RFC PATCH 2/4] xen/arm64: bitops: justify uninitialized variable inside a macro

2023-07-19 Thread Julien Grall
Hi, On 19/07/2023 09:54, Nicola Vetrini wrote: On 17/07/23 22:45, Julien Grall wrote: On 17/07/2023 21:40, Julien Grall wrote: On 14/07/2023 12:49, Nicola Vetrini wrote: The macro 'testop' expands to a function that declares the local variable 'oldbit', which is written before being set,

Re: [XEN PATCH v10 13/24] xen/arm: ffa: support mapping guest RX/TX buffers

2023-07-19 Thread Jens Wiklander
Hi Bertrand, On Tue, Jul 18, 2023 at 12:10 PM Bertrand Marquis wrote: > > Hi Jens, > > > On 17 Jul 2023, at 09:20, Jens Wiklander wrote: > > > > Adds support in the mediator to map and unmap the RX and TX buffers > > provided by the guest using the two FF-A functions FFA_RXTX_MAP and > > FFA_RXT

[PATCH v2 4/4] x86: short-circuit certain cpu_has_* when x86-64-v{2,3} are in effect

2023-07-19 Thread Jan Beulich
Certain fallback code can be made subject to DCE this way. Note that CX16 has no compiler provided manifest constant, so CONFIG_* are used there instead. Note also that we don't have cpu_has_movbe nor cpu_has_lzcnt (aka cpu_has_abm). Signed-off-by: Jan Beulich --- Of course we could use IS_ENABLE

[PATCH v2 3/4] x86: use POPCNT for hweight() when available

2023-07-19 Thread Jan Beulich
This is faster than using the software implementation, and the insn is available on all half-way recent hardware. Use the respective compiler builtins when available. Signed-off-by: Jan Beulich Reviewed-by: Jason Andryuk --- a/xen/arch/x86/include/asm/bitops.h +++ b/xen/arch/x86/include/asm/bit

[PATCH v2 2/4] x86: allow Kconfig control over psABI level

2023-07-19 Thread Jan Beulich
Newer hardware offers more efficient and/or flexible and/or capable instructions, some of which we can make good use of in the hypervisor as well. Allow a basic way (no alternatives patching) of enabling their use. Of course this means that hypervisors thus built won't work anymore on older, less c

[PATCH v2 1/4] build: make cc-option properly deal with unrecognized sub-options

2023-07-19 Thread Jan Beulich
In options like -march=, it may be only the sub-option which is unrecognized by the compiler. In such an event the error message often splits option and argument, typically saying something like "bad value '' for ''. Extend the grep invocation accordingly, also accounting for Clang to not mention e

  1   2   >