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

2023-07-26 Thread Juergen Gross
On 18.07.23 13:31, Rahul Singh wrote: 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 doing more than binding that’s why we need to introduce the new IOCTL to only bind the stat

Re: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall

2023-07-26 Thread Juergen Gross
On 22.07.23 01:13, Stefano Stabellini wrote: The same way we already do in xenbus_init. Fixes the following warning: [ 352.175563] Trying to free already-free IRQ 0 [ 352.177355] WARNING: CPU: 1 PID: 88 at kernel/irq/manage.c:1893 free_irq+0xbf/0x350 [...] [ 352.213951] Call Trace: [ 352.21

Re: [PATCH v4] xen: speed up grant-table reclaim

2023-07-26 Thread Juergen Gross
On 26.07.23 18:52, Demi Marie Obenour wrote: When a grant entry is still in use by the remote domain, Linux must put it on a deferred list. Normally, this list is very short, because the PV network and block protocols expect the backend to unmap the grant first. However, Qubes OS's GUI protocol

Re: [PATCH] libxl: Add missing libxl__virtio_devtype to device_type_tbl array

2023-07-26 Thread Viresh Kumar
On 26-07-23, 17:14, Oleksandr Tyshchenko wrote: > From: Oleksandr Tyshchenko > > Without it being present it won't be possible to use some > libxl__device_type's callbacks for virtio devices as the common code > can only invoke these callbacks (by dereferencing a pointer) for valid > libxl__devic

[qemu-mainline test] 182023: tolerable FAIL - PUSHED

2023-07-26 Thread osstest service owner
flight 182023 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/182023/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 182006 test-armhf-armhf-libvirt-qcow2 15 s

Re: [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless

2023-07-26 Thread Qi Zheng
Hi Dave, On 2023/7/27 07:09, Dave Chinner wrote: On Wed, Jul 26, 2023 at 05:14:09PM +0800, Qi Zheng wrote: On 2023/7/26 16:08, Dave Chinner wrote: On Mon, Jul 24, 2023 at 05:43:51PM +0800, Qi Zheng wrote: @@ -122,6 +126,13 @@ void shrinker_free_non_registered(struct shrinker *shrinker); v

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

2023-07-26 Thread osstest service owner
flight 182028 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/182028/ 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 v8 02/13] vpci: use per-domain PCI lock to protect vpci structure

2023-07-26 Thread Volodymyr Babchuk
Hi Roger, Roger Pau Monné writes: > On Wed, Jul 26, 2023 at 01:17:58AM +, Volodymyr Babchuk wrote: >> >> Hi Roger, >> >> Roger Pau Monné writes: >> >> > On Thu, Jul 20, 2023 at 12:32:31AM +, Volodymyr Babchuk wrote: >> >> From: Oleksandr Andrushchenko >> >> @@ -498,6 +537,7 @@ void

[libvirt test] 182021: tolerable all pass - PUSHED

2023-07-26 Thread osstest service owner
flight 182021 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/182021/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt-raw 15 saverestore-support-check fail blocked in 182004 test-armhf-armhf-libvirt 16 savere

Re: [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless

2023-07-26 Thread Dave Chinner
On Wed, Jul 26, 2023 at 05:14:09PM +0800, Qi Zheng wrote: > On 2023/7/26 16:08, Dave Chinner wrote: > > On Mon, Jul 24, 2023 at 05:43:51PM +0800, Qi Zheng wrote: > > > @@ -122,6 +126,13 @@ void shrinker_free_non_registered(struct shrinker > > > *shrinker); > > > void shrinker_register(struct shr

Re: [XEN PATCH v4 3/4] automation: Add ECLAIR pipelines

2023-07-26 Thread Stefano Stabellini
On Wed, 26 Jul 2023, Simone Ballarin wrote: > Add two pipelines that analyze an ARM64 and a X86_64 build with the > ECLAIR static analyzer on the guidelines contained in Set1. > > The analysis configuration is stored in automation/eclair_analysis. > > All commits on the xen-project/xen:staging br

Re: [XEN PATCH v2] xen: use parameter name 'mcs' in arch_do_multicall_call()

2023-07-26 Thread Stefano Stabellini
On Wed, 26 Jul 2023, Federico Serafini wrote: > Make function declaration and definition consistent using the same > parameter name ('mcs' do denote a pointer to an 'mc_state'). > This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations > of an object or function shall use the same na

Re: [XEN PATCH v3] xen/spinlock: mechanically rename parameter name 'debug'

2023-07-26 Thread Stefano Stabellini
On Wed, 26 Jul 2023, Jan Beulich wrote: > On 26.07.2023 08:42, Nicola Vetrini wrote: > > On 26/07/23 08:34, Jan Beulich wrote: > >> On 25.07.2023 22:45, Nicola Vetrini wrote: > >>> Rule 5.3 has the following headline: > >>> "An identifier declared in an inner scope shall not hide an > >>> identifie

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

2023-07-26 Thread Stewart Hildebrand
On 7/19/23 20:32, Volodymyr Babchuk wrote: > 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

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

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

Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping

2023-07-26 Thread Oleksii
On Wed, 2023-07-26 at 17:59 +0200, Jan Beulich wrote: > On 26.07.2023 17:54, Oleksii wrote: > > On Wed, 2023-07-26 at 17:00 +0200, Jan Beulich wrote: > > > On 26.07.2023 15:12, Oleksii wrote: > > > > On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote: > > > > > On 26.07.2023 13:23, Oleksii wrote:

[PATCH v7 13/15] libxc: Add xc_set_cpufreq_cppc

2023-07-26 Thread Jason Andryuk
Add xc_set_cpufreq_cppc to allow calling xen_systctl_pm_op SET_CPUFREQ_CPPC. Signed-off-by: Jason Andryuk Acked-by: Anthony PERARD --- v2: Mark xc_set_hwp_para_t const v4: s/hwp/cppc/ Add Anthony's Ack v5: Remove const and copy back result --- tools/include/xenctrl.h | 4 tools/libs/ctr

[PATCH v7 14/15] xenpm: Add set-cpufreq-cppc subcommand

2023-07-26 Thread Jason Andryuk
set-cpufreq-cppc allows setting the Hardware P-State (HWP) parameters. It can be run on all or just a single cpu. There are presets of balance, powersave & performance. Those can be further tweaked by param:val arguments as explained in the usage description. Parameter names are just checked to

[PATCH v7 12/15] xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op

2023-07-26 Thread Jason Andryuk
Add SET_CPUFREQ_HWP xen_sysctl_pm_op to set HWP parameters. The sysctl supports setting multiple values simultaneously as indicated by the set_params bits. This allows atomically applying new HWP configuration via a single wrmsr. XEN_SYSCTL_HWP_SET_PRESET_BALANCE/PERFORMANCE/POWERSAVE provide th

[PATCH v7 15/15] CHANGELOG: Add Intel HWP entry

2023-07-26 Thread Jason Andryuk
Signed-off-by: Jason Andryuk Acked-by: Henry Wang --- v3: Position under existing Added section Add Henry's Ack v2: Add blank line --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d7e0590f8..8d6e6c3088 100644 --- a/CHANGELOG

[PATCH v7 11/15] xenpm: Print HWP/CPPC parameters

2023-07-26 Thread Jason Andryuk
Print HWP-specific parameters. Some are always present, but others depend on hardware support. Signed-off-by: Jason Andryuk Reviewed-by: Jan Beulich --- v2: Style fixes Declare i outside loop Replace repearted hardware/configured limits with spaces Fixup for hw_ removal Use XEN_HWP_GOVERNOR Use

[PATCH v7 10/15] libxc: Include cppc_para in definitions

2023-07-26 Thread Jason Andryuk
Expose the cppc_para fields through libxc. Signed-off-by: Jason Andryuk Acked-by: Anthony PERARD --- v4: Rename hwp to cppc Add Anthony's Ack --- tools/include/xenctrl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index 8aedb952a0..209

[PATCH v7 09/15] cpufreq: Export HWP parameters to userspace as CPPC

2023-07-26 Thread Jason Andryuk
Extend xen_get_cpufreq_para to return hwp parameters. HWP is an implementation of ACPI CPPC (Collaborative Processor Performance Control). Use the CPPC name since that might be useful in the future for AMD P-state. We need the features bitmask to indicate fields supported by the actual hardware

[PATCH v7 08/15] xenpm: Change get-cpufreq-para output for hwp

2023-07-26 Thread Jason Andryuk
When using HWP, some of the returned data is not applicable. In that case, we should just omit it to avoid confusing the user. So switch to printing the base and max frequencies since those are relevant to HWP. Similarly, stop printing the CPU frequencies since those do not apply. The scaling fie

[PATCH v7 07/15] xen/x86: Tweak PDC bits when using HWP

2023-07-26 Thread Jason Andryuk
Qubes testing of HWP support had a report of a laptop, Thinkpad X1 Carbon Gen 4 with a Skylake processor, locking up during boot when HWP is enabled. A user found a kernel bug that seems to be the same issue: https://bugzilla.kernel.org/show_bug.cgi?id=110941. That bug was fixed by Linux commit a

[PATCH v7 06/15] cpufreq: Add Hardware P-State (HWP) driver

2023-07-26 Thread Jason Andryuk
>From the Intel SDM: "Hardware-Controlled Performance States (HWP), which autonomously selects performance states while utilizing OS supplied performance guidance hints." Enable HWP to run in autonomous mode by poking the correct MSRs. HWP is disabled by default, and cpufreq=hwp enables it. cpuf

[PATCH v7 05/15] pmstat&xenpm: Re-arrage for cpufreq union

2023-07-26 Thread Jason Andryuk
Rearrange code now that xen_sysctl_pm_op's get_para fields has the nested union and struct. In particular, the scaling governor information like scaling_available_governors is inside the union, so it is not always available. Move those fields (op->u.get_para.u.s.u.*) together as well as the commo

[PATCH v7 04/15] xen/sysctl: Nest cpufreq scaling options

2023-07-26 Thread Jason Andryuk
Add a union and struct so that most of the scaling variables of struct xen_get_cpufreq_para are within in a binary-compatible layout. This allows cppc_para to live in the larger union and use uint32_ts - struct xen_cppc_para will be 10 uint32_t's. The new scaling struct is 3 * uint32_t + 16 bytes

[PATCH v7 03/15] cpufreq: Export intel_feature_detect

2023-07-26 Thread Jason Andryuk
Export feature_detect as intel_feature_detect so it can be re-used by HWP. Signed-off-by: Jason Andryuk Acked-by: Jan Beulich --- v4: Add Jan's Ack v3: Remove void * cast when calling intel_feature_detect v2: export intel_feature_detect with typed pointer Move intel_feature_detect to acpi/cpuf

[PATCH v7 00/15] Intel Hardware P-States (HWP) support

2023-07-26 Thread Jason Andryuk
Hi, This patch series adds Hardware-Controlled Performance States (HWP) for Intel processors to Xen. v2 was only partially reviewed, so v3 is mostly a reposting of v2. In v2 & v3, I think I addressed all comments for v1. I kept patch 11 "xenpm: Factor out a non-fatal cpuid_parse variant", with

[PATCH v7 02/15] cpufreq: Add perf_freq to cpuinfo

2023-07-26 Thread Jason Andryuk
acpi-cpufreq scales the aperf/mperf measurements by max_freq, but HWP needs to scale by base frequency. Settings max_freq to base_freq "works" but the code is not obvious, and returning values to userspace is tricky. Add an additonal perf_freq member which is used for scaling aperf/mperf measurem

[PATCH v7 01/15] cpufreq: Allow restricting to internal governors only

2023-07-26 Thread Jason Andryuk
For hwp, the standard governors are not usable, and only the internal one is applicable. Add the cpufreq_governor_internal boolean to indicate when an internal governor, like hwp, will be used. This is set during presmp_initcall, and governor registration can be skipped when called during initcal

Re: [PATCH v6 06/15] cpufreq: Add Hardware P-State (HWP) driver

2023-07-26 Thread Jason Andryuk
On Tue, Jul 25, 2023 at 10:37 AM Jan Beulich wrote: > > On 25.07.2023 15:26, Jason Andryuk wrote: > > #define hwp_err(cpu, fmt, args...) \ > > printk(XENLOG_ERR "HWP: CPU%u error: " fmt, cpu, args) > > ..., just that you're missing the ##: > > #define hwp_err(cpu, fmt, args...) \

Re: [PATCH v3 6/8] RISC-V: annotate entry points with type and size

2023-07-26 Thread Oleksii
On Wed, 2023-07-26 at 17:43 +0200, Jan Beulich wrote: > On 26.07.2023 17:28, Oleksii wrote: > > On Mon, 2023-07-10 at 10:58 +0200, Jan Beulich wrote: > > > On 10.07.2023 10:56, Jan Beulich wrote: > > > > Use the generic framework in xen/linkage.h. No change in > > > > generated > > > > code > > > >

[PATCH v4] xen: speed up grant-table reclaim

2023-07-26 Thread Demi Marie Obenour
When a grant entry is still in use by the remote domain, Linux must put it on a deferred list. Normally, this list is very short, because the PV network and block protocols expect the backend to unmap the grant first. However, Qubes OS's GUI protocol is subject to the constraints of the X Window

[XEN PATCH v4 2/4] automation: Add xen builds for the ECLAIR analyses

2023-07-26 Thread Simone Ballarin
This patch defines an ARM64 and a X86_64 build for the ECLAIR pipelines. These files are used by the analyze.sh script in automation/eclair_analysis: it initially calls prepare.sh, then runs into an ECLAIR environment build.sh. Only the toolchain invocations triggered by build.sh are analyzed; th

[XEN PATCH v4 1/4] automation: Add ECLAIR utilities and settings

2023-07-26 Thread Simone Ballarin
The files with extension ecl are ECLAIR configurations that are loaded during the analysis phase or during the report generation phase: analysis.ecl is the main file for the analysis phase, while reports.ecl is the one for the report phase. All other ecl files are included by one of the two main on

[XEN PATCH v4 4/4] maintainers: Add ECLAIR reviewer

2023-07-26 Thread Simone Ballarin
Signed-off-by: Simone Ballarin Acked-by: Stefano Stabellini -- Changes in v4: - add 'Acked-by' - remove undesired blanks Changes in v3: - split maintainer add in a separate patch; - substitute blanks with tabs; - change role from maintainer to reviewer. Changes in v2: - add ECLAIR configuratio

[XEN PATCH v4 3/4] automation: Add ECLAIR pipelines

2023-07-26 Thread Simone Ballarin
Add two pipelines that analyze an ARM64 and a X86_64 build with the ECLAIR static analyzer on the guidelines contained in Set1. The analysis configuration is stored in automation/eclair_analysis. All commits on the xen-project/xen:staging branch will be analyzed and their artifacts will be stored

[XEN PATCH v4 0/4] automation: Add ECLAIR pipelines

2023-07-26 Thread Simone Ballarin
This patch series adds two pipelines that analyze an ARM64 and a X86_64 build with the ECLAIR static analyzer on the guidelines contained in Set1. The builds analyzed are the ones triggered by automation/eclair_analysis/build.sh. automation/eclair_analysis/ECLAIR contains the ECLAIR configuration

Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping

2023-07-26 Thread Jan Beulich
On 26.07.2023 17:54, Oleksii wrote: > On Wed, 2023-07-26 at 17:00 +0200, Jan Beulich wrote: >> On 26.07.2023 15:12, Oleksii wrote: >>> On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote: On 26.07.2023 13:23, Oleksii wrote: > I would like to ask for advice on whether it would be easier, >

[linux-linus test] 182011: regressions - FAIL

2023-07-26 Thread osstest service owner
flight 182011 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/182011/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-xsm 6 xen-buildfail REGR. vs. 180278 test-amd64-amd64-xl

Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping

2023-07-26 Thread Oleksii
On Wed, 2023-07-26 at 17:00 +0200, Jan Beulich wrote: > On 26.07.2023 15:12, Oleksii wrote: > > On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote: > > > On 26.07.2023 13:23, Oleksii wrote: > > > > I would like to ask for advice on whether it would be easier, > > > > less > > > > bug- > > > > pro

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

2023-07-26 Thread Shawn Anastasio
On 7/26/23 10:45 AM, Jan Beulich wrote: > On 26.07.2023 17:42, Shawn Anastasio wrote: >> On 7/26/23 10:32 AM, Jan Beulich wrote: >>> On 24.07.2023 17:06, Shawn Anastasio wrote: On 7/24/23 7:40 AM, Jan Beulich wrote: > On 21.07.2023 19:02, Shawn Anastasio wrote: >> On typical Power VMs

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

2023-07-26 Thread Jan Beulich
On 26.07.2023 17:42, Shawn Anastasio wrote: > On 7/26/23 10:32 AM, Jan Beulich wrote: >> On 24.07.2023 17:06, Shawn Anastasio wrote: >>> On 7/24/23 7:40 AM, Jan Beulich wrote: On 21.07.2023 19:02, Shawn Anastasio wrote: > On typical Power VMs (e.g. QEMU's -M pseries), a variety of services

Re: [PATCH v3 6/8] RISC-V: annotate entry points with type and size

2023-07-26 Thread Jan Beulich
On 26.07.2023 17:28, Oleksii wrote: > On Mon, 2023-07-10 at 10:58 +0200, Jan Beulich wrote: >> On 10.07.2023 10:56, Jan Beulich wrote: >>> Use the generic framework in xen/linkage.h. No change in generated >>> code >>> except of course the converted symbols change to be hidden ones and >>> gain >>>

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

2023-07-26 Thread Shawn Anastasio
On 7/26/23 10:32 AM, Jan Beulich wrote: > On 24.07.2023 17:06, Shawn Anastasio wrote: >> On 7/24/23 7:40 AM, Jan Beulich wrote: >>> On 21.07.2023 19:02, Shawn Anastasio wrote: On typical Power VMs (e.g. QEMU's -M pseries), a variety of services including an early serial console are provid

Re: [PATCH v2] vpci: add permission checks to map_range()

2023-07-26 Thread Rahul Singh
Hi Roger, > On 26 Jul 2023, at 3:01 pm, Roger Pau Monne wrote: > > Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add > the permissions checks to vPCI map_range(), which is used to map the > BARs into the domain p2m. > > Adding those checks requires that for x86 PVH hardware d

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

2023-07-26 Thread Jan Beulich
On 24.07.2023 17:06, Shawn Anastasio wrote: > On 7/24/23 7:40 AM, Jan Beulich wrote: >> On 21.07.2023 19:02, Shawn Anastasio wrote: >>> On typical Power VMs (e.g. QEMU's -M pseries), a variety of services >>> including an early serial console are provided by Open Firmware. >>> Implement the require

Re: [PATCH v3 6/8] RISC-V: annotate entry points with type and size

2023-07-26 Thread Oleksii
On Mon, 2023-07-10 at 10:58 +0200, Jan Beulich wrote: > On 10.07.2023 10:56, Jan Beulich wrote: > > Use the generic framework in xen/linkage.h. No change in generated > > code > > except of course the converted symbols change to be hidden ones and > > gain > > a valid size. > > > > Signed-off-by:

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

2023-07-26 Thread osstest service owner
flight 182024 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/182024/ 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] libxl: Add missing libxl__virtio_devtype to device_type_tbl array

2023-07-26 Thread Oleksandr Tyshchenko
On 26.07.23 17:50, Jan Beulich wrote: Hello Jan > On 26.07.2023 16:14, Oleksandr Tyshchenko wrote: >> From: Oleksandr Tyshchenko >> >> Without it being present it won't be possible to use some >> libxl__device_type's callbacks for virtio devices as the common code >> can only invoke these cal

Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping

2023-07-26 Thread Jan Beulich
On 26.07.2023 15:12, Oleksii wrote: > On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote: >> On 26.07.2023 13:23, Oleksii wrote: >>> I would like to ask for advice on whether it would be easier, less >>> bug- >>> provoking ( during identity mapping to remove of whole Xen ) to >>> have a >>> separ

Re: [PATCH v2] vpci: add permission checks to map_range()

2023-07-26 Thread Jan Beulich
On 26.07.2023 16:01, Roger Pau Monne wrote: > Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add > the permissions checks to vPCI map_range(), which is used to map the > BARs into the domain p2m. > > Adding those checks requires that for x86 PVH hardware domain builder > the perm

Re: [XEN PATCH] xen/kernel: change parameter name in add_taint() definition

2023-07-26 Thread Jan Beulich
On 26.07.2023 15:58, Federico Serafini wrote: > Change parameter name from 'flag' to 'taint' for consistency with > the corresponding declaration. > This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations > of an object or function shall use the same names and type qualifiers". > >

Re: [PATCH] libxl: Add missing libxl__virtio_devtype to device_type_tbl array

2023-07-26 Thread Jan Beulich
On 26.07.2023 16:14, Oleksandr Tyshchenko wrote: > From: Oleksandr Tyshchenko > > Without it being present it won't be possible to use some > libxl__device_type's callbacks for virtio devices as the common code > can only invoke these callbacks (by dereferencing a pointer) for valid > libxl__devi

Re: [PATCH mm-unstable v7 00/31] Split ptdesc from struct page

2023-07-26 Thread Matthew Wilcox
On Mon, Jul 24, 2023 at 09:41:36PM -0700, Hugh Dickins wrote: > On Mon, 24 Jul 2023, Vishal Moola (Oracle) wrote: > > > The MM subsystem is trying to shrink struct page. This patchset > > introduces a memory descriptor for page table tracking - struct ptdesc. > > > > This patchset introduces ptde

[PATCH] libxl: Add missing libxl__virtio_devtype to device_type_tbl array

2023-07-26 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko Without it being present it won't be possible to use some libxl__device_type's callbacks for virtio devices as the common code can only invoke these callbacks (by dereferencing a pointer) for valid libxl__device_type's elements when iterating over device_type_tbl[]. Si

Re: [PATCH] vpci: add permission checks to map_range()

2023-07-26 Thread Jan Beulich
On 26.07.2023 15:37, Roger Pau Monné wrote: > On Wed, Jul 26, 2023 at 02:36:17PM +0200, Jan Beulich wrote: >> Another Dom0 related concern can probably be put off until we actually >> get a report of this failing (which may be more likely because of the >> XSM check below): The function being used

[PATCH v2] vpci: add permission checks to map_range()

2023-07-26 Thread Roger Pau Monne
Just like it's done for the XEN_DOMCTL_memory_mapping hypercall, add the permissions checks to vPCI map_range(), which is used to map the BARs into the domain p2m. Adding those checks requires that for x86 PVH hardware domain builder the permissions are set before initializing the IOMMU, or else a

[XEN PATCH] xen/kernel: change parameter name in add_taint() definition

2023-07-26 Thread Federico Serafini
Change parameter name from 'flag' to 'taint' for consistency with the corresponding declaration. This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations of an object or function shall use the same names and type qualifiers". No functional changes. Signed-off-by: Federico Serafini

Re: [PATCH] vpci: add permission checks to map_range()

2023-07-26 Thread Roger Pau Monné
On Wed, Jul 26, 2023 at 02:36:17PM +0200, Jan Beulich wrote: > On 24.07.2023 17:37, Roger Pau Monne wrote: > > @@ -1184,6 +1177,20 @@ int __init dom0_construct_pvh(struct domain *d, > > const module_t *image, > > > > printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id); > >

Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping

2023-07-26 Thread Oleksii
On Wed, 2023-07-26 at 13:58 +0200, Jan Beulich wrote: > On 26.07.2023 13:23, Oleksii wrote: > > I would like to ask for advice on whether it would be easier, less > > bug- > > provoking ( during identity mapping to remove of whole Xen ) to > > have a > > separate identity section that won't be more

[qemu-mainline test] 182006: tolerable FAIL - PUSHED

2023-07-26 Thread osstest service owner
flight 182006 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/182006/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 181952 test-armhf-armhf-libvirt-qcow2 15 s

[PATCH v3 3/4] iommu/vtd: rename io_apic_read_remap_rte() local variable

2023-07-26 Thread Roger Pau Monne
Preparatory change to unify the IO-APIC pin variable name between io_apic_read_remap_rte() and amd_iommu_ioapic_update_ire(), so that the local variable can be made a function parameter with the same name across vendors. Signed-off-by: Roger Pau Monné --- Changes since v1: - New in this version.

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

2023-07-26 Thread Roger Pau Monne
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 interrupt remapping entry is always consistent. This

[PATCH v3 2/4] x86/ioapic: RTE modifications must use ioapic_write_entry

2023-07-26 Thread Roger Pau Monne
Do not allow to write to RTE registers using io_apic_write and instead require changes to RTE to be performed using ioapic_write_entry. This is in preparation for passing the full contents of the RTE to the IOMMU interrupt remapping handlers, so remapping entries for IO-APIC RTEs can be updated at

[PATCH v3 0/4] x86/ioapic: fix edge triggered interrupt migration

2023-07-26 Thread Roger Pau Monne
Hello, Following series attempts to solve the issue with IO-APIC edge triggered interrupts seeing an inconsistent IRTE when injected while being migrated. It's been simplified a bit from the original RFC, and does make the logic in the IOMMU RTE update handlers cleaner, as those get passed the fu

[PATCH v3 1/4] x86/ioapic: add a raw field to RTE struct

2023-07-26 Thread Roger Pau Monne
Further changes will require access to the full RTE as a single value in order to pass it to IOMMU interrupt remapping handlers. No functional change intended. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich --- Changes since v1: - Fix initializers. --- Tested on gitlab CI, builds on all

Re: [PATCH] vpci: add permission checks to map_range()

2023-07-26 Thread Jan Beulich
On 24.07.2023 17:37, Roger Pau Monne wrote: > @@ -1184,6 +1177,20 @@ int __init dom0_construct_pvh(struct domain *d, const > module_t *image, > > printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id); > > +if ( is_hardware_domain(d) ) > +{ > +/* > + *

Re: [XEN PATCH 0/4] xen: address violations of MISRA C:2012 Rule 7.2

2023-07-26 Thread Simone Ballarin
Il giorno mer 26 lug 2023 alle ore 14:02 Jan Beulich ha scritto: > On 26.07.2023 13:03, Simone Ballarin wrote: > > The xen sources contains violations of MISRA C:2012 Rule 7.2 whose > headline > > states: > > "A 'u' or 'U' suffix shall be applied to all integer constants that are > > represented

Re: [XEN PATCH 0/4] xen: address violations of MISRA C:2012 Rule 7.2

2023-07-26 Thread Jan Beulich
On 26.07.2023 13:03, Simone Ballarin wrote: > The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline > states: > "A 'u' or 'U' suffix shall be applied to all integer constants that are > represented in an unsigned type". > > These violations are caused by the missing "u" or "U

Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping

2023-07-26 Thread Jan Beulich
On 26.07.2023 13:23, Oleksii wrote: > I would like to ask for advice on whether it would be easier, less bug- > provoking ( during identity mapping to remove of whole Xen ) to have a > separate identity section that won't be more than PAGE_SIZE. I'm afraid you can't safely do this in C, or at leas

[xen-4.17-testing test] 182016: tolerable trouble: fail/pass/starved - PUSHED

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

Re: [PATCH v4 2/2] xen/riscv: introduce identity mapping

2023-07-26 Thread Oleksii
Hi all, I would like to ask for advice on whether it would be easier, less bug- provoking ( during identity mapping to remove of whole Xen ) to have a separate identity section that won't be more than PAGE_SIZE. Please take a look at the changes below. Comments are welcome. diff --git a/xen/arch

Xen Security Advisory 433 v2 (CVE-2023-20593) - x86/AMD: Zenbleed

2023-07-26 Thread Xen . org security team
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Xen Security Advisory CVE-2023-20593 / XSA-433 version 2 x86/AMD: Zenbleed UPDATES IN VERSION 2 Include the CVE, which was missed accidentally in the rush of

Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value parameters const

2023-07-26 Thread Juergen Gross
On 26.07.23 11:29, Julien Grall wrote: Hi, On 26/07/2023 09:44, Juergen Gross wrote: On 26.07.23 10:20, Julien Grall wrote: To give a concrete example, with the current interface we are telling the user that what they store in the hashtable can be modified at some point. By adding 'const' for

[XEN PATCH v4 4/4] xen/x86: address violations of MISRA C:2012 Rule 7.2

2023-07-26 Thread Simone Ballarin
From: Gianluca Luparini The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline states: "A 'u' or 'U' suffix shall be applied to all integer constants that are represented in an unsigned type". Add the 'U' suffix to integers literals with unsigned type. Use _AC() for macro co

[XEN PATCH v4 3/4] x86/viridian: address violations of MISRA C:2012 Rule 7.2

2023-07-26 Thread Simone Ballarin
From: Gianluca Luparini The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline states: "A 'u' or 'U' suffix shall be applied to all integer constants that are represented in an unsigned type". Add the 'U' suffix to integers literals with unsigned type and also to other liter

[XEN PATCH 0/4] xen: address violations of MISRA C:2012 Rule 7.2

2023-07-26 Thread Simone Ballarin
The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline states: "A 'u' or 'U' suffix shall be applied to all integer constants that are represented in an unsigned type". These violations are caused by the missing "u" or "U" suffix in unsigned integer constants, such as: xen/ar

[XEN PATCH v4 2/4] xen/vpci: address violations of MISRA C:2012 Rule 7.2

2023-07-26 Thread Simone Ballarin
From: Gianluca Luparini The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline states: "A 'u' or 'U' suffix shall be applied to all integer constants that are represented in an unsigned type". Add the 'U' suffix to integers literals with unsigned type and also to other liter

[XEN PATCH v4 1/4] x86/vmx: address violations of MISRA C:2012 Rule 7.2

2023-07-26 Thread Simone Ballarin
From: Gianluca Luparini The xen sources contains violations of MISRA C:2012 Rule 7.2 whose headline states: "A 'u' or 'U' suffix shall be applied to all integer constants that are represented in an unsigned type". Add the 'U' suffix to integers literals with unsigned type. For the sake of unifo

[PATCH] libxenstat/Linux: pass nul-terminated string to strpbrk()

2023-07-26 Thread Jan Beulich
While what "tmp" points to has been cleared at the end of the first iteration of parseNetDevLine()'s main loop, this is too late for the first iteration's invocation of strpbrk() (copying the interface name). Properly nul-terminate the string at population time instead, removing the late clearing.

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

2023-07-26 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 v3 4/5] x86: use POPCNT for hweight() when available

2023-07-26 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 v3 3/5] x86: allow Kconfig control over psABI level

2023-07-26 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 v3 2/5] build: permit Kconfig control over how to deal with unsatisfiable choices

2023-07-26 Thread Jan Beulich
Some options we allow the build admin to select may require new enough tool chain components to fulfill (partly or entirely). Provide yet another control to pick what action to take at the end of the build process - be silent about this, warn, or fail the build. Signed-off-by: Jan Beulich --- Thi

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

2023-07-26 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

[PATCH v3 0/5] x86: allow Kconfig control over psABI level

2023-07-26 Thread Jan Beulich
As discussed in Prague, with some minor add-ons (patch 2 replacing a much older patch under the same title). v3 addresses issues found as well as review feedback; see individual patches for details. Patch 3 in particular continues to raises several questions as well, though. 1: build: make cc-opt

[libvirt test] 182004: tolerable FAIL - PUSHED

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

Re: [PATCH v5 1/2] tools/console: Add escape argument to configure escape character

2023-07-26 Thread Hongda Deng
On 2023/7/12 18:29, Peter Hoyes wrote: From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases. Add --e

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

2023-07-26 Thread Roger Pau Monné
On Wed, Jul 19, 2023 at 12:37:47PM +0200, Jan Beulich wrote: > On 18.07.2023 14:43, Roger Pau Monne wrote: > > @@ -439,36 +427,47 @@ unsigned int cf_check io_apic_read_remap_rte( > > } > > > > void cf_check io_apic_write_remap_rte( > > -unsigned int apic, unsigned int reg, unsigned int valu

Re: [XEN PATCH v2] xen: use parameter name 'mcs' in arch_do_multicall_call()

2023-07-26 Thread Jan Beulich
On 26.07.2023 11:34, Federico Serafini wrote: > Make function declaration and definition consistent using the same > parameter name ('mcs' do denote a pointer to an 'mc_state'). > This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations > of an object or function shall use the same na

[PATCH v2] x86/cpu-policy: Advertise MSR_ARCH_CAPS to guests by default

2023-07-26 Thread Andrew Cooper
With xl/libxl now able to control the policy bits for MSR_ARCH_CAPS, it is safe to advertise to guests by default. In turn, we don't need the special case to expose details to dom0. This advertises MSR_ARCH_CAPS to guests on *all* Intel hardware, even if the register content ends up being empty.

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

2023-07-26 Thread Roger Pau Monné
On Wed, Jul 26, 2023 at 01:17:58AM +, Volodymyr Babchuk wrote: > > Hi Roger, > > Roger Pau Monné writes: > > > On Thu, Jul 20, 2023 at 12:32:31AM +, Volodymyr Babchuk wrote: > >> From: Oleksandr Andrushchenko > >> @@ -498,6 +537,7 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg,

[XEN PATCH v2] xen: use parameter name 'mcs' in arch_do_multicall_call()

2023-07-26 Thread Federico Serafini
Make function declaration and definition consistent using the same parameter name ('mcs' do denote a pointer to an 'mc_state'). This addresses a violation of MISRA C:2012 Rule 8.3: "All declarations of an object or function shall use the same names and type qualifiers". Signed-off-by: Federico Ser

Re: [PATCH v2 28/47] bcache: dynamically allocate the md-bcache shrinker

2023-07-26 Thread Qi Zheng
On 2023/7/26 15:32, Muchun Song wrote: On 2023/7/24 17:43, Qi Zheng wrote: In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the md-bcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-s

Re: [PATCH v2 43/47] mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}

2023-07-26 Thread Muchun Song
> On Jul 24, 2023, at 17:43, Qi Zheng wrote: > > Currently, we maintain two linear arrays per node per memcg, which are > shrinker_info::map and shrinker_info::nr_deferred. And we need to resize > them when the shrinker_nr_max is exceeded, that is, allocate a new array, > and then copy the old

Re: [PATCH v2 23/47] drm/msm: dynamically allocate the drm-msm_gem shrinker

2023-07-26 Thread Qi Zheng
On 2023/7/26 15:24, Muchun Song wrote: On 2023/7/24 17:43, Qi Zheng wrote: In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the drm-msm_gem shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read

Re: [PATCH v3 08/25] tools/xenstore: make hashtable key and value parameters const

2023-07-26 Thread Julien Grall
Hi, On 26/07/2023 09:44, Juergen Gross wrote: On 26.07.23 10:20, Julien Grall wrote: To give a concrete example, with the current interface we are telling the user that what they store in the hashtable can be modified at some point. By adding 'const' for the value in hashtable_add(), we can m

  1   2   >