2023-10-17 19:31:35

by Christian Lamparter

[permalink] [raw]
Subject: Re: [PATCH v1] x86/cpu/cacheinfo: fix panic on Ryzen Mobile 7x40 series in VBox VM

Heads up!

Oracle addressed this with their virtualbox 7.0.12 release.
If you are affected, try it!

On Saturday, September 2, 2023 12:19:11 AM CEST Christian Lamparter wrote:
> Ryzen Mobile 7x40 chips experience an early kernel fault
> (division by zero) due to nonexistent input validation
> from CPUID data in amd_cpuid4().
>
> This error was first reported on reddit [0] for a
> "AMD Ryzen 9 7940HS w/ Radeon 780M Graphics", but since then
> the bug has been reproduced on a "AMD Ryzen 7 7840HS" Laptop
> too.
>
> [...]
>
> The reason why this is happening is because the Ryzen CPU reports in its
> CPUID 80000006 edx register (which contains the L3 Cache Information)
> the value "00009000". This magic value means according to AMD's
> "AMD64 Architecture Programmer's Manual Volume 3" Table E-4.
> "L2/L3 Cache and TLB Associativity Field Encoding":
>
> | Value for all fields should be determinded from Fn8000_001D.
>
> (This means to look in cpuid(0x8000001D,...) instead.)
>
> So, amd_cpuid4() is missing this special case. A case which has been
> present - according to this AMD Community post [1] - since
> Zen 2/Ryzen 3000 Series.
>
> But wait, why is this only happening with Linux' when running under
> VirtualBox with these Ryzen Mobile CPUs and not when running natively?
> [...]