All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hongbo Li <lihongbo22@huawei.com>
To: Naman Jain <namjain@linux.microsoft.com>, <kys@microsoft.com>,
	<haiyangz@microsoft.com>, <wei.liu@kernel.org>,
	<decui@microsoft.com>
Cc: <linux-hyperv@vger.kernel.org>
Subject: Re: [PATCH -next] hv: vmbus: Constify struct kobj_type and struct attribute_group
Date: Thu, 5 Sep 2024 09:14:56 +0800	[thread overview]
Message-ID: <4ff906fd-406e-4b7f-bdbb-e35c04e95c59@huawei.com> (raw)
In-Reply-To: <fec0bb67-7fc3-4f67-818e-a0439a9822a9@linux.microsoft.com>



On 2024/9/4 19:10, Naman Jain wrote:
> 
> 
> On 9/4/2024 3:48 PM, Hongbo Li wrote:
>>
>>
>> On 2024/9/4 18:09, Naman Jain wrote:
>>>
>>>
>>> On 9/4/2024 6:45 AM, Hongbo Li wrote:
>>>> The `struct attribute_group` and `struct kobj_type` are not
>>>> modified, and they are only used in the helpers which take a
>>>> const type parameter.
>>>>
>>>> Constifying these structure and moving them to a read-only section,
>>>> and this can increase over all security.
>>>>
>>>> ```
>>>> [Before]
>>>>     text   data    bss    dec    hex    filename
>>>>    20568   4699     48  25315   62e3    drivers/hv/vmbus_drv.o
>>>>
>>>> [After]
>>>>     text   data    bss    dec    hex    filename
>>>>    20696   4571     48  25315   62e3    drivers/hv/vmbus_drv.o
>>>> ```
>>>>
> 
> ...
> 
>>>
>>> Small thing, I hope you included before and after logs in commit msg to
>>> show that some of the data section moved to text as you made these
>>> variables constant. If not, please move these after ---.
>>>
>> You mean remove the '```' or move the whole part after --- ?
> 
> Never mind. IMO, mentioning these stats was really optional since we are 
> not saving any memory here. This could have been moved to the section 
> after --- so that it does not get captured in git log.
Thank you, I got it and have learned something.

Thanks,
Hongbo

  However there's
> no harm in keeping it where it is. So your call.
> 
> 
> Regards,
> Naman
> 
>>
>> Thanks,
>> Hongbo
>>
>>>
>>> Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
>>>
>>> Regards,
>>> Naman
> 

  reply	other threads:[~2024-09-05  1:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04  1:15 [PATCH -next] hv: vmbus: Constify struct kobj_type and struct attribute_group Hongbo Li
2024-09-04 10:09 ` Naman Jain
2024-09-04 10:18   ` Hongbo Li
2024-09-04 11:10     ` Naman Jain
2024-09-05  1:14       ` Hongbo Li [this message]
2024-09-05  7:33 ` Wei Liu

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=4ff906fd-406e-4b7f-bdbb-e35c04e95c59@huawei.com \
    --to=lihongbo22@huawei.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=namjain@linux.microsoft.com \
    --cc=wei.liu@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.