Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8489494rwl; Sat, 31 Dec 2022 06:42:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXtqlVhFM0etCxySHvqPQtk+uWEvfjMbe6p081XBES36cOvdDzMlL2lK+HKP0HStKyNqmzhH X-Received: by 2002:a05:6a21:1506:b0:a4:255b:f3b8 with SMTP id nq6-20020a056a21150600b000a4255bf3b8mr44170011pzb.45.1672497727634; Sat, 31 Dec 2022 06:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672497727; cv=none; d=google.com; s=arc-20160816; b=Kdu7xsLV6qqXQXY5ch0nG+jZ7i+YmgCJXI1zE8CwOO28boudJTtMvhM8yBFsqFkwWF H3j0xKXP+dDUNI9CGo6cYiiYWIuCeO9DKOIFBYKTOqLT/jGB7EI4uyaYs0PHtZxPL8SS +VKv0oVJ/yCZfqzW6wEducx2aDXK0qQu1BKbwn52pvFiZ1heBX4IUWLbSZGW/P1RuzTi jWh7JAWlkfqwtyXkrPMZNI9b1XG9ESPT82+Ze2KOm+p9OG/P1Y39eQhNnJkLPLcz27KN E7MNVWWu8RzVICy0UP8cX4xSRU8MV6VJxjvfog6OyXfax8beJK+57PDYjTXXwobKqvaq RN/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E2wmlHvVomyofqRCJf8xfYVH8sZL3Dd8L4/TPehW1Yw=; b=c4C4YoghmMZFFCrhZk42Enn6Pit1nV0jNZKTx16ny/aWoWN2dyWCVi3p0E0Ovf4dgQ 5kq6EpsEfHZvp10PxCa+tW0MEVGje0kSGmSJmlLzrp+AGho9inXKLrjcl/2/9+7og9X5 Oub0W/KhFagi/ad6VFVV5jJX12RK4lK+T2uNpKaAhmaDKTMVDCTomv0Tmivdg5E8WIQW B4bBKAKbgYTwH0LbqEMxfF8r3KmGFVAFrHxdy77bJTGPRxfNndZ94h5jBD7qyQxm8/I4 RmCGfLGnbmkFlv1EWWzbCkfrHQ5qQ3hDN5qFhndElT095lggdU5Y0ymgGzlc5gtwIjCw 9zFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=bYJMYrnX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 15-20020a630a0f000000b00477b463b049si24956576pgk.491.2022.12.31.06.41.31; Sat, 31 Dec 2022 06:42:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=bYJMYrnX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231939AbiLaNmj (ORCPT + 62 others); Sat, 31 Dec 2022 08:42:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiLaNmg (ORCPT ); Sat, 31 Dec 2022 08:42:36 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E2BCB2C for ; Sat, 31 Dec 2022 05:42:35 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 19B0FB80761 for ; Sat, 31 Dec 2022 13:42:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35666C433EF; Sat, 31 Dec 2022 13:42:31 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="bYJMYrnX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1672494149; 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: in-reply-to:in-reply-to:references:references; bh=E2wmlHvVomyofqRCJf8xfYVH8sZL3Dd8L4/TPehW1Yw=; b=bYJMYrnXsYoytmbfdMfU0ed34teYzMX4TFMO/F2u1WxepKWG81VNgq532j1ZgGNU75XY9I g0yeZe4ANe0vceStz6ryhNhxgacZZCUAVPJPgmVAMN+duJaumLvF9fvRwS2e8NrDxyiDws 1e/81cMdmUhtOPoKwxMNzl7TiPTdCBw= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id e6787442 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 31 Dec 2022 13:42:29 +0000 (UTC) Date: Sat, 31 Dec 2022 14:42:26 +0100 From: "Jason A. Donenfeld" To: Borislav Petkov Cc: "H. Peter Anvin" , pbonzini@redhat.com, ebiggers@kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, ardb@kernel.org, kraxel@redhat.com, philmd@linaro.org Subject: Re: [PATCH qemu] x86: don't let decompressed kernel image clobber setup_data Message-ID: References: <6cab26b5-06ae-468d-ac79-ecdecb86ef07@linaro.org> <9188EEE9-2759-4389-B39E-0FEBBA3FA57D@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 31, 2022 at 02:35:45PM +0100, Borislav Petkov wrote: > On Sat, Dec 31, 2022 at 01:54:50PM +0100, Jason A. Donenfeld wrote: > > Nothing special... `-kernel bzImage` should be enough to do it. Eric > > reported it, and then I was able to repro trivially. Sure you got the > > right version? > > Yeah, qemu executables confusion here - had wrongly something older of the > version 7.1... > > Now made sure I'm actually booting with the latest qemu: > > QEMU emulator version 7.2.50 (v7.2.0-333-g222059a0fccf) > > With that the kernel with your config hangs early during boot and the stack > trace is below. > > Seeing how it says trapnr 14, then that looks like something you are seeing. > > But lemme poke at it more. Yes. The cause is what I've described in the commit message. There are two proposed fixes, the v1, which has the 62 MiB limitation due to a kernel bug, and the v3, which seems to work fine, and is simpler, and I suspect that's the one QEMU upstream should take. https://lore.kernel.org/lkml/20221230220725.618763-1-Jason@zx2c4.com/