Re: [PATCH 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb

2022-03-08 Thread Christoph Hellwig
On Tue, Mar 08, 2022 at 04:38:21PM -0500, Boris Ostrovsky wrote: > > On 3/1/22 5:53 AM, Christoph Hellwig wrote: >> Allow to pass a remap argument to the swiotlb initialization functions >> to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping >> from xen_swiotlb_fixup, so we don't e

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

2022-03-08 Thread osstest service owner
flight 168487 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/168487/ 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 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb

2022-03-08 Thread Boris Ostrovsky
On 3/1/22 5:53 AM, Christoph Hellwig wrote: Allow to pass a remap argument to the swiotlb initialization functions to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping from xen_swiotlb_fixup, so we don't even need that quirk. Any chance this patch could be split? Lots of thin

[ovmf test] 168489: regressions - FAIL

2022-03-08 Thread osstest service owner
flight 168489 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/168489/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64 6 xen-buildfail REGR. vs. 168254 build-amd64-xsm

[xen-unstable test] 168476: tolerable FAIL

2022-03-08 Thread osstest service owner
flight 168476 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/168476/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-i386-xl-qemuu-ovmf-amd64 18 guest-localmigrate/x10 fail pass in 168470 test-armhf-armhf-libvirt-raw

RE: Proposal for Porting Xen to Armv8-R64 - DraftA

2022-03-08 Thread Stefano Stabellini
On Tue, 8 Mar 2022, Wei Chen wrote: > > On Mon, 7 Mar 2022, Wei Chen wrote: > > > > > On 01/03/2022 07:51, Wei Chen wrote: > > > > > >>> ### 1.2. Xen Challenges with PMSA Virtualization > > > > > >>> Xen is PMSA unaware Type-1 Hypervisor, it will need > > modifications to > > > > > run > > > > > >>

[XEN][RFC PATCH v3 05/14] xen/device-tree: Add _dt_find_node_by_path() to find nodes in device tree

2022-03-08 Thread Vikram Garhwal
Add _dt_find_by_path() to find a matching node with path for a dt_device_node. Signed-off-by: Vikram Garhwal --- xen/common/device_tree.c | 10 -- xen/include/xen/device_tree.h | 9 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/xen/common/device_tree.c b

[XEN][RFC PATCH v3 10/14] xen/arm: Implement device tree node removal functionalities

2022-03-08 Thread Vikram Garhwal
Introduce sysctl XEN_SYSCTL_dt_overlay to remove device-tree nodes added using device tree overlay. xl overlay remove file.dtbo: Removes all the nodes in a given dtbo. First, removes IRQ permissions and MMIO accesses. Next, it finds the nodes in dt_host and delete the device node entri

[XEN][RFC PATCH v3 06/14] xen/smmu: Add remove_device callback for smmu_iommu ops

2022-03-08 Thread Vikram Garhwal
Add remove_device callback for removing the device entry from smmu-master using following steps: 1. Find if SMMU master exists for the device node. 2. Remove the SMMU master Signed-off-by: Vikram Garhwal --- xen/drivers/passthrough/arm/smmu.c | 56 ++ 1 file changed,

[XEN][RFC PATCH v3 02/14] xen/arm: Add CONFIG_OVERLAY_DTB

2022-03-08 Thread Vikram Garhwal
Introduce a config option where the user can enable support for adding/removing device tree nodes using a device tree binary overlay. Signed-off-by: Vikram Garhwal --- xen/arch/arm/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index

[XEN][RFC PATCH v3 09/14] xen/iommu: Introduce iommu_remove_dt_device()

2022-03-08 Thread Vikram Garhwal
Remove master device from the IOMMU. Signed-off-by: Vikram Garhwal --- xen/drivers/passthrough/device_tree.c | 38 +++ xen/include/xen/iommu.h | 2 ++ 2 files changed, 40 insertions(+) diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passt

[XEN][RFC PATCH v3 14/14] tools/xl: Add new xl command overlay for device tree overlay support

2022-03-08 Thread Vikram Garhwal
Signed-off-by: Vikram Garhwal --- tools/xl/xl.h | 4 tools/xl/xl_cmdtable.c | 6 ++ tools/xl/xl_vmcontrol.c | 45 + 3 files changed, 55 insertions(+) diff --git a/tools/xl/xl.h b/tools/xl/xl.h index c5c4bedbdd..604fd5bb94 100644 --- a

[XEN][RFC PATCH v3 13/14] tools/libs/light: Implement new libxl functions for device tree overlay ops

2022-03-08 Thread Vikram Garhwal
Signed-off-by: Vikram Garhwal --- tools/include/libxl.h| 3 ++ tools/libs/light/Makefile| 1 + tools/libs/light/libxl_overlay.c | 67 3 files changed, 71 insertions(+) create mode 100644 tools/libs/light/libxl_overlay.c diff --git a/tools/i

[XEN][RFC PATCH v3 11/14] xen/arm: Implement device tree node addition functionalities

2022-03-08 Thread Vikram Garhwal
Update sysctl XEN_SYSCTL_dt_overlay to enable support for dtbo nodes addition using device tree overlay. xl overlay add file.dtbo: Each time overlay nodes are added using .dtbo, a new fdt(memcpy of device_tree_flattened) is created and updated with overlay nodes. This updated fdt is fu

[XEN][RFC PATCH v3 01/14] xen/arm/device: Remove __init from function type

2022-03-08 Thread Vikram Garhwal
Change function type of following function to access during runtime: 1. map_irq_to_domain() 2. handle_device_interrupt() 3. map_range_to_domain() 4. unflatten_dt_node() 5. unflatten_device_tree() Move map_irq_to_domain(), handle_device_interrupt() and map_range_to_domain() to d

[XEN][RFC PATCH v3 07/14] xen/iommu: Move spin_lock from iommu_dt_device_is_assigned to caller

2022-03-08 Thread Vikram Garhwal
Rename iommu_dt_device_is_assigned() to iommu_dt_device_is_assigned_lock(). Moving spin_lock to caller was done to prevent the concurrent access to iommu_dt_device_is_assigned while doing add/remove/assign/deassign. Signed-off-by: Vikram Garhwal --- xen/drivers/passthrough/device_tree.c | 11 ++

[XEN][RFC PATCH v3 03/14] libfdt: Keep fdt functions after init for CONFIG_OVERLAY_DTB.

2022-03-08 Thread Vikram Garhwal
This is done to access fdt library function which are required for adding device tree overlay nodes for dynamic programming of nodes. Acked-by: Julien Grall Signed-off-by: Vikram Garhwal --- xen/common/libfdt/Makefile | 4 1 file changed, 4 insertions(+) diff --git a/xen/common/libfdt/Mak

[XEN][RFC PATCH v3 12/14] tools/libs/ctrl: Implement new xc interfaces for dt overlay

2022-03-08 Thread Vikram Garhwal
xc_dt_overlay() sends the device tree binary overlay, size of .dtbo and overlay operation type i.e. add or remove to xen. Signed-off-by: Vikram Garhwal --- tools/include/xenctrl.h | 3 +++ tools/libs/ctrl/Makefile | 1 + tools/libs/ctrl/xc_overlay.c | 51 ++

[XEN][RFC PATCH v3 08/14] xen/iommu: protect iommu_add_dt_device() with dtdevs_lock

2022-03-08 Thread Vikram Garhwal
Protect iommu_add_dt_device() with dtdevs_lock to prevent concurrent access add. Signed-off-by: Vikram Garhwal --- xen/drivers/passthrough/device_tree.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/de

[XEN][RFC PATCH v3 04/14] libfdt: overlay: change overlay_get_target()

2022-03-08 Thread Vikram Garhwal
Rename overlay_get_target() to fdt_overlay_target_offset() and remove static function type. This is done to get the target path for the overlay nodes which is very useful in many cases. For example, Xen hypervisor needs it when applying overlays because Xen needs to do further processing of the ov

[XEN][RFC PATCH v3 00/14] dynamic node programming using overlay dtbo

2022-03-08 Thread Vikram Garhwal
Hi, This RFC patch series is for introducing dynamic programming i.e. add/remove the devices during run time. Using "xl overlay" a device can be added/removed with dtbo. For adding a node using dynamic programming: 1. flatten device tree overlay node will be added to a fdt 2. Updated fdt

[ovmf test] 168479: regressions - FAIL

2022-03-08 Thread osstest service owner
flight 168479 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/168479/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-xsm 6 xen-buildfail REGR. vs. 168254 build-amd64

Re: [PATCH 1/3] xen/arm: Add i.MX lpuart driver

2022-03-08 Thread Julien Grall
Hi Peng, On 28/02/2022 01:07, Peng Fan (OSS) wrote: From: Peng Fan Signed-off-by: Peng Fan --- xen/drivers/char/Kconfig | 8 + xen/drivers/char/Makefile | 1 + xen/drivers/char/imx-lpuart.c | 303 ++ xen/include/xen/imx-lpuart.h | 64 +++

[qemu-mainline test] 168474: regressions - trouble: broken/fail/pass

2022-03-08 Thread osstest service owner
flight 168474 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/168474/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-libvirt-qcow2 broken test-armhf-armhf-libvirt-qcow2 5 host

Re: [PATCH 1/3] xen/arm: Add i.MX lpuart driver

2022-03-08 Thread Julien Grall
On 28/02/2022 09:27, Peng Fan wrote: Hi Julien, Hi Peng, Subject: Re: [PATCH 1/3] xen/arm: Add i.MX lpuart driver Hi Peng, On 28/02/2022 01:07, Peng Fan (OSS) wrote: From: Peng Fan Can you give me a link to the specification and/or a similar driver in Linux? https://www.nxp.com/web

Re: [PATCH v4] vpci/msix: fix PBA accesses

2022-03-08 Thread Alex Olson
On Tue, 2022-03-08 at 09:31 +0100, Jan Beulich wrote: > On 07.03.2022 17:37, Roger Pau Monne wrote: > > Map the PBA in order to access it from the MSI-X read and write > > handlers. Note that previously the handlers would pass the physical > > host address into the {read,write}{l,q} handlers, which

Re: [XEN v9 3/4] xen/arm64: io: Handle the abort due to access to stage1 translation table

2022-03-08 Thread Julien Grall
Hi, On 08/03/2022 11:22, Ayan Kumar Halder wrote: Hi Julien, On 07/03/2022 23:59, Julien Grall wrote: Hi, On 07/03/2022 22:23, Ayan Kumar Halder wrote: On 07/03/2022 19:37, Julien Grall wrote: On 07/03/2022 14:27, Ayan Kumar Halder wrote: Hi Julien, Hi Ayan, Hi Julien, I need a bit

[PATCH v6 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Jane Malalane
Introduce a new per-domain creation x86 specific flag to select whether hardware assisted virtualization should be used for x{2}APIC. A per-domain option is added to xl in order to select the usage of x{2}APIC hardware assisted virtualization, as well as a global configuration option. Having all

[PATCH v6 1/2] xen+tools: Report Interrupt Controller Virtualization capabilities on x86

2022-03-08 Thread Jane Malalane
Add XEN_SYSCTL_PHYSCAP_X86_ASSISTED_XAPIC and XEN_SYSCTL_PHYSCAP_X86_ASSISTED_X2APIC to report accelerated xapic and x2apic, on x86 hardware. No such features are currently implemented on AMD hardware. HW assisted xAPIC virtualization will be reported if HW, at the minimum, supports virtualize_api

Re: [PATCH v3 2/2] livepatch: set -f{function,data}-sections compiler option

2022-03-08 Thread Jan Beulich
On 08.03.2022 17:41, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 04:13:55PM +0100, Jan Beulich wrote: >> On 08.03.2022 15:46, Roger Pau Monné wrote: >>> On Tue, Mar 08, 2022 at 03:09:17PM +0100, Jan Beulich wrote: On 08.03.2022 14:49, Roger Pau Monne wrote: > If livepatching support i

Re: [PATCH v3 1/2] xen/build: put image header into a separate section

2022-03-08 Thread Jan Beulich
On 08.03.2022 17:36, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 04:08:53PM +0100, Jan Beulich wrote: >> On 08.03.2022 15:18, Roger Pau Monné wrote: >>> On Tue, Mar 08, 2022 at 02:57:23PM +0100, Jan Beulich wrote: On 08.03.2022 14:49, Roger Pau Monne wrote: > So it can be explicitly p

Re: [PATCH v3 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Doebel, Bjoern
On 08.03.22 17:01, Ross Lagerwall wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. From: Doebel, Bjoern Sent: Tuesday, March 8, 2022 3:41 PM To: Ross Lagerwall ;

Re: [RFC PATCH v1] arch/x86: Livepatch: fix overflow check when computing ELF relocations

2022-03-08 Thread Ross Lagerwall
> From: Roger Pau Monne > Sent: Tuesday, March 8, 2022 4:26 PM > To: Bjoern Doebel ; Jan Beulich > Cc: Michael Kurth ; Martin Pohlack ; > Konrad Rzeszutek Wilk ; Ross Lagerwall > ; xen-devel@lists.xenproject.org > > Subject: Re: [RFC PATCH v1] arch/x86: Livepatch: fix overflow check when > c

Re: [RFC PATCH v1] arch/x86: Livepatch: fix overflow check when computing ELF relocations

2022-03-08 Thread Jan Beulich
On 08.03.2022 17:26, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 05:15:33PM +0100, Roger Pau Monné wrote: >> On Tue, Mar 08, 2022 at 04:45:34PM +0100, Jan Beulich wrote: >>> On 08.03.2022 16:36, Bjoern Doebel wrote: --- a/xen/arch/x86/livepatch.c +++ b/xen/arch/x86/livepatch.c @

Re: [PATCH] x86/kexec: Fix kexec-reboot with CET active

2022-03-08 Thread Jan Beulich
On 08.03.2022 17:22, Andrew Cooper wrote: > On 08/03/2022 08:15, Jan Beulich wrote: >> On 07.03.2022 21:53, Andrew Cooper wrote: >>> --- a/xen/arch/x86/machine_kexec.c >>> +++ b/xen/arch/x86/machine_kexec.c >>> @@ -156,6 +156,16 @@ void machine_kexec(struct kexec_image *image) >>> */ >>>

Re: [PATCH v3 2/2] livepatch: set -f{function,data}-sections compiler option

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 04:13:55PM +0100, Jan Beulich wrote: > On 08.03.2022 15:46, Roger Pau Monné wrote: > > On Tue, Mar 08, 2022 at 03:09:17PM +0100, Jan Beulich wrote: > >> On 08.03.2022 14:49, Roger Pau Monne wrote: > >>> If livepatching support is enabled build the hypervisor with > >>> -f{fu

Re: [PATCH v3 1/2] xen/build: put image header into a separate section

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 04:08:53PM +0100, Jan Beulich wrote: > On 08.03.2022 15:18, Roger Pau Monné wrote: > > On Tue, Mar 08, 2022 at 02:57:23PM +0100, Jan Beulich wrote: > >> On 08.03.2022 14:49, Roger Pau Monne wrote: > >>> So it can be explicitly placed ahead of the rest of the .text content >

Re: [PATCH 4.16] VT-d: drop undue address-of from check_cleanup_domid_map()

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 04:27:00PM +0100, Jan Beulich wrote: > For an unknown reason I added back the operator while backporting, > despite 4.16 having c06e3d810314 ("VT-d: per-domain IOMMU bitmap needs > to have dynamic size"). I can only assume that I mistakenly took the > 4.15 backport as basis

Re: [RFC PATCH v1] arch/x86: Livepatch: fix overflow check when computing ELF relocations

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 05:15:33PM +0100, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 04:45:34PM +0100, Jan Beulich wrote: > > On 08.03.2022 16:36, Bjoern Doebel wrote: > > > --- a/xen/arch/x86/livepatch.c > > > +++ b/xen/arch/x86/livepatch.c > > > @@ -339,7 +339,7 @@ int arch_livepatch_perfor

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 04:16:21PM +, Jane Malalane wrote: > On 08/03/2022 16:02, Roger Pau Monné wrote: > > On Tue, Mar 08, 2022 at 03:44:18PM +, Jane Malalane wrote: > >> On 08/03/2022 11:38, Roger Pau Monné wrote: > >>> On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: > >>>

Re: [PATCH] x86/kexec: Fix kexec-reboot with CET active

2022-03-08 Thread Andrew Cooper
On 08/03/2022 08:15, Jan Beulich wrote: > On 07.03.2022 21:53, Andrew Cooper wrote: >> --- a/xen/arch/x86/machine_kexec.c >> +++ b/xen/arch/x86/machine_kexec.c >> @@ -156,6 +156,16 @@ void machine_kexec(struct kexec_image *image) >> */ >> local_irq_disable(); >> >> +/* Reset CPUID

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Jane Malalane
On 08/03/2022 16:02, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 03:44:18PM +, Jane Malalane wrote: >> On 08/03/2022 11:38, Roger Pau Monné wrote: >>> On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x

Re: [RFC PATCH v1] arch/x86: Livepatch: fix overflow check when computing ELF relocations

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 04:45:34PM +0100, Jan Beulich wrote: > On 08.03.2022 16:36, Bjoern Doebel wrote: > > --- a/xen/arch/x86/livepatch.c > > +++ b/xen/arch/x86/livepatch.c > > @@ -339,7 +339,7 @@ int arch_livepatch_perform_rela(struct livepatch_elf > > *elf, > > > > val -= (uint6

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Jane Malalane
On 08/03/2022 16:02, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 03:44:18PM +, Jane Malalane wrote: >> On 08/03/2022 11:38, Roger Pau Monné wrote: >>> On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Andrew Cooper
On 08/03/2022 15:36, Jan Beulich wrote: > On 08.03.2022 16:19, Andrew Cooper wrote: >> On 08/03/2022 14:37, Jan Beulich wrote: >>> On 08.03.2022 15:01, Andrew Cooper wrote: For livepatching, we need to look at a potentially clobbered function and determine whether it used to have an ENDBR

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 03:44:18PM +, Jane Malalane wrote: > On 08/03/2022 11:38, Roger Pau Monné wrote: > > On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: > >> diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h > >> b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h > >> index 9119aa

Re: [PATCH v3 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Ross Lagerwall
> From: Doebel, Bjoern > Sent: Tuesday, March 8, 2022 3:41 PM > To: Ross Lagerwall ; > xen-devel@lists.xenproject.org > Cc: Michael Kurth ; Martin Pohlack ; > Roger Pau Monne ; Andrew Cooper > ; Konrad Rzeszutek Wilk > Subject: Re: [PATCH v3 2/2] xen/x86: Livepatch: support patching CET-enhan

Re: [RFC PATCH v1] arch/x86: Livepatch: fix overflow check when computing ELF relocations

2022-03-08 Thread Jan Beulich
On 08.03.2022 16:36, Bjoern Doebel wrote: > --- a/xen/arch/x86/livepatch.c > +++ b/xen/arch/x86/livepatch.c > @@ -339,7 +339,7 @@ int arch_livepatch_perform_rela(struct livepatch_elf *elf, > > val -= (uint64_t)dest; > *(int32_t *)dest = val; Afaict after this assignment

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Jane Malalane
On 08/03/2022 11:38, Roger Pau Monné wrote: > On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: >> Introduce a new per-domain creation x86 specific flag to >> select whether hardware assisted virtualization should be used for >> x{2}APIC. >> >> A per-domain option is added to xl in ord

Re: [PATCH v3 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Doebel, Bjoern
On 08.03.22 16:25, Ross Lagerwall wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. From: Bjoern Doebel Sent: Tuesday, March 8, 2022 10:29 AM To: xen-devel@lists.x

Re: [PATCH v4 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Jan Beulich
On 08.03.2022 16:23, Bjoern Doebel wrote: > @@ -127,15 +161,21 @@ int arch_livepatch_verify_func(const struct > livepatch_func *func) > void noinline arch_livepatch_apply(struct livepatch_func *func) > { > uint8_t *old_ptr; > -uint8_t insn[sizeof(func->opaque)]; > +struct x86_livepa

[RFC PATCH v1] arch/x86: Livepatch: fix overflow check when computing ELF relocations

2022-03-08 Thread Bjoern Doebel
Comparing a signed 64bit integer to a signed 32 bit integer may lead to unexpected overflows. Adjust the cast to use the same type. Signed-off-by: Bjoern Doebel CC: Konrad Rzeszutek Wilk CC: Ross Lagerwall --- I need some input here. When testing the CET-BIT livepatch updates I noticed that my

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Jan Beulich
On 08.03.2022 16:19, Andrew Cooper wrote: > On 08/03/2022 14:37, Jan Beulich wrote: >> On 08.03.2022 15:01, Andrew Cooper wrote: >>> For livepatching, we need to look at a potentially clobbered function and >>> determine whether it used to have an ENDBR64 instruction. >>> >>> Use a non-default 4-by

[PATCH 4.16] VT-d: drop undue address-of from check_cleanup_domid_map()

2022-03-08 Thread Jan Beulich
For an unknown reason I added back the operator while backporting, despite 4.16 having c06e3d810314 ("VT-d: per-domain IOMMU bitmap needs to have dynamic size"). I can only assume that I mistakenly took the 4.15 backport as basis and/or reference. Fixes: fa45f6b5560e ("VT-d: split domid map cleanu

Re: [PATCH v3 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Ross Lagerwall
> From: Bjoern Doebel > Sent: Tuesday, March 8, 2022 10:29 AM > To: xen-devel@lists.xenproject.org > Cc: Michael Kurth ; Martin Pohlack ; > Roger Pau Monne ; Andrew Cooper > ; Bjoern Doebel ; Konrad > Rzeszutek Wilk ; Ross Lagerwall > > Subject: [PATCH v3 2/2] xen/x86: Livepatch: support pat

[PATCH v4 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Bjoern Doebel
Xen enabled CET for supporting architectures. The control flow aspect of CET expects functions that can be called indirectly (i.e., via function pointers) to start with an ENDBR64 instruction. Otherwise a control flow exception is raised. This expectation breaks livepatching flows because we patch

[PATCH v4 1/2] Livepatch: resolve old address before function verification

2022-03-08 Thread Bjoern Doebel
When verifying that a livepatch can be applied, we may as well want to inspect the target function to be patched. To do so, we need to resolve this function's address before running the arch-specific livepatch_verify hook. Signed-off-by: Bjoern Doebel Acked-by: Konrad Rzeszutek Wilk Reviewed-by:

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Andrew Cooper
On 08/03/2022 14:37, Jan Beulich wrote: > On 08.03.2022 15:01, Andrew Cooper wrote: >> For livepatching, we need to look at a potentially clobbered function and >> determine whether it used to have an ENDBR64 instruction. >> >> Use a non-default 4-byte P6 long nop, not emitted by toolchains, and >

Re: [PATCH v3 2/2] livepatch: set -f{function,data}-sections compiler option

2022-03-08 Thread Jan Beulich
On 08.03.2022 15:46, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 03:09:17PM +0100, Jan Beulich wrote: >> On 08.03.2022 14:49, Roger Pau Monne wrote: >>> If livepatching support is enabled build the hypervisor with >>> -f{function,data}-sections compiler options, which is required by the >>> li

Re: [PATCH v3 1/2] xen/build: put image header into a separate section

2022-03-08 Thread Jan Beulich
On 08.03.2022 15:18, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 02:57:23PM +0100, Jan Beulich wrote: >> On 08.03.2022 14:49, Roger Pau Monne wrote: >>> So it can be explicitly placed ahead of the rest of the .text content >>> in the linker script (and thus the resulting image). This is a >>>

Re: [PATCH 4/4] livepatch: differentiate between old and new build systems

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 02:38:47PM +, Andrew Cooper wrote: > On 02/03/2022 14:27, Roger Pau Monne wrote: > > diff --git a/livepatch-build b/livepatch-build > > index 38a92be..656cdac 100755 > > --- a/livepatch-build > > +++ b/livepatch-build > > @@ -98,14 +98,20 @@ function build_special() > >

Re: [PATCH v3 0/2] livepatch: enable -f{function,data}-sections compiler option

2022-03-08 Thread Julien Grall
Hi, On 08/03/2022 13:49, Roger Pau Monne wrote: Hello, The content in v3 has been split in two patches, but is still mostly the same. The main difference is that first patch does a bit of cleanup of the build logic now that the header object file doesn't need to be the first one passed to the l

Re: [PATCH v3 2/2] livepatch: set -f{function,data}-sections compiler option

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 03:09:17PM +0100, Jan Beulich wrote: > On 08.03.2022 14:49, Roger Pau Monne wrote: > > If livepatching support is enabled build the hypervisor with > > -f{function,data}-sections compiler options, which is required by the > > livepatching tools to detect changes and create l

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Jan Beulich
On 08.03.2022 15:31, Jane Malalane wrote: > On 08/03/2022 12:33, Roger Pau Monné wrote: >> On Tue, Mar 08, 2022 at 01:24:23PM +0100, Jan Beulich wrote: >>> On 08.03.2022 12:38, Roger Pau Monné wrote: On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: > @@ -685,13 +687,31 @@ int

Re: [PATCH 4/4] livepatch: differentiate between old and new build systems

2022-03-08 Thread Andrew Cooper
On 02/03/2022 14:27, Roger Pau Monne wrote: > diff --git a/livepatch-build b/livepatch-build > index 38a92be..656cdac 100755 > --- a/livepatch-build > +++ b/livepatch-build > @@ -98,14 +98,20 @@ function build_special() > > # Build with special GCC flags > cd "${SRCDIR}/xen" || die > -

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Jan Beulich
On 08.03.2022 15:01, Andrew Cooper wrote: > For livepatching, we need to look at a potentially clobbered function and > determine whether it used to have an ENDBR64 instruction. > > Use a non-default 4-byte P6 long nop, not emitted by toolchains, and introduce > the was_endbr64() predicate. Did y

Re: [PATCH 1/2] Livepatch: resolve old address before function verification

2022-03-08 Thread Ross Lagerwall
> From: Bjoern Doebel > Sent: Monday, March 7, 2022 11:53 AM > To: xen-devel@lists.xenproject.org > Cc: Michael Kurth ; Martin Pohlack ; > Roger Pau Monne ; Andrew Cooper > ; Bjoern Doebel ; Konrad > Rzeszutek Wilk ; Ross Lagerwall > > Subject: [PATCH 1/2] Livepatch: resolve old address befo

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Jane Malalane
On 08/03/2022 12:33, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 01:24:23PM +0100, Jan Beulich wrote: >> On 08.03.2022 12:38, Roger Pau Monné wrote: >>> On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: @@ -685,13 +687,31 @@ int arch_sanitise_domain_config(struct xen_do

Re: [PATCH v3 1/2] xen/build: put image header into a separate section

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 02:11:28PM +, Andrew Cooper wrote: > On 08/03/2022 13:49, Roger Pau Monne wrote: > > diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S > > index 08016948ab..47d09d6cf1 100644 > > --- a/xen/arch/arm/xen.lds.S > > +++ b/xen/arch/arm/xen.lds.S > > @@ -30,9 +30,13

Re: [PATCH v3 1/2] xen/build: put image header into a separate section

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 02:57:23PM +0100, Jan Beulich wrote: > On 08.03.2022 14:49, Roger Pau Monne wrote: > > So it can be explicitly placed ahead of the rest of the .text content > > in the linker script (and thus the resulting image). This is a > > prerequisite for further work that will add a c

Re: [XEN PATCH v9 06/30] build: rework test/livepatch/Makefile

2022-03-08 Thread Ross Lagerwall
> From: Anthony PERARD > Sent: Tuesday, January 25, 2022 11:00 AM > To: xen-devel@lists.xenproject.org > Cc: Anthony Perard ; Jan Beulich > ; Andrew Cooper ; George Dunlap > ; Julien Grall ; Stefano Stabellini > ; Wei Liu ; Konrad Rzeszutek Wilk > ; Ross Lagerwall > Subject: [XEN PATCH v9 06

Re: [PATCH v2] x86/build: use --orphan-handling linker option if available

2022-03-08 Thread Jan Beulich
On 08.03.2022 15:07, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 01:34:06PM +0100, Jan Beulich wrote: >> On 08.03.2022 13:11, Roger Pau Monné wrote: >>> On Tue, Mar 08, 2022 at 12:15:04PM +0100, Jan Beulich wrote: On 08.03.2022 11:12, Roger Pau Monné wrote: > On Mon, Mar 07, 2022 at 0

Re: [PATCH v3 1/2] xen/build: put image header into a separate section

2022-03-08 Thread Andrew Cooper
On 08/03/2022 13:49, Roger Pau Monne wrote: > diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S > index 08016948ab..47d09d6cf1 100644 > --- a/xen/arch/arm/xen.lds.S > +++ b/xen/arch/arm/xen.lds.S > @@ -30,9 +30,13 @@ SECTIONS >_start = .; >.text : { > _stext = .;

Re: [PATCH v3 2/2] livepatch: set -f{function,data}-sections compiler option

2022-03-08 Thread Jan Beulich
On 08.03.2022 14:49, Roger Pau Monne wrote: > If livepatching support is enabled build the hypervisor with > -f{function,data}-sections compiler options, which is required by the > livepatching tools to detect changes and create livepatches. > > This shouldn't result in any functional change on th

Re: [PATCH v2] x86/build: use --orphan-handling linker option if available

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 01:34:06PM +0100, Jan Beulich wrote: > On 08.03.2022 13:11, Roger Pau Monné wrote: > > On Tue, Mar 08, 2022 at 12:15:04PM +0100, Jan Beulich wrote: > >> On 08.03.2022 11:12, Roger Pau Monné wrote: > >>> On Mon, Mar 07, 2022 at 02:53:32PM +0100, Jan Beulich wrote: > @@ -

[PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Andrew Cooper
For livepatching, we need to look at a potentially clobbered function and determine whether it used to have an ENDBR64 instruction. Use a non-default 4-byte P6 long nop, not emitted by toolchains, and introduce the was_endbr64() predicate. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Ro

Re: [PATCH 4/4] livepatch: differentiate between old and new build systems

2022-03-08 Thread Ross Lagerwall
> From: Roger Pau Monne > Sent: Wednesday, March 2, 2022 2:27 PM > To: xen-devel@lists.xenproject.org > Cc: Ross Lagerwall ; konrad.w...@oracle.com > ; doe...@amazon.de ; jul...@xen.org > ; Andrew Cooper ; Roger Pau Monne > > Subject: [PATCH 4/4] livepatch: differentiate between old and new b

Re: [PATCH v3 1/2] xen/build: put image header into a separate section

2022-03-08 Thread Jan Beulich
On 08.03.2022 14:49, Roger Pau Monne wrote: > So it can be explicitly placed ahead of the rest of the .text content > in the linker script (and thus the resulting image). This is a > prerequisite for further work that will add a catch-all to the text > section (.text.*). > > Note that placement of

Re: [PATCH v3 00/13] xen: drop hypercall function tables

2022-03-08 Thread Jan Beulich
On 08.03.2022 14:44, Juergen Gross wrote: > On 08.03.22 14:42, Jan Beulich wrote: >> On 08.03.2022 13:56, Juergen Gross wrote: >>> On 08.03.22 13:50, Jan Beulich wrote: On 08.03.2022 09:39, Juergen Gross wrote: > On 08.03.22 09:34, Jan Beulich wrote: >> On 08.12.2021 16:55, Juergen Gro

Re: [PATCH 3/4] livepatch: do the initial build using CROSS_COMPILE

2022-03-08 Thread Ross Lagerwall
> From: Roger Pau Monne > Sent: Wednesday, March 2, 2022 2:27 PM > To: xen-devel@lists.xenproject.org > Cc: Ross Lagerwall ; konrad.w...@oracle.com > ; doe...@amazon.de ; jul...@xen.org > ; Andrew Cooper ; Roger Pau Monne > > Subject: [PATCH 3/4] livepatch: do the initial build using CROSS_CO

[PATCH v3 2/2] livepatch: set -f{function,data}-sections compiler option

2022-03-08 Thread Roger Pau Monne
If livepatching support is enabled build the hypervisor with -f{function,data}-sections compiler options, which is required by the livepatching tools to detect changes and create livepatches. This shouldn't result in any functional change on the hypervisor binary image, but does however require so

[PATCH v3 1/2] xen/build: put image header into a separate section

2022-03-08 Thread Roger Pau Monne
So it can be explicitly placed ahead of the rest of the .text content in the linker script (and thus the resulting image). This is a prerequisite for further work that will add a catch-all to the text section (.text.*). Note that placement of the sections inside of .text is also slightly adjusted

[PATCH v3 0/2] livepatch: enable -f{function,data}-sections compiler option

2022-03-08 Thread Roger Pau Monne
Hello, The content in v3 has been split in two patches, but is still mostly the same. The main difference is that first patch does a bit of cleanup of the build logic now that the header object file doesn't need to be the first one passed to the linker script. Thanks, Roger. Roger Pau Monne (2):

Re: [PATCH 2/4] livepatch: improve rune for fetching of Build ID

2022-03-08 Thread Ross Lagerwall
> From: Roger Pau Monne > Sent: Wednesday, March 2, 2022 2:27 PM > To: xen-devel@lists.xenproject.org > Cc: Ross Lagerwall ; konrad.w...@oracle.com > ; doe...@amazon.de ; jul...@xen.org > ; Andrew Cooper ; Roger Pau Monne > ; Roger Pau Monné > Subject: [PATCH 2/4] livepatch: improve rune for

Re: [PATCH v3 00/13] xen: drop hypercall function tables

2022-03-08 Thread Juergen Gross
On 08.03.22 14:42, Jan Beulich wrote: On 08.03.2022 13:56, Juergen Gross wrote: On 08.03.22 13:50, Jan Beulich wrote: On 08.03.2022 09:39, Juergen Gross wrote: On 08.03.22 09:34, Jan Beulich wrote: On 08.12.2021 16:55, Juergen Gross wrote: In order to avoid indirect function calls on the hyp

Re: [PATCH v3 00/13] xen: drop hypercall function tables

2022-03-08 Thread Jan Beulich
On 08.03.2022 13:56, Juergen Gross wrote: > On 08.03.22 13:50, Jan Beulich wrote: >> On 08.03.2022 09:39, Juergen Gross wrote: >>> On 08.03.22 09:34, Jan Beulich wrote: On 08.12.2021 16:55, Juergen Gross wrote: > In order to avoid indirect function calls on the hypercall path as > much

Re: [PATCH 1/4] livepatch: update readme to mention --xen-depends

2022-03-08 Thread Ross Lagerwall
> From: Roger Pau Monne > Sent: Wednesday, March 2, 2022 2:27 PM > To: xen-devel@lists.xenproject.org > Cc: Ross Lagerwall ; konrad.w...@oracle.com > ; doe...@amazon.de ; jul...@xen.org > ; Andrew Cooper ; Roger Pau Monne > > Subject: [PATCH 1/4] livepatch: update readme to mention --xen-depe

Re: [PATCH v3 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Doebel, Bjoern
On 08.03.22 14:06, Konrad Rzeszutek Wilk wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. On Tue, Mar 08, 2022 at 12:44:54PM +, Andrew Cooper wrote: On 08/03/2

Re: [PATCH v3 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Doebel, Bjoern
On 08.03.22 13:44, Andrew Cooper wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. On 08/03/2022 10:29, Bjoern Doebel wrote: @@ -104,18 +122,34 @@ void noinline arc

Re: [PATCH v3 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Konrad Rzeszutek Wilk
On Tue, Mar 08, 2022 at 12:44:54PM +, Andrew Cooper wrote: > On 08/03/2022 10:29, Bjoern Doebel wrote: > > @@ -104,18 +122,34 @@ void noinline arch_livepatch_revive(void) > > > > int arch_livepatch_verify_func(const struct livepatch_func *func) > > { > > +BUILD_BUG_ON(sizeof(struct x86_

[ovmf test] 168478: regressions - FAIL

2022-03-08 Thread osstest service owner
flight 168478 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/168478/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-xsm 6 xen-buildfail REGR. vs. 168254 build-amd64

Re: [PATCH v3 00/13] xen: drop hypercall function tables

2022-03-08 Thread Juergen Gross
On 08.03.22 13:50, Jan Beulich wrote: On 08.03.2022 09:39, Juergen Gross wrote: On 08.03.22 09:34, Jan Beulich wrote: On 08.12.2021 16:55, Juergen Gross wrote: In order to avoid indirect function calls on the hypercall path as much as possible this series is removing the hypercall function tab

Re: [PATCH v3 00/13] xen: drop hypercall function tables

2022-03-08 Thread Jan Beulich
On 08.03.2022 09:39, Juergen Gross wrote: > On 08.03.22 09:34, Jan Beulich wrote: >> On 08.12.2021 16:55, Juergen Gross wrote: >>> In order to avoid indirect function calls on the hypercall path as >>> much as possible this series is removing the hypercall function tables >>> and is replacing the h

Re: [PATCH v3 2/2] xen/x86: Livepatch: support patching CET-enhanced functions

2022-03-08 Thread Andrew Cooper
On 08/03/2022 10:29, Bjoern Doebel wrote: > @@ -104,18 +122,34 @@ void noinline arch_livepatch_revive(void) > > int arch_livepatch_verify_func(const struct livepatch_func *func) > { > +BUILD_BUG_ON(sizeof(struct x86_livepatch_meta) != LIVEPATCH_OPAQUE_SIZE); > + > /* If NOPing.. */ >

Re: [PATCH v4] vpci/msix: fix PBA accesses

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 11:46:20AM +0100, Jan Beulich wrote: > On 08.03.2022 10:05, Roger Pau Monné wrote: > > On Tue, Mar 08, 2022 at 09:31:34AM +0100, Jan Beulich wrote: > >> On 07.03.2022 17:37, Roger Pau Monne wrote: > >>> Map the PBA in order to access it from the MSI-X read and write > >>> ha

Re: [PATCH v2] x86/build: use --orphan-handling linker option if available

2022-03-08 Thread Jan Beulich
On 08.03.2022 13:11, Roger Pau Monné wrote: > On Tue, Mar 08, 2022 at 12:15:04PM +0100, Jan Beulich wrote: >> On 08.03.2022 11:12, Roger Pau Monné wrote: >>> On Mon, Mar 07, 2022 at 02:53:32PM +0100, Jan Beulich wrote: @@ -179,6 +188,13 @@ SECTIONS #endif #endif +#ifnde

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 01:24:23PM +0100, Jan Beulich wrote: > On 08.03.2022 12:38, Roger Pau Monné wrote: > > On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: > >> @@ -685,13 +687,31 @@ int arch_sanitise_domain_config(struct > >> xen_domctl_createdomain *config) > >> } > >>

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Jan Beulich
On 08.03.2022 12:38, Roger Pau Monné wrote: > On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: >> @@ -685,13 +687,31 @@ int arch_sanitise_domain_config(struct >> xen_domctl_createdomain *config) >> } >> } >> >> -if ( config->arch.misc_flags & ~XEN_X86_MSR_RELAXED

Re: [PATCH v2] x86/build: use --orphan-handling linker option if available

2022-03-08 Thread Roger Pau Monné
On Tue, Mar 08, 2022 at 12:15:04PM +0100, Jan Beulich wrote: > On 08.03.2022 11:12, Roger Pau Monné wrote: > > On Mon, Mar 07, 2022 at 02:53:32PM +0100, Jan Beulich wrote: > >> As was e.g. making necessary 4b7fd8153ddf ("x86: fold sections in final > >> binaries"), arbitrary sections appearing with

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC

2022-03-08 Thread Roger Pau Monné
On Mon, Mar 07, 2022 at 03:06:09PM +, Jane Malalane wrote: > Introduce a new per-domain creation x86 specific flag to > select whether hardware assisted virtualization should be used for > x{2}APIC. > > A per-domain option is added to xl in order to select the usage of > x{2}APIC hardware assi

  1   2   >