Re: [PATCH 2/4] x86/svm: cleanup svm.h

2023-02-20 Thread Xenia Ragiadakou
On 2/21/23 01:08, Andrew Cooper wrote: On 17/02/2023 6:48 pm, Xenia Ragiadakou wrote: Remove the forward declaration of struct vcpu because it is not used. Huh, turns out that was my fault in c/s b158e72abe, shortly after I introduced them in the first place. Also, looking into that, there'

Re: [PATCH 0/6] xen/x86: Use SPDX (take 1)

2023-02-20 Thread Jan Beulich
On 19.02.2023 19:41, Julien Grall wrote: > On 13/02/2023 09:27, Jan Beulich wrote: >> On 10.02.2023 00:00, Julien Grall wrote: >>> Julien Grall (6): >>>xen/x86: Replace GPL v2.0 copyright with an SPDX tag in *.c >>>xen/x86: Replace GPL v2.0 copyright with an SPDX tag in *.c (part 2) >>>

Re: [PATCH 1/4] x86/svm: cleanup svm.c

2023-02-20 Thread Xenia Ragiadakou
Hi Andrew, On 2/21/23 00:12, Andrew Cooper wrote: On 17/02/2023 6:48 pm, Xenia Ragiadakou wrote: Do not include the headers: xen/irq.h asm/hvm/svm/intr.h asm/io.h asm/mem_sharing.h asm/regs.h Out of interest, how are you calculating these?  They're accurate as far as I can tell

Re: [PATCH linux-next 2/2] x86/xen/time: cleanup xen_tsc_safe_clocksource

2023-02-20 Thread Krister Johansen
On Mon, Feb 20, 2023 at 08:14:40PM -0800, Krister Johansen wrote: > On Mon, Feb 20, 2023 at 11:01:18PM +0100, Thomas Gleixner wrote: > > On Mon, Feb 20 2023 at 09:17, Krister Johansen wrote: > > > @@ -495,8 +496,7 @@ static int __init xen_tsc_safe_clocksource(void) > > > /* Leaf 4, sub-leaf 0 (0x

Re: [PATCH linux-next 2/2] x86/xen/time: cleanup xen_tsc_safe_clocksource

2023-02-20 Thread Krister Johansen
On Mon, Feb 20, 2023 at 11:01:18PM +0100, Thomas Gleixner wrote: > On Mon, Feb 20 2023 at 09:17, Krister Johansen wrote: > > @@ -495,8 +496,7 @@ static int __init xen_tsc_safe_clocksource(void) > > /* Leaf 4, sub-leaf 0 (0x4x03) */ > > cpuid_count(xen_cpuid_base() + 3, 0, &eax, &ebx, &e

[linux-linus test] 177951: regressions - trouble: broken/fail/pass/starved

2023-02-20 Thread osstest service owner
flight 177951 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/177951/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-credit2 broken test-amd64-amd64-xl-credit2 5 host-insta

Re: [RFC PATCH 08/10] xen: pci: remove pcidev_[un]lock[ed] calls

2023-02-20 Thread Volodymyr Babchuk
Hi Stefano, Stefano Stabellini writes: > On Wed, 31 Aug 2022, Volodymyr Babchuk wrote: >> As pci devices are refcounted now and all list that store them are >> protected by separate locks, we can safely drop global pcidevs_lock. >> >> Signed-off-by: Volodymyr Babchuk > > Up until this patch

Re: [PATCH 2/4] x86/svm: cleanup svm.h

2023-02-20 Thread Andrew Cooper
On 17/02/2023 6:48 pm, Xenia Ragiadakou wrote: > Remove the forward declaration of struct vcpu because it is not used. Huh, turns out that was my fault in c/s b158e72abe, shortly after I introduced them in the first place. Also, looking into that, there's one legitimate use of svm.h from outside,

Re: [PATCH] tools/xenstore: remove stale comment in create_node()

2023-02-20 Thread Julien Grall
Hi, On 20/02/2023 14:57, Juergen Gross wrote: There is a part of a comment in create_node() which should have been deleted when modifying the related coding. IIUC, you are referring to: 1cd3cc7ea27c ("tools/xenstore: create_node: Don't defer work to undo any changes on failure"). If so, th

Re: [PATCH v2 09/13] tools/xenstore: add TDB access trace support

2023-02-20 Thread Julien Grall
Hi, On 20/01/2023 10:00, Juergen Gross wrote: Add a new trace switch "tdb" and the related trace calls. The "tdb" switch is off per default. Signed-off-by: Juergen Gross With one remark (see below): Reviewed-by: Julien Grall --- tools/xenstore/xenstored_core.c| 8 +++- to

Re: [PATCH v2 08/13] tools/xenstore: add accounting trace support

2023-02-20 Thread Julien Grall
Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: Add a new trace switch "acc" and the related trace calls. The "acc" switch is off per default. Signed-off-by: Juergen Gross With one reamrk (see below): Reviewed-by: Julien Grall --- tools/xenstore/xenstored_core.c | 2 +- tool

Re: [PATCH v6 13/41] mm: Make pte_mkwrite() take a VMA

2023-02-20 Thread Edgecombe, Rick P
On Mon, 2023-02-20 at 12:23 +0100, David Hildenbrand wrote: > That looks painful but IMHO worth it :) > > Acked-by: David Hildenbrand Thanks. Yes it was not the most fun, but I agree - worth it.

Re: [PATCH v2 04/13] tools/xenstore: add framework to commit accounting data on success only

2023-02-20 Thread Julien Grall
Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: Instead of modifying accounting data and undo those modifications in case of an error during further processing, add a framework for collecting the needed changes and commit them only when the whole operation has succeeded. This scheme can r

Re: [RFC PATCH 07/10] xen: pci: add per-device locking

2023-02-20 Thread Volodymyr Babchuk
Hi Stefano, Stefano Stabellini writes: > On Wed, 31 Aug 2022, Volodymyr Babchuk wrote: >> Spinlock in struct pci_device will be used to protect access to device >> itself. Right now it is used mostly by MSI code. >> >> Signed-off-by: Volodymyr Babchuk > > There are 2 instances of: > > BU

Re: [PATCH 1/4] x86/svm: cleanup svm.c

2023-02-20 Thread Andrew Cooper
On 17/02/2023 6:48 pm, Xenia Ragiadakou wrote: > Do not include the headers: > xen/irq.h > asm/hvm/svm/intr.h > asm/io.h > asm/mem_sharing.h > asm/regs.h Out of interest, how are you calculating these?  They're accurate as far as I can tell. Looking at asm/hvm/svm/*, intr.h itself can b

Re: [PATCH linux-next 2/2] x86/xen/time: cleanup xen_tsc_safe_clocksource

2023-02-20 Thread Thomas Gleixner
On Mon, Feb 20 2023 at 09:17, Krister Johansen wrote: > @@ -495,8 +496,7 @@ static int __init xen_tsc_safe_clocksource(void) > /* Leaf 4, sub-leaf 0 (0x4x03) */ > cpuid_count(xen_cpuid_base() + 3, 0, &eax, &ebx, &ecx, &edx); > > - /* tsc_mode = no_emulate (2) */ > - if (eb

Re: [RFC PATCH 05/10] xen: pci: introduce reference counting for pdev

2023-02-20 Thread Volodymyr Babchuk
Hi Stefano, Thank you for the review Stefano Stabellini writes: > On Wed, 31 Aug 2022, Volodymyr Babchuk wrote: >> Prior to this change, lifetime of pci_dev objects was protected by global >> pcidevs_lock(). We are going to get if of this lock, so we need some >> other mechanism to ensure tha

Re: [PATCH v6 13/41] mm: Make pte_mkwrite() take a VMA

2023-02-20 Thread Edgecombe, Rick P
On Mon, 2023-02-20 at 12:00 +1100, Michael Ellerman wrote: > Acked-by: Michael Ellerman (powerpc) Thanks!

[PATCH 1/2] xen/ioapic: Don't use local_irq_restore() to disable irqs

2023-02-20 Thread Andrew Cooper
Despite its name, the irq{save,restore}() APIs are only intended to conditionally disable and re-enable interrupts. IO-APIC's timer_irq_works() violates this intention. As it is init code, switch to simple irq enable/disable(). No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beu

[PATCH 0/2] xen/irq: Perf improvements

2023-02-20 Thread Andrew Cooper
Andrew Cooper (2): xen/ioapic: Don't use local_irq_restore() to disable irqs x86/irq: Improve local_irq_restore() code generation and performance xen/arch/x86/include/asm/system.h | 9 ++--- xen/arch/x86/io_apic.c| 5 ++--- 2 files changed, 4 insertions(+), 10 deletions(-) --

[PATCH 2/2] x86/irq: Improve local_irq_restore() code generation and performance

2023-02-20 Thread Andrew Cooper
POPF is a horribly expensive instruction, while STI is an optimised fastpath. Switching POPF for a conditional branch and STI caused an 8% perf improvement in various linux measurements. While I don't expect the change to be that dramatic in Xen, there will be an improvement. Furthermore, there

[RFC PATCH] libxl/dm: Stop using "xenfv" machine in the Qemu upstream device model

2023-02-20 Thread Chuck Zmudzinski
The "xenfv" machine is almost a clone of the "pc" machine with accel=xen in Qemu upstream and is mostly redundant, so with this patch libxl stops using the "xenfv" machine type in favor of the "pc" machine type with accel=xen. Looking at the Qemu upstream code in hw/i386/pc_piix.c, the obvious dif

Re: [PATCH v2 01/13] tools/xenstore: don't allow creating too many nodes in a transaction

2023-02-20 Thread Julien Grall
On 20/02/2023 14:21, Juergen Gross wrote: On 20.02.23 15:15, Julien Grall wrote: On 20/02/2023 13:49, Juergen Gross wrote: On 20.02.23 13:07, Julien Grall wrote: Hi Juergen, On 20/02/2023 11:04, Juergen Gross wrote: On 20.02.23 10:46, Julien Grall wrote: Hi Juergen, On 20/01/2023 10:00,

[PATCH linux-next 2/2] x86/xen/time: cleanup xen_tsc_safe_clocksource

2023-02-20 Thread Krister Johansen
Modifies xen_tsc_safe_clocksource() to use newly defined constants from arch/x86/include/asm/xen/cpuid.h. This replaces a numeric value with XEN_CPUID_TSC_MODE_NEVER_EMULATE, and deletes a comment that is now self explanatory. There should be no change in the function's behavior. Signed-off-by:

[PATCH linux-next 1/2] xen: update arch/x86/include/asm/xen/cpuid.h

2023-02-20 Thread Krister Johansen
Update arch/x86/include/asm/xen/cpuid.h from the Xen tree to get newest definitions. This picks up some TSC mode definitions and comment formatting changes. Signed-off-by: Krister Johansen --- arch/x86/include/asm/xen/cpuid.h | 22 ++ 1 file changed, 18 insertions(+), 4 dele

[PATCH linux-next 0/2] x86/xen TSC related cleanups

2023-02-20 Thread Krister Johansen
Hi, Enclosed please find a pair of patches that perform some additional cleanup that was suggested by Boris and Jan. Specifically: this resync's arch/x86/include/asm/xen/cpuid.h from its upstream source in the Xen tree, and then uses one of the new #define-s to replace a constant in x86/xen/time.c

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2023-02-20 Thread Matias Ezequiel Vara Larsen
On Thu, Feb 16, 2023 at 04:15:29PM +0100, Jan Beulich wrote: > On 16.02.2023 16:07, Matias Ezequiel Vara Larsen wrote: > > On Wed, Dec 14, 2022 at 08:29:53AM +0100, Jan Beulich wrote: > >> On 07.10.2022 14:39, Matias Ezequiel Vara Larsen wrote: > >>> @@ -287,6 +289,20 @@ static inline void vcpu_run

[PATCH v2 4/4] xen/x86: switch x86 to use generic implemetation of bug.h

2023-02-20 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V2: * Remove all unnecessary things from as they were introduced in . * Define BUG_INSTR = 'ud2' and MODIFIER = 'c' ( it is needed to skip '$' when use an imidiate in x86 assembly ) * Update do_invalid_op() to re-use handle_bug_frame()

[PATCH v2 3/4] xen/arm: switch ARM to use generic implementation of bug.h

2023-02-20 Thread Oleksii Kurochko
Signed-off-by: Oleksii Kurochko --- Changes in V2: * Rename bug_file() in ARM implementation to bug_ptr() as generic do_bug_frame() uses bug_ptr(). * Remove generic parts from bug.h * Remove declaration of 'int do_bug_frame(...)' from as it was introduced in --- xen/arch/arm/Kconfig

[PATCH v2 1/4] xen: introduce CONFIG_GENERIC_BUG_FRAME

2023-02-20 Thread Oleksii Kurochko
A large part of the content of the bug.h is repeated among all architectures, so it was decided to create a new config CONFIG_GENERIC_BUG_FRAME. The version of from x86 was taken as the base version. The patch introduces the following stuff: * common bug.h header * generic implementation of

[PATCH v2 0/4] introduce generic implementation of macros from bug.h

2023-02-20 Thread Oleksii Kurochko
A large part of the content of the bug.h is repeated among all architectures (especially x86 and RISCV have the same implementation), so it was created a new config CONFIG_GENERIC_BUG_FRAME which is used to introduce generic implementation of do_bug_frame() and move x86's to with the following ch

[PATCH v2 2/4] xen: change to

2023-02-20 Thread Oleksii Kurochko
Since the generic version of bug.h stuff was introduced use instead of unnecessary Signed-off-by: Oleksii Kurochko --- Changes in V2: * Put [PATCH v1 4/4] xen: change to as second patch, update the patch to change all to among the whole project to not break build. * Update the com

[PATCH] tools/xenstore: remove stale comment in create_node()

2023-02-20 Thread Juergen Gross
There is a part of a comment in create_node() which should have been deleted when modifying the related coding. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c

Re: [PATCH] accel/xen: Remove dead code

2023-02-20 Thread Paul Durrant
On 15/02/2023 15:34, Philippe Mathieu-Daudé wrote: Unused since introduction in commit 04b0de0ee8 ("xen: factor out common functions"). Signed-off-by: Philippe Mathieu-Daudé --- accel/xen/xen-all.c | 10 -- 1 file changed, 10 deletions(-) Acked-by: Paul Durrant

Re: [PATCH v2 01/13] tools/xenstore: don't allow creating too many nodes in a transaction

2023-02-20 Thread Juergen Gross
On 20.02.23 15:15, Julien Grall wrote: On 20/02/2023 13:49, Juergen Gross wrote: On 20.02.23 13:07, Julien Grall wrote: Hi Juergen, On 20/02/2023 11:04, Juergen Gross wrote: On 20.02.23 10:46, Julien Grall wrote: Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: The accounting for the

Re: [PATCH] hw/i386/xen: Remove unused 'hw/ide.h' include from header

2023-02-20 Thread Paul Durrant
On 20/02/2023 09:27, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/xen/xen_platform.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 66e6de31a6..3795a203d4 100644 --- a/hw/i386/xen/xen_platform

Re: [PATCH v2 01/13] tools/xenstore: don't allow creating too many nodes in a transaction

2023-02-20 Thread Julien Grall
On 20/02/2023 13:49, Juergen Gross wrote: On 20.02.23 13:07, Julien Grall wrote: Hi Juergen, On 20/02/2023 11:04, Juergen Gross wrote: On 20.02.23 10:46, Julien Grall wrote: Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: The accounting for the number of nodes of a domain in an active

Re: [PATCH v2 01/13] tools/xenstore: don't allow creating too many nodes in a transaction

2023-02-20 Thread Juergen Gross
On 20.02.23 14:49, Juergen Gross wrote: Assume node quota is 1000, and at start of the transaction the guest is owning 999 nodes. In the transaction the guest is deleting 10 nodes, then dom0 is creating 5 additional nodes owned by the guest. The central node counter is now 1004 (over quota), whil

Re: [PATCH v2 01/13] tools/xenstore: don't allow creating too many nodes in a transaction

2023-02-20 Thread Juergen Gross
On 20.02.23 13:07, Julien Grall wrote: Hi Juergen, On 20/02/2023 11:04, Juergen Gross wrote: On 20.02.23 10:46, Julien Grall wrote: Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: The accounting for the number of nodes of a domain in an active transaction is not working correctly, as i

[PATCH RFC] xen: Annotate printk() as cold

2023-02-20 Thread Andrew Cooper
There is no such thing as a fastpath with a printk() on it, making printk() an excellent heuristic for slowpaths. Net delta is: add/remove: 595/2 grow/shrink: 56/762 up/down: 70879/-87331 (-16452) Total: Before=4085425, After=4068973, chg -0.40% because cold functions are optimised different

[xen-unstable test] 177883: tolerable trouble: fail/pass/starved

2023-02-20 Thread osstest service owner
flight 177883 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/177883/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 177852 Tests which did not succeed, but

Re: [PATCH v2 03/13] tools/xenstore: introduce accounting data array for per-domain values

2023-02-20 Thread Julien Grall
On 20/02/2023 11:20, Juergen Gross wrote: On 17.02.23 20:29, Julien Grall wrote: Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: Introduce the scheme of an accounting data array for per-domain accounting data and use it initially for the number of nodes owned by a domain. Make the ac

Re: [PATCH v2 01/13] tools/xenstore: don't allow creating too many nodes in a transaction

2023-02-20 Thread Julien Grall
Hi Juergen, On 20/02/2023 11:04, Juergen Gross wrote: On 20.02.23 10:46, Julien Grall wrote: Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: The accounting for the number of nodes of a domain in an active transaction is not working correctly, as it allows to create arbitrary number of n

[PATCH 3/3] x86/treewide: Drop the TRAP_* legacy names

2023-02-20 Thread Andrew Cooper
We have two naming schemes for exceptions - X86_EXC_?? which use the archtiectural abbreviations, and TRAP_* which is a mix of terminology and nonstandard abbrevations. Switch to X86_EXC_* uniformly. No funcational change, confirmed by diffing the disassembly. Only 7 binary changes, and they're

[PATCH 0/3] x86/entry: Cleanup and livepatch support

2023-02-20 Thread Andrew Cooper
The main patch here is patch 2, to support livepatching. Patch 3 is just cleanup. Andrew Cooper (3): x86/traps: Move do_general_protection() earlier x86/entry: Rework the exception entrypoints x86/treewide: Drop the TRAP_* legacy names xen/arch/x86/cpu/mcheck/vmce.c | 2 +- xen/

[PATCH 1/3] x86/traps: Move do_general_protection() earlier

2023-02-20 Thread Andrew Cooper
... in order to clean up the declarations without needing to forward declare it for handle_gdt_ldt_mapping_fault() No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu --- xen/arch/x86/traps.c | 157 +--

[PATCH 2/3] x86/entry: Rework the exception entrypoints

2023-02-20 Thread Andrew Cooper
This fixes two issues preventing livepatching. First, that #PF and NMI fall through into other functions, and second to add ELF metadata. Use a macro to generate the entrypoints programatically, rather than opencoding them all. Switch to using the architectural short names. Remove the DECLARE_T

Re: [PATCH] x86/asm: ELF metadata for simple cases

2023-02-20 Thread Ross Lagerwall
> From: Andrew Cooper > Sent: Monday, February 20, 2023 11:04 AM > To: Xen-devel > Cc: Andrew Cooper ; Jan Beulich > ; Roger Pau Monne ; Wei Liu > ; Konrad Rzeszutek Wilk ; Ross > Lagerwall > Subject: [PATCH] x86/asm: ELF metadata for simple cases >   > This is generally good practice, and n

Re: [PATCH v6 13/41] mm: Make pte_mkwrite() take a VMA

2023-02-20 Thread David Hildenbrand
On 18.02.23 22:14, Rick Edgecombe wrote: The x86 Control-flow Enforcement Technology (CET) feature includes a new type of memory called shadow stack. This shadow stack memory has some unusual properties, which requires some core mm changes to function properly. One of these unusual properties is

Re: [PATCH v2 03/13] tools/xenstore: introduce accounting data array for per-domain values

2023-02-20 Thread Juergen Gross
On 17.02.23 20:29, Julien Grall wrote: Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: Introduce the scheme of an accounting data array for per-domain accounting data and use it initially for the number of nodes owned by a domain. Make the accounting data type to be unsigned int, as no d

Re: [PATCH v6 11/41] mm: Introduce pte_mkwrite_kernel()

2023-02-20 Thread David Hildenbrand
On 18.02.23 22:14, Rick Edgecombe wrote: The x86 Control-flow Enforcement Technology (CET) feature includes a new type of memory called shadow stack. This shadow stack memory has some unusual properties, which requires some core mm changes to function properly. One of these changes is to allow f

Re: [PATCH v6 11/41] mm: Introduce pte_mkwrite_kernel()

2023-02-20 Thread David Hildenbrand
On 19.02.23 21:38, Kees Cook wrote: On Sat, Feb 18, 2023 at 01:14:03PM -0800, Rick Edgecombe wrote: The x86 Control-flow Enforcement Technology (CET) feature includes a new type of memory called shadow stack. This shadow stack memory has some unusual properties, which requires some core mm chang

Re: [PATCH v2 01/13] tools/xenstore: don't allow creating too many nodes in a transaction

2023-02-20 Thread Juergen Gross
On 20.02.23 10:46, Julien Grall wrote: Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: The accounting for the number of nodes of a domain in an active transaction is not working correctly, as it allows to create arbitrary number of nodes. The transaction will finally fail due to exceeding

[PATCH] x86/asm: ELF metadata for simple cases

2023-02-20 Thread Andrew Cooper
This is generally good practice, and necessary for livepatch binary diffing to work. With this, livepatching of the SVM entry path works. The only complication is with svm_stgi_label which is only used by oprofile to guestimate (not completely correctly) when an NMI hit guest context. Livepatchi

Re: [PATCH v2 01/13] tools/xenstore: don't allow creating too many nodes in a transaction

2023-02-20 Thread Julien Grall
Hi Juergen, On 20/01/2023 10:00, Juergen Gross wrote: The accounting for the number of nodes of a domain in an active transaction is not working correctly, as it allows to create arbitrary number of nodes. The transaction will finally fail due to exceeding the number of nodes quota, but before c

[PATCH] hw/i386/xen: Remove unused 'hw/ide.h' include from header

2023-02-20 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/xen/xen_platform.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 66e6de31a6..3795a203d4 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -25,7 +25,6 @@