Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp283520lqj; Wed, 10 Apr 2024 10:13:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7nU04keQxm3Fu3EfudrTqD3brnv9jmYwTsaK1ajlszUcx3nzsFfdgfiCGju/y2U1bJuHxB4S2osVkbQRJxOZghqQT3BWi4fvj1BecOg== X-Google-Smtp-Source: AGHT+IG0LnjQY0kbeP2Rn2Pe47raq+N6PEl2xwYfkTNBGFO8afwOVsP5n/qCBCjNvEP4XQeRV+BG X-Received: by 2002:a05:6a20:3c92:b0:1a7:47ff:5f3e with SMTP id b18-20020a056a203c9200b001a747ff5f3emr4208326pzj.9.1712769230943; Wed, 10 Apr 2024 10:13:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712769230; cv=pass; d=google.com; s=arc-20160816; b=Yw6HQS2yO3sfPSDgQgulENL7PWR09i1yklo8545ita66KPNXctEAOIw3auawj+tADB Phy5KdUI5FZTj9yefi/IQC6V4lqv0qP57+Sj1zSYaiZNG6cTQsEMYCtrpBNXGBwdqZLa 2LnUCJWDlF332PY+BxNK5Xo0zxBUVekkvjOAn+dNyy2M5/AO3FeTy2Hovb9lOvJlOaPN cD4/L7ElndNg7gy8fj94QzA3QhrB7QMdi5t1Jw3lFsuc9B2h01v/CBBjw9tSsu1Sz9fv R9eAcIKJTMaR6p0HtKfke3n5Vu/4s7HDYi19yJB0h3ppBYF5ct9FMe3/KryeaPtzYe8f uObQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9xeRyuxcj+aF48mWrF6gVxlSnsUa0Vc3EPCtjbE/FCk=; fh=fffhgQomylnSOy2yviDX1N9EZYOf5kPGCLJwk77+9H0=; b=ko4aT5/9+yy7dWrGupzreHZCqdE5mBVqElUi+CY9DitgYsEEfGCGIcrr6kz0FPzurJ 2px0lV+dksYrfajZGsXjS05ACfOFJVA6vB2GRDKMwY5xNdcb91+WU7RNhwhqoPZK/Sa9 bTAK8r4uEa/6eL5OuvZ2JkduWQezJgeUA83IKYCKFCTlmMdYRnKjdUTk4Lx7eQe1TLfj z41r9uqqoPD+d24SJiFUPdNVyzdHqXvd/F4oufYP07wZlyKLnrSuKUvu5yQTfoI23DZx C2TwA8wJ3rZVpJLP7U9txhM423Y1Sb2FEBtmVQhZNRb9TpHtERS/pvKqYsHRW/h5hzSA vHVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hfoDkDZm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x22-20020a1709027c1600b001e43ce0be9fsi6020726pll.359.2024.04.10.10.13.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 10:13:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hfoDkDZm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B40FDB26FB5 for ; Wed, 10 Apr 2024 16:29:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3980317B501; Wed, 10 Apr 2024 16:29:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hfoDkDZm" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2621C15ADBF; Wed, 10 Apr 2024 16:29:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712766565; cv=none; b=o7a9b2h1vww+M5ZUttEXH7O00dDKPabwg660/D43XZQqPjcPJ2u+KJufugeBW11+Lwe92WOQHy7mW3srXUBehoX9fnWu3lx2pqduvpv0neR3a3zH/RvXprud9p/TWKDY5oo9GNzXCllHCUhTD1Fy5LCYScVurE7ATRLhQt5ga6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712766565; c=relaxed/simple; bh=YSAPIOtYNplSycjf3v7XSTEn1r+NDjIrTJDrbvJR6wQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DSwwGr6g8CXPJmYzVSmFJA7IgeUryVwdMnkqGtw88RdTA/io4qVlbMzLdV6XZ+Sfz9saRakrra90f5tPe/YM9ps2nH1w5RID5kpQIl6xRCE/8wlDQmVfvghdFE2FkFgkNquy2InEO/ZTMM0JeQvq5iS9NuXBNzQ496jwRJTCr/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hfoDkDZm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5E97C433F1; Wed, 10 Apr 2024 16:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712766564; bh=YSAPIOtYNplSycjf3v7XSTEn1r+NDjIrTJDrbvJR6wQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hfoDkDZmkfM1oz64jIu5UjxX41RaJQV5t+KnioNgququptp/uL1Ngg3yuFw1jrM/Y Avy/wg6bFnwXimgGm2fPCTdKORiXvuF0RWNGJpH7/YgrC40a9EBz0Xs9rieevLBPMt bma23ZzR1JhK3g7R4/R7mMGL+wxGQLxJi8gjMnNQUoXxG/jNS4IWef++uCTdR6yZDo gUchAkh8ExprvWjL093grl2C0CGwdLVq5zlN4LWAxGkyJqKPKaHzA4mUkFeDkTUMJn BooX7ewcIzpZI91f2IykdEFzrSV9im+noRy4iUgJCnXr0dJ62xpQ84nyIc7gkUpzpU XPDKOkCeDKp6A== Date: Wed, 10 Apr 2024 18:29:19 +0200 From: Alexey Gladkov To: Jiri Slaby Cc: Greg Kroah-Hartman , LKML , kbd@lists.linux.dev, linux-api@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-serial@vger.kernel.org, Helge Deller Subject: Re: [RESEND PATCH v3 1/2] VT: Add KDFONTINFO ioctl Message-ID: References: <74ca50e0-61b1-4d4c-85dd-a5d920548c04@kernel.org> <6bb4f4fb-573c-4f63-967c-2cb08514fc91@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6bb4f4fb-573c-4f63-967c-2cb08514fc91@kernel.org> On Wed, Apr 03, 2024 at 07:27:55AM +0200, Jiri Slaby wrote: > On 02. 04. 24, 15:19, Alexey Gladkov wrote: > >>> --- a/include/uapi/linux/kd.h > >>> +++ b/include/uapi/linux/kd.h > ... > >>> +struct console_font_info { > >>> + unsigned int min_width, min_height; /* minimal font size */ > >>> + unsigned int max_width, max_height; /* maximum font size */ > >>> + unsigned int flags; /* KD_FONT_INFO_FLAG_* */ > >> > >> This does not look like a well-defined™ and extendable uapi structure. > >> While it won't change anything here, still use fixed-length __u32. > >> > >> And you should perhaps add some reserved fields. Do not repeat the same > >> mistakes as your predecessors with the current kd uapi. > > > > I thought about it, but I thought it would be overengineering. > > It would not. UAPI structs are set in stone once released. > > And in this case, it's likely you would want to know more info about > fonts in the future. > > > Can you suggest how best to do this? > > Given you have flags in there already (to state that the structure > contains more), just add an array of u32 reserved[] space. 3 or 5, I > would say (to align the struct to 64bit). struct console_font_info { __u32 min_width, min_height; /* minimal font size */ __u32 max_width, max_height; /* maximum font size */ __u32 flags; /* KD_FONT_INFO_FLAG_* */ __u32 reserved[5]; /* This field is reserved forfuture use. Must be 0. */ }; So, struct should be like this ? I wouldn't add the version to the flags. Maybe it would be better to add a separate field with the version? -- Rgrds, legion