From patchwork Mon Feb 5 12:01:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gowans, James" X-Patchwork-Id: 13545319 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 C2290C4828D for ; Mon, 5 Feb 2024 12:03:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D4316B0071; Mon, 5 Feb 2024 07:03:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 584A16B007D; Mon, 5 Feb 2024 07:03:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44CB46B0095; Mon, 5 Feb 2024 07:03:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 31A646B0071 for ; Mon, 5 Feb 2024 07:03:48 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 12C9540A1A for ; Mon, 5 Feb 2024 12:03:48 +0000 (UTC) X-FDA: 81757616136.08.B5DAA2C Received: from smtp-fw-9106.amazon.com (smtp-fw-9106.amazon.com [207.171.188.206]) by imf30.hostedemail.com (Postfix) with ESMTP id DE87380025 for ; Mon, 5 Feb 2024 12:03:45 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=amazon.com header.s=amazon201209 header.b=ME9B1obe; spf=pass (imf30.hostedemail.com: domain of "prvs=75897cb1d=jgowans@amazon.com" designates 207.171.188.206 as permitted sender) smtp.mailfrom="prvs=75897cb1d=jgowans@amazon.com"; dmarc=pass (policy=quarantine) header.from=amazon.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707134626; 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=GuAtgRmAwOIaihgufqnss82d+hBkVwofjU/pF2m60/o=; b=uDxmjgdxgExJq1N/UHVYYmLjztFXk+x3yq1GJvgI4qUh1QgZuIYt0PZO6vo+HTzJM4O3FM cK7Ur+gnuDBX1Sanur67BW/mpJNoo5iYtkb0jscmDKk+yI8njEOq73htPRvEw65jvokwV0 B6jGg+jM11XF1AVVgyGGw/qVmlKOoWw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707134626; a=rsa-sha256; cv=none; b=bpmCfj2MGVL/GQeVHZKdKEcPYAmQbKGKFjHfT3pyAQkvKu7s2AgtH6B7zD6PeMU7jGAZHs HyEke1r5MwoxE/NxPycdZW+yteexhOJ5iCkseb/fRJEoUaGyharCNetFYKQYnfBI/ZwRDA wJQVe5M0SSXHfJFXXRwKK8iOmgi6W9U= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=amazon.com header.s=amazon201209 header.b=ME9B1obe; spf=pass (imf30.hostedemail.com: domain of "prvs=75897cb1d=jgowans@amazon.com" designates 207.171.188.206 as permitted sender) smtp.mailfrom="prvs=75897cb1d=jgowans@amazon.com"; dmarc=pass (policy=quarantine) header.from=amazon.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1707134627; x=1738670627; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GuAtgRmAwOIaihgufqnss82d+hBkVwofjU/pF2m60/o=; b=ME9B1obeUmQM9MkN6Op0qWCk6d1TisM3ZFjvsc+fV9xRk+cP71AItSw2 UWeUy7Ba6irWTxoYF9pWq124a7w42680MvPgAscD49ZauKwN1amktWRQZ 475YFAiHs/RHR3W8EvTtn8GsN166o933cjfp3nsQkypmRQgIImSRXNUgt 8=; X-IronPort-AV: E=Sophos;i="6.05,245,1701129600"; d="scan'208";a="702146151" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.25.36.210]) by smtp-border-fw-9106.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 12:03:45 +0000 Received: from EX19MTAEUB002.ant.amazon.com [10.0.43.254:55484] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.32.190:2525] with esmtp (Farcaster) id 54deb5d5-b17f-4ae2-b6be-2dc346f855b1; Mon, 5 Feb 2024 12:03:43 +0000 (UTC) X-Farcaster-Flow-ID: 54deb5d5-b17f-4ae2-b6be-2dc346f855b1 Received: from EX19D014EUC004.ant.amazon.com (10.252.51.182) by EX19MTAEUB002.ant.amazon.com (10.252.51.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 5 Feb 2024 12:03:40 +0000 Received: from dev-dsk-jgowans-1a-a3faec1f.eu-west-1.amazon.com (172.19.112.191) by EX19D014EUC004.ant.amazon.com (10.252.51.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 5 Feb 2024 12:03:33 +0000 From: James Gowans To: CC: Eric Biederman , , "Joerg Roedel" , Will Deacon , , Alexander Viro , "Christian Brauner" , , Paolo Bonzini , Sean Christopherson , , Andrew Morton , , Alexander Graf , David Woodhouse , "Jan H . Schoenherr" , Usama Arif , Anthony Yznaga , Stanislav Kinsburskii , , , Subject: [RFC 06/18] init: Add liveupdate cmdline param Date: Mon, 5 Feb 2024 12:01:51 +0000 Message-ID: <20240205120203.60312-7-jgowans@amazon.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240205120203.60312-1-jgowans@amazon.com> References: <20240205120203.60312-1-jgowans@amazon.com> MIME-Version: 1.0 X-Originating-IP: [172.19.112.191] X-ClientProxiedBy: EX19D033UWC001.ant.amazon.com (10.13.139.218) To EX19D014EUC004.ant.amazon.com (10.252.51.182) X-Rspamd-Queue-Id: DE87380025 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: yi4bhqsw1k8td7eh47pk9s64xbs9qbhx X-HE-Tag: 1707134625-383314 X-HE-Meta: U2FsdGVkX1/Fk+52ENJCBngGMMkJypxiAoO6PnfFCH1VeAf9jirbMK1Md0ptZOtZeonrwcy4NXjv/03tBqm/cQlQR51BtPMMsuKd8dSwcpZSp24Wr0hW/GxrNTyK3S91iN2qdX4h2ctR4CQoVxvt/QCbr/L8E1diTw/UZa41oj4OUaNo5tYLK8A0BP3rXX1cbbDJSvq9WR22n4MGubScc2RlJFI0gu5FcJTMXaVdXw+eLVgmLKIIoQXak9cYSdaZBimViDPgFvUvwpwqh3gHSHTkY/WskyeJSwduVIzwEqgx03yoTz936r++1KbNbeSPWzlaE4X0MkdJnxJ/zywxHR+GVg7XDcKen/CkjibJsDHhb/IlAmj/qz/70LibN+LthRsFcwWBdg9nIfvK+76nMktAcXMzdtRWsH626NKTXUicd1FnQWGnXrdISRJI230v6KnQlBaB44wMFhzod+VeGvcXS323poJF+NPhBFBQL/kp+eEtJZ7DRSk1kkp3jhKZq1fEg5hJ9gAiESLs2XPQx4tkVltBaJto79SH/gZM1/Fu7kzZRWv433ahc9rV/OVzmVKmbooYhy9F4eXPlnunZ0+DOx0RpN3sNGrZ4Am0hoStFRFhNhZxpgG3yPwa6mfkWW2bmGfHqULU78i78LwTWiVonGL9XXWxyucHoHTuW4WiRT7xMX+7r5VbcrupRi4HyK0UVolP8vQtqrcp+OlRx6rgh3jln0UlcCfRenkPS8fuxod9J/e37bxRkD1YtFuESjN7kz5KMWZvHYagRnKs6kWziiUAqjCsswJT91Ly6sN1Hmq+1LTLNQx/+mCRT1G9IJiYKn5MzR6PdBZq9dvHT5nm3O4BZJmR2SR8W+GfIInpKHpUhSRH7+JGynIG8QKB4gqCJFjR/n71rdGbncCcx1tkc+4dmgdKyG+TfB2wY/G+Gt8eXVL5qNPSJU/pqeh9FP6ZMn9qVqi7vaSIEGA SUNurbtw SKpLZbgLtT3Nb11wYZDc1EKtjIUNGudecORUWBGGVI/TDvj9HLJvt0JpNh+pwBakHwR1lR++UNED9AgbaPsrztmSFXd09dMPRHlqTlEKyeImMGQ2cgRYR5vWx6VMSHPWngcHlc7jEV2LeLnHjVZjDdcU6bnyTr6W1iKDAbUuLjrq81jzYT9Ckl4mBpXgl2D38hY0TuBgko/dJHfDFk7QW2rncPgb4eEPxZrIPvBWIe5Zvps3VHU6iqxts8WWCrUiKt+Dw9vVUYYzu3CK4HIXLLygcQkw1qcVXybbf1ncb77a02Zyz1dDaEyvixnVVxkciCKdZ8CkI+wjpa/ew7y/Q91LgJxhTQJ969+0tJPXUp67P7gnKdESssAMZ1okJaGJhHYbUzOXMAn/C36Vja0MgzYD8MwpT3JNzZWTPWjANSotygSgbspWGCQIFP/0ANBV9GILfULUQIl/m5Dh8ASsfEbWU22kcH6aE+MYpkzdlc6spbzotgBHNIIhArxckKiQ3H5ZKudpI0s5nybyTwx7I1jKEkS0pgfMNQpbJyi2uwoSmAx0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This will allow other subsystems to know when we're going a LU and hence when they should be restoring rather than reinitialising state. --- include/linux/init.h | 1 + init/main.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/include/linux/init.h b/include/linux/init.h index 266c3e1640d4..d7c68c7bfaf0 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -146,6 +146,7 @@ extern int do_one_initcall(initcall_t fn); extern char __initdata boot_command_line[]; extern char *saved_command_line; extern unsigned int saved_command_line_len; +extern bool liveupdate; extern unsigned int reset_devices; /* used by init/main.c */ diff --git a/init/main.c b/init/main.c index e24b0780fdff..7807a56c3473 100644 --- a/init/main.c +++ b/init/main.c @@ -165,6 +165,16 @@ static char *ramdisk_execute_command = "/init"; bool static_key_initialized __read_mostly; EXPORT_SYMBOL_GPL(static_key_initialized); +bool liveupdate __read_mostly; +EXPORT_SYMBOL(liveupdate); + +static int __init set_liveupdate(char *param) +{ + liveupdate = true; + return 0; +} +early_param("liveupdate", set_liveupdate); + /* * If set, this is an indication to the drivers that reset the underlying * device before going ahead with the initialization otherwise driver might