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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BE44C3DA79 for ; Mon, 26 Dec 2022 14:24:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2AC00900003; Mon, 26 Dec 2022 09:24:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 25B78900002; Mon, 26 Dec 2022 09:24:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FD09900003; Mon, 26 Dec 2022 09:24:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id F1AB9900002 for ; Mon, 26 Dec 2022 09:24:19 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id B53AC8065E for ; Mon, 26 Dec 2022 14:24:19 +0000 (UTC) X-FDA: 80284677438.25.1273EA2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id F0971C0014 for ; Mon, 26 Dec 2022 14:24:17 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=TGvK9CV+; spf=pass (imf22.hostedemail.com: domain of "SRS0=Dxcw=4Y=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=Dxcw=4Y=zx2c4.com=Jason@kernel.org"; dmarc=pass (policy=quarantine) header.from=zx2c4.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672064658; h=from:from:sender: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:dkim-signature; bh=+PjVgheTmRbQKAuExj3xzO22Ben4VI5teURA2yxJhLo=; b=ZsrOQ58dwi0GYnixBqPzN806W0ozOfX/lzXxFzmCaU5IGd9RHiJMGp9H5gWaZRQ84M/zzD kLJqIBRchtVzCbjfhVesiaDY5JhVSRVE8PA54RwbMXDpL8UgeE7VoFXZ2R5DEEWt7MHm2g HhWbhSHUJZ2SfAH4ftQFvcdrK6JtEI4= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=TGvK9CV+; spf=pass (imf22.hostedemail.com: domain of "SRS0=Dxcw=4Y=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=Dxcw=4Y=zx2c4.com=Jason@kernel.org"; dmarc=pass (policy=quarantine) header.from=zx2c4.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672064658; a=rsa-sha256; cv=none; b=Evg9s/rH52L8MMCke8AnCyZFETFsH6nZcmqGuo9kDsS8+8r0VWmH+k+H6GyxMJklNvSTVx fKL91KjOpkpbNw1Z1Yrhr54pkQWqeeUvyklN9+AcLcYlBSqvlvLCqiqMP5EeB9sbG+Mz6P czwghXUTh50UbNs3j9YcFE+cL25r/PU= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C499460EA7; Mon, 26 Dec 2022 14:24:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2A3CC433D2; Mon, 26 Dec 2022 14:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1672064651; 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=+PjVgheTmRbQKAuExj3xzO22Ben4VI5teURA2yxJhLo=; b=TGvK9CV+6vgvSlJ5DdLaAPqT4V2pOSs+YhMJnnK6JxQCpOwqfBy3EdQhSoUuLZYyETQbs0 Gp4sB5YZ31XODWi3o+Bls1Cw+DJO9FBLOF1VOC+2eJcArwrKe5e9xDphpGxzb/YUrlOErc J+r7UW98dnjFt5ifXTke3JSK3ZjlUac= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 544c39fb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 26 Dec 2022 14:24:11 +0000 (UTC) Date: Mon, 26 Dec 2022 15:24:07 +0100 From: "Jason A. Donenfeld" To: Eric Biggers , x86@kernel.org, linux-mm@kvack.org Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, Laurent Vivier , "Michael S . Tsirkin" , Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Richard Henderson , Ard Biesheuvel , Gerd Hoffmann , kasan-dev@googlegroups.com, Dmitry Vyukov Subject: Re: [PATCH v5 4/4] x86: re-enable rng seeding via SetupData Message-ID: References: <20220921093134.2936487-1-Jason@zx2c4.com> <20220921093134.2936487-4-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: F0971C0014 X-Stat-Signature: hbnsr4itpdcs14pu3smyp93fcqz845ts X-HE-Tag: 1672064657-638277 X-HE-Meta: U2FsdGVkX1+cg4r0Tzfl3XozHy8sbxlpXM4KTqhF/INTw27nP/1PcIJ2h9vZk54anqKpICu3hab4nRYQSXPHFmRG0EENndV9aq3Ci6ql1tCVTcAfNVdQSBzcNQMEDSy9fhZBKKhBnQBTZ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, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, I'm currently stumped at the moment, so adding linux-mm@ and x86@. Still working on it though. Details of where I'm at are below the quote below. On Sat, Dec 24, 2022 at 05:21:46AM +0100, Jason A. Donenfeld wrote: > On Sat, Dec 24, 2022 at 04:09:08AM +0100, Jason A. Donenfeld wrote: > > Hi Eric, > > > > Replying to you from my telephone, and I'm traveling the next two days, > > but I thought I should mention some preliminary results right away from > > doing some termux compiles: > > > > On Fri, Dec 23, 2022 at 04:14:00PM -0800, Eric Biggers wrote: > > > Hi Jason, > > > > > > On Wed, Sep 21, 2022 at 11:31:34AM +0200, Jason A. Donenfeld wrote: > > > > This reverts 3824e25db1 ("x86: disable rng seeding via setup_data"), but > > > > for 7.2 rather than 7.1, now that modifying setup_data is safe to do. > > > > > > > > Cc: Laurent Vivier > > > > Cc: Michael S. Tsirkin > > > > Cc: Paolo Bonzini > > > > Cc: Peter Maydell > > > > Cc: Philippe Mathieu-Daudé > > > > Cc: Richard Henderson > > > > Cc: Ard Biesheuvel > > > > Acked-by: Gerd Hoffmann > > > > Signed-off-by: Jason A. Donenfeld > > > > --- > > > > hw/i386/microvm.c | 2 +- > > > > hw/i386/pc_piix.c | 3 ++- > > > > hw/i386/pc_q35.c | 3 ++- > > > > 3 files changed, 5 insertions(+), 3 deletions(-) > > > > > > > > > > After upgrading to QEMU 7.2, Linux 6.1 no longer boots with some configs. There > > > is no output at all. I bisected it to this commit, and I verified that the > > > following change to QEMU's master branch makes the problem go away: > > > > > > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > > > index b48047f50c..42f5b07d2f 100644 > > > --- a/hw/i386/pc_piix.c > > > +++ b/hw/i386/pc_piix.c > > > @@ -441,6 +441,7 @@ static void pc_i440fx_8_0_machine_options(MachineClass *m) > > > pc_i440fx_machine_options(m); > > > m->alias = "pc"; > > > m->is_default = true; > > > + PC_MACHINE_CLASS(m)->legacy_no_rng_seed = true; > > > } > > > > > > I've attached the kernel config I am seeing the problem on. > > > > > > For some reason, the problem also goes away if I disable CONFIG_KASAN. > > > > > > Any idea what is causing this? > > > > - Commenting out the call to parse_setup_data() doesn't fix the issue. > > So there's no KASAN issue with the actual parser. > > > > - Using KASAN_OUTLINE rather than INLINE does fix the issue! > > > > That makes me suspect that it's file size related, and QEMU or the BIOS > > is placing setup data at an overlapping offset by accident, or something > > similar. > > I removed the file systems from your config to bring the kernel size > back down, and voila, it works, even with KASAN_INLINE. So perhaps I'm > on the right track here... QEMU sticks setup_data after the kernel image, the same as kexec-tools and everything else. Apparently, when the kernel image is large, the call to early_memremap(boot_params.hdr.setup_data, ...) returns a value that points some place bogus, and the system crashes or does something weird. I haven't yet determined what this limit is, but in my current test kernel, a value of 0x0000000001327650 is enough to make it point to rubbish. Is this expected? What's going on here? Jason