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

2022-02-14 Thread Jan Beulich
On 14.02.2022 18:09, Jane Malalane wrote: > On 14/02/2022 13:18, Jan Beulich wrote: >> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments >> unless you have verified the sender and know the content is safe. >> >> On 14.02.2022 14:11, Jane Malalane wrote: >>> On 11/02/2022 11

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

2022-02-14 Thread osstest service owner
flight 168111 xen-unstable real [real] flight 168116 xen-unstable real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/168111/ http://logs.test-lab.xenproject.org/osstest/logs/168116/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd6

[PATCH V3 11/13] media: tda8083: use time_is_after_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/dvb-frontends/tda8083.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/tda8083.c b/drivers/media/dv

[PATCH V3 12/13] media: wl128x: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/radio/wl128x/fmdrv_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/driver

[PATCH V3 9/13] media: si21xx: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/dvb-frontends/si21xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb-

[PATCH V3 6/13] input: serio: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/input/serio/ps2-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpi

[PATCH V3 10/13] media: stv0299: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/dvb-frontends/stv0299.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/stv0299.c b/drivers/medi

[PATCH V3 10/13] md: use time_is_before_eq_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/md/dm-writecache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 5

[PATCH V3 13/13] media: vivid: use time_is_after_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/test-drivers/vivid/vivid-kthread-cap.c | 3 ++- drivers/media/test-drivers/vivid/vivid-kthread-out.c | 3 ++- drivers/media/test-drivers/vivid/vi

[PATCH V3 7/13] md: use time_is_before_jiffies(() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/md/dm-thin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index f4234d6..dced764 --- a/d

[PATCH V3 5/13] hid: use time_is_after_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing Acked-by: Srinivas Pandruvada --- drivers/hid/intel-ish-hid/ipc/ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/intel-ish-hid/ip

[PATCH V3 4/13] gpu: drm: radeon: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/gpu/drm/radeon/radeon_pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/rade

[PATCH V3 3/13] gpu: drm: i915: use time_is_after_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c

[PATCH V3 2/13] clk: mvebu: use time_is_before_eq_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/clk/mvebu/armada-37xx-periph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/

[PATCH V3 00/13] use time_is_{before,after}_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. V2: Batch them in a series suggested by Joe. Use time_xxx_jiffies() instead of time_xxx() suggested by Kieran. V3: Fix subject and description suggested by Ted. Wang Qing (14): block: xen: u

[PATCH V3 1/13] block: xen: use time_is_before_eq_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/block/xen-blkback/blkback.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/x

[qemu-mainline test] 168109: FAIL

2022-02-14 Thread osstest service owner
flight 168109 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/168109/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-xsm broken in 168104 build-ar

Re: [RFC v2 5/8] xen/arm: introduce SCMI-SMC mediator driver

2022-02-14 Thread Stefano Stabellini
On Mon, 14 Feb 2022, Oleksii Moisieiev wrote: > Hi Bertrand, > > On Mon, Feb 14, 2022 at 11:27:21AM +, Bertrand Marquis wrote: > > Hi Oleksii, > > > > > On 14 Feb 2022, at 11:13, Oleksii Moisieiev > > > wrote: > > > > > > Hi Julien, > > > > > > On Sat, Feb 12, 2022 at 12:43:56PM +, Ju

Re: [PATCH] RFC: Version support policy

2022-02-14 Thread George Dunlap
> On Aug 19, 2021, at 10:18 AM, Jan Beulich wrote: > > On 13.08.2021 13:37, Ian Jackson wrote: >> The current policy for minimum supported versions of tools, compilers, >> etc. is unsatisfactory: For many dependencies no minimum version is >> specified. For those where a version is stated, upd

Re: [PATCH] RFC: Version support policy

2022-02-14 Thread George Dunlap
> On Aug 18, 2021, at 12:16 PM, Marek Marczykowski-Górecki > wrote: > > On Fri, Aug 13, 2021 at 12:37:27PM +0100, Ian Jackson wrote: >> The current policy for minimum supported versions of tools, compilers, >> etc. is unsatisfactory: For many dependencies no minimum version is >> specified. F

Re: [PATCH 0/3] amd/msr: implement MSR_VIRT_SPEC_CTRL for HVM guests

2022-02-14 Thread Andrew Cooper
On 01/02/2022 16:46, Roger Pau Monne wrote: > Hello, > > The following series implements support for MSR_VIRT_SPEC_CTRL on > different AMD CPU families. > > Note that the support is added backwards, starting with the newer CPUs > that support MSR_SPEC_CTRL and moving to the older ones either using

[linux-linus test] 168108: regressions - trouble: blocked/broken/fail/pass

2022-02-14 Thread osstest service owner
flight 168108 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/168108/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64 broken build-arm64-pvops

Re: [PATCH v2 02/70] xen/sort: Switch to an extern inline implementation

2022-02-14 Thread Andrew Cooper
On 14/02/2022 13:13, Bertrand Marquis wrote: > Hi Andrew, > >> On 14 Feb 2022, at 12:50, Andrew Cooper wrote: >> >> There are exactly 3 callers of sort() in the hypervisor. Callbacks in a >> tight >> loop like this are problematic for performance, especially with Spectre v2 >> protections, which

[linux-5.4 test] 168106: trouble: blocked/broken/fail/pass

2022-02-14 Thread osstest service owner
flight 168106 linux-5.4 real [real] http://logs.test-lab.xenproject.org/osstest/logs/168106/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64 broken build-arm64-pvops

Re: [RFC PATCH] arm/vgic-v3: provide custom callbacks for pend_lpi_tree radix tree

2022-02-14 Thread Luca Fancellu
> On 11 Feb 2022, at 16:12, Julien Grall wrote: > > > > On 11/02/2022 15:45, Luca Fancellu wrote: >>> On 11 Feb 2022, at 15:26, Julien Grall wrote: >>> >>> Hi Luca, >>> >>> On 11/02/2022 15:00, Luca Fancellu wrote: pend_lpi_tree is a radix tree used to store pending irqs, the tree is

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

2022-02-14 Thread Jane Malalane
On 14/02/2022 13:18, Jan Beulich wrote: > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments > unless you have verified the sender and know the content is safe. > > On 14.02.2022 14:11, Jane Malalane wrote: >> On 11/02/2022 11:46, Jan Beulich wrote: >>> [CAUTION - EXTERNAL

Re: [PATCH v2 21/70] xen/evtchn: CFI hardening

2022-02-14 Thread Andrew Cooper
On 14/02/2022 16:53, David Vrabel wrote: > On 14/02/2022 12:50, Andrew Cooper wrote: >> Control Flow Integrity schemes use toolchain and optionally hardware >> support >> to help protect against call/jump/return oriented programming attacks. >> >> Use cf_check to annotate function pointer targets f

Re: [PATCH v2 21/70] xen/evtchn: CFI hardening

2022-02-14 Thread David Vrabel
On 14/02/2022 12:50, Andrew Cooper wrote: Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. [...] -static void evtchn_2l_set_pe

Re: [PATCH v2 5/7] x86/hvm: Use __initdata_cf_clobber for hvm_funcs

2022-02-14 Thread Jan Beulich
On 14.02.2022 17:39, Andrew Cooper wrote: > On 14/02/2022 13:35, Andrew Cooper wrote: >> On 14/02/2022 13:10, Jan Beulich wrote: >>> On 14.02.2022 13:56, Andrew Cooper wrote: --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -88,7 +88,7 @@ unsigned int opt_hvm_debug_level

Re: [PATCH 3/3] amd/msr: implement VIRT_SPEC_CTRL for HVM guests using legacy SSBD

2022-02-14 Thread Jan Beulich
On 01.02.2022 17:46, Roger Pau Monne wrote: > @@ -716,26 +702,117 @@ void amd_init_ssbd(const struct cpuinfo_x86 *c) > if (rdmsr_safe(MSR_AMD64_LS_CFG, val) || > ({ > val &= ~mask; > - if (opt_ssbd) > +

Re: [PATCH v2 5/7] x86/hvm: Use __initdata_cf_clobber for hvm_funcs

2022-02-14 Thread Andrew Cooper
On 14/02/2022 13:35, Andrew Cooper wrote: > On 14/02/2022 13:10, Jan Beulich wrote: >> On 14.02.2022 13:56, Andrew Cooper wrote: >>> --- a/xen/arch/x86/hvm/hvm.c >>> +++ b/xen/arch/x86/hvm/hvm.c >>> @@ -88,7 +88,7 @@ unsigned int opt_hvm_debug_level __read_mostly; >>> integer_param("hvm_debug", op

Re: [PATCH v2 3/7] x86/altcall: Optimise away endbr64 instruction where possible

2022-02-14 Thread Jan Beulich
On 14.02.2022 17:03, Andrew Cooper wrote: > On 14/02/2022 13:51, Jan Beulich wrote: >> On 14.02.2022 14:31, Andrew Cooper wrote: >>> On 14/02/2022 13:06, Jan Beulich wrote: On 14.02.2022 13:56, Andrew Cooper wrote: > @@ -330,6 +333,41 @@ static void init_or_livepatch > _apply_alternat

Re: [PATCH v2 64/70] x86: Introduce helpers/checks for endbr64 instructions

2022-02-14 Thread Andrew Cooper
On 14/02/2022 12:51, Andrew Cooper wrote: > ... to prevent the optimiser creating unsafe code. See the code comment for > full details. > > Signed-off-by: Andrew Cooper From review in the follow-up series, I've merged this delta: diff --git a/xen/arch/x86/include/asm/endbr.h b/xen/arch/x86/incl

Re: [PATCH 16/16] x86/P2M: the majority for struct p2m_domain's fields are HVM-only

2022-02-14 Thread Jan Beulich
On 14.02.2022 16:51, George Dunlap wrote: > > >> On Jul 5, 2021, at 5:15 PM, Jan Beulich wrote: >> >> ..., as are the majority of the locks involved. Conditionalize things >> accordingly. >> >> Also adjust the ioreq field's indentation at this occasion. >> >> Signed-off-by: Jan Beulich > > Rev

Re: [PATCH v2 3/7] x86/altcall: Optimise away endbr64 instruction where possible

2022-02-14 Thread Andrew Cooper
On 14/02/2022 13:51, Jan Beulich wrote: > On 14.02.2022 14:31, Andrew Cooper wrote: >> On 14/02/2022 13:06, Jan Beulich wrote: >>> On 14.02.2022 13:56, Andrew Cooper wrote: @@ -330,6 +333,41 @@ static void init_or_livepatch _apply_alternatives(struct alt_instr *start, add_n

Re: [PATCH 2/3] amd/msr: allow passthrough of VIRT_SPEC_CTRL for HVM guests

2022-02-14 Thread Jan Beulich
On 01.02.2022 17:46, Roger Pau Monne wrote: > Allow HVM guests untrapped access to MSR_VIRT_SPEC_CTRL if the > hardware has support for it. This requires adding logic in the > vm{entry,exit} paths for SVM in order to context switch between the > hypervisor value and the guest one. The added handler

Re: [PATCH 16/16] x86/P2M: the majority for struct p2m_domain's fields are HVM-only

2022-02-14 Thread George Dunlap
> On Jul 5, 2021, at 5:15 PM, Jan Beulich wrote: > > ..., as are the majority of the locks involved. Conditionalize things > accordingly. > > Also adjust the ioreq field's indentation at this occasion. > > Signed-off-by: Jan Beulich Reviewed-by: George Dunlap With one question… > @@ -905

Re: [PATCH 15/16] x86/P2M: p2m.c is HVM-only

2022-02-14 Thread George Dunlap
> On Jul 5, 2021, at 5:14 PM, Jan Beulich wrote: > > This only requires moving p2m_percpu_rwlock elsewhere (ultimately I > think all P2M locking should go away as well when !HVM, but this looks > to require further code juggling). The two other unguarded functions are > already unneeded (by vir

Re: [PATCH 14/16] paged_pages field is MEM_PAGING-only

2022-02-14 Thread George Dunlap
> On Jul 5, 2021, at 5:14 PM, Jan Beulich wrote: > > Conditionalize it and its uses accordingly. > > Signed-off-by: Jan Beulich Reviewed-by: George Dunlap signature.asc Description: Message signed with OpenPGP

Re: [PATCH 13/16] shr_pages field is MEM_SHARING-only

2022-02-14 Thread George Dunlap
> On Jul 5, 2021, at 5:13 PM, Jan Beulich wrote: > > Conditionalize it and its uses accordingly. The main goal though is to > demonstrate that x86's p2m_teardown() is now empty when !HVM, which in > particular means the last remaining use of p2m_lock() in this cases goes > away. > > Signed-off

Re: SecureBoot and PCI passthrough with kernel lockdown in place (on Xen)

2022-02-14 Thread marma...@invisiblethingslab.com
On Mon, Feb 14, 2022 at 03:25:31PM +, Andrew Cooper wrote: > On 14/02/2022 15:02, Dario Faggioli wrote: > > Hello, > > > > We have run into an issue when trying to use PCI passthrough for a Xen > > VM running on an host where dom0 kernel is 5.14.21 (but we think it > > could be any kernel > 5.4

Re: SecureBoot and PCI passthrough with kernel lockdown in place (on Xen)

2022-02-14 Thread Andrew Cooper
On 14/02/2022 15:02, Dario Faggioli wrote: > Hello, > > We have run into an issue when trying to use PCI passthrough for a Xen > VM running on an host where dom0 kernel is 5.14.21 (but we think it > could be any kernel > 5.4) and SecureBoot is enabled. Back up a bit... Xen doesn't support SecureB

Re: [PATCH 11/16] x86/P2M: derive a HVM-only variant from __get_gfn_type_access()

2022-02-14 Thread Jan Beulich
On 14.02.2022 16:12, George Dunlap wrote: >> On Jul 5, 2021, at 5:12 PM, Jan Beulich wrote: >> >> Introduce an inline wrapper dealing with the non-translated-domain case, >> while stripping that logic from the main function, which gets renamed to >> p2m_get_gfn_type_access(). HVM-only callers can

Re: [PATCH 12/16] x86/p2m: re-arrange {,__}put_gfn()

2022-02-14 Thread George Dunlap
> On Jul 5, 2021, at 5:12 PM, Jan Beulich wrote: > > All explicit callers of __put_gfn() are in HVM-only code and hold a valid > P2M pointer in their hands. Move the paging_mode_translate() check out of > there into put_gfn(), renaming __put_gfn() and making its GFN parameter > type-safe. > >

Re: SecureBoot and PCI passthrough with kernel lockdown in place (on Xen)

2022-02-14 Thread Jan Beulich
On 14.02.2022 16:02, Dario Faggioli wrote: > We have run into an issue when trying to use PCI passthrough for a Xen > VM running on an host where dom0 kernel is 5.14.21 (but we think it > could be any kernel > 5.4) and SecureBoot is enabled. > > The error we get, when (for instance) trying to atta

Re: [PATCH 11/16] x86/P2M: derive a HVM-only variant from __get_gfn_type_access()

2022-02-14 Thread George Dunlap
> On Jul 5, 2021, at 5:12 PM, Jan Beulich wrote: > > Introduce an inline wrapper dealing with the non-translated-domain case, > while stripping that logic from the main function, which gets renamed to > p2m_get_gfn_type_access(). HVM-only callers can then directly use the > main function. > >

Re: [PATCH 1/3] amd/msr: implement VIRT_SPEC_CTRL for HVM guests on top of SPEC_CTRL

2022-02-14 Thread Jan Beulich
On 01.02.2022 17:46, Roger Pau Monne wrote: > Use the logic to set shadow SPEC_CTRL values in order to implement > support for VIRT_SPEC_CTRL (signaled by VIRT_SSBD CPUID flag) for HVM > guests. This includes using the spec_ctrl vCPU MSR variable to store > the guest set value of VIRT_SPEC_CTRL.SSB

SecureBoot and PCI passthrough with kernel lockdown in place (on Xen)

2022-02-14 Thread Dario Faggioli
Hello, We have run into an issue when trying to use PCI passthrough for a Xen VM running on an host where dom0 kernel is 5.14.21 (but we think it could be any kernel > 5.4) and SecureBoot is enabled. The error we get, when (for instance) trying to attach a device to an (HVM) VM, on such system is

Re: [PATCH v2 00/70] x86: Support for CET Indirect Branch Tracking

2022-02-14 Thread Jan Beulich
On 14.02.2022 15:15, Andrew Cooper wrote: > On 14/02/2022 13:43, Jan Beulich wrote: >> On 14.02.2022 14:10, Andrew Cooper wrote: >>> On 14/02/2022 12:50, Andrew Cooper wrote: CET Indirect Branch Tracking is a hardware feature designed to protect against forward-edge control flow hij

Re: [PATCH v2 03/70] xen/xsm: Move {do,compat}_flask_op() declarations into a header

2022-02-14 Thread Daniel P. Smith
On 2/14/22 07:50, Andrew Cooper wrote: > Declaring sideways like this is unsafe, because the compiler can't check that > the implementaton in flask_op.c still has the same type. > > Signed-off-by: Andrew Cooper > --- > CC: Daniel De Graaf > CC: Daniel Smith > > v2: > * Rework in the face of n

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 16:31, Jan Beulich wrote: > On 14.02.2022 15:26, Oleksandr Andrushchenko wrote: >> >> On 14.02.22 16:19, Jan Beulich wrote: >>> On 09.02.2022 14:36, Oleksandr Andrushchenko wrote: @@ -410,14 +428,37 @@ static void vpci_write_helper(const struct pci_dev *pdev,

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Jan Beulich
On 14.02.2022 15:26, Oleksandr Andrushchenko wrote: > > > On 14.02.22 16:19, Jan Beulich wrote: >> On 09.02.2022 14:36, Oleksandr Andrushchenko wrote: >>> @@ -410,14 +428,37 @@ static void vpci_write_helper(const struct pci_dev >>> *pdev, >>>r->private); >>> } >>> >>> +stati

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

2022-02-14 Thread Jan Beulich
On 08.02.2022 17:17, Roger Pau Monné wrote: > On Mon, Feb 07, 2022 at 06:21:01PM +, Jane Malalane wrote: >> --- a/xen/arch/x86/traps.c >> +++ b/xen/arch/x86/traps.c >> @@ -1115,7 +1115,8 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, >> uint32_t leaf, >> if ( !is_hvm_domain(d)

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 16:19, Jan Beulich wrote: > On 09.02.2022 14:36, Oleksandr Andrushchenko wrote: >> @@ -410,14 +428,37 @@ static void vpci_write_helper(const struct pci_dev >> *pdev, >>r->private); >> } >> >> +static bool vpci_header_write_lock(const struct pci_dev *pdev, >> +

Re: [PATCH 10/16] x86/P2M: p2m_get_page_from_gfn() is HVM-only

2022-02-14 Thread George Dunlap
> On Jul 5, 2021, at 5:10 PM, Jan Beulich wrote: > > This function is the wrong layer to go through for PV guests. It happens > to work, but produces results which aren't fully consistent with > get_page_from_gfn(). The latter function, however, cannot be used in > map_domain_gfn() as it may no

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Jan Beulich
On 09.02.2022 14:36, Oleksandr Andrushchenko wrote: > @@ -410,14 +428,37 @@ static void vpci_write_helper(const struct pci_dev > *pdev, > r->private); > } > > +static bool vpci_header_write_lock(const struct pci_dev *pdev, > + unsigned int start,

Re: [PATCH v2 00/70] x86: Support for CET Indirect Branch Tracking

2022-02-14 Thread Andrew Cooper
On 14/02/2022 13:43, Jan Beulich wrote: > On 14.02.2022 14:10, Andrew Cooper wrote: >> On 14/02/2022 12:50, Andrew Cooper wrote: >>> CET Indirect Branch Tracking is a hardware feature designed to protect >>> against >>> forward-edge control flow hijacking (Call/Jump oriented programming), and >>>

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Jan Beulich
On 14.02.2022 15:00, Oleksandr Andrushchenko wrote: > /* > * FIXME: apply_map is called from dom0 specific init code when > * system_state < SYS_STATE_active, so there is no race condition > * possible between this code and vpci_process_pending. So, neither > * vpci_process_pending may try to acqui

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 15:48, Jan Beulich wrote: > On 14.02.2022 14:27, Oleksandr Andrushchenko wrote: >> >> On 14.02.22 15:22, Jan Beulich wrote: >>> On 14.02.2022 14:13, Oleksandr Andrushchenko wrote: On 14.02.22 14:57, Jan Beulich wrote: > On 14.02.2022 12:37, Oleksandr Andrushchenko wrote:

Re: [PATCH v2 04/70] x86/pv-shim: Don't modify the hypercall table

2022-02-14 Thread Jan Beulich
On 14.02.2022 14:50, Andrew Cooper wrote: > On 14/02/2022 13:33, Jan Beulich wrote: >> On 14.02.2022 13:50, Andrew Cooper wrote: >>> From: Juergen Gross >>> >>> When running as pv-shim the hypercall is modified today in order to >>> replace the functions for __HYPERVISOR_event_channel_op and >>> _

Re: [PATCH v2 3/7] x86/altcall: Optimise away endbr64 instruction where possible

2022-02-14 Thread Jan Beulich
On 14.02.2022 14:31, Andrew Cooper wrote: > On 14/02/2022 13:06, Jan Beulich wrote: >> On 14.02.2022 13:56, Andrew Cooper wrote: >>> @@ -330,6 +333,41 @@ static void init_or_livepatch >>> _apply_alternatives(struct alt_instr *start, >>> add_nops(buf + a->repl_len, total_len - a->repl_len)

Re: [PATCH v2 04/70] x86/pv-shim: Don't modify the hypercall table

2022-02-14 Thread Andrew Cooper
On 14/02/2022 13:33, Jan Beulich wrote: > On 14.02.2022 13:50, Andrew Cooper wrote: >> From: Juergen Gross >> >> When running as pv-shim the hypercall is modified today in order to >> replace the functions for __HYPERVISOR_event_channel_op and >> __HYPERVISOR_grant_table_op hypercalls. >> >> Chang

Re: Development Issue of Concern

2022-02-14 Thread George Dunlap
On Sat, Feb 12, 2022 at 1:46 AM Elliott Mitchell wrote: > The tradition has been to name the active development branch in GIT has > been named "master". Quite a number of people object to the name due to > its history. > > In light of such concerns, perhaps the Xen Project should join with other

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Jan Beulich
On 14.02.2022 14:27, Oleksandr Andrushchenko wrote: > > > On 14.02.22 15:22, Jan Beulich wrote: >> On 14.02.2022 14:13, Oleksandr Andrushchenko wrote: >>> >>> On 14.02.22 14:57, Jan Beulich wrote: On 14.02.2022 12:37, Oleksandr Andrushchenko wrote: > On 14.02.22 13:25, Roger Pau Monné wr

Re: [PATCH v2 00/70] x86: Support for CET Indirect Branch Tracking

2022-02-14 Thread Jan Beulich
On 14.02.2022 14:10, Andrew Cooper wrote: > On 14/02/2022 12:50, Andrew Cooper wrote: >> CET Indirect Branch Tracking is a hardware feature designed to protect >> against >> forward-edge control flow hijacking (Call/Jump oriented programming), and is >> a >> companion feature to CET Shadow Stacks

Re: [PATCH v2 34/70] x86/emul: CFI hardening

2022-02-14 Thread Jan Beulich
On 14.02.2022 13:50, Andrew Cooper wrote: > Control Flow Integrity schemes use toolchain and optionally hardware support > to help protect against call/jump/return oriented programming attacks. > > Use cf_check to annotate function pointer targets for the toolchain. > > pv_emul_is_mem_write() is

Re: [PATCH v2 5/7] x86/hvm: Use __initdata_cf_clobber for hvm_funcs

2022-02-14 Thread Andrew Cooper
On 14/02/2022 13:10, Jan Beulich wrote: > On 14.02.2022 13:56, Andrew Cooper wrote: >> --- a/xen/arch/x86/hvm/hvm.c >> +++ b/xen/arch/x86/hvm/hvm.c >> @@ -88,7 +88,7 @@ unsigned int opt_hvm_debug_level __read_mostly; >> integer_param("hvm_debug", opt_hvm_debug_level); >> #endif >> >> -struct hv

Re: [PATCH v2 04/70] x86/pv-shim: Don't modify the hypercall table

2022-02-14 Thread Jan Beulich
On 14.02.2022 13:50, Andrew Cooper wrote: > From: Juergen Gross > > When running as pv-shim the hypercall is modified today in order to > replace the functions for __HYPERVISOR_event_channel_op and > __HYPERVISOR_grant_table_op hypercalls. > > Change this to call the related functions from the n

Re: [PATCH v2 3/7] x86/altcall: Optimise away endbr64 instruction where possible

2022-02-14 Thread Andrew Cooper
On 14/02/2022 13:06, Jan Beulich wrote: > On 14.02.2022 13:56, Andrew Cooper wrote: >> With altcall, we convert indirect branches into direct ones. With that >> complete, none of the potential targets need an endbr64 instruction. >> >> Furthermore, removing the endbr64 instructions is a security d

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

2022-02-14 Thread osstest service owner
flight 168110 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/168110/ 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] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Oleksandr Andrushchenko
On 14.02.22 15:22, Jan Beulich wrote: > On 14.02.2022 14:13, Oleksandr Andrushchenko wrote: >> >> On 14.02.22 14:57, Jan Beulich wrote: >>> On 14.02.2022 12:37, Oleksandr Andrushchenko wrote: On 14.02.22 13:25, Roger Pau Monné wrote: > On Mon, Feb 14, 2022 at 11:15:27AM +, Oleksandr

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

2022-02-14 Thread Jan Beulich
On 14.02.2022 14:11, Jane Malalane wrote: > On 11/02/2022 11:46, Jan Beulich wrote: >> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments >> unless you have verified the sender and know the content is safe. >> >> On 11.02.2022 12:29, Roger Pau Monné wrote: >>> On Fri, Feb 11

Re: [PATCH] vpci: introduce per-domain lock to protect vpci structure

2022-02-14 Thread Jan Beulich
On 14.02.2022 14:13, Oleksandr Andrushchenko wrote: > > > On 14.02.22 14:57, Jan Beulich wrote: >> On 14.02.2022 12:37, Oleksandr Andrushchenko wrote: >>> >>> On 14.02.22 13:25, Roger Pau Monné wrote: On Mon, Feb 14, 2022 at 11:15:27AM +, Oleksandr Andrushchenko wrote: > On 14.02.22

[PATCH v2 12/70] xen: CFI hardening for acpi_table_parse()

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/acpi/boot

[PATCH v2 19/70] xsm: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Reviewed-by: Daniel P. Smith --- xen/include/xsm

Re: [PATCH v2 3/7] x86/altcall: Optimise away endbr64 instruction where possible

2022-02-14 Thread Jan Beulich
On 14.02.2022 13:56, Andrew Cooper wrote: > With altcall, we convert indirect branches into direct ones. With that > complete, none of the potential targets need an endbr64 instruction. > > Furthermore, removing the endbr64 instructions is a security defence-in-depth > improvement, because it lim

[PATCH v2 17/70] xen: CFI hardening for open_softirq()

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/cpu/mchec

[PATCH v2 47/70] x86/logdirty: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/mm/hap/ha

[PATCH v2 61/70] x86/setup: Read CR4 earlier in __start_xen()

2022-02-14 Thread Andrew Cooper
This is necessary for read_cr4() to function correctly. Move the EFER caching at the same time. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- xen/arch/x86/setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c i

[PATCH v2 70/70] x86: Enable CET Indirect Branch Tracking

2022-02-14 Thread Andrew Cooper
With all the pieces now in place, turn CET-IBT on when available. MSR_S_CET, like SMEP/SMAP, controls Ring1 meaning that ENDBR_EN can't be enabled for Xen independently of PV32 kernels. As we already disable PV32 for CET-SS, extend this to all CET, adjusting the documentation/comments as appropri

[PATCH v2 21/70] xen/evtchn: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/common/event_2l.c

[PATCH v2 67/70] x86/entry: Make IDT entrypoints CET-IBT compatible

2022-02-14 Thread Andrew Cooper
Each IDT vector needs to land on an endbr64 instruction. This is especially important for the #CP handler, which will recurse indefinitely if the endbr64 is missing, eventually escalating to #DF if guard pages are active. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich

[PATCH v2 54/70] x86/dpci: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/hvm/hvm.c

[PATCH v2 24/70] xen/keyhandler: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Tweak {IRQ_,}KEYHANDLER() to use a named initialiser instead of requiring a poin

[PATCH v2 31/70] x86: CFI hardening for request_irq()

2022-02-14 Thread Andrew Cooper
... and friends; alloc_direct_apic_vector() and set_direct_apic_vector(). Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signe

Re: [PATCH v2 02/70] xen/sort: Switch to an extern inline implementation

2022-02-14 Thread Julien Grall
Hi, On 14/02/2022 12:50, Andrew Cooper wrote: There are exactly 3 callers of sort() in the hypervisor. Callbacks in a tight loop like this are problematic for performance, especially with Spectre v2 protections, which is why extern inline is used commonly by libraries. Both ARM callers pass in

[PATCH v2 65/70] x86/emul: Update emulation stubs to be CET-IBT compatible

2022-02-14 Thread Andrew Cooper
All indirect branches need to land on an endbr64 instruction. For stub_selftests(), use endbr64 unconditionally for simplicity. For ioport and instruction emulation, add endbr64 conditionally. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monné CC: W

[PATCH v2 28/70] xen/video: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/drivers/video/lfb.

[PATCH v2 63/70] x86/traps: Rework write_stub_trampoline() to not hardcode the jmp

2022-02-14 Thread Andrew Cooper
For CET-IBT, we will need to optionally insert an endbr64 instruction at the start of the stub. Don't hardcode the jmp displacement assuming that it starts at byte 24 of the stub. Also add extra comments describing what is going on. The mix of %rax and %rsp is far from trivial to follow. Signed

[PATCH v2 62/70] x86/alternatives: Clear CR4.CET when clearing CR0.WP

2022-02-14 Thread Andrew Cooper
This allows us to have CET active much earlier in boot. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- xen/arch/x86/alternative.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c index 436047abe021..ec

[PATCH v2 40/70] x86/idle: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/acpi/cpu_

[PATCH v2 34/70] x86/emul: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. pv_emul_is_mem_write() is only used in a single file. Having it as a static inl

[PATCH v2 29/70] xen/console: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/drivers/char/conso

[PATCH v2 22/70] xen/hypfs: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Juergen Gross --- xen/common/hypfs.c

[PATCH v2 66/70] x86/entry: Make syscall/sysenter entrypoints CET-IBT compatible

2022-02-14 Thread Andrew Cooper
Each of MSR_{L,C}STAR and MSR_SYSENTER_EIP need to land on an endbr64 instruction. For sysenter, this is easy. Unfortunately for syscall, the stubs are already 29 byte long with a limit of 32. endbr64 is 4 bytes. Luckily, there is a 1 byte instruction which can move from the stubs into the main

[PATCH v2 42/70] x86/hvmsave: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/cpu/mchec

[PATCH v2 30/70] xen/misc: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/mm.c

[PATCH v2 16/70] xen: CFI hardening for IPIs

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/acpi/cpu_

[PATCH v2 15/70] xen: CFI hardening for call_rcu()

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/hvm/mtrr.

[PATCH v2 25/70] xen/vpci: CFI hardening

2022-02-14 Thread Andrew Cooper
Control Flow Integrity schemes use toolchain and optionally hardware support to help protect against call/jump/return oriented programming attacks. Use cf_check to annotate function pointer targets for the toolchain. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/drivers/vpci/heade

  1   2   >