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

Re: [PATCH v4 2/2] xen/console: add compile-time rate-limiting controls


  • To: Roger Pau Monné <roger@xxxxxxxxxxxxxx>
  • From: dmukhin@xxxxxxxx
  • Date: Mon, 10 Aug 2026 10:56:15 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
  • 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=90aLdj9xpoZAg+4D/L3YjgL0OFuZL96uidt3wVPvCGE=; b=qWhj0UzYYZVp3G2S4/F/7QqkmaO4ExmjOSqVLY+f+xqd4zkjoZrkGdErt5DgMdQUvvhd05FJDs7w8I2dNLDzpdV/su2wCsX3VYz6udRYVnAVjTb+Z/CHwfvfqHI6C2qnB/NvSKfWlG7lRwe29h6fGLSICR7CUHpaSzxfhzLEDscVYvk0iG9IWt95MA35/JOU9X/x6CuixKMXkfESUjCWG+vUnHDh9LbtBzqVri6enAF61q4NkUO4WHSQZzbk9S4b3vyR0956LfyueQkOcHqJtcvYeyfTEEeYJmsR+FKKx4+4nAuXL0nqR0MTN+BkC/zoEka8vUnq3Fr07whz9YTyUQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VZ1LKXPtRVbKqm1hOmFUycC0ZinT1rZHtxollgPIxUoFI++RCMiCPrQlNZ4NFC+swUDaVngGF2bFBrJ4P/AlptCA///Y87J/z3j1BpEQSFjlImA7Op3tjDsgfAiCeQlkss+YDyH0n3cu70zt7ML0u3++LCb0/uuP6R9wlO36Ex7k2TYoHztbB9Ow4aMuMFP3re3lSMtUjlNm05qQ4XWQ657sYudjO6cf/g9cog/orrlO9rgVEaRPnpzgEwrNu0vrbqTamN3A9L18xmB++iOPSB1DUYPShkDCTSND5LLQpY1XFSuEfBTQQWQl5DIQ/eMgxKHOkMSxi7ECL6HfKhZM9g==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=fail header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: dmukhin@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, sstabellini@xxxxxxxxxx
  • Delivery-date: Mon, 10 Aug 2026 17:56:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

On Mon, Aug 10, 2026 at 03:06:35PM +0200, Roger Pau Monné wrote:
> On Wed, Jul 29, 2026 at 12:25:20AM -0700, dmukhin@xxxxxxxx wrote:
> > From: Denis Mukhin <dmukhin@xxxxxxxx> 
> > 
> > Introduce CONFIG_PRINTK_RATELIMIT_MS and CONFIG_PRINTK_RATELIMIT_BURST
> > for configuring rate-limiting policy at the compile time.
> > 
> > Use symbols for global rate-limiting initialization in the console driver.
> > 
> > Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
> > ---
> > Changes since v3:
> > - added note on security support for non-standard configurations
> > - gated menu with EXPERT
> > 
> > I kept both settings for now.
> > ---
> >  xen/common/Kconfig         | 36 ++++++++++++++++++++++++++++++++++++
> >  xen/drivers/char/console.c |  6 ++++--
> >  2 files changed, 40 insertions(+), 2 deletions(-)
> > 
> > diff --git a/xen/common/Kconfig b/xen/common/Kconfig
> > index da80fdba8469..749d3bfb08e0 100644
> > --- a/xen/common/Kconfig
> > +++ b/xen/common/Kconfig
> > @@ -672,4 +672,40 @@ config PM_STATS
> >       Enable collection of performance management statistics to aid in
> >       analyzing and tuning power/performance characteristics of the system
> >  
> > +menu "Console rate-limiting"
> > +   visible if EXPERT
> 
> No strong opinion, but there's a drivers/char/Kconfig which might be a
> more natural place for those option to live, and then there's no
> reason for the extra menu?

I had the knob initially in drivers/char/Kconfig, but moved to
common/Kconfig to address Jan's feedback:

  
https://lore.kernel.org/xen-devel/2eba7de1-a8e2-4c45-affb-8ecb91278707@xxxxxxxx/

> 
> > +
> > +config PRINTK_RATELIMIT_MS
> > +   int "printk rate-limiting time window (milliseconds)"
> > +   default 5000
> > +   help
> > +     Specifies the time window, in milliseconds, for rate-limited [*] 
> > printk
> > +     messages. No more than `CONFIG_PRINTK_RATELIMIT_BURST` messages will 
> > be
> > +     printed within this window.
> > +
> > +     Setting this value to 0 disables rate-limiting entirely.
> > +
> > +     Configurations using a value other than the default of 5000 are not
> > +     security supported.
> > +
> > +     [*] Rate-limited messages are those controlled by the `loglvl` and
> > +     `guest_loglvl` command-line parameters.
> > +
> > +config PRINTK_RATELIMIT_BURST
> > +   int "printk rate-limited message burst size"
> > +   default 10
> > +   help
> > +     Defines the maximum number of rate-limited [*] printk messages that 
> > may
> > +     be printed within each `CONFIG_PRINTK_RATELIMIT_MS` time window.
> > +
> > +     Setting this value to 0 disables rate-limiting entirely.
> > +
> > +     Configurations using a value other than the default of 10 are not
> > +     security supported.
> > +
> > +     [*] Rate-limited messages are those controlled by the `loglvl` and
> > +     `guest_loglvl` command-line parameters.
> 
> Is it common to use footnotes in Kconfig options?  It seems a bit
> weird to me, I would probably just expand inside parenthesis if
> needed.

I'll just drop extra text.

> 
> Also, I'm a bit confused by the mention of loglvl and guest_loglvl
> explicitly here: messages outside of the selected level are just
> discarded, and hence it's kind of obvious that just messages inside
> the selected level are controlled by this rate-limiting.



 


Rackspace

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