All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>
To: Alex Deucher
	<alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: "David Airlie" <airlied-cv59FeDIM0c@public.gmane.org>,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"amd-gfx list"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Maling list - DRI developers"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Alex Deucher" <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	"Rex Zhu" <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>,
	"Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>,
	"Hawking Zhang" <Hawking.Zhang-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH] drm/amd/powerplay: rv: Use designated initializers
Date: Fri, 28 Jul 2017 11:13:01 +0200	[thread overview]
Message-ID: <04db0bba-bf20-27dc-06ec-b99ce2df7fc8@amd.com> (raw)
In-Reply-To: <CADnq5_N=PK=k7Q9QGCqoQ0Bx5YnRRw1WjXijtxqhfKmFoh3MTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Am 28.07.2017 um 03:43 schrieb Alex Deucher:
> On Tue, Jul 25, 2017 at 5:47 PM, Kees Cook <keescook@chromium.org> wrote:
>> As done for vega10 in commit 3ddd396f6b57 ("drm/amd/powerplay: Use
>> designated initializers") mark other tableFunction entries with designated
>> initializers. The randstruct plugin requires designated initializers for
>> structures that are entirely function pointers.
>>
>> Cc: Rex Zhu <Rex.Zhu@amd.com>
>> Cc: Hawking Zhang <Hawking.Zhang@amd.com>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>> If I can get an Ack for this, I'll carry it in the gcc-plugins tree, unless
>> you think this is worth landing for v4.13, in which case, please take it
>> now. :)
>>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
>
> I'm happy to take this through my tree if that is ok with you.

I'm wondering a bit how the plugin detects that it can randomize a 
structure layout?

We have a couple of structs where this would be fatal.

Christian.

>
> Alex
>
>> Thanks!
>> ---
>>   drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
>> index 4c7f430b36eb..8e6cfd89c7e0 100644
>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
>> @@ -308,8 +308,8 @@ static int rv_tf_set_num_active_display(struct pp_hwmgr *hwmgr, void *input,
>>   }
>>
>>   static const struct phm_master_table_item rv_set_power_state_list[] = {
>> -       { NULL, rv_tf_set_clock_limit },
>> -       { NULL, rv_tf_set_num_active_display },
>> +       { .tableFunction = rv_tf_set_clock_limit },
>> +       { .tableFunction = rv_tf_set_num_active_display },
>>          { }
>>   };
>>
>> @@ -382,7 +382,7 @@ static int rv_tf_disable_gfx_off(struct pp_hwmgr *hwmgr,
>>   }
>>
>>   static const struct phm_master_table_item rv_disable_dpm_list[] = {
>> -       {NULL, rv_tf_disable_gfx_off},
>> +       { .tableFunction = rv_tf_disable_gfx_off },
>>          { },
>>   };
>>
>> @@ -407,7 +407,7 @@ static int rv_tf_enable_gfx_off(struct pp_hwmgr *hwmgr,
>>   }
>>
>>   static const struct phm_master_table_item rv_enable_dpm_list[] = {
>> -       {NULL, rv_tf_enable_gfx_off},
>> +       { .tableFunction = rv_tf_enable_gfx_off },
>>          { },
>>   };
>>
>> --
>> 2.7.4
>>
>>
>> --
>> Kees Cook
>> Pixel Security
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <christian.koenig@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>, Kees Cook <keescook@chromium.org>
Cc: "David Airlie" <airlied@linux.ie>,
	LKML <linux-kernel@vger.kernel.org>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Rex Zhu" <Rex.Zhu@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Hawking Zhang" <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amd/powerplay: rv: Use designated initializers
Date: Fri, 28 Jul 2017 11:13:01 +0200	[thread overview]
Message-ID: <04db0bba-bf20-27dc-06ec-b99ce2df7fc8@amd.com> (raw)
In-Reply-To: <CADnq5_N=PK=k7Q9QGCqoQ0Bx5YnRRw1WjXijtxqhfKmFoh3MTg@mail.gmail.com>

Am 28.07.2017 um 03:43 schrieb Alex Deucher:
> On Tue, Jul 25, 2017 at 5:47 PM, Kees Cook <keescook@chromium.org> wrote:
>> As done for vega10 in commit 3ddd396f6b57 ("drm/amd/powerplay: Use
>> designated initializers") mark other tableFunction entries with designated
>> initializers. The randstruct plugin requires designated initializers for
>> structures that are entirely function pointers.
>>
>> Cc: Rex Zhu <Rex.Zhu@amd.com>
>> Cc: Hawking Zhang <Hawking.Zhang@amd.com>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>> If I can get an Ack for this, I'll carry it in the gcc-plugins tree, unless
>> you think this is worth landing for v4.13, in which case, please take it
>> now. :)
>>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
>
> I'm happy to take this through my tree if that is ok with you.

I'm wondering a bit how the plugin detects that it can randomize a 
structure layout?

We have a couple of structs where this would be fatal.

Christian.

>
> Alex
>
>> Thanks!
>> ---
>>   drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
>> index 4c7f430b36eb..8e6cfd89c7e0 100644
>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
>> @@ -308,8 +308,8 @@ static int rv_tf_set_num_active_display(struct pp_hwmgr *hwmgr, void *input,
>>   }
>>
>>   static const struct phm_master_table_item rv_set_power_state_list[] = {
>> -       { NULL, rv_tf_set_clock_limit },
>> -       { NULL, rv_tf_set_num_active_display },
>> +       { .tableFunction = rv_tf_set_clock_limit },
>> +       { .tableFunction = rv_tf_set_num_active_display },
>>          { }
>>   };
>>
>> @@ -382,7 +382,7 @@ static int rv_tf_disable_gfx_off(struct pp_hwmgr *hwmgr,
>>   }
>>
>>   static const struct phm_master_table_item rv_disable_dpm_list[] = {
>> -       {NULL, rv_tf_disable_gfx_off},
>> +       { .tableFunction = rv_tf_disable_gfx_off },
>>          { },
>>   };
>>
>> @@ -407,7 +407,7 @@ static int rv_tf_enable_gfx_off(struct pp_hwmgr *hwmgr,
>>   }
>>
>>   static const struct phm_master_table_item rv_enable_dpm_list[] = {
>> -       {NULL, rv_tf_enable_gfx_off},
>> +       { .tableFunction = rv_tf_enable_gfx_off },
>>          { },
>>   };
>>
>> --
>> 2.7.4
>>
>>
>> --
>> Kees Cook
>> Pixel Security
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-07-28  9:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 21:47 [PATCH] drm/amd/powerplay: rv: Use designated initializers Kees Cook
2017-07-28  1:43 ` Alex Deucher
2017-07-28  1:43   ` Alex Deucher
     [not found]   ` <CADnq5_N=PK=k7Q9QGCqoQ0Bx5YnRRw1WjXijtxqhfKmFoh3MTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-28  9:13     ` Christian König [this message]
2017-07-28  9:13       ` Christian König
2017-07-28 17:10       ` Kees Cook
2017-07-28 17:15   ` Kees Cook
     [not found]     ` <CAGXu5jJ8uJTDHVWv9qwULRmoF6n5tHK=a2WWoe2CMGfmD8Wc4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-28 17:26       ` Deucher, Alexander
2017-07-28 17:26         ` Deucher, Alexander

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=04db0bba-bf20-27dc-06ec-b99ce2df7fc8@amd.com \
    --to=christian.koenig-5c7gfcevmho@public.gmane.org \
    --cc=Hawking.Zhang-5C7GfCeVMHo@public.gmane.org \
    --cc=Rex.Zhu-5C7GfCeVMHo@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.