Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp523980imn; Fri, 29 Jul 2022 14:34:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR6VLCIqXYGK9eO8zBLq0KCgwfDE+YXH1o3ybxQ1wqeNLAbmDnnd2mo0pkx22z+XhMU+Jhq4 X-Received: by 2002:a17:902:d4c5:b0:16d:65e3:7215 with SMTP id o5-20020a170902d4c500b0016d65e37215mr5711668plg.142.1659130455720; Fri, 29 Jul 2022 14:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659130455; cv=none; d=google.com; s=arc-20160816; b=zZEkimhKj+yVBYdjhkdVlS9S0CFlx0jnLh3IK3w+JFx+VubTv9sfEs+MZ6RirtCSYN pTM5DQlc8R5KARha5Pmzg4AWQUx9j1cpxXsouglEoPyz0YuRftzbFPl2okN3AsZCChMl LxfnYLxE5KhHO3dwaQuurrOmgs+pLEvjhTvzjmAG9l8SBkDS3UHfWelhicFDC8rA1MaK Bknv1Mix7Hij1A/HX4LkR36bq1K9jVcbs8YJaIebusnFQDLfGhiEBB7vSdotT+3RB/5x 2Tiw+ksj2gL71l0QUBQPqG7lx8S0F8oBEUnqcv32GUubcPJTxXZL+38wXE3DLqsmYHjW a1Ig== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EuRhSvlTzxBIhrA8hHoMAr8WfhmsTnDFuycwSZ/LtBA=; b=va89RLO+e3tDeubSLRIbJoWGLtOevqlnxKPuBE6CzfHCfQtAV9/WD8DRv9DcOBWD1W vLfOW4nboYgzxJcPpoa+wa6AlKIb9PLVdsMAFYblGadZ6nkRiu5K3OLagYtkatGOTaIH 8hzcHb8FKNUi/TkTs7ujS+MqJB2uMm1JS7OHlPMTLbQS8jjPkf/e1mNuKCXiWoNIhMQr KrHeyVUjJxPtUfGeaeiSXcft5A7ddQTrc7sv7I9Ekd/bcgk3qqyJO2BUIeST9MznZ1om ZkfoNilkkYKM0e2zRyID8AGxVOo7eUfQkLxWsK+04D7usPtfK1RDic1b5ds3gNR8Te19 CGjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@angband.pl header.s=tartarus header.b=Ma0kBF6R; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my17-20020a17090b4c9100b001f248fefb0bsi10512452pjb.47.2022.07.29.14.34.00; Fri, 29 Jul 2022 14:34:15 -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=fail header.i=@angband.pl header.s=tartarus header.b=Ma0kBF6R; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230089AbiG2VVz (ORCPT + 99 others); Fri, 29 Jul 2022 17:21:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbiG2VVx (ORCPT ); Fri, 29 Jul 2022 17:21:53 -0400 Received: from tartarus.angband.pl (tartarus.angband.pl [51.83.246.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC27C83F01 for ; Fri, 29 Jul 2022 14:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=angband.pl; s=tartarus; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=EuRhSvlTzxBIhrA8hHoMAr8WfhmsTnDFuycwSZ/LtBA=; b=Ma0kBF6RN+JBt2bYT3Kz0EjO7v oExYZT4RXMOts6tgdGZEeTNgAsBzapat1zb+ZZgODOpZxYGbjm+/22XSfoicQxX6EpBiTty+stpex BEGg48NMhgLF7tsol/AGQrOnLKp5hDMIrFdNIH0Znfm9/Hq5AB94wwvEAS614vLib9WM=; Received: from kilobyte by tartarus.angband.pl with local (Exim 4.94.2) (envelope-from ) id 1oHXQT-00648v-4t; Fri, 29 Jul 2022 23:21:41 +0200 Date: Fri, 29 Jul 2022 23:21:41 +0200 From: Adam Borowski To: Greg KH Cc: Xingrui Yi , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vt: remove old FONT ioctls definitions in uapi Message-ID: References: <20220722061133.7765-1-yixingrui@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Junkbait: aaron@angband.pl, zzyx@angband.pl X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kilobyte@angband.pl X-SA-Exim-Scanned: No (on tartarus.angband.pl); SAEximRunCond expanded to false X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Thu, Jul 28, 2022 at 10:26:10AM +0200, Greg KH wrote: > On Fri, Jul 22, 2022 at 02:11:33PM +0800, Xingrui Yi wrote: > > As was demonstrated by commit ff2047fb755d ("vt: drop old FONT ioctls"), > > old font ioctls like PIO_FONT have been deleted and KDFONTOP ioctl is used > > for years instead. > > > > However, unused definitions of these ioctl numbers and "strut > > consolefontdesc" still exist in a uapi header. They could have been removed > > since no userspace was using them. Otherwise they will become a > > misleading for users, and users will fail with ENOTTY with wrong call. > > -#define GIO_FONT 0x4B60 /* gets font in expanded form */ > > -#define PIO_FONT 0x4B61 /* use font in expanded form */ > > -#define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */ > > -#define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */ > > -struct consolefontdesc { > > -#define PIO_FONTRESET 0x4B6D /* reset to default font */ > Did you rebuild a distribution like Debian to verify that these values > and structure are not used anywhere? I just did. https://codesearch.debian.net lists packages to check: aalib busybox cde console-cyrillic dietlibc doclifter emscripten fpc gargoyle-free gcc-10 gcc-11 gcc-12 gcc-9 gcc-arm-none-eabi gcc-avr gcc-riscv64-unknown-elf gcc-snapshot hurd kbd kfreebsd-10 lazarus libabigail libexplain linux llvm-toolchain-11 llvm-toolchain-12 llvm-toolchain-13 llvm-toolchain-14 llvm-toolchain-9 llvm-toolchain-snapshot lynx manpages-l10n sequeler strace stress-ng systemd trinity vala valgrind Of these, I've ignored the kernels, and built only the latest released version of a compiler. .--====[ aalib ] aalinux.c: In function ‘linux_init’: aalinux.c:106:34: error: storage size of ‘desc’ isn’t known 106 | struct consolefontdesc desc; | ^~~~ aalinux.c:109:26: error: ‘GIO_FONTX’ undeclared (first use in this function) 109 | i = ioctl (fd, GIO_FONTX, &desc); | ^~~~~~~~~ `---- .--====[ kbd ] kdfontop.c: In function ‘kfont_restore_font’: kdfontop.c:27:23: error: ‘PIO_FONTRESET’ undeclared (first use in this function) 27 | if (ioctl(fd, PIO_FONTRESET, 0)) { | ^~~~~~~~~~~~~ kdfontop.c: In function ‘get_font_giofontx’: kdfontop.c:89:32: error: storage size of ‘cfd’ isn’t known kdfontop.c:102:30: error: ‘GIO_FONTX’ undeclared kdfontop.c: In function ‘get_font_giofont’: kdfontop.c:137:30: error: ‘GIO_FONT’ undeclared kdfontop.c: In function ‘put_font_piofontx’: kdfontop.c:242:32: error: storage size of ‘cfd’ isn’t known kdfontop.c:262:31: error: ‘PIO_FONTX’ undeclared kdfontop.c: In function ‘put_font_piofont’: kdfontop.c:299:31: error: ‘PIO_FONT’ undeclared `---- .--====[ gcc-12 ] ../../../../src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:850:29: error: 'GIO_FONT' was not declared in this scope 850 | unsigned IOCTL_GIO_FONT = GIO_FONT; | ^~~~~~~~ `---- .--====[ llvm-toolchain-14 ] /<>/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:865:29: error: use of undeclared identifier 'GIO_FONT' unsigned IOCTL_GIO_FONT = GIO_FONT; ^ /<>/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:898:29: error: use of undeclared identifier 'PIO_FONT' unsigned IOCTL_PIO_FONT = PIO_FONT; ^ `---- .--====[ libexplain ] libexplain/buffer/consolefontdesc.c: In function ‘explain_buffer_consolefontdesc’: libexplain/buffer/consolefontdesc.c:34:48: error: invalid application of ‘sizeof’ to incomplete type ‘c onst struct consolefontdesc’ 34 | if (explain_is_efault_pointer(value, sizeof(*value))) | ^ libexplain/buffer/consolefontdesc.c:43:14: error: invalid use of undefined type ‘const struct consolefo ntdesc’ 43 | value->charcount, | ^~ `---- .--====[ trinity ] In file included from ioctls/vt.c:8: ioctls/vt.c:48:15: error: ‘GIO_FONT’ undeclared here (not in a function) 48 | IOCTL(GIO_FONT), | ^~~~~~~~ include/ioctls.h:53:22: note: in definition of macro ‘IOCTL’ 53 | { .request = _request, .name = #_request, } | ^~~~~~~~ ioctls/vt.c:49:15: error: ‘PIO_FONT’ undeclared here (not in a function) 49 | IOCTL(PIO_FONT), | ^~~~~~~~ ioctls/vt.c:50:15: error: ‘GIO_FONTX’ undeclared here (not in a function) ioctls/vt.c:51:15: error: ‘PIO_FONTX’ undeclared here (not in a function) ioctls/vt.c:52:15: error: ‘PIO_FONTRESET’ undeclared here (not in a function) `---- So there _are_ failures in userspace. But let's take a look at them: * aalib: dead upstream since 2001, this code is broken * kbd: uses KDFONTOP, falls back if unsupported * libsanitizer (bundled in gcc, llvm-toolchain): can drop * libexplain: can drop * trinity: can drop So we have one real failure, one fallback, and a few "lists all ioctls". I'd say that's acceptable. Especially because presence of code that list all ioctls means we would never done any clean-up otherwise. Meow! -- ⢀⣴⠾⠻⢶⣦⠀ Aryans: split from other Indo-Europeans ~2900-2000BC → Ural → ⣾⠁⢠⠒⠀⣿⡁ Bactria → settled 2000-1000BC in northwest India. ⢿⡄⠘⠷⠚⠋⠀ Gypsies: came ~1000AD from northern India; aryan. ⠈⠳⣄⠀⠀⠀⠀ Germans: IE people who came ~2800BC to Scandinavia; not aryan.