[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.22 v3] xen/x86: Change stub page allocation/free


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 12 Jun 2026 11:51:34 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wuo4Jwek3qoNujtbRi4UfO6L6g1gowRsFuzpATDRLGM=; b=ip7fpX17ADxwGiFvX15vmEsxmnrWa5TebqX0kM2sPQ+vz6mzR9rnXAVhntTv0EV5a8ntH3IReyl5Dn4TPgvn52alxQJK0f3AHpGmrJ6ndOW9HDOO+Cyrcmez1XXyvXvVFGKfULwQVGMtnZiEGlxI+UjlpEvrqXJemm4uujvc4ZMSukBN5r+IOoXk8V3ESLTITxpVpAJbmefmJpNWxBQvlIVf5Cup4fb/9qVrzdga5KhcQNqx459wkHSyBIIrTKP/7UZNd7oc533Lnrf3ZV6l7Ls3d8iOqwu/0TlUwpJ1eqMpC7zLef5LAItjhtXqaQ8b+TRA0NyIwQyZNjf9Mhrdug==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fGGpQ81JTm1GLBURHmGdOpzubPd2rXA0cvcDsXQjp3DzKka5BWPtTJE37CMUN3bRgFp5QwVsFlcyrds53qF5pdrgo5sZBzAeiGLcmKh2KnJKg7/FPH7/zBqPKiDyh2xlIhaDw3B3Nhvv8jVbfMU2UKiEoOhgNoCuwyOTZfUObrEXw24iKkWTvoxBiRZR4LXJ1ygCsyCI2CG0lHZSbR6rZDQsK0ULSEdF5U31WXRcWq1kWISZO8viBMK7tOW2gTElBCWoO8EXuo6paLEpF8Q54wFAgeOPpOKqknuy1ZsXfrHBrghGAJM05GcmoCSanHohFyRfq4OkCjryf+6MaEAVRw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Oleksii Kurochko <oleskii.kurochko@xxxxxxxxx>
  • Delivery-date: Fri, 12 Jun 2026 09:51:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Jun 12, 2026 at 10:35:59AM +0100, Andrew Cooper wrote:
> On 12/06/2026 9:22 am, Roger Pau Monne wrote:
> > diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> > index 4192edf635b6..0253d22c349d 100644
> > --- a/xen/arch/x86/setup.c
> > +++ b/xen/arch/x86/setup.c
> > @@ -2089,9 +2089,7 @@ void asmlinkage __init noreturn __start_xen(void)
> >  
> >      init_idle_domain();
> >  
> > -    this_cpu(stubs.addr) = alloc_stub_page(smp_processor_id(),
> > -                                           &this_cpu(stubs).mfn);
> > -    BUG_ON(!this_cpu(stubs.addr));
> > +    init_stub();
> 
> While I hate to nitpick further, "stubs".  There are 4 per CPU, and I'm
> reasonably sure we're consistently plural elsewhere.

Funny you ask - I had it as "stubs" initially, but then realized the
existing function is named alloc_stub_page(), and hence switched back
to use "stub" as that seemed more inline with the existing usage.

I will adjust on commit.

> Otherwise (and with Jan's grammar note in the commit message too),
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Thanks, yes, that's been adjusted in the commit message.

> One further thought, which would be for a followup patch if we decide to
> do it.
> 
> We do now use UDB for bugframes.  It's also marginally better than INT3
> because if we do ever end up finding ourselves executing it, because
> we'll #UD on the first one, rather than try to brute force our way
> through the #BPs printing a log message per instruction.
> 
> One thing I didn't check and I really need to is whether UDB has the
> same speculation-halting properties that UD2 has.  It's not a guarantee,
> given that the encoding is valid in other modes.

Hm, yes, let's see if I find some time to change it, or whether
someone else beats me to it :).

Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.