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

Re: [PATCH 01/16] x86/cpu: Fix boot time cache flushing


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 27 Jan 2026 11:08:17 +0000
  • 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=zojH4Bsz+1Ec+v1l9BvN7ZFAPPUaYAhgqTdW0Rkk0Gs=; b=K3XVjGvnq9D3Tkm41zMWJUwKxyEMPxsk/m7k+obVMAd04rnih9SG3pHcbrnuQbzvXG4zF8Ag1SeInfqOAsRgLnhgV7NjAaoy9HSS6Mf2RFF4rh0Hql5ECTby1rATBMleD1+0WokQwVLVjh2zLyK7yTlHqZ8renrkl4cloSvmoOKxiRPJKu8Aysh9im5GVCqR1cdpPXmmtZ9Wz5npVj2F6J4rLCUGeWP0a/gg6h6sgajGXPS3PHodwbaZznFWzsbLJmzKxidKmtmWWzvRjlTCb2uk3U5Hrh09JOOeQga9XzR7cb5RbqLBfi2F+nQntC/b0Zzzv3oD5phtAMDUT94SXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BnzBIH2w8SyNqEVFhAx3Bzq9FD3kjA5O+10g1y7X1Vg0f2qB5J5lgkX0KaHGxdrW5dtKq7rME7D5SgPHAygL+QNz2AK/LI/dt33sUFBYUWiXvjU7z64NVs3iWNbmspX7JvWaQ3L5t9kUwlVmj1+XKMfRv4AMHiRSL27S1j00YvdtxvTI2vE/VNiCBLj3VxfW/fe2NJh1Pmc7t8Baot3MLub/tDR6xY+Pl9ku0CYP3e5KHdvTBv319VkCyppadXkXDLgaE6UzqJkpu19VjzQQjDIRDKbTLkiT6XxbJZ1f2mePOxihcgR62gRYROe2TSbFXDU3jPQDnkzeWJRmlmiDnQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Julian Vetter <julian.vetter@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 27 Jan 2026 11:08:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27/01/2026 10:37 am, Jan Beulich wrote:
> On 26.01.2026 18:53, Andrew Cooper wrote:
>> --- a/xen/arch/x86/cpu/common.c
>> +++ b/xen/arch/x86/cpu/common.c
>> @@ -319,8 +319,6 @@ void __init early_cpu_init(bool verbose)
>>      uint64_t val;
>>      u32 eax, ebx, ecx, edx;
>>  
>> -    c->x86_cache_alignment = 32;
>> -
>>      /* Get vendor name */
>>      cpuid(0x00000000, &c->cpuid_level, &ebx, &ecx, &edx);
>>      *(u32 *)&c->x86_vendor_id[0] = ebx;
>> @@ -352,6 +350,7 @@ void __init early_cpu_init(bool verbose)
>>      if (edx & cpufeat_mask(X86_FEATURE_CLFLUSH)) {
>>              unsigned int size = ((ebx >> 8) & 0xff) * 8;
>>  
>> +            c->x86_clflush_size = size;
>>              c->x86_cache_alignment = size;
> With this change, can't the writing of the field in generic_identify()
> go away? CPU_DATA_INIT() in particular doesn't invalidate it.

No, it can't.  The value needs setting up on every AP, right now at least.

>  Perferably
> with that dropped (unless of course there is a reason not to):
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Hopefully this is a good enough reason.  I know we agreed to make it a
single global, but that's future work.

>
> Tangentially, "cpuid=no-clflush" didn't have any effect on any of this so
> far, and also isn't going to have with the changes you make.

The line immediately out of context above will applies the clear cap
mask, so will cause cpuid=no-clflush to take effect.

~Andrew



 


Rackspace

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