Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3474880rwa; Tue, 23 Aug 2022 05:29:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qjf5WTlhKJDIftTu5octb1EXwwBPae5G989R1q56GfWnJTnHlNGQx+yDxdMy1ZPsUGChs X-Received: by 2002:a05:6402:11cd:b0:43d:7862:7c25 with SMTP id j13-20020a05640211cd00b0043d78627c25mr3591019edw.96.1661257760291; Tue, 23 Aug 2022 05:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257760; cv=none; d=google.com; s=arc-20160816; b=DIQ7U3sbII1eExr0aFmUEzmOVYHaYkzTJ0eFjN5OTzcllMnSVg61jISHqKVC1vLwNv AtRj5AVUkRD3+RbzmCQXL3IXPCqtwCBOSc/dsWpebCAfwEMcVzkSERVYZY9Tfsx1mxoE KDFqO6QPEUn2TMnTRI3Da/9Httz7D+Y6lQHp/0B7oer2cqpvGpJo8qcOFWjKPtjtDjkM WGkGKt8/7zYeRLST4Gcz/vhOaKj90V7u+L/pvP27/LH4f+0fMPlElxk8Etpv0gLy9bMb z+0hLktiHYpJ37fOxeTEM6NTNDFDmrMmmmWMSxz54YJBImZ9e5JQsJKiPXEccQBcZbG8 DFug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=E28nMh1/SJRocrQabWnWR98smn/4d43M3Dycfd/c5Qs=; b=Sk4aWo6fF4eJjThWiu7I6/qRd+Ut3T4RLpmtf6T0tREf7KpaxITa4odtybmW6QXKFk hoCKCixrSavJNWWlv1KJCaZ+L0YTXzYGSKucCKcbFucermKnqg4AAD+VoykQOLC7WngZ ca+jQLb4mX9n1864OfyDHKMJoJAMMPBCXHerPfLSby/e1G0gnBeXTYiiyZtqwD1MCJoX ZFyyaertbPGJwSfPf/hOYt8SwM5KdfbKXajLaWgMZUSbM7xJ/MizSzfdi318aRhEx98p zelNFHsxYEHHV+ypm4Om+6EYEuUdTp8miA8GmYu2l7FiHaLJNzklOU9rXOBoTQ+pMu3E nb/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x0ELQ0CK; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a50c907000000b00446090a70f0si1881500edh.488.2022.08.23.05.28.55; Tue, 23 Aug 2022 05:29:20 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=x0ELQ0CK; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353955AbiHWKYL (ORCPT + 99 others); Tue, 23 Aug 2022 06:24:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353537AbiHWKLh (ORCPT ); Tue, 23 Aug 2022 06:11:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B59ED9E; Tue, 23 Aug 2022 01:57:11 -0700 (PDT) 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 18483B81C3A; Tue, 23 Aug 2022 08:57:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E97AC433D6; Tue, 23 Aug 2022 08:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245028; bh=sYVT2j00dyVweiIPJGZ8CUNOSD+Cpd4aEfLMKMU4bOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x0ELQ0CKK84jwhKp2GcJ5RRB2oMazxN3z/ses8+npL96ftPULlFgCCnKqHsUxb+yv hjB7afR2AO3c+XVe0ozYZFAfzddLMSEZroqhQmqJ8i7c4Ve77hqpKz7IDWuQtkHDap JoOOnQco4FbOhMPlg3V1GH8yUAVcbdDW+xCOJ9TY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" , Richard Weinberger , Sasha Levin Subject: [PATCH 5.15 192/244] um: add "noreboot" command line option for PANIC_TIMEOUT=-1 setups Date: Tue, 23 Aug 2022 10:25:51 +0200 Message-Id: <20220823080105.806375480@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Jason A. Donenfeld [ Upstream commit dda520d07b95072a0b63f6c52a8eb566d08ea897 ] QEMU has a -no-reboot option, which halts instead of reboots when the guest asks to reboot. This is invaluable when used with CONFIG_PANIC_TIMEOUT=-1 (and panic_on_warn), because it allows panics and warnings to be caught immediately in CI. Implement this in UML too, by way of a basic setup param. Signed-off-by: Jason A. Donenfeld Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- arch/um/os-Linux/skas/process.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 87d3129e7362..0df2ebcc97c0 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -707,10 +708,24 @@ void halt_skas(void) UML_LONGJMP(&initial_jmpbuf, INIT_JMP_HALT); } +static bool noreboot; + +static int __init noreboot_cmd_param(char *str, int *add) +{ + noreboot = true; + return 0; +} + +__uml_setup("noreboot", noreboot_cmd_param, +"noreboot\n" +" Rather than rebooting, exit always, akin to QEMU's -no-reboot option.\n" +" This is useful if you're using CONFIG_PANIC_TIMEOUT in order to catch\n" +" crashes in CI\n"); + void reboot_skas(void) { block_signals_trace(); - UML_LONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT); + UML_LONGJMP(&initial_jmpbuf, noreboot ? INIT_JMP_HALT : INIT_JMP_REBOOT); } void __switch_mm(struct mm_id *mm_idp) -- 2.35.1