Re: [PATCH v5 2/5] xen/ppc: Implement bitops.h

2023-09-14 Thread Jan Beulich
On 14.09.2023 20:15, Shawn Anastasio wrote: > On 9/13/23 2:29 AM, Jan Beulich wrote: >> On 12.09.2023 20:35, Shawn Anastasio wrote: >>> --- a/xen/arch/ppc/include/asm/bitops.h >>> +++ b/xen/arch/ppc/include/asm/bitops.h >>> @@ -1,9 +1,335 @@ >>> +/* SPDX-License-Identifier: GPL-2.0-or-later */ >>>

Re: [PATCH v1 16/29] xen/asm-generic: introduce stub header flushtlb.h

2023-09-14 Thread Jiamei Xie
Hi Oleksii On 2023/9/14 22:56, Oleksii Kurochko wrote: The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/flushtlb.h | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 xen/include/

[linux-linus test] 183004: regressions - FAIL

2023-09-14 Thread osstest service owner
flight 183004 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/183004/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 182531 test-amd64

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

2023-09-14 Thread osstest service owner
flight 183006 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/183006/ 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 v10 02/38] x86/opcode: Add the WRMSRNS instruction to the x86 opcode map

2023-09-14 Thread Google
On Wed, 13 Sep 2023 21:47:29 -0700 Xin Li wrote: > Add the opcode used by WRMSRNS, which is the non-serializing version of > WRMSR and may replace it to improve performance, to the x86 opcode map. > > Tested-by: Shan Kang > Signed-off-by: Xin Li This looks good to me. Acked-by: Masami Hirama

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread Juergen Gross
On 15.09.23 03:16, andrew.coop...@citrix.com wrote: On 15/09/2023 2:01 am, H. Peter Anvin wrote: The whole bit with alternatives and pvops being separate is a major maintainability problem, and honestly it never made any sense in the first place. Never have two mechanisms to do one job; it makes

Re: [PATCH v10 08/38] x86/cpufeatures: Add the cpu feature bit for FRED

2023-09-14 Thread Juergen Gross
On 15.09.23 03:07, Thomas Gleixner wrote: On Thu, Sep 14 2023 at 14:15, andrew wrote: PV guests are never going to see FRED (or LKGS for that matter) because it advertises too much stuff which simply traps because the kernel is in CPL3. That said, the 64bit PV ABI is a whole lot closer to FRED

Re: [PATCH] xen/efi: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
On Mon, Sep 11, 2023 at 06:59:31PM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > `efi_loader_signature` has space for 4 bytes. We are copying "Xen" (3 bytes) > plus a NUL-byte which makes 4 total bytes. With that being said, there is >

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread H. Peter Anvin
On 9/14/23 18:46, andrew.coop...@citrix.com wrote: On 15/09/2023 1:38 am, H. Peter Anvin wrote: On 9/14/23 17:33, andrew.coop...@citrix.com wrote: It's an assumption about what "definitely won't" be paravirt in the future. XenPV stack handling is almost-FRED-like and has been for the better p

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread andrew . cooper3
On 15/09/2023 1:38 am, H. Peter Anvin wrote: > On 9/14/23 17:33, andrew.coop...@citrix.com wrote: >> >> It's an assumption about what "definitely won't" be paravirt in the >> future. >> >> XenPV stack handling is almost-FRED-like and has been for the better >> part of two decades. >> >> You frequen

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread andrew . cooper3
On 15/09/2023 2:01 am, H. Peter Anvin wrote: > The whole bit with alternatives and pvops being separate is a major > maintainability problem, and honestly it never made any sense in the > first place. Never have two mechanisms to do one job; it makes it > harder to grok their interactions. This bi

Re: [PATCH v10 08/38] x86/cpufeatures: Add the cpu feature bit for FRED

2023-09-14 Thread Thomas Gleixner
On Thu, Sep 14 2023 at 14:15, andrew wrote: > PV guests are never going to see FRED (or LKGS for that matter) because > it advertises too much stuff which simply traps because the kernel is in > CPL3. > > That said, the 64bit PV ABI is a whole lot closer to FRED than it is to > IDT delivery.  (Almo

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread H. Peter Anvin
WRMSR has one complexity that most other PV-ops don't, and that's the exception table reference for the instruction itself. In a theoretical future ought to look like: mov$msr, %ecx mov$lo, %eax mov$hi, %edx 1: {call paravirt_blah(%rip) | cs...cs wrmsr | cs...cs wrmsr

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread Thomas Gleixner
On Fri, Sep 15 2023 at 00:46, andrew wrote: > On 15/09/2023 12:00 am, Thomas Gleixner wrote: > What I meant was "there should be the two top-level APIs, and under the > covers they DTRT".  Part of doing the right thing is to wire up paravirt > for configs where that is specified. > > Anything else

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread H. Peter Anvin
On 9/14/23 17:33, andrew.coop...@citrix.com wrote: It's an assumption about what "definitely won't" be paravirt in the future. XenPV stack handling is almost-FRED-like and has been for the better part of two decades. You frequently complain that there's too much black magic holding XenPV toget

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread andrew . cooper3
On 15/09/2023 1:12 am, Thomas Gleixner wrote: > On Fri, Sep 15 2023 at 00:46, andrew wrote: >> On 15/09/2023 12:00 am, Thomas Gleixner wrote: >>> So no. I'm fundamentally disagreeing with your recommendation. The way >>> forward is: >>> >>> 1) Provide the native variant for wrmsrns(), i.e. rename

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread Thomas Gleixner
On Fri, Sep 15 2023 at 00:46, andrew wrote: > On 15/09/2023 12:00 am, Thomas Gleixner wrote: >> So no. I'm fundamentally disagreeing with your recommendation. The way >> forward is: >> >> 1) Provide the native variant for wrmsrns(), i.e. rename the proposed >> wrmsrns() to native_wrmsr_ns()

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread andrew . cooper3
On 15/09/2023 12:00 am, Thomas Gleixner wrote: >> and despite what Juergen said, I'm going to recommend that you do wire >> this through the paravirt infrastructure, for the benefit of regular >> users having a nice API, not because XenPV is expecting to do something >> wildly different here. > I f

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread H. Peter Anvin
On September 14, 2023 4:00:39 PM PDT, Thomas Gleixner wrote: >Andrew! > >On Thu, Sep 14 2023 at 15:05, andrew wrote: >> On 14/09/2023 5:47 am, Xin Li wrote: >>> +static __always_inline void wrmsrns(u32 msr, u64 val) >>> +{ >>> + __wrmsrns(msr, val, val >> 32); >>> +} >> >> This API works in ter

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread Thomas Gleixner
Andrew! On Thu, Sep 14 2023 at 15:05, andrew wrote: > On 14/09/2023 5:47 am, Xin Li wrote: >> +static __always_inline void wrmsrns(u32 msr, u64 val) >> +{ >> +__wrmsrns(msr, val, val >> 32); >> +} > > This API works in terms of this series where every WRMSRNS is hidden > behind a FRED check, b

[linux-linus test] 183002: regressions - FAIL

2023-09-14 Thread osstest service owner
flight 183002 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/183002/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 8 xen-boot fail REGR. vs. 182531 test-amd64

Re: [PATCH v4 6/8] tools/binfile: switch to common annotations model

2023-09-14 Thread Julien Grall
Hi Jan, On 04/08/2023 07:30, Jan Beulich wrote: Use DATA() / END() and drop the now redundant .global. No change in generated data; of course the two symbols now properly gain "hidden" binding. Signed-off-by: Jan Beulich Reviewed-by: Julien Grall Cheers, -- Julien Grall

Re: [PATCH v4 4/8] Arm: annotate entry points with type and size

2023-09-14 Thread Julien Grall
Hi, On 04/08/2023 07:28, Jan Beulich wrote: Use the generic framework in xen/linkage.h. No change in generated code except for the changed padding value (noticable when config.gz isn't a multiple of 4 in size). Plus of course the converted symbols change to be hidden ones. Note that ASM_INT() i

Re: [PATCH v4 1/8] common: assembly entry point type/size annotations

2023-09-14 Thread Julien Grall
Hi Jan, On 04/08/2023 07:26, Jan Beulich wrote: Recent gas versions generate minimalistic Dwarf debug info for items annotated as functions and having their sizes specified [1]. Furthermore generating live patches wants items properly annotated. "Borrow" Arm's END() and (remotely) derive other a

4.8-unstable: building firmware/hvmloader errors in Bookworm with gcc-12.2

2023-09-14 Thread Pry Mar
Hello, First attempt to build xen-4.18-unstabl in deb12 (Bookworm): /home/mockbuild/pbdeps/xen-4.18~rc0/debian/build/build-utils_amd64/tools/firmware/hvmloader/dsdt_anycpu.asl 9851: Name ( SLT, 0x0 ) Remark 2173 - Creation of named objects within a method is highly ineffic

Re: [PATCH 8/8] x86/spec-ctrl: Mitigate the Zen1 DIV leakge

2023-09-14 Thread Andrew Cooper
On 14/09/2023 2:12 pm, Jason Andryuk wrote: > On Wed, Sep 13, 2023 at 6:09 PM Andrew Cooper > wrote: >> @@ -955,6 +960,40 @@ static void __init srso_calculations(bool >> hw_smt_enabled) >> setup_force_cpu_cap(X86_FEATURE_SRSO_NO); >> } >> >> +/* >> + * Div leakage is specific to the AM

Re: [PATCH 8/8] x86/spec-ctrl: Mitigate the Zen1 DIV leakge

2023-09-14 Thread Andrew Cooper
On 14/09/2023 11:52 am, Jan Beulich wrote: > On 13.09.2023 22:27, Andrew Cooper wrote: >> @@ -378,6 +392,8 @@ UNLIKELY_DISPATCH_LABEL(\@_serialise): >> verw STACK_CPUINFO_FIELD(verw_sel)(%r14) >> .L\@_verw_skip: >> >> +ALTERNATIVE "", DO_SPEC_CTRL_DIV, X86_FEATURE_SC_DIV >> + >> .L\@_s

Re: [PATCH 7/8] x86/spec-ctrl: Issue VERW during IST exit to Xen

2023-09-14 Thread Andrew Cooper
On 14/09/2023 11:01 am, Jan Beulich wrote: > On 13.09.2023 22:27, Andrew Cooper wrote: >> There is a corner case where e.g. an NMI hitting an exit-to-guest path after >> SPEC_CTRL_EXIT_TO_* would have run the entire NMI handler *after* the VERW >> flush to scrub potentially sensitive data from uarc

Re: [PATCH 6/8] x86/entry: Track the IST-ness of an entry for the exit paths

2023-09-14 Thread Andrew Cooper
On 14/09/2023 10:32 am, Jan Beulich wrote: > On 13.09.2023 22:27, Andrew Cooper wrote: >> --- a/xen/arch/x86/x86_64/compat/entry.S >> +++ b/xen/arch/x86/x86_64/compat/entry.S >> @@ -117,8 +117,15 @@ compat_process_trap: >> call compat_create_bounce_frame >> jmp compat_test_all_

Re: [PATCH 5/8] x86/entry: Adjust restore_all_xen to hold stack_end in %r14

2023-09-14 Thread Andrew Cooper
On 14/09/2023 9:51 am, Jan Beulich wrote: > On 13.09.2023 22:27, Andrew Cooper wrote: >> All other SPEC_CTRL_{ENTRY,EXIT}_* helpers hold stack_end in %r14. Adjust it >> for consistency, freeing up %rbx to be used differently. >> >> Signed-off-by: Andrew Cooper > Reviewed-by: Jan Beulich > > The

Re: [PATCH 4/8] x86/spec-ctrl: Extend all SPEC_CTRL_{ENTER,EXIT}_* comments

2023-09-14 Thread Andrew Cooper
On 14/09/2023 8:58 am, Jan Beulich wrote: > On 13.09.2023 22:27, Andrew Cooper wrote: >> --- a/xen/arch/x86/include/asm/spec_ctrl_asm.h >> +++ b/xen/arch/x86/include/asm/spec_ctrl_asm.h >> @@ -218,7 +218,10 @@ >> wrmsr >> .endm >> >> -/* Use after an entry from PV context (syscall/sysenter/

[PATCH v6 2/4] xen/ppc: Define minimal stub headers required for full build

2023-09-14 Thread Shawn Anastasio
Additionally, change inclusion of asm/ headers to corresponding xen/ ones throughout arch/ppc now that they work. Signed-off-by: Shawn Anastasio Acked-by: Jan Beulich --- v6: No changes. v5: - Drop vm_event.h in favor of asm-generic variant - (numa.h) Fix lingering reference to Arm v4: -

[PATCH v6 4/4] xen/ppc: Enable full Xen build

2023-09-14 Thread Shawn Anastasio
Bring ppc's Makefile and arch.mk in line with arm and x86 to disable the build overrides and enable the full Xen build. Signed-off-by: Shawn Anastasio Reviewed-by: Jan Beulich --- xen/arch/ppc/Makefile | 16 +++- xen/arch/ppc/arch.mk | 3 --- 2 files changed, 15 insertions(+), 4 d

[PATCH v6 1/4] xen/ppc: Implement bitops.h

2023-09-14 Thread Shawn Anastasio
Implement bitops.h, based on Linux's implementation as of commit 5321d1b1afb9a17302c6cec79f0cbf823eb0d3fc. Though it is based off of Linux's implementation, this code diverges significantly in a number of ways: - Bitmap entries changed to 32-bit words to match X86 and Arm on Xen - PPC32-specifi

[PATCH v6 3/4] xen/ppc: Add stub function and symbol definitions

2023-09-14 Thread Shawn Anastasio
Add stub function and symbol definitions required by common code. If the file that the definition is supposed to be located in doesn't already exist yet, temporarily place its definition in the new stubs.c Signed-off-by: Shawn Anastasio Acked-by: Jan Beulich --- v6: No changes. v5: No changes.

[PATCH v6 0/4] ppc: Enable full Xen build

2023-09-14 Thread Shawn Anastasio
Hello all, This patch series performs all of the additions necessary to drop the build overrides for PPC and enable the full Xen build. Except in cases where compatibile implementations already exist (e.g. bitops.h), the newly added definitions are simple, unimplemented stubs that just call BUG_ON

Re: [PATCH 5/5] x86/pv: Rewrite %dr6 handling

2023-09-14 Thread Andrew Cooper
On 14/09/2023 5:06 pm, Jan Beulich wrote: > On 13.09.2023 01:21, Andrew Cooper wrote: >> --- a/xen/arch/x86/include/asm/domain.h >> +++ b/xen/arch/x86/include/asm/domain.h >> @@ -729,6 +729,18 @@ static inline void pv_inject_hw_exception(unsigned int >> vector, int errcode) >> pv_inject_event

Re: [PATCH 3/5] x86/emul: Add a pending_dbg field to x86_emulate_ctxt.retire

2023-09-14 Thread Andrew Cooper
On 14/09/2023 4:04 pm, Jan Beulich wrote: > On 13.09.2023 01:21, Andrew Cooper wrote: >> --- a/xen/arch/x86/x86_emulate/x86_emulate.c >> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c >> @@ -8379,7 +8379,10 @@ x86_emulate( >> if ( !mode_64bit() ) >> _regs.r(ip) = (uint32_t)_regs.r(ip);

Re: [PATCH v5 2/5] xen/ppc: Implement bitops.h

2023-09-14 Thread Shawn Anastasio
On 9/13/23 2:29 AM, Jan Beulich wrote: > On 12.09.2023 20:35, Shawn Anastasio wrote: >> Implement bitops.h, based on Linux's implementation as of commit >> 5321d1b1afb9a17302c6cec79f0cbf823eb0d3fc. Though it is based off of >> Linux's implementation, this code diverges significantly in a number of

Re: [PATCH 2/5] x86: Introduce x86_merge_dr6()

2023-09-14 Thread Andrew Cooper
On 14/09/2023 3:53 pm, Jan Beulich wrote: > On 13.09.2023 01:21, Andrew Cooper wrote: >> The current logic used to update %dr6 when injecting #DB is buggy. The >> architectural behaviour is to overwrite B{0..3} and accumulate all other >> bits. > While I consider this behavior plausible, forever

Re: [PATCH] x86/shutdown: change default reboot method preference

2023-09-14 Thread Andrew Cooper
On 14/09/2023 4:21 pm, Roger Pau Monne wrote: > The current logic to chose the preferred reboot method is based on the mode > Xen > has been booted into, so if the box is booted from UEFI, the preferred reboot > method will be to use the ResetSystem() run time service call. > > However, that call

Re: [PATCH] Revert "EDAC/mce_amd: Do not load edac_mce_amd module on guests"

2023-09-14 Thread Elliott Mitchell
On Fri, Sep 08, 2023 at 05:59:11AM +0200, Borislav Petkov wrote: > On Thu, Sep 07, 2023 at 08:08:00PM -0700, Elliott Mitchell wrote: > > This reverts commit 767f4b620edadac579c9b8b6660761d4285fa6f9. > > > > There are at least 3 valid reasons why a VM may see MCE events/registers. > > Hmm, so they

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-14 Thread Akihiko Odaki
On 2023/09/14 17:29, Albert Esteve wrote: On Thu, Sep 14, 2023 at 9:17 AM Akihiko Odaki > wrote: On 2023/09/13 23:18, Albert Esteve wrote: > > > On Wed, Sep 13, 2023 at 3:43 PM Akihiko Odaki mailto:akihiko.od...@daynix.com> >

Re: [PATCH 5/5] x86/pv: Rewrite %dr6 handling

2023-09-14 Thread Jan Beulich
On 13.09.2023 01:21, Andrew Cooper wrote: > --- a/xen/arch/x86/include/asm/domain.h > +++ b/xen/arch/x86/include/asm/domain.h > @@ -729,6 +729,18 @@ static inline void pv_inject_hw_exception(unsigned int > vector, int errcode) > pv_inject_event(&event); > } > > +static inline void pv_injec

Re: [PATCH v1 01/29] xen/asm-generic: introduce stub header spinlock.h

2023-09-14 Thread Jan Beulich
On 14.09.2023 16:56, Oleksii Kurochko wrote: > The patch introduces stub header needed for full Xen build. > > Signed-off-by: Oleksii Kurochko Hmm, looking here I think I need to take back what I said in reply to the cover letter, taking this as an example. > --- /dev/null > +++ b/xen/include/a

[PATCH v1 27/29] xen/asm-generic: introduce stub header numa.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/numa.h | 35 ++ 1 file changed, 35 insertions(+) create mode 100644 xen/include/asm-generic/numa.h diff --git a/xen/include/asm-generic/numa

[PATCH v1 29/29] xen/asm-generic: introduce stub header softirq.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/softirq.h | 17 + 1 file changed, 17 insertions(+) create mode 100644 xen/include/asm-generic/softirq.h diff --git a/xen/include/asm-generic/softirq.h b/xe

[PATCH v1 19/29] xen/asm-generic: introduce stub header hardirq.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/hardirq.h | 27 +++ 1 file changed, 27 insertions(+) create mode 100644 xen/include/asm-generic/hardirq.h diff --git a/xen/include/asm-generic/hardi

[PATCH v1 23/29] xen/asm-generic: introduce stub header domain.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/domain.h | 53 1 file changed, 53 insertions(+) create mode 100644 xen/include/asm-generic/domain.h diff --git a/xen/include/asm-generic/do

[PATCH v1 25/29] xen/asm-generic: introduce stub header irq.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/irq.h | 44 +++ 1 file changed, 44 insertions(+) create mode 100644 xen/include/asm-generic/irq.h diff --git a/xen/include/asm-generic/irq.h

[PATCH v1 26/29] xen/asm-generic: introduce stub header monitor.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/monitor.h | 64 +++ 1 file changed, 64 insertions(+) create mode 100644 xen/include/asm-generic/monitor.h diff --git a/xen/include/asm-generic/m

[PATCH v1 20/29] xen/asm-generic: introduce stub header div64.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/div64.h | 24 1 file changed, 24 insertions(+) create mode 100644 xen/include/asm-generic/div64.h diff --git a/xen/include/asm-generic/div64.h b/xe

[PATCH] x86/shutdown: change default reboot method preference

2023-09-14 Thread Roger Pau Monne
The current logic to chose the preferred reboot method is based on the mode Xen has been booted into, so if the box is booted from UEFI, the preferred reboot method will be to use the ResetSystem() run time service call. However, that call seems to be widely untested once the firmware has exited b

[libvirt test] 183001: tolerable all pass - PUSHED

2023-09-14 Thread osstest service owner
flight 183001 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/183001/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 182958 test-armhf-armhf-libvirt-qcow2 15 saveres

[PATCH v1 28/29] xen/asm-generic: introduce stub header p2m.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/p2m.h | 115 ++ 1 file changed, 115 insertions(+) create mode 100644 xen/include/asm-generic/p2m.h diff --git a/xen/include/asm-generic/p2m.

[PATCH v1 24/29] xen/asm-generic: introduce stub header guest_access.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/guest_access.h | 31 ++ 1 file changed, 31 insertions(+) create mode 100644 xen/include/asm-generic/guest_access.h diff --git a/xen/include/asm-gene

Re: [PATCH 1/5] x86/pv: Fix the determiniation of whether to inject #DB

2023-09-14 Thread Jan Beulich
On 14.09.2023 16:49, Andrew Cooper wrote: > On 14/09/2023 3:40 pm, Jan Beulich wrote: >> On 13.09.2023 01:21, Andrew Cooper wrote: >>> We long ago fixed the emulator to not inject exceptions behind our back. >>> Therefore, assert that that a PV event (including interrupts, because that >>> would be

Re: [PATCH 4/5] x86/pv: Drop priv_op_ctxt.bpmatch and use pending_dbg instead

2023-09-14 Thread Jan Beulich
On 13.09.2023 01:21, Andrew Cooper wrote: > With a full pending_dbg field in x86_emulate_ctxt, use it rather than using a > local bpmatch field. > > This simplifies the OKAY/DONE path as singlestep is already accumulated by > x86_emulate() when appropriate. > > Signed-off-by: Andrew Cooper Revi

[PATCH v1 17/29] xen/asm-generic: introduce stub header percpu.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/percpu.h | 35 1 file changed, 35 insertions(+) create mode 100644 xen/include/asm-generic/percpu.h diff --git a/xen/include/asm-generic/pe

[PATCH v1 22/29] xen/asm-generic: introduce stub header delay.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/delay.h | 21 + 1 file changed, 21 insertions(+) create mode 100644 xen/include/asm-generic/delay.h diff --git a/xen/include/asm-generic/delay.h b/xen/i

[PATCH v1 16/29] xen/asm-generic: introduce stub header flushtlb.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/flushtlb.h | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 xen/include/asm-generic/flushtlb.h diff --git a/xen/include/asm-generic/

Re: [PATCH v1 00/29] Introduce stub headers necessary for full Xen build

2023-09-14 Thread Jan Beulich
On 14.09.2023 16:56, Oleksii Kurochko wrote: > Based on two patch series [1] and [2], the idea of which is to provide minimal > amount of things for a complete Xen build, a large amount of headers are the > same > or almost the same, so it makes sense to move them to asm-generic. > > Also, provid

Re: [PATCH 3/5] x86/emul: Add a pending_dbg field to x86_emulate_ctxt.retire

2023-09-14 Thread Jan Beulich
On 13.09.2023 01:21, Andrew Cooper wrote: > --- a/xen/arch/x86/x86_emulate/x86_emulate.c > +++ b/xen/arch/x86/x86_emulate/x86_emulate.c > @@ -8379,7 +8379,10 @@ x86_emulate( > if ( !mode_64bit() ) > _regs.r(ip) = (uint32_t)_regs.r(ip); > > -/* Should a singlestep #DB be raised?

[PATCH v1 18/29] xen/asm-generic: introduce stub header smp.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/smp.h | 30 ++ 1 file changed, 30 insertions(+) create mode 100644 xen/include/asm-generic/smp.h diff --git a/xen/include/asm-generic/smp.h b/xe

[PATCH v1 14/29] xen/asm-generic: introduce stub header setup.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/setup.h | 16 1 file changed, 16 insertions(+) create mode 100644 xen/include/asm-generic/setup.h diff --git a/xen/include/asm-generic/setup.h b/xen/includ

[PATCH v1 13/29] xen/asm-generic: introduce stub header random.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/random.h | 20 1 file changed, 20 insertions(+) create mode 100644 xen/include/asm-generic/random.h diff --git a/xen/include/asm-generic/random.h b/xen

[PATCH v1 21/29] xen/asm-generic: introduce stub header altp2m.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/altp2m.h | 34 1 file changed, 34 insertions(+) create mode 100644 xen/include/asm-generic/altp2m.h diff --git a/xen/include/asm-generic/al

[PATCH v1 12/29] xen/asm-generic: introduce stub header pci.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/pci.h | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 xen/include/asm-generic/pci.h diff --git a/xen/include/asm-generic/pci.h b/xen/include/as

[PATCH v1 15/29] xen/asm-generic: introduce stub header xenoprof.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/xenoprof.h | 14 ++ 1 file changed, 14 insertions(+) create mode 100644 xen/include/asm-generic/xenoprof.h diff --git a/xen/include/asm-generic/xenoprof.h b/xe

[PATCH v1 09/29] xen/asm-generic: introduce stub header iocap.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/iocap.h | 17 + 1 file changed, 17 insertions(+) create mode 100644 xen/include/asm-generic/iocap.h diff --git a/xen/include/asm-generic/iocap.h b/xen/inclu

[PATCH v1 10/29] xen/asm-generic: introduce stub header iommu.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces stub header necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/iommu.h | 17 + 1 file changed, 17 insertions(+) create mode 100644 xen/include/asm-generic/iommu.h diff --git a/xen/include/asm-generic/iommu.h b/xen/inclu

[PATCH v1 07/29] xen/asm-generic: introduce stub header guest_atomics.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces stub header needed for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/guest_atomics.h | 47 + 1 file changed, 47 insertions(+) create mode 100644 xen/include/asm-generic/guest_atomics.h diff --git a/xen/include/asm-gener

[PATCH v1 11/29] xen/asm-generic: introduce stub header mem_access.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/mem_access.h | 14 ++ 1 file changed, 14 insertions(+) create mode 100644 xen/include/asm-generic/mem_access.h diff --git a/xen/include/asm-generic/mem_access.h

[PATCH v1 02/29] xen/asm-generic: introduce stub header paging.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces stub header needed for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/paging.h | 17 + 1 file changed, 17 insertions(+) create mode 100644 xen/include/asm-generic/paging.h diff --git a/xen/include/asm-generic/paging.h b/xen/incl

[PATCH v1 00/29] Introduce stub headers necessary for full Xen build

2023-09-14 Thread Oleksii Kurochko
Based on two patch series [1] and [2], the idea of which is to provide minimal amount of things for a complete Xen build, a large amount of headers are the same or almost the same, so it makes sense to move them to asm-generic. Also, providing such stub headers should help future architectures to

[PATCH v1 08/29] xen/asm-generic: introduce stub hypercall.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces header stub necessry for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/hypercall.h | 14 ++ 1 file changed, 14 insertions(+) create mode 100644 xen/include/asm-generic/hypercall.h diff --git a/xen/include/asm-generic/hypercall.h b

[PATCH v1 01/29] xen/asm-generic: introduce stub header spinlock.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces stub header needed for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/spinlock.h | 23 +++ 1 file changed, 23 insertions(+) create mode 100644 xen/include/asm-generic/spinlock.h diff --git a/xen/include/asm-generic/spinlock.

[PATCH v1 06/29] xen/asm-generic: introduce stub header grant_table.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces stub header needed for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/grant_table.h | 14 ++ 1 file changed, 14 insertions(+) create mode 100644 xen/include/asm-generic/grant_table.h diff --git a/xen/include/asm-generic/grant_table.

[PATCH v1 05/29] xen/asm-generic: introduce stub header event.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces stub header needed for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/event.h | 39 + 1 file changed, 39 insertions(+) create mode 100644 xen/include/asm-generic/event.h diff --git a/xen/include/asm-generic/event

[PATCH v1 04/29] xen/asm-generic: introduce stub header device.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces stub header needed for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/device.h | 65 1 file changed, 65 insertions(+) create mode 100644 xen/include/asm-generic/device.h diff --git a/xen/include/asm-generic/devi

[PATCH v1 03/29] xen/asm-generic: introduce stub header cpufeature.h

2023-09-14 Thread Oleksii Kurochko
The patch introduces stub header needed for full Xen build. Signed-off-by: Oleksii Kurochko --- xen/include/asm-generic/cpufeature.h | 23 +++ 1 file changed, 23 insertions(+) create mode 100644 xen/include/asm-generic/cpufeature.h diff --git a/xen/include/asm-generic/cpufe

[PATCH v3] x86/amd: do not expose HWCR.TscFreqSel to guests

2023-09-14 Thread Roger Pau Monne
OpenBSD 7.3 will unconditionally access HWCR if the TSC is reported as Invariant, and it will then attempt to also unconditionally access PSTATE0 if HWCR.TscFreqSel is set (currently the case on Xen). The motivation for exposing HWCR.TscFreqSel was to avoid warning messages from Linux. It has bee

Re: [PATCH 2/5] x86: Introduce x86_merge_dr6()

2023-09-14 Thread Jan Beulich
On 13.09.2023 01:21, Andrew Cooper wrote: > The current logic used to update %dr6 when injecting #DB is buggy. The > architectural behaviour is to overwrite B{0..3} and accumulate all other bits. While I consider this behavior plausible, forever since the introduction of debug registers in i386 I

Re: [PATCH 1/5] x86/pv: Fix the determiniation of whether to inject #DB

2023-09-14 Thread Andrew Cooper
On 14/09/2023 3:40 pm, Jan Beulich wrote: > On 13.09.2023 01:21, Andrew Cooper wrote: >> We long ago fixed the emulator to not inject exceptions behind our back. >> Therefore, assert that that a PV event (including interrupts, because that >> would be buggy too) isn't pending, rather than skipping

Re: [PATCH 1/5] x86/pv: Fix the determiniation of whether to inject #DB

2023-09-14 Thread Jan Beulich
On 13.09.2023 01:21, Andrew Cooper wrote: > We long ago fixed the emulator to not inject exceptions behind our back. > Therefore, assert that that a PV event (including interrupts, because that > would be buggy too) isn't pending, rather than skipping the #DB injection if > one is. > > On the othe

Re: [PATCH v2 for-4.18?] x86: support data operand independent timing mode

2023-09-14 Thread Demi Marie Obenour
On Thu, Sep 14, 2023 at 10:04:31AM +0100, Julien Grall wrote: > Hi Jan, > > On 14/09/2023 07:32, Jan Beulich wrote: > > On 13.09.2023 19:56, Julien Grall wrote: > > > On 11/09/2023 16:01, Jan Beulich wrote: > > > > [1] specifies a long list of instructions which are intended to exhibit > > > > tim

[PATCH v2] timer: fix NR_CPUS=1 build with gcc13

2023-09-14 Thread Jan Beulich
Gcc13 apparently infers from "if ( old_cpu < new_cpu )" that "new_cpu" is >= 1, and then (on x86) complains about "per_cpu(timers, new_cpu)" exceeding __per_cpu_offset[]'s bounds (being an array of 1 in such a configuration). Make the code conditional upon there being at least 2 CPUs configured (ot

[xen-unstable test] 183000: tolerable FAIL

2023-09-14 Thread osstest service owner
flight 183000 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/183000/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stopfail like 182997 test-amd64-i386-xl-qemuu-win7-amd64

Re: [PATCH v10 05/38] x86/trapnr: Add event type macros to

2023-09-14 Thread andrew . cooper3
On 14/09/2023 5:47 am, Xin Li wrote: > Intel VT-x classifies events into eight different types, which is > inherited by FRED for event identification. As such, event type > becomes a common x86 concept, and should be defined in a common x86 > header. > > Add event type macros to , and use it in . >

Re: [PATCH v2] x86/amd: do not expose HWCR.TscFreqSel to guests

2023-09-14 Thread Jan Beulich
On 14.09.2023 15:39, Roger Pau Monné wrote: > On Thu, Sep 14, 2023 at 03:16:40PM +0200, Jan Beulich wrote: >> On 14.09.2023 14:57, Roger Pau Monné wrote: >>> On Thu, Sep 14, 2023 at 02:49:45PM +0200, Jan Beulich wrote: On 14.09.2023 14:37, Roger Pau Monné wrote: > On Thu, Sep 14, 2023 at 0

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread andrew . cooper3
On 14/09/2023 5:47 am, Xin Li wrote: > Add an always inline API __wrmsrns() to embed the WRMSRNS instruction > into the code. > > Tested-by: Shan Kang > Signed-off-by: Xin Li > --- > arch/x86/include/asm/msr.h | 18 ++ > 1 file changed, 18 insertions(+) > > diff --git a/arch/x86/

Re: [PATCH v2] x86/amd: do not expose HWCR.TscFreqSel to guests

2023-09-14 Thread Roger Pau Monné
On Thu, Sep 14, 2023 at 03:16:40PM +0200, Jan Beulich wrote: > On 14.09.2023 14:57, Roger Pau Monné wrote: > > On Thu, Sep 14, 2023 at 02:49:45PM +0200, Jan Beulich wrote: > >> On 14.09.2023 14:37, Roger Pau Monné wrote: > >>> On Thu, Sep 14, 2023 at 07:52:33AM +0200, Jan Beulich wrote: > On 1

Re: [PATCH v2] x86/amd: do not expose HWCR.TscFreqSel to guests

2023-09-14 Thread Jan Beulich
On 14.09.2023 14:57, Roger Pau Monné wrote: > On Thu, Sep 14, 2023 at 02:49:45PM +0200, Jan Beulich wrote: >> On 14.09.2023 14:37, Roger Pau Monné wrote: >>> On Thu, Sep 14, 2023 at 07:52:33AM +0200, Jan Beulich wrote: On 13.09.2023 16:52, Roger Pau Monne wrote: > OpenBSD 7.3 will uncondit

Re: [PATCH v10 08/38] x86/cpufeatures: Add the cpu feature bit for FRED

2023-09-14 Thread andrew . cooper3
On 14/09/2023 7:09 am, Jan Beulich wrote: > On 14.09.2023 08:03, Juergen Gross wrote: >> On 14.09.23 06:47, Xin Li wrote: >>> From: "H. Peter Anvin (Intel)" >>> >>> Any FRED CPU will always have the following features as its baseline: >>>1) LKGS, load attributes of the GS segment but the base

Re: [PATCH 8/8] x86/spec-ctrl: Mitigate the Zen1 DIV leakge

2023-09-14 Thread Jason Andryuk
On Wed, Sep 13, 2023 at 6:09 PM Andrew Cooper wrote: > @@ -955,6 +960,40 @@ static void __init srso_calculations(bool hw_smt_enabled) > setup_force_cpu_cap(X86_FEATURE_SRSO_NO); > } > > +/* > + * Div leakage is specific to the AMD Zen1 microarchitecure. Use STIBP as a > + * heuristic to

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-14 Thread andrew . cooper3
On 14/09/2023 7:02 am, Juergen Gross wrote: > On 14.09.23 06:47, Xin Li wrote: >> Add an always inline API __wrmsrns() to embed the WRMSRNS instruction >> into the code. >> >> Tested-by: Shan Kang >> Signed-off-by: Xin Li > > In order to avoid having to add paravirt support for WRMSRNS I think >

Re: [PATCH v2] x86/amd: do not expose HWCR.TscFreqSel to guests

2023-09-14 Thread Roger Pau Monné
On Thu, Sep 14, 2023 at 02:49:45PM +0200, Jan Beulich wrote: > On 14.09.2023 14:37, Roger Pau Monné wrote: > > On Thu, Sep 14, 2023 at 07:52:33AM +0200, Jan Beulich wrote: > >> On 13.09.2023 16:52, Roger Pau Monne wrote: > >>> OpenBSD 7.3 will unconditionally access HWCR if the TSC is reported as >

Re: [PATCH v2] x86/amd: do not expose HWCR.TscFreqSel to guests

2023-09-14 Thread Andrew Cooper
On 13/09/2023 3:52 pm, Roger Pau Monne wrote: > OpenBSD 7.3 will unconditionally access HWCR if the TSC is reported as > Invariant, and it will then attempt to also unconditionally access PSTATE0 if > HWCR.TscFreqSel is set (currently the case on Xen). > > The relation between HWCR.TscFreqSel and P

Re: [PATCH v2] x86/amd: do not expose HWCR.TscFreqSel to guests

2023-09-14 Thread Jan Beulich
On 14.09.2023 14:37, Roger Pau Monné wrote: > On Thu, Sep 14, 2023 at 07:52:33AM +0200, Jan Beulich wrote: >> On 13.09.2023 16:52, Roger Pau Monne wrote: >>> OpenBSD 7.3 will unconditionally access HWCR if the TSC is reported as >>> Invariant, and it will then attempt to also unconditionally access

Re: [PATCH v2] x86/amd: do not expose HWCR.TscFreqSel to guests

2023-09-14 Thread Roger Pau Monné
On Thu, Sep 14, 2023 at 07:52:33AM +0200, Jan Beulich wrote: > On 13.09.2023 16:52, Roger Pau Monne wrote: > > OpenBSD 7.3 will unconditionally access HWCR if the TSC is reported as > > Invariant, and it will then attempt to also unconditionally access PSTATE0 > > if > > HWCR.TscFreqSel is set (cu

  1   2   >