Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3407604rwa; Tue, 23 Aug 2022 04:23:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR7xa4diXoBo1DpmbNnYDuINvV99afGRNZPgfKAOnTJ4rUjorN5WE1JmlNgAMN3WTvvEfwe+ X-Received: by 2002:a17:90b:1a8f:b0:1fb:6f83:81b3 with SMTP id ng15-20020a17090b1a8f00b001fb6f8381b3mr978289pjb.205.1661253801680; Tue, 23 Aug 2022 04:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253801; cv=none; d=google.com; s=arc-20160816; b=mtOmwDGtr22Q4GKZJkIBtS8aMYcUnL2QshgLRpgDLvFCYgQ5giwfcpllQMi+pwW4eA RXVZVzl3QiWdw3VEPr77J1BIJtYx9r9hvB9leIIxJr1UCq4tyQfclbxwRd2O7Kvbo3Oq bEPNkNIsnGD5boY/7j+O8CWXIISL3eGbaoSP6Kktf/uGNH7R9Dslz/RTTkMdFpHZavGa qVT8hAfQylyKaHw5wZdwkWswZIaRCvNkCAurjixeQxTKWth3GaGf8HtL0s9sRFxoeM8U Ht4y5nmRUJFPKNQQtImIL+JPGWQDwCxWGdwgYJliEpu3mXT3FA3KQn120Z0Kt3iG5OwT DB7g== 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=cg9vhgfqOeoyuakip1wXhUBygL3nUJ24jl2yvHnXaAk=; b=zJNknvs03DtHJMqZ+5btUEB7jpmEFJUn33hZFRoMegZEVn1DrrxP/7WjgJf5F1iA1o Ek9EZ1j9LrnNwSWAHilbIZRBM1tKo6u4pHFZH9zSLrvBAOkVVMFN/jDtrfvs73jCBYAU 6cV4RF6yVXjEbMt2kXbaYjSIWnsyG+4KOmNwDc2cykw7HbP4afz966epghStI15Mvuti Y85ZSyYkBGmZRUr6F1a0tLOgKqQRcW8y3MEO5gav8LMRi5MkkNHPvWxAZoKHmSFFdd+4 N0ic8/Zm+zHBFWW+5VLAkEp5AizLvOpd1+zTfwxB1JbRRKNIi3/URurKS4G2xg1ZFsqr hGbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lndspGLd; 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 198-20020a6300cf000000b0042a88f7b969si8888565pga.812.2022.08.23.04.23.10; Tue, 23 Aug 2022 04:23:21 -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=lndspGLd; 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 S1349476AbiHWJWu (ORCPT + 99 others); Tue, 23 Aug 2022 05:22:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350349AbiHWJVm (ORCPT ); Tue, 23 Aug 2022 05:21:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E75F56DF84; Tue, 23 Aug 2022 01:34:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2668E614E9; Tue, 23 Aug 2022 08:33:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24B2DC433B5; Tue, 23 Aug 2022 08:33:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243626; bh=DDeFuJF+/jJw8oszRdDIPDDVt6JZ7zvbZcQR2zC/mkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lndspGLdjuTdRA/rDt2Fi8ATC7qo1NFU90qexq0kj9Xd6/UOmySKhNoL2CuFlLmjV Q8dxIH10ohUkEf5a6V2/bvAvrUmyE8jAdEFmckdlv0rPwhpeTJqINYQKSUyRWd0SIz RMrJSNSDVuvpNvKM742BZuuloMWUIFi+/I3uv/2I= 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.19 297/365] um: add "noreboot" command line option for PANIC_TIMEOUT=-1 setups Date: Tue, 23 Aug 2022 10:03:18 +0200 Message-Id: <20220823080130.606552627@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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 c316c993a949..b24db6017ded 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