All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Vagin <avagin@gmail.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Dmitry Safonov <dima@arista.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/6] arm64/vdso: Add time napespace page
Date: Wed, 22 Apr 2020 22:23:57 -0700	[thread overview]
Message-ID: <20200423052357.GA967113@gmail.com> (raw)
In-Reply-To: <20200416104527.GD4987@lakrids.cambridge.arm.com>

On Thu, Apr 16, 2020 at 11:45:27AM +0100, Mark Rutland wrote:
> Hi Andrei,
> 
> On Wed, Apr 15, 2020 at 10:26:15PM -0700, Andrei Vagin wrote:
> > diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h
> > index 07468428fd29..351c145d3808 100644
> > --- a/arch/arm64/include/asm/vdso.h
> > +++ b/arch/arm64/include/asm/vdso.h
...
> > +#ifdef CONFIG_TIME_NS
> > +static __always_inline const struct vdso_data *__arch_get_timens_vdso_data(void)
> > +{
> > +	const struct vdso_data *ret;
> > +
> > +	ret = _timens_data;
> > +	OPTIMIZER_HIDE_VAR(ret);
> > +
> > +	return ret;
> > +}
> > +#endif
> 
> Sorry for the confusion here, but please either:
> 
> * Add a preparatory patch making __arch_get_vdso_data() use
>   OPTIMIZER_HIDE_VAR(), and use OPTIMIZER_HIDE_VAR() here.
> 
> * Use the same assembly as __arch_get_vdso_data() currently does.
> 
> ... and either way add a comment here:
> 
> 	/* See __arch_get_vdso_data() */
> 
> ... so taht the rationale is obvious.
> 
> [...]
> 
> > +enum vvar_pages {
> > +	VVAR_DATA_PAGE_OFFSET = 0,
> > +#ifdef CONFIG_TIME_NS
> > +	VVAR_TIMENS_PAGE_OFFSET = 1,
> > +#endif /* CONFIG_TIME_NS */
> > +	VVAR_NR_PAGES = __VVAR_PAGES,
> > +};
> 
> Pet peeve, but we don't need the initializers here, as enums start from
> zero. The last element shouldn't have a trailing comma as we don't
> expect to add elements after it in future.
> 
> Rather than assigning to VVAR_NR_PAGES, it'd be better to use a
> BUILD_BUG_ON() to verify that it is the number we expect:
> 
> enum vvar_pages {
> 	VVAR_DATA_PAGE,
> #ifdef CONFIG_TIME_NS
> 	VVAR_TIMENS_PAGE,
> #endif
> 	VVAR_NR_PAGES
> };
> 
> BUILD_BUG_ON(VVAR_NR_PAGES != __VVAR_PAGES);

Hi Mark,

Thank you for the review. I have sent a fixed version of this patch in
replay to the origin patch.

Thanks,
Andrei

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Andrei Vagin <avagin@gmail.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Dmitry Safonov <dima@arista.com>
Subject: Re: [PATCH 3/6] arm64/vdso: Add time napespace page
Date: Wed, 22 Apr 2020 22:23:57 -0700	[thread overview]
Message-ID: <20200423052357.GA967113@gmail.com> (raw)
In-Reply-To: <20200416104527.GD4987@lakrids.cambridge.arm.com>

On Thu, Apr 16, 2020 at 11:45:27AM +0100, Mark Rutland wrote:
> Hi Andrei,
> 
> On Wed, Apr 15, 2020 at 10:26:15PM -0700, Andrei Vagin wrote:
> > diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h
> > index 07468428fd29..351c145d3808 100644
> > --- a/arch/arm64/include/asm/vdso.h
> > +++ b/arch/arm64/include/asm/vdso.h
...
> > +#ifdef CONFIG_TIME_NS
> > +static __always_inline const struct vdso_data *__arch_get_timens_vdso_data(void)
> > +{
> > +	const struct vdso_data *ret;
> > +
> > +	ret = _timens_data;
> > +	OPTIMIZER_HIDE_VAR(ret);
> > +
> > +	return ret;
> > +}
> > +#endif
> 
> Sorry for the confusion here, but please either:
> 
> * Add a preparatory patch making __arch_get_vdso_data() use
>   OPTIMIZER_HIDE_VAR(), and use OPTIMIZER_HIDE_VAR() here.
> 
> * Use the same assembly as __arch_get_vdso_data() currently does.
> 
> ... and either way add a comment here:
> 
> 	/* See __arch_get_vdso_data() */
> 
> ... so taht the rationale is obvious.
> 
> [...]
> 
> > +enum vvar_pages {
> > +	VVAR_DATA_PAGE_OFFSET = 0,
> > +#ifdef CONFIG_TIME_NS
> > +	VVAR_TIMENS_PAGE_OFFSET = 1,
> > +#endif /* CONFIG_TIME_NS */
> > +	VVAR_NR_PAGES = __VVAR_PAGES,
> > +};
> 
> Pet peeve, but we don't need the initializers here, as enums start from
> zero. The last element shouldn't have a trailing comma as we don't
> expect to add elements after it in future.
> 
> Rather than assigning to VVAR_NR_PAGES, it'd be better to use a
> BUILD_BUG_ON() to verify that it is the number we expect:
> 
> enum vvar_pages {
> 	VVAR_DATA_PAGE,
> #ifdef CONFIG_TIME_NS
> 	VVAR_TIMENS_PAGE,
> #endif
> 	VVAR_NR_PAGES
> };
> 
> BUILD_BUG_ON(VVAR_NR_PAGES != __VVAR_PAGES);

Hi Mark,

Thank you for the review. I have sent a fixed version of this patch in
replay to the origin patch.

Thanks,
Andrei

  reply	other threads:[~2020-04-23  5:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16  5:26 [PATCH v3 0/6] arm64: add the time namespace support Andrei Vagin
2020-04-16  5:26 ` Andrei Vagin
2020-04-16  5:26 ` [PATCH 1/6] arm64/vdso: use the fault callback to map vvar pages Andrei Vagin
2020-04-16  5:26   ` Andrei Vagin
2020-04-16  5:26 ` [PATCH 2/6] arm64/vdso: Zap vvar pages when switching to a time namespace Andrei Vagin
2020-04-16  5:26   ` Andrei Vagin
2020-04-16  5:26 ` [PATCH 3/6] arm64/vdso: Add time napespace page Andrei Vagin
2020-04-16  5:26   ` Andrei Vagin
2020-04-16 10:45   ` Mark Rutland
2020-04-16 10:45     ` Mark Rutland
2020-04-23  5:23     ` Andrei Vagin [this message]
2020-04-23  5:23       ` Andrei Vagin
2020-04-17  4:11   ` [PATCH 3/6 v2] arm64/vdso: Add time namespace page Andrei Vagin
2020-04-17  4:11     ` Andrei Vagin
2020-04-16  5:26 ` [PATCH 4/6] arm64/vdso: Handle faults on timens page Andrei Vagin
2020-04-16  5:26   ` Andrei Vagin
2020-04-16  5:26 ` [PATCH 5/6] arm64/vdso: Restrict splitting VVAR VMA Andrei Vagin
2020-04-16  5:26   ` Andrei Vagin
2020-04-16  5:26 ` [PATCH 6/6] arm64: enable time namespace support Andrei Vagin
2020-04-16  5:26   ` Andrei Vagin
2020-05-20 12:02 ` [PATCH v3 0/6] arm64: add the " Vincenzo Frascino
2020-05-20 12:02   ` Vincenzo Frascino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200423052357.GA967113@gmail.com \
    --to=avagin@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=dima@arista.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=tglx@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.