From mboxrd@z Thu Jan 1 00:00:00 1970 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 C37514EB51; Mon, 26 Aug 2024 08:07:45 +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=1724659665; cv=none; b=ArulI7VhmgDN3otL9XdqE+iQXWA71QZmZ3Ry7278MfyFDv45/d1I18QX+RVoDdHkFao4pvGQNG6eSmIhTLLuvquR9SCMnRKDBEZV78m+5xnh2Xu+78Bk9UBwjg2pV16SvBq8IfWf7v9X4wNlMIHpXdP7MM+wtVEK7KDrGJnFcRE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724659665; c=relaxed/simple; bh=2zXfAK81LnBk/mOEZ9lvbbgXSwT+8B3Bi2M4zPLnMko=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IeO0cBFvBUJlw/cxyxTZDv6LBxV8FRel0h/zcDZh6AdmTxeV5ccsxepH/otRhN+agrBaz9rmGl/M/YdeUucrbEgl15763TJHy3sKKiRoFqYpBllIhq5KEC5pRw9YreKOQJQzzT+Yykv3JjBEh41XE8JeQYVw1bdqHkU4N+nVmNE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b=StHVCOh4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="StHVCOh4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F8E8C8CDD6; Mon, 26 Aug 2024 08:07:43 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="StHVCOh4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1724659661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UaxHDzyeQARFqyBuo6p6nbdr7RFX49mOAxwSudvJyzo=; b=StHVCOh4KNNCyFXRLYUoNCdTcNxSS6Z3asRmnJ9ATPyiIOC/xbFWmEWaSFpaObsfsoO+X3 qqjWV+mwTMIgJyMwkuMkqXw1CrHepM96JxAR4p2UKjZOsZsDhunIzVT2qZzKIWCwWJ7sje lqmadHbYXdoCfy5fWd5XhoCzWQm9vhQ= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id a6c12a3f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 26 Aug 2024 08:07:41 +0000 (UTC) Date: Mon, 26 Aug 2024 10:07:32 +0200 From: "Jason A. Donenfeld" To: Christophe Leroy Cc: Michael Ellerman , Nicholas Piggin , Naveen N Rao , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Theodore Ts'o , Arnd Bergmann , Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Vincenzo Frascino , Shuah Khan , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2 02/17] vdso: Clean header inclusion in getrandom Message-ID: References: <2a081f1fff5e40f496153f8e0162fc7ec5adab2e.1724309198.git.christophe.leroy@csgroup.eu> 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 In-Reply-To: <2a081f1fff5e40f496153f8e0162fc7ec5adab2e.1724309198.git.christophe.leroy@csgroup.eu> On Thu, Aug 22, 2024 at 09:13:10AM +0200, Christophe Leroy wrote: > diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h > index 0c92db84469d..6e4f8fae3ce9 100644 > --- a/arch/x86/include/asm/pvclock.h > +++ b/arch/x86/include/asm/pvclock.h > @@ -5,6 +5,7 @@ > #include > #include > > +struct timespec64; > /* some helper functions for xen and kvm pv clock sources */ > u64 pvclock_clocksource_read(struct pvclock_vcpu_time_info *src); > u64 pvclock_clocksource_read_nowd(struct pvclock_vcpu_time_info *src); This change isn't mentioned in the commit message and could probably benefit from doing so. > diff --git a/lib/vdso/getrandom.c b/lib/vdso/getrandom.c > index b230f0b10832..cab153c5f9be 100644 > --- a/lib/vdso/getrandom.c > +++ b/lib/vdso/getrandom.c > @@ -3,15 +3,13 @@ > * Copyright (C) 2022-2024 Jason A. Donenfeld . All Rights Reserved. > */ > > -#include > -#include > -#include > +#include > #include > #include > +#include Ah, that's where you do it. Ignore my comment on the previous commit, then. > #include > -#include > -#include > #include > +#include > > #define MEMCPY_AND_ZERO_SRC(type, dst, src, len) do { \ > while (len >= sizeof(type)) { \ > @@ -23,6 +21,9 @@ > } \ > } while (0) > > +#define _PAGE_SIZE (1UL << CONFIG_PAGE_SHIFT) > +#define _PAGE_MASK (~(_PAGE_SIZE - 1)) If PAGE_SIZE isn't defined at this point, why not just call it PAGE_SIZE instead of _PAGE_SIZE? But if that's the case, why not put the vdso definition of PAGE_SIZE into some vdso header included by this file?