[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jL-q6dxU6fXs2U9o8LMzmOF9mgT0OTkDiHtKw_wDCM0-A@mail.gmail.com>
Date: Mon, 13 Aug 2018 15:37:35 -0700
From: Kees Cook <keescook@...omium.org>
To: Zubin Mithra <zsm@...omium.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
Guenter Roeck <groeck@...omium.org>
Subject: Re: [PATCH] perf/x86: Add __ro_after_init annotations
On Fri, Aug 10, 2018 at 8:43 AM, Zubin Mithra <zsm@...omium.org> wrote:
> x86_pmu_{format,events,attr,caps}_group is written to in
> init_hw_perf_events and not modified after. This makes them suitable
> candidates for annotating as __ro_after_init.
>
> Signed-off-by: Zubin Mithra <zsm@...omium.org>
Reviewed-by: Kees Cook <keescook@...omium.org>
-Kees
> ---
> arch/x86/events/core.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
> index 5f4829f10129..88e5f67f5d4c 100644
> --- a/arch/x86/events/core.c
> +++ b/arch/x86/events/core.c
> @@ -1584,7 +1584,7 @@ static void __init pmu_check_apic(void)
>
> }
>
> -static struct attribute_group x86_pmu_format_group = {
> +static struct attribute_group x86_pmu_format_group __ro_after_init = {
> .name = "format",
> .attrs = NULL,
> };
> @@ -1715,7 +1715,7 @@ static struct attribute *events_attr[] = {
> NULL,
> };
>
> -static struct attribute_group x86_pmu_events_group = {
> +static struct attribute_group x86_pmu_events_group __ro_after_init = {
> .name = "events",
> .attrs = events_attr,
> };
> @@ -2230,7 +2230,7 @@ static struct attribute *x86_pmu_attrs[] = {
> NULL,
> };
>
> -static struct attribute_group x86_pmu_attr_group = {
> +static struct attribute_group x86_pmu_attr_group __ro_after_init = {
> .attrs = x86_pmu_attrs,
> };
>
> @@ -2248,7 +2248,7 @@ static struct attribute *x86_pmu_caps_attrs[] = {
> NULL
> };
>
> -static struct attribute_group x86_pmu_caps_group = {
> +static struct attribute_group x86_pmu_caps_group __ro_after_init = {
> .name = "caps",
> .attrs = x86_pmu_caps_attrs,
> };
> --
> 2.18.0.597.ga71716f1ad-goog
>
--
Kees Cook
Pixel Security
Powered by blists - more mailing lists