From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9ECC317D36D; Fri, 31 May 2024 19:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717182747; cv=none; b=qM0PClENSTBdnbhKW3YMbCc0BaLRqg/38LrFuKad4M5RVLl04LJhuYtafaOHevlGUFNn1WNBTtRDjtkRELQhW1qFChX3uTtW+KDdubnxfCtpNpo9Giv/ZW8InuQGS9czvM8vyqoqb4tsvFihxsXHVV2ihZqQoH5KtN1b/NZVvbI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717182747; c=relaxed/simple; bh=sFsB5dqdy3gZRk50dI6z/h66URse+3gNEkhEkUqmsgQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=q+ZWo/nXtBaL6cgaRARYgkWcigNtkZmyjHjkCNu2vNW9tjv6QvZ7l4oaKDz37lbdrrzkgo4qMFa8zItf5xiPhsi4yWn4Q45QAqUlZFGkKOwab1how974YL4PLfH6EoymOW451kxSorB/dXvpzrII4BRs+CRi90ohPNDZ/TM7V/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=NkubCPox; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="NkubCPox" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=WusGXCsAP8jLvsx8zCO8SWtowPYaOe3WkJ+UrPpN66k=; b=NkubCPox2v0/24Di9p78k3teLJ rPt60VFZf5BlsFEh4KekHeGTRsJtoqjRbk7INTfkQLC6czg/eFvcKOFed1CqZ7k1Msx1SCVYAMU+A AnXj6yCqi4JJxBI40UiFH5jw1OV6djwOuBVce7ET6sSEo5igfyZqy2/SNZxyFYQcREfitSw0eAysk LH4e9UyiBz92JCFTBJih508iNv++M6PrzDdAPFd74DDttP9B7nf+r3LHk14pLm78EQ4owWOvuMvYu pIXxYtQvROat9d49Tzok7zPM48Ay8k46CgRWrvkNZMyXUWfmejUMFmZcva9PIlW4iWt/N2M94lyMw MHeoMTXA==; Received: from [50.53.4.147] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD7ft-0000000BD8i-1Abg; Fri, 31 May 2024 19:12:25 +0000 Message-ID: <173853ee-348d-4f76-bc50-c5727d76b3c9@infradead.org> Date: Fri, 31 May 2024 12:12:23 -0700 Precedence: bulk X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v16 4/5] random: introduce generic vDSO getrandom() implementation To: "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, patches@lists.linux.dev, tglx@linutronix.de Cc: linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , Adhemerval Zanella Netto , Carlos O'Donell , Florian Weimer , Arnd Bergmann , Jann Horn , Christian Brauner , David Hildenbrand References: <20240528122352.2485958-1-Jason@zx2c4.com> <20240528122352.2485958-5-Jason@zx2c4.com> Content-Language: en-US From: Randy Dunlap In-Reply-To: <20240528122352.2485958-5-Jason@zx2c4.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 5/28/24 5:19 AM, Jason A. Donenfeld wrote: > +/** > + * type vdso_kernel_ulong - unsigned long type that matches kernel's unsigned long s/type/typedef/ (for first "type" only) > + * > + * Data shared between userspace and the kernel must operate the same way in both 64-bit code and in > + * 32-bit compat code, over the same potentially 64-bit kernel. This type represents the size of an > + * unsigned long as used by kernel code. This isn't necessarily the same as an unsigned long as used > + * by userspace, however. > + * > + * +-------------------+-------------------+------------------+-------------------+ > + * | 32-bit userspace | 32-bit userspace | 64-bit userspace | 64-bit userspace | > + * | unsigned long | vdso_kernel_ulong | unsigned long | vdso_kernel_ulong | > + * +---------------+-------------------+-------------------+------------------+-------------------+ > + * | 32-bit kernel | ✓ same size | ✓ same size | > + * | unsigned long | | | > + * +---------------+-------------------+-------------------+------------------+-------------------+ > + * | 64-bit kernel | ✘ different size! | ✓ same size | ✓ same size | ✓ same size | > + * | unsigned long | | | | | > + * +---------------+-------------------+-------------------+------------------+-------------------+ > + */ > +#ifdef CONFIG_64BIT > +typedef u64 vdso_kernel_ulong; > +#else > +typedef u32 vdso_kernel_ulong; > +#endif -- #Randy https://people.kernel.org/tglx/notes-about-netiquette https://subspace.kernel.org/etiquette.html