Re: [PATCH 0/9] hw/sysbus/platform-bus: Introduce TYPE_DYNAMIC_SYS_BUS_DEVICE

2025-01-28 Thread Peter Maydell
On Tue, 28 Jan 2025 at 10:42, Gerd Hoffmann wrote: > > On Sat, Jan 25, 2025 at 07:13:34PM +0100, Philippe Mathieu-Daudé wrote: > > Some SysBus devices can optionally be dynamically plugged onto > > the sysbus-platform-bus (then virtual guests are aware of > > mmio mapping and IRQs via device tree

Re: [PULL v1 0/1] Xen Queue

2024-10-22 Thread Peter Maydell
On Mon, 21 Oct 2024 at 08:40, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > The following changes since commit f1dd640896ee2b50cb34328f2568aad324702954: > > Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging > (2024-10-18 10:42:56 +0100) > > are available in

Re: [PULL v2 2/5] hw/xen: Expose handle_bufioreq in xen_register_ioreq

2024-10-07 Thread Peter Maydell
On Thu, 3 Oct 2024 at 19:57, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > Expose handle_bufioreq in xen_register_ioreq(). > This is to allow machines to enable or disable buffered ioreqs. > > No functional change since all callers still set it to > HVM_IOREQSRV_BUFIOREQ_ATOMIC. > >

Re: [RFC PATCH 25/28] x86: Use PIE codegen for the core kernel

2024-10-06 Thread H. Peter Anvin
On October 6, 2024 12:17:40 PM PDT, Uros Bizjak wrote: >On Sun, Oct 6, 2024 at 8:01 PM David Laight wrote: >> >> ... >> > Due to the non-negligible impact of PIE, perhaps some kind of >> > CONFIG_PIE config definition should be introduced, so the assembly >> > code would be able to choose optimal

Re: [RFC PATCH 25/28] x86: Use PIE codegen for the core kernel

2024-10-05 Thread H. Peter Anvin
On 10/5/24 01:31, Uros Bizjak wrote: movq $sym to leaq sym(%rip) which you said ought to be smaller (and in reality appears to be the same size, 7 bytes) seems like a no-brainer and can be treated as a code quality issue -- in other words, file bug reports against gcc and clang. It is the kern

Re: [RFC PATCH 25/28] x86: Use PIE codegen for the core kernel

2024-10-04 Thread H. Peter Anvin
On 10/3/24 04:13, Ard Biesheuvel wrote: That said, doing changes like changing "mov $sym" to "lea sym(%rip)" I feel are a complete no-brainer and should be done regardless of any other code generation issues. Yes, this is the primary reason I ended up looking into this in the first place. Ear

Re: [PULL v2 0/5] Xen Queue

2024-10-04 Thread Peter Maydell
On Thu, 3 Oct 2024 at 19:57, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > The following changes since commit 423be09ab9492735924e73a2d36069784441ebc6: > > Merge tag 'warn-pull-request' of https://gitlab.com/marcandre.lureau/qemu > into staging (2024-10-03 10:32:54 +0100) > > are

Re: [PULL v1 0/5] Xen Queue

2024-10-03 Thread Peter Maydell
On Thu, 3 Oct 2024 at 15:31, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > The following changes since commit 423be09ab9492735924e73a2d36069784441ebc6: > > Merge tag 'warn-pull-request' of https://gitlab.com/marcandre.lureau/qemu > into staging (2024-10-03 10:32:54 +0100) > > are

Re: [RFC PATCH 25/28] x86: Use PIE codegen for the core kernel

2024-10-01 Thread H. Peter Anvin
On 9/25/24 08:01, Ard Biesheuvel wrote: From: Ard Biesheuvel As an intermediate step towards enabling PIE linking for the 64-bit x86 kernel, enable PIE codegen for all objects that are linked into the kernel proper. This substantially reduces the number of relocations that need to be processed

Re: [PULL v1 00/12] Xen queue

2024-09-05 Thread Peter Maydell
On Wed, 4 Sept 2024 at 17:15, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > The following changes since commit e638d685ec2a0700fb9529cbd1b2823ac4120c53: > > Open 9.2 development tree (2024-09-03 09:18:43 -0700) > > are available in the Git repository at: > > https://gitlab.com/ed

Re: [PATCH] xen: Fix null pointer dereference in xen_init_lock_cpu()

2024-06-26 Thread Peter Zijlstra
On Wed, Jun 26, 2024 at 03:43:39PM +0800, Ma Ke wrote: > kasprintf() is used for formatting strings and dynamically allocating > memory space. If memory allocation fails, kasprintf() will return NULL. > We should add a check to ensure that failure does not occur. Did you also consider what happens

Re: [PATCH v4 13/17] softmmu: Pass RAM MemoryRegion and is_write xen_map_cache()

2024-05-01 Thread Peter Xu
On Tue, Apr 30, 2024 at 06:49:35PM +0200, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Propagate MR and is_write to xen_map_cache(). > This is in preparation for adding support for grant mappings. > > No functional change. > > Signed-off-by: Edga

Re: [PATCH] xen-hvm: Avoid livelock while handling buffered ioreqs

2024-04-09 Thread Peter Maydell
On Tue, 9 Apr 2024 at 15:20, Ross Lagerwall wrote: > > On Tue, Apr 9, 2024 at 11:20 AM Anthony PERARD > wrote: > > > > On Thu, Apr 04, 2024 at 03:08:33PM +0100, Ross Lagerwall wrote: > > > diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c > > > index 1627da739822..1116b3978938 10064

Re: [PATCH for-9.1 v5 11/14] memory: Add Error** argument to the global_dirty_log routines

2024-03-22 Thread Peter Xu
Yong. I think I'll go ahead and queue it then. It should be in the 1st migration pull for 9.1. Thanks, -- Peter Xu

Re: [PATCH for-9.1 v5 09/14] memory: Add Error** argument to .log_global_start() handler

2024-03-20 Thread Peter Xu
On Wed, Mar 20, 2024 at 05:15:06PM +0100, Cédric Le Goater wrote: > Sure, or I will in a v6. Markus had a comment on 8/14. Yeah, I can handle both if they're the only ones. Thanks, -- Peter Xu

Re: [PATCH for-9.1 v5 11/14] memory: Add Error** argument to the global_dirty_log routines

2024-03-20 Thread Peter Xu
t sees dirty log not ever started. For those bits, I'll wait and see whether Yong or Hailiang (cced) has any comments. From generic migration/memory side, nothing I see wrong: Acked-by: Peter Xu Thanks, -- Peter Xu

Re: [PATCH for-9.1 v5 09/14] memory: Add Error** argument to .log_global_start() handler

2024-03-20 Thread Peter Xu
performed to stop dirty logging on all listeners where it was > previously enabled. > > Cc: Stefano Stabellini > Cc: Anthony Perard > Cc: Paul Durrant > Cc: "Michael S. Tsirkin" > Cc: Paolo Bonzini > Cc: David Hildenbrand > Signed-off-by: Cédric Le Goater

Re: [PATCH v2 1/1] x86/fred: Fix init_task thread stack pointer initialization

2024-03-06 Thread H. Peter Anvin
On March 6, 2024 10:28:25 AM PST, Xin Li wrote: >On 3/4/2024 12:33 AM, Xin Li (Intel) wrote: >> As TOP_OF_KERNEL_STACK_PADDING is defined as 0 on x86_64, no one noticed >> it's missing in the calculation of the .sp field in INIT_THREAD until it >> is defined to 16 with CONFIG_X86_FRED=y. >> >> Su

Re: QEMU features useful for Xen development?

2024-02-19 Thread Peter Maydell
On Thu, 31 Aug 2023 at 11:32, Ayan Kumar Halder wrote: > On 31/08/2023 11:03, Peter Maydell wrote: > > On Thu, 31 Aug 2023 at 10:53, Alex Bennée wrote: > >> Peter Maydell writes: > >>> On Thu, 31 Aug 2023 at 01:57, Stefano Stabellini > >>> wrote: &g

Re: [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info()

2024-01-26 Thread Peter Maydell
On Fri, 26 Jan 2024 at 15:20, David Woodhouse wrote: > > On Fri, 2024-01-26 at 14:43 +, Peter Maydell wrote: > > > > > +NICInfo *qemu_find_nic_info(const char *typename, bool match_default, > > > +const char *alias); > &g

Re: [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info()

2024-01-26 Thread Peter Maydell
On Mon, 8 Jan 2024 at 20:49, David Woodhouse wrote: > > From: David Woodhouse > > Most code which directly accesses nd_table[] and nb_nics uses them for > one of two things. Either "I have created a NIC device and I'd like a > configuration for it", or "I will create a NIC device *if* there is a

Re: [PULL 0/6] Block patches

2024-01-09 Thread Peter Maydell
On Mon, 8 Jan 2024 at 16:37, Stefan Hajnoczi wrote: > > The following changes since commit ffd454c67e38cc6df792733ebc5d967eee28ac0d: > > Merge tag 'pull-vfio-20240107' of https://github.com/legoater/qemu into > staging (2024-01-08 10:28:42 +) > > are available in the Git repository at: > >

Re: [PATCH v6 01/11] linux-headers: Update to kernel headers to add venus capset

2023-12-19 Thread Peter Maydell
On Tue, 19 Dec 2023 at 13:49, Huang Rui wrote: > > On Tue, Dec 19, 2023 at 08:20:22PM +0800, Akihiko Odaki wrote: > > On 2023/12/19 16:53, Huang Rui wrote: > > > Sync up kernel headers to update venus macro till they are merged into > > > mainline. > > > > Thanks for sorting things out with the ke

Re: [PATCH V8 00/12] fix migration of suspended runstate

2023-12-17 Thread Peter Xu
On Wed, Dec 13, 2023 at 10:35:33AM -0500, Steven Sistare wrote: > Hi Peter, all have RB's, with all i's dotted and t's crossed - steve Yes this seems to be more migration related so maybe good candidate for a pull from migration submodule. But since this is still solving a

Re: [PATCH v13 24/35] x86/fred: Add a NMI entry stub for FRED

2023-12-14 Thread H. Peter Anvin
So we have recently discovered an overlooked interaction with VT-x. Immediately before VMENTER and after VMEXIT, CR2 is live with the *guest* CR2. Regardless of if the guest uses FRED or not, this is guest state and SHOULD NOT be corrupted. Furthermore, host state MUST NOT leak into the guest.

Re: [PATCH] fix qemu build with xen-4.18.0

2023-12-12 Thread Peter Maydell
On Tue, 12 Dec 2023 at 14:20, Anthony PERARD wrote: > Building qemu with something like: > ./configure --enable-xen --cpu=x86_64 > used to work. Can we fix that? It still works with v8.1.0. > At least, it works on x86, I never really try to build qemu for arm. > Notice that there's no "--targe

RE: [PATCH v13 26/35] x86/fred: FRED entry/exit and dispatch code

2023-12-06 Thread H. Peter Anvin
On December 6, 2023 11:19:26 AM PST, "Li, Xin3" wrote: >> >>> +case X86_TRAP_OF: >> >>> +exc_overflow(regs); >> >>> +return; >> >>> + >> >>> +/* INT3 */ >> >>> +case X86_TRAP_BP: >> >>> +exc_int3(regs); >> >>> +

Re: [RFC PATCH v2 17/19] heki: x86: Update permissions counters during text patching

2023-12-06 Thread Peter Zijlstra
On Wed, Dec 06, 2023 at 10:37:33AM -0600, Madhavan T. Venkataraman wrote: > > > On 11/30/23 05:33, Peter Zijlstra wrote: > > On Wed, Nov 29, 2023 at 03:07:15PM -0600, Madhavan T. Venkataraman wrote: > > > >> Kernel Lockdown > >> --- >

Re: [PATCH 1/6] system/cpus: rename qemu_mutex_lock_iothread() to qemu_bql_lock()

2023-11-30 Thread Peter Xu
On Thu, Nov 30, 2023 at 03:43:25PM -0500, Stefan Hajnoczi wrote: > On Thu, Nov 30, 2023 at 03:08:49PM -0500, Peter Xu wrote: > > On Wed, Nov 29, 2023 at 04:26:20PM -0500, Stefan Hajnoczi wrote: > > > The Big QEMU Lock (BQL) has many names and they are confusing. The > > >

Re: [PATCH 1/6] system/cpus: rename qemu_mutex_lock_iothread() to qemu_bql_lock()

2023-11-30 Thread Peter Xu
ock(void) > - bool qemu_bql_locked(void) > > There are more APIs with "iothread" in their names. Subsequent patches > will rename them. There are also comments and documentation that will be > updated in later patches. > > Signed-off-by: Stefan Hajnoczi Acked-by:

Re: [RFC PATCH v2 17/19] heki: x86: Update permissions counters during text patching

2023-11-30 Thread Peter Zijlstra
e table so that text can be patched. heki_text_poke_end() > is called to revert write permissions in the extended page table. This, if text_poke works, then static_call / jump_label / ftrace and everything else should work, they all rely on this. > Peter mentioned the following: > &g

RE: [PATCH v12 24/37] x86/idtentry: Incorporate definitions/declarations of the FRED entries

2023-11-28 Thread H. Peter Anvin
On November 28, 2023 10:39:01 AM PST, "Li, Xin3" wrote: >> > FRED and IDT can share most of the definitions and declarations so >> > that in the majority of cases the actual handler implementation is the >> > same. >> > >> > The differences are the exceptions where FRED stores exception related >>

Re: [PATCH v12 16/37] x86/ptrace: Add FRED additional information to the pt_regs structure

2023-11-28 Thread H. Peter Anvin
gt; >> Specially introduce a new structure fred_ss to denote the FRED flags >> above SS selector, which avoids FRED_SSX_ macros and makes the code >> simpler and easier to read. >> >> Signed-off-by: H. Peter Anvin (Intel) > >You and hpa need to go through a

Re: [RFC PATCH v2 17/19] heki: x86: Update permissions counters during text patching

2023-11-27 Thread Peter Zijlstra
On Mon, Nov 27, 2023 at 10:48:29AM -0600, Madhavan T. Venkataraman wrote: > Apologies for the late reply. I was on vacation. Please see my response below: > > On 11/13/23 02:19, Peter Zijlstra wrote: > > On Sun, Nov 12, 2023 at 09:23:24PM -0500, Mickaël Salaün wrote: > &

Re: [RFC PATCH v2 18/19] heki: x86: Protect guest kernel memory using the KVM hypervisor

2023-11-27 Thread Peter Zijlstra
On Mon, Nov 27, 2023 at 11:05:23AM -0600, Madhavan T. Venkataraman wrote: > Apologies for the late reply. I was on vacation. Please see my response below: > > On 11/13/23 02:54, Peter Zijlstra wrote: > > On Sun, Nov 12, 2023 at 09:23:25PM -0500, Mickaël Salaün wrote: > &

Re: [PATCH v12 19/37] x86/fred: Update MSR_IA32_FRED_RSP0 during task switch

2023-11-13 Thread H. Peter Anvin
On November 13, 2023 1:29:47 PM EST, Borislav Petkov wrote: >On Mon, Nov 13, 2023 at 12:36:04PM -0500, H. Peter Anvin wrote: >> A resource cannot be consumed after the value has been written; this >> is the only necessary level of serialization, equivalent to, say, RAX. &g

Re: [PATCH v12 19/37] x86/fred: Update MSR_IA32_FRED_RSP0 during task switch

2023-11-13 Thread H. Peter Anvin
On November 13, 2023 4:37:42 AM EST, Borislav Petkov wrote: >On Mon, Oct 02, 2023 at 11:24:40PM -0700, Xin Li wrote: >> From: "H. Peter Anvin (Intel)" >> >> MSR_IA32_FRED_RSP0 is used during ring 3 event delivery, and needs to >> be updated to point to t

Re: [RFC PATCH v2 18/19] heki: x86: Protect guest kernel memory using the KVM hypervisor

2023-11-13 Thread Peter Zijlstra
On Sun, Nov 12, 2023 at 09:23:25PM -0500, Mickaël Salaün wrote: > From: Madhavan T. Venkataraman > > Implement a hypervisor function, kvm_protect_memory() that calls the > KVM_HC_PROTECT_MEMORY hypercall to request the KVM hypervisor to > set specified permissions on a list of guest pages. > > U

Re: [RFC PATCH v2 17/19] heki: x86: Update permissions counters during text patching

2023-11-13 Thread Peter Zijlstra
nters for the text page so that write > permissions can be temporarily established in the EPT to modify the > instructions in that page. > > Cc: Borislav Petkov > Cc: Dave Hansen > Cc: H. Peter Anvin > Cc: Ingo Molnar > Cc: Kees Cook > Cc: Madhavan T. Venkataram

Re: [PATCH] hw/xen: clean up xen_block_find_free_vdev() to avoid Coverity false positive

2023-11-09 Thread Peter Maydell
On Thu, 9 Nov 2023 at 15:30, David Woodhouse wrote: > > From: David Woodhouse > > Coverity couldn't see that nr_existing was always going to be zero when > qemu_xen_xs_directory() returned NULL in the ENOENT case (CID 1523906). > > Perhaps more to the point, neither c

Re: [PULL 06/15] hw/xen: automatically assign device index to block devices

2023-11-09 Thread Peter Maydell
On Tue, 7 Nov 2023 at 09:24, David Woodhouse wrote: > > From: David Woodhouse > > There's no need to force the user to assign a vdev. We can automatically > assign one, starting at xvda and searching until we find the first disk > name that's unused. > > This means we can now allow '-drive if=xen

Re: [PATCH] acpi_idle: use raw_safe_halt() from acpi_idle_play_dead()

2023-10-27 Thread Peter Zijlstra
at __cpuidle stuff) but I've not yet gone through the whole hotplug thing :/ This seems right, at this point everything, including RCU is very much gone, any instrumentation is undesired. Acked-by: Peter Zijlstra (Intel) > > drivers/acpi/processor_idle.c | 2 +- > 1 f

Re: [PATCH v2 0/4] Introduce %rip-relative addressing to PER_CPU_VAR macro

2023-10-12 Thread H. Peter Anvin
On 10/12/23 14:17, Uros Bizjak wrote: Are you PIC-adjusting the percpu variables as well? After this patch (and after fixing percpu_stable_op to use "a" operand modifier on GCC), the only *one* remaining absolute reference to percpu variable remain in xen-head.S, where: movq$INIT_PER

Re: [PATCH v2 0/4] Introduce %rip-relative addressing to PER_CPU_VAR macro

2023-10-12 Thread H. Peter Anvin
On 10/12/23 13:59, Uros Bizjak wrote: On Thu, Oct 12, 2023 at 10:53 PM Dave Hansen wrote: On 10/12/23 13:12, Uros Bizjak wrote: The last patch introduces (%rip) suffix and uses it for x86_64 target, resulting in a small code size decrease: text data bss dec hex filename 25510677 4386685 80838

Re: [PATCH 1/4] x86/percpu: Use explicit segment registers in lib/cmpxchg{8,16}b_emu.S

2023-10-12 Thread H. Peter Anvin
On 10/12/23 14:02, H. Peter Anvin wrote:> %fs?? > Nevermind, I forgot that we changed from %gs to %fs on i386 at some point in the now-distant past. -hpa

Re: [PATCH 1/4] x86/percpu: Use explicit segment registers in lib/cmpxchg{8,16}b_emu.S

2023-10-12 Thread H. Peter Anvin
gister, so >use explicit segment registers to access percpu variable instead. > >Also add a missing function comment to this_cpu_cmpxchg8b_emu. > >No functional changes intended. > >Cc: Thomas Gleixner >Cc: Ingo Molnar >Cc: Borislav Petkov >Cc: Dave Hansen >Cc: &q

Re: [PATCH v11 05/37] x86/trapnr: Add event type macros to

2023-09-27 Thread H. Peter Anvin
cept, and should be defined in a common x86 >> header. >> >> Add event type macros to , and use it in . >> >> Suggested-by: H. Peter Anvin (Intel) >> Tested-by: Shan Kang >> Signed-off-by: Xin Li >> --- >> >> Changes since v10: >

RE: [PATCH v11 35/37] x86/syscall: Split IDT syscall setup code into idt_syscall_init()

2023-09-25 Thread H. Peter Anvin
On September 25, 2023 10:56:44 AM PDT, "Li, Xin3" wrote: >> >diff --git a/arch/x86/kernel/cpu/common.c >> >b/arch/x86/kernel/cpu/common.c index 20bbedbf6dcb..2ee4e7b597a3 100644 >> >--- a/arch/x86/kernel/cpu/common.c >> >+++ b/arch/x86/kernel/cpu/common.c >> >@@ -2071,10 +2071,8 @@ static void wrm

Re: [PATCH v11 35/37] x86/syscall: Split IDT syscall setup code into idt_syscall_init()

2023-09-25 Thread H. Peter Anvin
On September 23, 2023 2:42:10 AM PDT, Xin Li wrote: >Because FRED uses the ring 3 FRED entrypoint for SYSCALL and SYSENTER and >ERETU is the only legit instruction to return to ring 3, there is NO need >to setup SYSCALL and SYSENTER MSRs for FRED, except the IA32_STAR MSR. > >Split IDT syscall set

RE: [PATCH v10 36/38] x86/fred: Add fred_syscall_init()

2023-09-20 Thread H. Peter Anvin
On September 20, 2023 1:18:14 AM PDT, Thomas Gleixner wrote: >On Wed, Sep 20 2023 at 04:33, Li, Xin3 wrote: >>> > +static inline void fred_syscall_init(void) { >>> > + /* >>> > + * Per FRED spec 5.0, FRED uses the ring 3 FRED entrypoint for SYSCALL >>> > + * and SYSENTER, and ERETU is the only

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

2023-09-20 Thread Peter Zijlstra
On Fri, Sep 15, 2023 at 02:16:50AM +0100, andrew.coop...@citrix.com wrote: > Juergen has already done the work to delete one of these two patching > mechanisms and replace it with the other. > > https://lore.kernel.org/lkml/a32e211f-4add-4fb2-9e5a-480ae9b9b...@suse.com/ > > Unfortunately, it's o

Re: [RFC PATCH 1/3] x86/paravirt: move some functions and defines to alternative

2023-09-20 Thread Peter Zijlstra
On Thu, Jun 08, 2023 at 04:03:31PM +0200, Juergen Gross wrote: > As a preparation for replacing paravirt patching completely by > alternative patching, move some backend functions and #defines to > alternative code and header. > > Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel)

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

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

2023-09-14 Thread H. Peter Anvin
ix.com wrote:> On 15/09/2023 1:07 am, H. Peter Anvin wrote: >> Is *that* your concern?! Just put a NOP before WRMSR – you need padding NOP bytes anyway – and the extable entry is no longer at the same address. Problem solved. >> >> Either that, or use a direct call, which ca

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 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 2/7] migration: Clean up local variable shadowing

2023-08-31 Thread Peter Xu
else rename variables. > > Signed-off-by: Markus Armbruster Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH 1/7] migration/rdma: Fix save_page method to fail on polling error

2023-08-31 Thread Peter Xu
remains zero. > > Broken since day one, and duplicated more recently. > > Fixes: 2da776db4846 (rdma: core logic) > Fixes: b390afd8c50b (migration/rdma: Fix out of order wrid) > Signed-off-by: Markus Armbruster Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH 3/7] ui: Clean up local variable shadowing

2023-08-31 Thread Peter Maydell
ZRLE_PIXEL *ptr; > - > for (ptr = data; ptr < data + w * h; ptr++) { > ZRLE_WRITE_PIXEL(vs, *ptr); > } For this one I'm tempted to suggest instead moving the pix and end currently at whole-function scope into their own block, so it's clear these are actually four completely independent uses of ptr/end. But either way Reviewed-by: Peter Maydell thanks -- PMM

Re: QEMU features useful for Xen development?

2023-08-31 Thread Peter Maydell
On Thu, 31 Aug 2023 at 11:49, Alex Bennée wrote: > Peter Maydell writes: > > All our MPS2/MPS3 boards are M-profile. That means we have the > > device models for all the interesting devices on the board, but > > it would be simpler to write the an536 board model separatel

Re: QEMU features useful for Xen development?

2023-08-31 Thread Peter Maydell
On Thu, 31 Aug 2023 at 10:53, Alex Bennée wrote: > > > Peter Maydell writes: > > > On Thu, 31 Aug 2023 at 01:57, Stefano Stabellini > > wrote: > >> As Xen is gaining R52 and R82 support, it would be great to be able to > >> use QEMU for development an

Re: QEMU features useful for Xen development?

2023-08-31 Thread Peter Maydell
On Thu, 31 Aug 2023 at 01:57, Stefano Stabellini wrote: > As Xen is gaining R52 and R82 support, it would be great to be able to > use QEMU for development and testing there as well, but I don't think > QEMU can emulate EL2 properly for the Cortex-R architecture. We would > need EL2 support in the

Re: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Peter Zijlstra
On Fri, Aug 04, 2023 at 05:35:11PM +, Li, Xin3 wrote: > > > The IDT event delivery of X86_TRAP_DF, X86_TRAP_TS, X86_TRAP_NP, > > > X86_TRAP_SS, X86_TRAP_GP, X86_TRAP_AC and X86_TRAP_CP pushes an error > > > code into the orig_ax member of the pt_regs structure, and the error > > > code is passe

Re: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Peter Zijlstra
On Fri, Aug 04, 2023 at 12:57:34AM -0700, Xin Li wrote: > The IDT event delivery of X86_TRAP_DF, X86_TRAP_TS, X86_TRAP_NP, > X86_TRAP_SS, X86_TRAP_GP, X86_TRAP_AC and X86_TRAP_CP pushes an error > code into the orig_ax member of the pt_regs structure, and the error > code is passed as the second ar

Re: [PATCH RESEND v9 33/36] KVM: VMX: Add VMX_DO_FRED_EVENT_IRQOFF for IRQ/NMI handling

2023-08-01 Thread Peter Zijlstra
On Tue, Aug 01, 2023 at 07:01:15PM +, Sean Christopherson wrote: > The spec I have from May 2022 says the NMI bit colocated with CS, not SS. And > the cover letter's suggestion to use a search engine to find the spec ain't > exactly helpful, that just gives me the same "May 2022 Revision 3.0"

Re: [PATCH RESEND v9 00/36] x86: enable FRED for x86-64

2023-08-01 Thread Peter Zijlstra
On Tue, Aug 01, 2023 at 12:52:36PM +0200, Peter Zijlstra wrote: > I also believe there is a kernel.org service for sending patch series, > but i'm not sure I remember the details. https://b4.docs.kernel.org/en/latest/contributor/send.html

Re: [PATCH RESEND v9 00/36] x86: enable FRED for x86-64

2023-08-01 Thread Peter Zijlstra
On Tue, Aug 01, 2023 at 01:32:42AM -0700, Xin Li wrote: > Resend because the mail system failed to deliver some messages yesterday. Well, you need to figure out how to send patches, because both yesterday and today are screwy. The one from yesterday came in 6 thread groups: 0-25, 26, 27, 28, 29,

Re: [PATCH v9 29/36] x86/fred: FRED entry/exit and dispatch code

2023-07-31 Thread H. Peter Anvin
On 7/30/23 23:41, Xin Li wrote: +static DEFINE_FRED_HANDLER(fred_other_default) +{ + regs->vector = X86_TRAP_UD; + fred_emulate_fault(regs); +} + +static DEFINE_FRED_HANDLER(fred_syscall) +{ + regs->orig_ax = regs->ax; + regs->ax = -ENOSYS; + do_syscall_64(regs, regs

Re: [PATCH v9 29/36] x86/fred: FRED entry/exit and dispatch code

2023-07-31 Thread H. Peter Anvin
On 7/30/23 23:41, Xin Li wrote: + +static DEFINE_FRED_HANDLER(fred_sw_interrupt_user) +{ + /* +* In compat mode INT $0x80 (32bit system call) is +* performance-critical. Handle it first. +*/ + if (IS_ENABLED(CONFIG_IA32_EMULATION) && + likely(regs->ve

[PATCH v7] xl: Add escape character argument to xl console

2023-07-28 Thread Peter Hoyes
From: Peter Hoyes Add -e argument to xl console and pass to new escape_character argument of libxl_console_exec. Introduce a new API version to support this new argument and advertise the new functionality in libxl.h In libxl_console_exec, there are currently two call sites to execl, which

[PATCH v6 2/2] xl: Add escape character argument to xl console

2023-07-27 Thread Peter Hoyes
From: Peter Hoyes Add -e argument to xl console and pass to new escape_character argument of libxl_console_exec. Introduce a new API version to support this new argument and advertise the new functionality in libxl.h In libxl_console_exec, there are currently two call sites to execl, which

[PATCH v6 1/2] tools/console: Add escape argument to configure escape character

2023-07-27 Thread Peter Hoyes
From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases. Add --escape argument to console tool for

[PATCH v6 0/2] Add escape character argument to Xen console

2023-07-27 Thread Peter Hoyes
From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases, falling back to the existing value if no

Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-07-24 Thread Peter Zijlstra
On Mon, Jul 24, 2023 at 05:43:10PM +0800, Qi Zheng wrote: > +void shrinker_unregister(struct shrinker *shrinker) > +{ > + struct dentry *debugfs_entry; > + int debugfs_id; > + > + if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED)) > + return; > + > + down_write(

[PATCH v5 1/2] tools/console: Add escape argument to configure escape character

2023-07-12 Thread Peter Hoyes
From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases. Add --escape argument to console tool for

[PATCH v5 2/2] xl: Add escape character argument to xl console

2023-07-12 Thread Peter Hoyes
From: Peter Hoyes Add -e argument to xl console and pass to new escape_character argument of libxl_console_exec. Introduce a new API version to support this new argument and advertise the new functionality in libxl.h In libxl_console_exec, there are currently two call sites to execl, which

[PATCH v5 0/2] Add escape character argument to Xen console

2023-07-12 Thread Peter Hoyes
From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases, falling back to the existing value if no

Re: [PATCH v3 2/2] xl: Add escape character argument to xl console

2023-07-12 Thread Peter Hoyes
Thanks for the feedback. On 10/07/2023 15:43, Anthony PERARD wrote: On Thu, Jun 22, 2023 at 03:12:48PM +0100, Peter Hoyes wrote: /* libxl_primary_console_exec finds the domid and console number * corresponding to the primary console of the given vm, then calls * libxl_console_exec with

[PATCH v4 2/2] xl: Add escape character argument to xl console

2023-07-12 Thread Peter Hoyes
From: Peter Hoyes Add -e argument to xl console and pass to new escape_character argument of libxl_console_exec. Introduce a new API version to support this new argument and advertise the new functionality in libxl.h In libxl_console_exec, there are currently two call sites to execl, which

[PATCH v4 1/2] tools/console: Add escape argument to configure escape character

2023-07-12 Thread Peter Hoyes
From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases. Add --escape argument to console tool for

[PATCH v4 0/2] Add escape character argument to Xen console

2023-07-12 Thread Peter Hoyes
From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases, falling back to the existing Make the nece

Re: [PATCH] xen-block: Avoid leaks on new error path

2023-07-04 Thread Peter Maydell
ter the error check, and free both > `filename` and `driver` when we are about to return and thus taking > care of both success and error path. > > Coverity only spotted the leak of qdicts (*_layer variables). > > Reported-by: Peter Maydell > Fixes: Coverity CID 1508722, 1398649 &

Re: [PATCH v6 03/33] pgtable: Create struct ptdesc

2023-06-27 Thread Peter Xu
ck_t *ptl; > +#else > + spinlock_t ptl; > +#endif > + }; > + unsigned int __page_type; > + atomic_t _refcount; > +#ifdef CONFIG_MEMCG > + unsigned long pt_memcg_data; > +#endif > +}; -- Peter Xu

Re: [PATCH v2 1/2] tools/console: Add escape argument to configure escape character

2023-06-22 Thread Peter Hoyes
On 22/06/2023 15:07, Jan Beulich wrote: On 22.06.2023 15:55, Peter Hoyes wrote: From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape char

[PATCH v3 2/2] xl: Add escape character argument to xl console

2023-06-22 Thread Peter Hoyes
From: Peter Hoyes Add -e argument to xl console and pass to new escape_character argument of libxl_console_exec. In libxl_console_exec, there are currently two call sites to execl, which uses varargs, in order to support optionally passing 'start-notify-fd' to the console client. I

[PATCH v3 1/2] tools/console: Add escape argument to configure escape character

2023-06-22 Thread Peter Hoyes
From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases. Add --escape argument to console tool for

[PATCH v2 2/2] xl: Add escape character argument to xl console

2023-06-22 Thread Peter Hoyes
From: Peter Hoyes Add -e argument to xl console and pass to new escape_character argument of libxl_console_exec. In libxl_console_exec, there are currently two call sites to execl, which uses varargs, in order to support optionally passing 'start-notify-fd' to the console client. I

[PATCH v2 1/2] tools/console: Add escape argument to configure escape character

2023-06-22 Thread Peter Hoyes
From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases. Add --escape argument to console tool for

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 02:05:13PM +0100, Andrew Cooper wrote: > On 22/06/2023 9:26 am, Peter Zijlstra wrote: > > On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: > > > >> The hypercalls we are talking of are synchronous ones. They are running > >>

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 12:33:31PM +0200, Juergen Gross wrote: > On 22.06.23 10:26, Peter Zijlstra wrote: > > > The downside would be that some workloads might see worse performance > > > due to backend I/O handling might get preempted. > > > > Is that an a

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: > The hypercalls we are talking of are synchronous ones. They are running > in the context of the vcpu doing the call (like a syscall from userland is > running in the process context). (so time actually passes from the guest's pov?)

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Peter Zijlstra
On Wed, Jun 21, 2023 at 07:19:21PM +, Per Bilse wrote: > On 6/21/2023 5:40 PM, Peter Zijlstra wrote: > > I don't understand it -- fundamentally, how can linux schedule when the > > guest isn't even running? Hypercall transfers control to the > > host/hypervisor

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Peter Zijlstra
On Wed, Jun 21, 2023 at 03:14:42PM +, Per Bilse wrote: > Some Xen hypercalls issued by dom0 guests may run for many 10s of > seconds, potentially causing watchdog timeouts and other problems. > It's rare for this to happen, but it does in extreme circumstances, > for instance when shutting down

Re: [PULL 05/27] hw/xen: Watches on XenStore transactions

2023-06-20 Thread Peter Maydell
On Fri, 2 Jun 2023 at 18:06, Peter Maydell wrote: > > On Tue, 2 May 2023 at 18:08, Peter Maydell wrote: > > > > On Tue, 7 Mar 2023 at 18:27, David Woodhouse wrote: > > > > > > From: David Woodhouse > > Hi; Coverity's "is there missing error

[PATCH 2/2] xl: Add escape character argument to xl console

2023-06-14 Thread Peter Hoyes
From: Peter Hoyes Add -e argument to xl console and pass to new escape_character argument of libxl_console_exec. In libxl_console_exec, there are currently two call sites to execl, which uses varargs, in order to support optionally passing 'start-notify-fd' to the console client. I

[PATCH 1/2] tools/console: Add escape argument to configure escape character

2023-06-14 Thread Peter Hoyes
From: Peter Hoyes Dom0 may be accessed via telnet, meaning the default escape character (which is the same as telnet's) cannot be directly used to exit the console. It would be helpful to make the escape character customizable in such use cases. Add --escape argument to console tool for

Re: [PULL 05/27] hw/xen: Watches on XenStore transactions

2023-06-02 Thread Peter Maydell
On Tue, 2 May 2023 at 18:08, Peter Maydell wrote: > > On Tue, 7 Mar 2023 at 18:27, David Woodhouse wrote: > > > > From: David Woodhouse > > > > Firing watches on the nodes that still exist is relatively easy; just > > walk the tree and look at the nodes

Re: [XEN PATCH] tools/xendomains: Don't auto save/restore/migrate on Arm*

2023-05-22 Thread Peter Hoyes
otherwise continues to shut down the domains cleanly, with the unsupported steps skipped. Also in sysconfig.xendomains, change "Default" to "Example" as the real default is an empty value. Reported-by: Peter Hoyes Signed-off-by: Anthony PERARD --- Peter, what do you think of thi

Re: [patch V4 37/37] x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it

2023-05-15 Thread Peter Zijlstra
On Fri, May 12, 2023 at 11:07:56PM +0200, Thomas Gleixner wrote: > From: Thomas Gleixner > > Implement the validation function which tells the core code whether > parallel bringup is possible. > > The only condition for now is that the kernel does not run in an encrypted > guest as these will tr

Re: [patch v3 08/36] x86/smpboot: Split up native_cpu_up() into separate phases and document them

2023-05-10 Thread Peter Zijlstra
On Tue, May 09, 2023 at 10:11:05PM +0200, Thomas Gleixner wrote: > On Tue, May 09 2023 at 12:04, Peter Zijlstra wrote: > > On Mon, May 08, 2023 at 09:43:39PM +0200, Thomas Gleixner wrote: > > Not to the detriment of this patch, but this barrier() and it's comment > >

  1   2   3   4   >