Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp319423rdb; Tue, 5 Dec 2023 06:26:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPrGW0UWBSqoF3cBcTQHzaksHVTUZQl2IkQF1dynex/bXEuLswTMCD8Jzwsgril0L46lZM X-Received: by 2002:a17:902:6946:b0:1d0:6ffe:a22 with SMTP id k6-20020a170902694600b001d06ffe0a22mr5353365plt.128.1701786404364; Tue, 05 Dec 2023 06:26:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701786404; cv=none; d=google.com; s=arc-20160816; b=x9nkfTceC9tB9383QHP08f9LPumS41sVV3wwTqS7d8OwRkNQvKzwmcm36gKZBuP7dH UKc5K3Zw/gT3qMnF6/IFAG8E+FsKK/xn1b2MZ6gGhzfHL8+eVBiiD1TjxcvkocLBX8az 2Cc0M9E96nikF45R0GrYfIVaMvE+vs1Zm9y2gb+X5lnyc01gqXlt/75esXNDFkaCGBjV X+fL1cH+iOQwI89ddmYVXtrZIsXHFBhw4R0wEXc56LmNKioKC6bL8NSxzBmnvGTuDn2M IjtBlxZ7do6HDo8hA9AbUZ/1rVtB4HKS8Kkeai56us3bXYVmHsGxjNMoPGshGhO92D/r CG3A== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Op8EMMLSn4u+aBPhlPBNq3QMTgHXM3GBpRsFBgi0BfQ=; fh=ff9xCG+qGZYbEQdSgqPpi+oUCnz6fvmSoLNiKJAdvIs=; b=qbuiXcaKEYGqSZUoTz/ljnez1By/5BUe5tWDojqdC8Kojq8FsYYU2uG0neFdzbGZiw XeT1mfo5p9zMycF7jK1O8vd2oWelv45egJyEZPC2Vc2jnkuO1EuT37/I7PnYUTVxAjHz 0p1iW3vY7qsduGkHAAwGTv1UTN9TzLH3sU+3lpEc/uktDCfyZbkIuaaU7VquwG26iZkZ z9YHUbAI9SL89We6RlfnXMMSqbOn4bXpSoeowOYWqx3emWdbu7M56QtOW/qQFTyuDXeI 1um34hkbIUA6uD1dmSz6GHhC+PkC0x7yve2BIKtSVIGZU6qOhfRc0iiR+QRfJVntUN+V 3KIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Je+fNcYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id mb5-20020a170903098500b001d05ec3be0bsi6875561plb.130.2023.12.05.06.26.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 06:26:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Je+fNcYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id AE79380A5F23; Tue, 5 Dec 2023 06:26:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345881AbjLEO0V (ORCPT + 99 others); Tue, 5 Dec 2023 09:26:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235465AbjLEO0U (ORCPT ); Tue, 5 Dec 2023 09:26:20 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B54C290; Tue, 5 Dec 2023 06:26:26 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40b5155e154so61390465e9.3; Tue, 05 Dec 2023 06:26:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701786385; x=1702391185; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Op8EMMLSn4u+aBPhlPBNq3QMTgHXM3GBpRsFBgi0BfQ=; b=Je+fNcYYEL+oFZXHBG4vyEm4q3MDARjCNpqHxjZnjM73qqZMRPVD7xWZibgPTy3/qZ cZ8IXlBB5x0tjJMdxDVWKk3z3BjzFi3X1paWRN+UEdh+T3DddyG+cimxxBfEEFaBW6E/ ksHVOnfKLbiMXQk9AGNjof23UTBc9YcjXzmsaZH5pbEVa6P+wzBYPzH5cu7dKdJtrQMh uKQ/r54G+UJpU6cqaRA3UmR9U7XTCcCTE2WMnHPL8Epk49F602I7KbEMwBGF1/hvwnNo dOXjcZoiWBK9RZeYs5Fi76sJn4nFe7doVl6pARNwGz4QT1cIckkCePFkTQLeXxmbSHUG gxHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701786385; x=1702391185; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Op8EMMLSn4u+aBPhlPBNq3QMTgHXM3GBpRsFBgi0BfQ=; b=dzH6VgYL2LMwnS30vzjJhaVXTq31R7cx0QQDTbh92Wrco9v9OBnX8Lc8ST1acPKaPU VZL56HFq97M/uWJv4ERUImKDOo6fdDRLu7zpBgqyaIdexAav3qJZKTAMLGQ9uoQki/cQ NBQgparuqcNzUelqonsVzhTJ14wXb4vW8/nCt1jH0RaX9TuVEXKOnwxkvWCyGaIBlI8G nwazp/4BLRmfxQePJgk1/I0Si5Rn6tCw1uHu+DLwT5m4wGOgACiGJ/nVLbei6YyBU80t ezpCKatvYywYsIjnqgc74uQmGhwPUaoLT6/2yegvHwvIMYiegkfCj+DcvOs7zlByIMoy 2t+Q== X-Gm-Message-State: AOJu0YwzAzKu92baV5gGxaknFvOj9FhAHzuvVJJIljX+N/DtMD+DePBx judPtpq3C2Tfz64Ke2OgfGhN0bjE6Q== X-Received: by 2002:a05:600c:4f50:b0:40b:5e1f:6fd9 with SMTP id m16-20020a05600c4f5000b0040b5e1f6fd9mr501528wmq.46.1701786384964; Tue, 05 Dec 2023 06:26:24 -0800 (PST) Received: from p183 ([46.53.254.107]) by smtp.gmail.com with ESMTPSA id t20-20020a05600c451400b004094e565e71sm19022491wmo.23.2023.12.05.06.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 06:26:24 -0800 (PST) Date: Tue, 5 Dec 2023 17:26:22 +0300 From: Alexey Dobriyan To: Florian Weimer Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] ELF: supply userspace with available page shifts (AT_PAGE_SHIFT_LIST) Message-ID: <75344429-1f34-4a14-ab10-8613846d694e@p183> References: <6b399b86-a478-48b0-92a1-25240a8ede54@p183> <87v89dvuxg.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87v89dvuxg.fsf@oldenburg.str.redhat.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 05 Dec 2023 06:26:41 -0800 (PST) On Tue, Dec 05, 2023 at 10:51:39AM +0100, Florian Weimer wrote: > * Alexey Dobriyan: > > > +/* > > + * Page sizes available for mmap(2) encoded as 1 page shift per byte in > > + * increasing order. > > + * > > + * Thus 32-bit systems get 4 shifts, 64-bit systems get 8 shifts tops. > > Couldn't you use the bits in a long instead, to indicate which shifts > are present? That's always going to be enough. Yes! I was so proud of myself for this line: val |= 21 << (s += 8); Now it is boring bitmask again :-)