From patchwork Wed Dec 16 04:47:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11976567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,TVD_SUBJ_WIPE_DEBT, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F00FCC0018C for ; Wed, 16 Dec 2020 04:47:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9BB5123159 for ; Wed, 16 Dec 2020 04:47:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BB5123159 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3E8BF8D001C; Tue, 15 Dec 2020 23:47:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 345728D0015; Tue, 15 Dec 2020 23:47:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 234B48D001C; Tue, 15 Dec 2020 23:47:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id 097E78D0015 for ; Tue, 15 Dec 2020 23:47:03 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D65F8180AD80F for ; Wed, 16 Dec 2020 04:47:02 +0000 (UTC) X-FDA: 77597910684.07.rice49_1c0be0f27429 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id BCED41803FFCF for ; Wed, 16 Dec 2020 04:47:02 +0000 (UTC) X-HE-Tag: rice49_1c0be0f27429 X-Filterd-Recvd-Size: 4049 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Dec 2020 04:47:02 +0000 (UTC) Date: Tue, 15 Dec 2020 20:47:00 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1608094021; bh=hCOLQsS+7kF4SyEfke0Rfn32KeTfC5ONmCG+kHtOVO4=; h=From:To:Subject:In-Reply-To:From; b=RZ6AJ5xfJtaNJxwpvyQF5Nn4BZFehlO5eiUEBNSU1nRmpvBlzGa22H95XyIEiTIy0 dU6x8Ajz4NlyEMphbQTbsnisjGuTGL9jkaGnNYC+X2RBMI1onxEB/0mPfZ9V/2Y8pl S9QNCX5IoDyZHKYzJTvcaju8onWUFn6gm1Dewg9M= From: Andrew Morton To: akpm@linux-foundation.org, arnd@arndb.de, keescook@chromium.org, linux-mm@kvack.org, linux@roeck-us.net, mcroce@microsoft.com, mm-commits@vger.kernel.org, natechancellor@gmail.com, pasha.tatashin@soleen.com, pmladek@suse.com, rppt@kernel.org, torvalds@linux-foundation.org, tyhicks@linux.microsoft.com Subject: [patch 85/95] reboot: remove cf9_safe from allowed types and rename cf9_force Message-ID: <20201216044700.imoUUGAt6%akpm@linux-foundation.org> In-Reply-To: <20201215204156.f05ec694b907845bcfab5c44@linux-foundation.org> User-Agent: s-nail v14.8.16 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: From: Matteo Croce Subject: reboot: remove cf9_safe from allowed types and rename cf9_force BOOT_CF9_SAFE_STR is an internal value used only by the x86 code and it's not possible to set it from userspace. Remove it, and rename 'cf9_force' to 'pci', so to make it coherent with the kernel command line reboot= option. Tested with this script: cd /sys/kernel/reboot/ for i in cold warm hard soft gpio; do echo $i >mode read j type read j cpu read j force read j Cc: Arnd Bergmann Cc: Guenter Roeck Cc: Kees Cook Cc: Mike Rapoport Cc: Nathan Chancellor Cc: Pavel Tatashin Cc: Petr Mladek Cc: Tyler Hicks Signed-off-by: Andrew Morton --- kernel/reboot.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) --- a/kernel/reboot.c~reboot-remove-cf9_safe-from-allowed-types-and-rename-cf9_force +++ a/kernel/reboot.c @@ -615,8 +615,7 @@ __setup("reboot=", reboot_setup); #define BOOT_BIOS_STR "bios" #define BOOT_ACPI_STR "acpi" #define BOOT_EFI_STR "efi" -#define BOOT_CF9_FORCE_STR "cf9_force" -#define BOOT_CF9_SAFE_STR "cf9_safe" +#define BOOT_PCI_STR "pci" static ssize_t mode_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { @@ -688,10 +687,7 @@ static ssize_t type_show(struct kobject val = BOOT_EFI_STR; break; case BOOT_CF9_FORCE: - val = BOOT_CF9_FORCE_STR; - break; - case BOOT_CF9_SAFE: - val = BOOT_CF9_SAFE_STR; + val = BOOT_PCI_STR; break; default: val = REBOOT_UNDEFINED_STR; @@ -715,10 +711,8 @@ static ssize_t type_store(struct kobject reboot_type = BOOT_ACPI; else if (!strncmp(buf, BOOT_EFI_STR, strlen(BOOT_EFI_STR))) reboot_type = BOOT_EFI; - else if (!strncmp(buf, BOOT_CF9_FORCE_STR, strlen(BOOT_CF9_FORCE_STR))) + else if (!strncmp(buf, BOOT_PCI_STR, strlen(BOOT_PCI_STR))) reboot_type = BOOT_CF9_FORCE; - else if (!strncmp(buf, BOOT_CF9_SAFE_STR, strlen(BOOT_CF9_SAFE_STR))) - reboot_type = BOOT_CF9_SAFE; else return -EINVAL;