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

Re: [PATCH] x86/AMD: also determine L3 cache size


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 16 Apr 2021 15:21:01 +0100
  • 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=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TS4K04nzW27cq6sYeA1GsnoF5qXEBZPiikDGGWvrla0=; b=YIvIUNb73jfM2dyiJdtKzS94rbP9OYJyGpAW7849XNdKaIFFnnjUT6FyBppwgDFFWocfHCoMKZm992A10tYRnldomQf9HBsPw72RjaKpGIPp5nuMyskKajry0FHfPgsZzLxmnd5fe6KlgjBwKVpEus5Rz0/vnqZZg/f8zw1YPzzyXsOaCoJxqbPi0LVcAESLwEwInKiGSMX+JgYzhAKYfZ9JuYJuzHJ7Sm0t38Q4orbgdwHFrKNRNJFzlBIfSuTFMMxsHHMdLz28yCl0gtfubt85Gv9T8gjnVSQ3BQ30dj+ikd0M/Be/asP7w5aJ/V5ZsC1S7kAXUeRkhm5LRe3XEw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nr/RPSeBC8DMK2S2TDySqAqp5v35PzTyuULwGm6H/0u8OrPO+jhZ966rB2lga8G2DvkUmRg/1ihvQfcDX8ezTng/PqdlhcULIBXSFeP0b6Rp64pPM4NlJ/zH6iZ/CCZGvIiYvM6J4y88Wu208vx0nWKjM22pM+K2eCpB5K88zNS/pQLQNjIzL27Zq3s4ZliVTE3F/zVn25hwIABjILsTNH2ZOxORDRuJ63calpy57QOJU/zu76nB9bBmwIS4cDE1fxk5SKZk9Z1lIY9Ny2Jf9vOoPYqZ1CVehm2GssGZcSF6tTGILfXxpuzltfsfYCU5sWP5wsrePHiXEwqydFZYwg==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 16 Apr 2021 14:21:26 +0000
  • Ironport-hdrordr: A9a23:5BytvqEd1nvevSOzpLqFR5TXdLJzesId70hD6mlYcjYQWtCEls yogfQQ3QL1jjFUY307hdWcIsC7L0/03aVepa0cJ62rUgWjgmunK4l+8ZDvqgeOJwTXzcQY76 tpdsFFZOHYJURmjMr8/QmzG8shxt7Cy6yzmeLC1R5WLT1CQYsI1XYcNi+wFEpqSA5aQb8wE5 SB7sRKzgDQB0g/RMK9G3UDQqz/vNXNjp3relorABQg5QmIg1qTmcHHOjKf2QoTVC4K/Kc6/Q H+4nDEz4iAk9X+8B/T0GfP849b8eGB9vJvDNGB4/JlUQnEpR2vYO1aKtu/lRAz5Nqi8VM71O TLyi1QQvhbz1P0UiWLrQD22w/muQxemUPK7VODm3PsrYjYaVsBerJ8rLlUeBfY9EYs1esUuM kgshP7xvgneS/opyjz68PFUBtnjCOP0B0fuNUekmBFVs8mYKJRxLZvj399KosKHy7x9ekcYZ BTJfzbjcwmFG+yU2rUpS1GztCqQx0Ib227a3lHkMmU3z9KpWt+3ksVyecO901whK4Vet1q4f /JPb9vk6wLZsgKbbhlDONEesevDHfRKCi8fl66EBDCLuUqKnjNo5n47PEc4/yrQoUByN8XlI 7aWF1VmGYucyvVeIyz9awO1iqIbHS2XDzrxM0bzYN+oKfASL3iNjDGYEwykuO7ys9vQPHzar KWAtZ7EvXjJWzhFcJixAvlQaRfLnEYTYk8pss7YVSTucjGQ7ea9dDzQbL2Hv7AADwkUmTwDj 8oRz7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dknBSfza8zqQWaPaX7pKaxjchmdFL51tgILW lHSwhIsvgCOOoP5v1oGVGhsTvcghstjFRsaeWNOv7HDiMIyVjNq0ps6gCeUAIrJPUX4KVAh/zG ep9OL5WyCId6dwCdP7lCS32EyaatIOUUHrd7kXyDN6hlkIiqEJ9hv68IarnQ/Sw4WWdodTsyXR +Sg=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16/04/2021 14:20, Jan Beulich wrote:
> For Intel CPUs we record L3 cache size, hence we should also do so for
> AMD and alike.
>
> While making these additions, also make sure (throughout the function)
> that we don't needlessly overwrite prior values when the new value to be
> stored is zero.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> I have to admit though that I'm not convinced the sole real use of the
> field (in flush_area_local()) is a good one - flushing an entire L3's
> worth of lines via CLFLUSH may not be more efficient than using WBINVD.
> But I didn't measure it (yet).

WBINVD always needs a broadcast IPI to work correctly.

CLFLUSH and friends let you do this from a single CPU, using cache
coherency to DTRT with the line, wherever it is.


Looking at that logic in flush_area_local(), I don't see how it can be
correct.  The WBINVD path is a decomposition inside the IPI, but in the
higher level helpers, I don't see how the "area too big, convert to
WBINVD" can be safe.

All users of FLUSH_CACHE are flush_all(), except two PCI
Passthrough-restricted cases. MMUEXT_FLUSH_CACHE_GLOBAL looks to be
safe, while vmx_do_resume() has very dubious reasoning, and is dead code
I think, because I'm not aware of a VT-x capable CPU without WBINVD-exiting.

~Andrew




 


Rackspace

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