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

2022-03-08 Thread Roger Pau Monné
On Mon, Mar 07, 2022 at 06:07:00PM +0100, Jan Beulich wrote: > On 07.03.2022 17:36, Roger Pau Monné wrote: > > On Mon, Mar 07, 2022 at 05:28:20PM +0100, Jan Beulich wrote: > >> On 07.03.2022 16:55, Roger Pau Monne wrote: > >>> If livepatching support is enabled build the hypervisor with > >>> -f{fu

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

2022-03-08 Thread Jan Beulich
On 07.03.2022 22:13, Bjoern Doebel wrote: > @@ -159,7 +200,11 @@ void noinline arch_livepatch_apply(struct livepatch_func > *func) > */ > void noinline arch_livepatch_revert(const struct livepatch_func *func) > { > -memcpy(func->old_addr, func->opaque, livepatch_insn_len(func)); > +str

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

2022-03-08 Thread Roger Pau Monné
On Mon, Mar 07, 2022 at 05:19:53PM +, Julien Grall wrote: > Hi Roger, > > On 07/03/2022 15:55, 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 chan

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

2022-03-08 Thread Jan Beulich
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 masking and faulting to the host's default. */ >

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

2022-03-08 Thread Doebel, Bjoern
On 08.03.22 09:07, Jan Beulich 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 07.03.2022 22:13, Bjoern Doebel wrote: @@ -159,7 +200,11 @@ void noinline arch_l

Re: [PATCH] x86/kexec: Use noreturn attributes, and drop unreachable code

2022-03-08 Thread Jan Beulich
On 07.03.2022 22:02, Andrew Cooper wrote: > kexec_reloc() does not return. Plumbing this property upwards lets us mark > machine_kexec() and machine_reboot_kexec() noreturn too. This in turn lets us > drop some unreachable BUG()/return statements. I'm certainly fine with the added attributes. I'

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

2022-03-08 Thread Jan Beulich
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 is wrong as > those expect a linear address. > > Map the PBA

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

2022-03-08 Thread Jan Beulich
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 hypercall handler calls via the function array > by automatically generated call macros. >

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

2022-03-08 Thread Juergen Gross
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 hypercall handler calls via the function array by automat

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 00/13] xen: drop hypercall function tables

2022-03-08 Thread Juergen Gross
On 08.03.22 09: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 v4] vpci/msix: fix PBA accesses

2022-03-08 Thread Roger Pau Monné
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 > > handlers. Note that previously the handlers would pass the physical > > host address into the {read,write}{l,q} handlers

[ovmf test] 168472: regressions - FAIL

2022-03-08 Thread osstest service owner
flight 168472 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/168472/ 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] 168470: tolerable FAIL - PUSHED

2022-03-08 Thread osstest service owner
flight 168470 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/168470/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stopfail like 168460 test-armhf-armhf-libvirt 16 save

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

2022-03-08 Thread Julien Grall
Hi Roger, On 08/03/2022 08:13, Roger Pau Monné wrote: On Mon, Mar 07, 2022 at 05:19:53PM +, Julien Grall wrote: Hi Roger, On 07/03/2022 15:55, Roger Pau Monne wrote: If livepatching support is enabled build the hypervisor with -f{function,data}-sections compiler options, which is required

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

2022-03-08 Thread Roger Pau Monné
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 without our linker script > placing them explicitly can be a problem. Have the linker make us aware > of such sections, s

[libvirt test] 168473: regressions - FAIL

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

[PATCH v3 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

[ovmf test] 168475: regressions - FAIL

2022-03-08 Thread osstest service owner
flight 168475 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/168475/ 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

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

2022-03-08 Thread Roger Pau Monné
On Mon, Mar 07, 2022 at 03:06:08PM +, Jane Malalane wrote: > Add XEN_SYSCTL_PHYSCAP_ARCH_ASSISTED_xapic and > XEN_SYSCTL_PHYSCAP_ARCH_ASSISTED_x2apic to report accelerated xapic > and x2apic, on x86 hardware. I think the commit message has gone out of sync with the code, those should now be XE

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

2022-03-08 Thread Jan Beulich
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 >>> handlers. Note that previously the handlers would pass the physical >>> h

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

2022-03-08 Thread Jan Beulich
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 without our linker script >> placing them explicitly can be a problem. Ha

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

2022-03-08 Thread Ayan Kumar Halder
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 of clarification to understand this. One clari

[ovmf test] 168477: regressions - FAIL

2022-03-08 Thread osstest service owner
flight 168477 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/168477/ 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

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

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 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 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 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 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 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 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 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

[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 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_

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 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 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 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 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 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

[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):

[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 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

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

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 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 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

[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 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: > @@ -

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 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 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: [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 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: [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 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 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] 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 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 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 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 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 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 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] 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 >

[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:

[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

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 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] 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

[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 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

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 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: [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 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: [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] 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 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/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 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: [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 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: [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 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] 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: [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: [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: [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: [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] 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

[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

[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

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

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: [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

  1   2   >