From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D2751B6CE9 for ; Thu, 2 Jan 2025 20:16:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735848975; cv=none; b=G7XzgZ1emzkV9gKYihsV36Zul2OuGNQXCfAZvp2FTDlBPDSxpDHH0ujE1WQrz5IakIxdX01y6ud8Iu00EKe4m2AydUsoMXvmv3pQvs0/1g04JJHFZp1GTKE2TnOKa5JMH2CEXpavFQ4wabFrUcYgvsKXpTRy3+EJ9t8PEAAMhj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735848975; c=relaxed/simple; bh=1ePtuUh6R9NEjynQtLxFfen1oTp81r+OUhdvaLWo8OA=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=N+2osFqGSZoeR9lBqiVyQZpQZSk7iVMn7k2DSWF0ptp/BrQKoVLC39vo5a7lGmlX+H8Fkp76H2V8Olyg+ibHOPvQhGr1JgXVBG6pNQ117IHX/eZEUQ/F2AsCM2cpWIupRWdn0BdNNb3uTIGRF+Ir2t9UbPDL8NxlOzIvk72mlXw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=d9Ez5Ylh; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d9Ez5Ylh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1735848969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1ePtuUh6R9NEjynQtLxFfen1oTp81r+OUhdvaLWo8OA=; b=d9Ez5Ylh/wa45YTB40BMYA+vX1uPZ1O83lzR7d25c/cOXXnBc/0Hs4Pl60ByCJAKqvM2Ai g4CZZfGDalxY9XeQ1L3N/jLCHnqF9I8UM/0J6xX77XL4GPVmO0vDftPH1xMfNCD3WiBlTj TgVf/a/wBxa/rswDLvYR5f89hKn4sA8= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-37--lO_dsNCOIGILsKUsq5S7w-1; Thu, 02 Jan 2025 15:16:08 -0500 X-MC-Unique: -lO_dsNCOIGILsKUsq5S7w-1 X-Mimecast-MFC-AGG-ID: -lO_dsNCOIGILsKUsq5S7w Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2ef909597d9so24108327a91.3 for ; Thu, 02 Jan 2025 12:16:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735848966; x=1736453766; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1ePtuUh6R9NEjynQtLxFfen1oTp81r+OUhdvaLWo8OA=; b=CActkup/X8wQRXtyyr7/trqmppy+kLj4IBLxLPFlBtnKokt8NLuQjH0SbXGEQ/SOgI cVaXITcT/K3naKnypgHC6bhZSDX7b5SiN5J1/ORPVXJxyIzc2Uypzjuq7AVpuTonsEl/ 6AcOtdIw6EgvQlxR+lfSbh/pa1rQqtLZNLJ6K8CBT1Rou7Pv73dfi6vJWDGdCt2ln5oM BH7dZsTfjl830RNNf2oe02/mv04HQ/fD0iNMGIYgp1rXwQyhvGOER/rt/J0alOQvtDm6 qzE3N9l0fq0xukWNE4WBjZPnDmM0EuWTiqwtFdY79pabf+FdmaGMq5DiYyGLHu7HEz7d yC2Q== X-Gm-Message-State: AOJu0Yz/V6VyRRSMg4/0qd7UffC/KZSJBMk9Xi4kGF6RdfmuU0I7C6zc PIqRb3azuHrjnLPHopz9c1No73nqR8MLGX4ZAPjNCB0Dcw7walbLcyzRbjgU//GFQNEHStTP9HS mQJaQdu97dCwtuLELzbtY7sQ5ZXeoULb9nScl2oTtGv+sa5WnAHMO1rhFf4UDSCJ139Oej7tMIr MkCj1hgCOTFMnYxtn2PbHoCeteI1UaEsfESbN6lZJkDyYtfvc= X-Gm-Gg: ASbGncv6geQUwU250y/SlPOwVnB6TkOFTiGDyJ69k91OfgehxiX5H0qqnctO0G1WIn0 TH5yTtL0q/cXw8Q9Qn08BO806eg0al/L85Z1zq9NVslzMD1mdFPFn8lRi0j9Vc2jVkeBKWxYge8 +8kwTgxPrtvYDZ2Ol5LEMhUSLcy6Dg69H2ZjZAP2fYJTUT+O87vCrbcROgJclrhVCrypW1vJUdN x0pntJ3SuQF/fTbWnsL4gx+zGS52aUHTXMB/68WCwwGTtItPiPAvT/HWuxsXglha8O1C0yAAt0= X-Received: by 2002:a05:6a00:1706:b0:726:f7c9:7b36 with SMTP id d2e1a72fcca58-72abdd7bacdmr78633560b3a.8.1735848965952; Thu, 02 Jan 2025 12:16:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKIZnsuu4TR2liJ20Kxw1T6vwII+QGoMmdtkS5VvE4j9Qf7srdmXLvpR80BXxpY72GtNiOWw== X-Received: by 2002:a05:6a00:1706:b0:726:f7c9:7b36 with SMTP id d2e1a72fcca58-72abdd7bacdmr78633523b3a.8.1735848965460; Thu, 02 Jan 2025 12:16:05 -0800 (PST) Received: from xps13a.happyassassin.net ([2001:569:5316:e500:c889:51cf:3e32:18c6]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8567449bfefsm21129491a12.64.2025.01.02.12.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 12:16:04 -0800 (PST) Message-ID: Subject: Re: Kernel crash while doing chroot'ed grub2-mkconfig on qemu-emulated Nehalem CPU since late November 6.13 snapshot From: Adam Williamson To: linux-kernel@vger.kernel.org Cc: jforbes@redhat.com, rppt@kernel.org, mcgrof@kernel.org Date: Thu, 02 Jan 2025 12:16:03 -0800 In-Reply-To: <9a3c747052fb82274ab3c4a84eaf64c1273117ce.camel@redhat.com> References: <9a3c747052fb82274ab3c4a84eaf64c1273117ce.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.2 (3.54.2-1.fc42) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2024-12-11 at 08:51 -0800, Adam Williamson wrote: > Hi, folks. Please CC me on replies, I'm not subscribed to the list. The > downstream bug report for this is > https://bugzilla.redhat.com/show_bug.cgi?id=3D2329581 . I also filed > https://bugzilla.kernel.org/show_bug.cgi?id=3D219554 but it looks like > nobody is monitoring that ATM, hence this email. Sorry, I don't know > where to send it that would be more targeted. >=20 > I maintain Fedora's openQA instance - https://openqa.fedoraproject.org/ > (openQA is an automated testing system which runs jobs on qemu VMs, > inputting keyboard and mouse events via VNC, and monitoring results via > screenshots and the serial console). >=20 > In openQA testing we've noticed a lot of failures of install tests > since kernel-6.13.0-0.rc0.20241125git9f16d5e6f220.8.fc42 landed in > Rawhide - that is, a snapshot of upstream git 9f16d5e6f220 . The > previous build, kernel-6.13.0-0.rc0.20241119git158f238aa69d.2.fc42 - a > snapshot of upstream 158f238aa69d - did not show this problem. The > problems persist with the latest kernel build, kernel-6.13.0- > 0.rc2.22.fc42 (a build of 6.13 rc2 exactly). >=20 > Both BIOS and UEFI x86_64 installs are frequently hitting kernel > crashes when the Fedora installer runs grub2-mkconfig as part of the > install process. In the BIOS case, this causes the system to hang > permanently. In the UEFI case, the system hangs for a while then > reboots, and fails to boot properly as the installation did not > complete. >=20 > I've reproduced both BIOS and UEFI failures locally with a qemu VM > configured like the one we use in the affected tests: 2 vCPUs, 4G RAM, > and CPU model Nehalem - that's `-cpu Nehalem` argument to qemu. If I > use host CPU config instead, the bug doesn't happen. We intentionally > use the Nehalem model in this testing to ensure Fedora doesn't > inadvertently stop supporting the CPU baseline it intends to support. >=20 > This happens on more than 50% of install attempts, but not all of them > (sometimes they work; I've set our test system to retry failures five > times for now to mitigate the effects of this bug). >=20 > The details of the traces we get in the kernel logs differ between > occurrences and also between BIOS and UEFI, which someone suggested > indicate this may be some kind of memory corruption issue. But the > broad shape is consistent: the installer reaches grub2-mkconfig and we > get a kernel crash. >=20 > I did also try reproducing this by running `grub2-mkconfig -o > /boot/grub/grub2.cfg` multiple times on an *installed* VM with the same > kernel and VM config, but could not trigger a crash in this case. There > must be something specific about how this happens in the installer > environment (for one thing, the installer runs the command chroot'ed > into the installed system environment). >=20 > I'll attach sample logs from a UEFI failure and a BIOS failure. >=20 > I haven't attempted to bisect this yet as I find bisecting kernel > issues pretty painful (the Fedora kernel package spec is a bit weird if > you're not used to it, building a full kernel takes a long time, I > don't know how to do intermittent builds with the Fedora kernel spec, > and since I can't yet reproduce this outside the installer I then have > to build an installer image with the kernel build in to test it...). > But if needs must I'll bite the bullet and do it. If anyone could e.g. > guess at a commit or commit series that might be causing this so I > could try a targeted reversion, though, that'd be great. Update on this: over the holidays, I bisected it to 5185e7f9f3bd754ab60680814afd714e2673ef88 . A kernel with that commit reverted does not hit the bug. I also did some testing with various CPU model configurations. I think this actually isn't to do with Nehalem per se, but "virtual machines where the CPU configuration does not exactly match the host", or something like that. I tried a bunch of qemu CPU model settings - nehalem, sandybridge, haswell, Skylake-Client and Cascadelake-Server - and got failures with all of them, but when I set the model to "host", all tests passed. The tests get farmed out to a cluster of systems which have different CPUs - one is Broadwell, one is Skylake, one is Cascade Lake - so I think when I set the model to anything specific, it will match the host CPU on some or none of those systems, but never *all* of them, so the bug will always show up. I have emailed the author and reviewer of 5185e7f9f3bd754ab60680814afd714e2673ef88 (also CCed on this mail) but have not heard back from them yet. I've sunk over a week into this bug at this point so it'd be great if someone could look at it. It's not the biggest regression in the world, but it is a bit awkward for our automated testing (I'll have to fiddle around to try and set CPU model 'host' for the most badly-affected tests but ensure we still have enough tests with 'nehalem' to confirm our baseline isn't moved). Thanks, and happy new year! --=20 Adam Williamson (he/him/his) Fedora QA Fedora Chat: @adamwill:fedora.im | Mastodon: @adamw@fosstodon.org https://www.happyassassin.net