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

Re: [PATCH] x86: Add Kconfig option to use a 32bit TLB clock on debug


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Mon, 12 Jan 2026 16:28:11 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=p5lPGmFvbpaE9gwdlvLa/CMdfRxAynaR5zdCd6X2C4E=; b=A2xusC+uzthIaK/iAoBltoO49PCQzsgmNXPsk3/EE87LK67LqO+vWjnSPAbTow9PXJsZ67hf4oFlJUKqKW7aGxtY1s14kwygrsWb6v8We6G1FYeydNYT0m7aiTO4p3dP+hIIpiJGNx3wFud9DCVF+S/1prPCCO1K1QfAebiFukpPb3+hb4GxMgmNjp4hDe/lrrZO7dI9A5VMp5O6wndO1PVe9e/Klg9HOxklyV527upjsx3YLZtPkH5eR0wzCE+kt24Xf9JUiTIF8Fhof8KFIdUYBofX/A2LeBW96vo8SaBU/hWkXmYCPEzad9f5qijf7Aoav5MGrjKvSXs8ooWfCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=E4P9i1wOqEG8il/gVYLjCWqDP67bljK1JNf7gAzGDLDfdJAcjZUriI7z0/qdzLMOdSV9Jlgwkv8AqdEo1ZpdCnAc2ssmgd6T5sC4uDW68hLFAjdt0vgtZa0zM/fdRcwj2/XFIZJtb9iM4RCqI/olXTKUGETnwvf+2xt7iTm9X1dlIzAAD9pOi3Une9WmlXj4NQl8bp1P6Nlo7lk7+lYZOZ5GPIk87UAViIFOvgL3XnN8RmCWN5RMqMVs/VZHoQGLLsiZHeLnsqoIyaYewJwLtzGg7qyO/jT+gEnuHelJ6Bt3dUxZkj5VosRuMuP8iC3o7D5/pY+FtcOcKywx3skswA==
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 12 Jan 2026 15:28:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon Jan 12, 2026 at 3:47 PM CET, Andrew Cooper wrote:
> On 12/01/2026 2:43 pm, Jan Beulich wrote:
>> On 12.01.2026 15:08, Alejandro Vallejo wrote:
>>> Debug builds stress the wrapping logic of the TLB clock by narrowing it
>>> down to 10 bits. This is inconvenient to test real time workloads on
>>> such builds.
>>>
>>> Add Kconfig option to be able to selectively use the non-stressed
>>> behaviour on debug.
>>>
>>> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
>> Hmm, yes, why not. However, ...
>>
>>> --- a/xen/arch/x86/flushtlb.c
>>> +++ b/xen/arch/x86/flushtlb.c
>>> @@ -20,11 +20,7 @@
>>>  #include <asm/spec_ctrl.h>
>>>  
>>>  /* Debug builds: Wrap frequently to stress-test the wrap logic. */
>>> -#ifdef NDEBUG
>>> -#define WRAP_MASK (0xFFFFFFFFU)
>>> -#else
>>> -#define WRAP_MASK (0x000003FFU)
>>> -#endif
>>> +#define WRAP_MASK (IS_ENABLED(CONFIG_DEBUG_TLB_CLK) ? 0x3FFU : UINT32_MAX)
>> ... the comment then will want updating as well, I'd say. It doesn't go
>> terribly stale this way, but at least slightly. I'd suggest to minimally
>> drop "builds".

I left the comment because the rationale still holds. Dropping "builds" sounds
good to me.

>
> I'm suggest just dropping WRAP_MASK.
>
> We've done this locally in the XenServer patchqueue since 2011 or so due
> to the overhead, and I don't think it's interesting enough to warrant a
> separate option.
>
> ~Andrew

I don't mind much either way. I need it gone for my needs and I don't care much
how it happens.

Jan + Roger, do you have strong opinions on the matter?

Cheers,
Alejandro



 


Rackspace

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