From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 304163FBA5; Mon, 7 Oct 2024 11:01:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728298870; cv=none; b=fxO8Stl48Gn0fcAh9Vn+5rEFJ/nSVC9DFbZTKs1DOTF/MzTGUresqtthzeQRUsSZIAd5Fc/SJZ5kOP8Qs9HY6T1eUAAFIzCxa4c9auskrXkDvGPncXNHUEMuOuHxmx7QSk0gS5LCS61Ds7KrJj2McGszfFHXgpb11hrsiiJbuaw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728298870; c=relaxed/simple; bh=FiSKg/kHhCDQOQ/TfOxXjBLaMI+VeWWs/jjr6N/6XTs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qgb57cJOqFQKq7H4TXqzdzgPghjP3tMo3qI4CaPIe6RA3L8g0hf9DKT9WMqO/+BqofnlY0ZDlp6Vi34rEEQjAV7liVCUkMNTEPxh96cLIyM8eWsKvV7uEgH1qs2A+iBSSiQm01ul4ltcwTJObVy0DZcL9b7bPCiiSy+CAQaD7OQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02F9CFEC; Mon, 7 Oct 2024 04:01:38 -0700 (PDT) Received: from [10.1.196.72] (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BDB013F640; Mon, 7 Oct 2024 04:01:05 -0700 (PDT) Message-ID: <850cdc2a-a336-4dab-bc7a-d9bcae3fb3cf@arm.com> Date: Mon, 7 Oct 2024 12:01:04 +0100 Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] vdso: Introduce vdso/page.h To: Arnd Bergmann , linux-kernel@vger.kernel.org, Linux-Arch , linux-mm@kvack.org Cc: Andy Lutomirski , Thomas Gleixner , "Jason A . Donenfeld" , Christophe Leroy , Michael Ellerman , Nicholas Piggin , Naveen N Rao , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Theodore Ts'o , Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers References: <20241003152910.3287259-1-vincenzo.frascino@arm.com> <20241003152910.3287259-3-vincenzo.frascino@arm.com> <423e571b-3ef6-4e80-ba81-bf42589a4ba8@app.fastmail.com> Content-Language: en-US From: Vincenzo Frascino In-Reply-To: <423e571b-3ef6-4e80-ba81-bf42589a4ba8@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/10/2024 14:13, Arnd Bergmann wrote: > On Thu, Oct 3, 2024, at 15:29, Vincenzo Frascino wrote: >> The VDSO implementation includes headers from outside of the >> vdso/ namespace. >> >> Introduce vdso/page.h to make sure that the generic library >> uses only the allowed namespace. >> >> Note: on a 32-bit architecture UL is an unsigned 32 bit long. Hence when >> it supports 64-bit phys_addr_t we might end up in situation in which the >> top 32 bit are cleared. To prevent this issue this patch provides >> separate macros for PAGE_MASK. >> >> Cc: Arnd Bergmann >> Cc: Andy Lutomirski >> Cc: Thomas Gleixner >> Cc: Jason A. Donenfeld >> Signed-off-by: Vincenzo Frascino > > Looks good to me. I would apply this to the asm-generic > tree for 6.13, but there is one small detail I'm unsure > about: > Thanks. >> +#if defined(CONFIG_PHYS_ADDR_T_64BIT) >> +#define PAGE_MASK (~((1 << CONFIG_PAGE_SHIFT) - 1)) >> +#else >> +#define PAGE_MASK (~(PAGE_SIZE-1)) >> +#endif > > We only want the #if branch for 32-bit architectures, right? > > On 64-bit ones, CONFIG_PHYS_ADDR_T_64BIT is always set, so > I think that is unnecessary change from the existing version, > even though it should be harmless. > It seemed harmless from the tests I did. But adding an '&& defined(CONFIG_32BIT)' makes it logically correct. I will add a comment as well in the next version. > Arnd -- Regards, Vincenzo