* [PATCH] Remove redundant and incorrect memset() [not found] <20131003131054.GB27835@gmail.com> @ 2013-10-04 16:02 ` Roy Franz 2013-10-04 17:33 ` Ingo Molnar 0 siblings, 1 reply; 4+ messages in thread From: Roy Franz @ 2013-10-04 16:02 UTC (permalink / raw) To: mingo, linux-kernel, linux-efi, matt.fleming, hpa Cc: msalter, patches, Roy Franz Remove a redundant memset() call from efi_relocate_kernel() that was clearing memory that would be used by BSS in non-compressed images loaded with this function. This clear was redundant with the clearing done in the image itself, and also implemented incorrectly with a 0 length. Signed-off-by: Roy Franz <roy.franz@linaro.org> Acked-by: Mark Salter <msalter@redhat.com> --- drivers/firmware/efi/efi-stub-helper.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/firmware/efi/efi-stub-helper.c b/drivers/firmware/efi/efi-stub-helper.c index cc0581d..b6bffbf 100644 --- a/drivers/firmware/efi/efi-stub-helper.c +++ b/drivers/firmware/efi/efi-stub-helper.c @@ -567,8 +567,6 @@ static efi_status_t efi_relocate_kernel(efi_system_table_t *sys_table_arg, * have been allocated by UEFI, so we can safely use memcpy. */ memcpy((void *)new_addr, (void *)cur_image_addr, image_size); - /* Zero any extra space we may have allocated for BSS. */ - memset((void *)(new_addr + image_size), alloc_size - image_size, 0); /* Return the new address of the relocated image. */ *image_addr = new_addr; -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove redundant and incorrect memset() 2013-10-04 16:02 ` [PATCH] Remove redundant and incorrect memset() Roy Franz @ 2013-10-04 17:33 ` Ingo Molnar 2013-10-04 17:38 ` H. Peter Anvin [not found] ` <CAFECyb_ddUU8p87iOZ43PxW3h-E5cJ-0BUEr9i4Z-VrUez6=Jw@mail.gmail.com> 0 siblings, 2 replies; 4+ messages in thread From: Ingo Molnar @ 2013-10-04 17:33 UTC (permalink / raw) To: Roy Franz; +Cc: linux-kernel, linux-efi, matt.fleming, hpa, msalter, patches * Roy Franz <roy.franz@linaro.org> wrote: > Remove a redundant memset() call from efi_relocate_kernel() that > was clearing memory that would be used by BSS in non-compressed > images loaded with this function. This clear was redundant with > the clearing done in the image itself, and also implemented incorrectly > with a 0 length. > > Signed-off-by: Roy Franz <roy.franz@linaro.org> > Acked-by: Mark Salter <msalter@redhat.com> Note the title: [PATCH] Remove redundant and incorrect memset() if it's both redundant *and* incorrect then the other memset() must be incorrect too and must be removed as well ;-) I suspect you wanted the title to say: [PATCH] Remove redundant memset() ? Thanks, Ingo ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove redundant and incorrect memset() 2013-10-04 17:33 ` Ingo Molnar @ 2013-10-04 17:38 ` H. Peter Anvin [not found] ` <CAFECyb_ddUU8p87iOZ43PxW3h-E5cJ-0BUEr9i4Z-VrUez6=Jw@mail.gmail.com> 1 sibling, 0 replies; 4+ messages in thread From: H. Peter Anvin @ 2013-10-04 17:38 UTC (permalink / raw) To: Ingo Molnar Cc: Roy Franz, linux-kernel, linux-efi, matt.fleming, msalter, patches On 10/04/2013 10:33 AM, Ingo Molnar wrote: > > * Roy Franz <roy.franz@linaro.org> wrote: > >> Remove a redundant memset() call from efi_relocate_kernel() that >> was clearing memory that would be used by BSS in non-compressed >> images loaded with this function. This clear was redundant with >> the clearing done in the image itself, and also implemented incorrectly >> with a 0 length. >> >> Signed-off-by: Roy Franz <roy.franz@linaro.org> >> Acked-by: Mark Salter <msalter@redhat.com> > > Note the title: > > [PATCH] Remove redundant and incorrect memset() > > if it's both redundant *and* incorrect then the other memset() must be > incorrect too and must be removed as well ;-) > > I suspect you wanted the title to say: > > [PATCH] Remove redundant memset() > And more importantly: [PATCH] boot,efi: Remove redundant memset() ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <CAFECyb_ddUU8p87iOZ43PxW3h-E5cJ-0BUEr9i4Z-VrUez6=Jw@mail.gmail.com>]
* Re: [PATCH] Remove redundant and incorrect memset() [not found] ` <CAFECyb_ddUU8p87iOZ43PxW3h-E5cJ-0BUEr9i4Z-VrUez6=Jw@mail.gmail.com> @ 2013-10-04 17:39 ` Ingo Molnar 0 siblings, 0 replies; 4+ messages in thread From: Ingo Molnar @ 2013-10-04 17:39 UTC (permalink / raw) To: Roy Franz Cc: H. Peter Anvin, Matt Fleming, linux-efi, patches, msalter, linux-kernel * Roy Franz <roy.franz@linaro.org> wrote: > On Oct 4, 2013 1:33 PM, "Ingo Molnar" <mingo@kernel.org> wrote: > > > > > > * Roy Franz <roy.franz@linaro.org> wrote: > > > > > Remove a redundant memset() call from efi_relocate_kernel() that > > > was clearing memory that would be used by BSS in non-compressed > > > images loaded with this function. This clear was redundant with > > > the clearing done in the image itself, and also implemented incorrectly > > > with a 0 length. > > > > > > Signed-off-by: Roy Franz <roy.franz@linaro.org> > > > Acked-by: Mark Salter <msalter@redhat.com> > > > > Note the title: > > > > [PATCH] Remove redundant and incorrect memset() > > > > if it's both redundant *and* incorrect then the other memset() must be > > incorrect too and must be removed as well ;-) > > > > I suspect you wanted the title to say: > > > > [PATCH] Remove redundant memset() > > > > ? > > > > Thanks, > > > > Ingo > Hi Ingo, > > The memset being removed is redundant with a correctly implemented > memset in the kernel itself. The memset being removed is also incorrect, > with a hard coded length of 0. So it was redundantly clearing nothing? ;-) Anyway, I agree, the title makes sense. Thanks, Ingo ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-04 17:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20131003131054.GB27835@gmail.com>
2013-10-04 16:02 ` [PATCH] Remove redundant and incorrect memset() Roy Franz
2013-10-04 17:33 ` Ingo Molnar
2013-10-04 17:38 ` H. Peter Anvin
[not found] ` <CAFECyb_ddUU8p87iOZ43PxW3h-E5cJ-0BUEr9i4Z-VrUez6=Jw@mail.gmail.com>
2013-10-04 17:39 ` Ingo Molnar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).