From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4106DC433F5 for ; Tue, 14 Sep 2021 08:33:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B7FE60F23 for ; Tue, 14 Sep 2021 08:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230349AbhINIfL (ORCPT ); Tue, 14 Sep 2021 04:35:11 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40438 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhINIfK (ORCPT ); Tue, 14 Sep 2021 04:35:10 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 18E8DDVp003164; Tue, 14 Sep 2021 04:33:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : content-transfer-encoding : mime-version; s=pp1; bh=pKxQpYGx7FCYqXPJeZcEZp0s2mCsJ/vTkMebph8UpHg=; b=c/jFDeff74opNPuhZivqJl24DeEXWtHpxq0scPesE73bTGItp2la9ee5Le8rh2WDqhK8 19KvhsAHO5kIig7f3OtmztBotyUNdOjPpHcqNkQ3aoekjW6ssWFDj8sYyZRYyGZEVeJp W+KIFryQLSaPQLEYn80iFdI3jcSn3aukG2CQEjrLUBIWs8KA8ldRz5hq0JYSy3S03fav 9eLKLDhoIapuWcwXS0GzUKMmu5bY38f0ZyI/PY8HPiQJeiePP1FRVQKFiR/WEcMzXNJG dTFSWKJ+Qj6/VfFT0S70+1k7A/Gg0Vbjd9Oqc/5OVdajPAHX5Q4/5htM421/ItjqzpKF 4g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b2n91v8qr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Sep 2021 04:33:30 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18E5xNPG014160; Tue, 14 Sep 2021 04:33:30 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b2n91v8pu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Sep 2021 04:33:30 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18E8XOWD005452; Tue, 14 Sep 2021 08:33:27 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04ams.nl.ibm.com with ESMTP id 3b0m39rvyu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Sep 2021 08:33:27 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18E8Sthk59048334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Sep 2021 08:28:55 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1501EA4057; Tue, 14 Sep 2021 08:33:24 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D5C7A405F; Tue, 14 Sep 2021 08:33:23 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.48.104]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 14 Sep 2021 08:33:23 +0000 (GMT) Date: Tue, 14 Sep 2021 11:33:21 +0300 From: Mike Rapoport To: Juergen Gross Cc: Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= , Ingo Molnar , Borislav Petkov , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, xen-devel Subject: Re: Linux 5.13+ as Xen dom0 crashes on Ryzen CPU (ucode loading related?) Message-ID: References: <923de2f5-3d33-4c02-acec-739fdaf2ae05@suse.com> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <923de2f5-3d33-4c02-acec-739fdaf2ae05@suse.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Fek_4RKUSmSBac3314u_qg2oT-UwR5fB X-Proofpoint-GUID: 1n5L13yxXZwxMDPxGVuAivJeUC3QPW11 Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 spamscore=0 adultscore=0 mlxscore=0 malwarescore=0 impostorscore=0 bulkscore=0 phishscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109140027 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021 at 09:14:38AM +0200, Juergen Gross wrote: > On 13.09.21 14:50, Marek Marczykowski-Górecki wrote: > > 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>] > > The domain's run state seems to be completely clobbered. > > Did you try to boot the kernel with "earlyprintk=xen" to get some idea > how far it progressed? > > I could imagine that doing the early reservations after the call of > e820__memory_setup() is problematic, as Xen PV guests have a hook in > this function performing some rather extended actions. Right, among them it may relocate initrd: https://elixir.bootlin.com/linux/latest/source/arch/x86/xen/setup.c#L872 and this may cause the reported crash. > I'm not sure the call of early_reserve_memory() can be moved just before > the e820__memory_setup() call. If this is possibel it should be done > IMO, if not then the reservations which have been at the start of > setup_arch() might need to go there again. early_reserve_memory() can be moved to the beginning of setup_arch(). Anther possibility is to move initrd relocation out of xen_setup_memory() and maybe even integrate it somehow in reserve_initrd(). -- Sincerely yours, Mike.