linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux 5.13+ as Xen dom0 crashes on Ryzen CPU (ucode loading related?)
@ 2021-09-13 12:50 Marek Marczykowski-Górecki
  2021-09-14  5:48 ` Mike Rapoport
  2021-09-14  7:14 ` Juergen Gross
  0 siblings, 2 replies; 7+ messages in thread
From: Marek Marczykowski-Górecki @ 2021-09-13 12:50 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Ingo Molnar, Borislav Petkov, Thomas Gleixner, x86, linux-kernel,
	xen-devel

[-- Attachment #1: Type: text/plain, Size: 2835 bytes --]

Hi,

Since 5.13, the Xen (PV) dom0 crashes on boot, before even printing the
kernel version.
Test environment:
 - Xen 4.14.2
 - AMD Ryzen 5 4500U (reported also on AMD Ryzen 7 4750U)
 - Linux 5.13.13, confirmed also on 5.14

The crash happens only if the initramfs has earlycpio with microcode.
I don't have a serial console, but I've got a photo with crash message
(from Xen, Linux doesn't managed to print anything):
https://user-images.githubusercontent.com/726704/133084966-5038f37e-001b-4688-9f90-83d09be3dc2d.jpg

Transcription of some of it:

    mapping kernel into physical memory
    about to get started
    (XEN) Pagetable walk from ffffffff82810888:
    (XEN)  L4[0x1ff] = 0000000332815067 0000000000002815
    (XEN)  L3[0x1fe] = 0000000332816067 0000000000002816
    (XEN)  L2[0x014] = 0000000334018067 0000000000004018
    (XEN)  L1[0x010] = 0000000332810067 0000000000002810
    (XEN) domain_crash_sync called from entry.S: fault at ffff82d04033e790 x86_64/entry.S#domain_crash_page_fault
    (XEN) Domain 0 (vcpu#0) crashed on cpu#0:
    (XEN) ----[ Xen-4.14.2  x86_64  debug=n  Not tainted ]----
    (XEN) CPU:    0
    (XEN) RIP:    e033:[<0000000000000000>]

I've bisected it down to the commit a799c2bd29d19c565f37fa038b31a0a1d44d0e4d

    x86/setup: Consolidate early memory reservations

    The early reservations of memory areas used by the firmware, bootloader,
    kernel text and data are spread over setup_arch(). Moreover, some of them
    happen *after* memblock allocations, e.g trim_platform_memory_ranges() and
    trim_low_memory_range() are called after reserve_real_mode() that allocates
    memory.

    There was no corruption of these memory regions because memblock always
    allocates memory either from the end of memory (in top-down mode) or above
    the kernel image (in bottom-up mode). However, the bottom up mode is going
    to be updated to span the entire memory [1] to avoid limitations caused by
    KASLR.

    Consolidate early memory reservations in a dedicated function to improve
    robustness against future changes. Having the early reservations in one
    place also makes it clearer what memory must be reserved before memblock
    allocations are allowed.

    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Reviewed-by: Baoquan He <bhe@redhat.com>
    Acked-by: Borislav Petkov <bp@suse.de>
    Acked-by: David Hildenbrand <david@redhat.com>
    Link: [1] https://lore.kernel.org/lkml/20201217201214.3414100-2-guro@fb.com
    Link: https://lkml.kernel.org/r/20210302100406.22059-2-rppt@kernel.org

Since this seems to affect Xen boot only, I'm copying xen-devel too.

Any ideas?

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-14 10:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 12:50 Linux 5.13+ as Xen dom0 crashes on Ryzen CPU (ucode loading related?) Marek Marczykowski-Górecki
2021-09-14  5:48 ` Mike Rapoport
2021-09-14  7:14 ` Juergen Gross
2021-09-14  8:33   ` Mike Rapoport
2021-09-14  8:42     ` Juergen Gross
2021-09-14  8:39   ` Jan Beulich
2021-09-14 10:51     ` Marek Marczykowski-Górecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).