Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp472381pxb; Tue, 14 Sep 2021 01:35:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjb82ZFX2aDMi/lr5LCBMup3scW4rkIl4uQ7ToXv7KGx2Z80B58E3Ct+NBZdQA3c3tzN8/ X-Received: by 2002:a05:6402:1bde:: with SMTP id ch30mr16662966edb.278.1631608540341; Tue, 14 Sep 2021 01:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631608540; cv=none; d=google.com; s=arc-20160816; b=ScBL/Y+levl6Jm5L57DvX4fII+SSddLoMjOi9OPlhq4Q0ZH+/LGoektF2eeVSBbwqP r7f8IxRdUUuBQxolBrL33twewDKWmfd+WdgFKtEucrfOdi0sBn6SiD4KiaeLr1xSQu2n ajUXw6oRUu6uGpPv+UT8wFrslzknMZmHjELIZ+Z7tGob6+6IABpipcPuA1x65wiDhmDv DuH8KW6AuPFghqlPW6R9KHAllfANWjMG/S9Rlv8OMDSTEgA46zMEw9KjE06eBb5wyFPu Z2MpeByDpqJz/Qe6ge7usXdd115PtxsIm2onU8tppvmWHZ3Rm5nLgl8gxFQEuy3peH6H 0yiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:content-disposition:references:message-id:subject:cc:to :from:date:dkim-signature; bh=pKxQpYGx7FCYqXPJeZcEZp0s2mCsJ/vTkMebph8UpHg=; b=wybDRns7PJI3dOemXLmjmIxyNySFCmszduUMfgMecPl3Q9ZwyePnNpZQuggI2CfdvR +/tURk0BgagsCYsFD2tkW6u7ebugeqTYlmUUWSNj3VImvEWLxVFeS5ztfXCEnc10CiqH +Gns23hiVA6+LycTLGTNLGzMb2Dz8/tBbnQravSEu0VLWO+VLjVAWjD/LKG26GZOkCo1 TU3XLlPT0AOtiNpYSE4MJk5rJfJLh61QnvFOqWpm9qsbKx4JyvZNXOLar9yDMuoud//K acCpNzoNpHhvJcXRX83Z4ASXriNMpol2ZAs3YMQOn8zWC4PgPArXnqvG6fSbIXarz7qb W9HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="c/jFDeff"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk14si9983532ejb.220.2021.09.14.01.35.15; Tue, 14 Sep 2021 01:35:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="c/jFDeff"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229663AbhINIfL (ORCPT + 99 others); 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.