From: kbuild test robot <lkp@intel.com>
To: Philipp Rudo <prudo@linux.vnet.ibm.com>
Cc: kbuild-all@01.org, kexec@lists.infradead.org,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
Eric Biederman <ebiederm@xmission.com>,
Vivek Goyal <vgoyal@redhat.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
x86@kernel.org, Dave Young <dyoung@redhat.com>,
AKASHI Takahiro <takahiro.akashi@linaro.org>
Subject: Re: [PATCH 07/11] kexec_file: Simplify kexec_purgatory_setup_sechdrs 1
Date: Thu, 1 Mar 2018 06:49:30 +0800 [thread overview]
Message-ID: <201803010616.VP399fem%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180226151620.20970-8-prudo@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 4811 bytes --]
Hi Philipp,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.16-rc3 next-20180228]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Philipp-Rudo/kexec_file-Clean-up-purgatory-load/20180228-223538
config: x86_64-randconfig-s4-03010216 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
Note: the linux-review/Philipp-Rudo/kexec_file-Clean-up-purgatory-load/20180228-223538 HEAD 28c77b126e4b2796074bd704e2370a38beb037c1 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
kernel/kexec_file.c: In function 'kexec_purgatory_setup_sechdrs':
>> kernel/kexec_file.c:798:3: error: expected ';' before '}' token
}
^
vim +798 kernel/kexec_file.c
713
714 /*
715 * kexec_purgatory_setup_sechdrs - prepares the pi->sechdrs buffer.
716 * @pi: Purgatory to be loaded.
717 * @kbuf: Buffer prepared to store purgatory.
718 *
719 * Allocates the memory needed for the buffer. Caller is responsible to free
720 * the memory after use.
721 *
722 * Return: 0 on success, negative errno on error.
723 */
724 static int kexec_purgatory_setup_sechdrs(struct purgatory_info *pi,
725 struct kexec_buf *kbuf)
726 {
727 unsigned long curr_load_addr;
728 unsigned long load_addr;
729 unsigned long bss_addr;
730 unsigned long offset;
731 unsigned char *buf_addr;
732 unsigned char *src;
733 Elf_Shdr *sechdrs;
734 int i;
735
736 sechdrs = vzalloc(pi->ehdr->e_shnum * sizeof(Elf_Shdr));
737 if (!sechdrs)
738 return -ENOMEM;
739 memcpy(sechdrs, (void *)pi->ehdr + pi->ehdr->e_shoff,
740 pi->ehdr->e_shnum * sizeof(Elf_Shdr));
741 pi->sechdrs = sechdrs;
742
743 /*
744 * We seem to have multiple copies of sections. First copy is which
745 * is embedded in kernel in read only section. Some of these sections
746 * will be copied to a temporary buffer and relocated. And these
747 * sections will finally be copied to their final destination at
748 * segment load time.
749 *
750 * Use ->sh_offset to reflect section address in memory. It will
751 * point to original read only copy if section is not allocatable.
752 * Otherwise it will point to temporary copy which will be relocated.
753 *
754 * Use ->sh_addr to contain final address of the section where it
755 * will go during execution time.
756 */
757 for (i = 0; i < pi->ehdr->e_shnum; i++) {
758 if (sechdrs[i].sh_type == SHT_NOBITS)
759 continue;
760
761 sechdrs[i].sh_offset = (unsigned long)pi->ehdr +
762 sechdrs[i].sh_offset;
763 }
764
765 /* Load SHF_ALLOC sections */
766 buf_addr = kbuf->buffer;
767 load_addr = curr_load_addr = kbuf->mem;
768 bss_addr = load_addr + kbuf->bufsz;
769 kbuf->image->start = pi->ehdr->e_entry;
770
771 for (i = 0; i < pi->ehdr->e_shnum; i++) {
772 unsigned long align;
773
774 if (!(sechdrs[i].sh_flags & SHF_ALLOC))
775 continue;
776
777 align = sechdrs[i].sh_addralign;
778
779 if (sechdrs[i].sh_type == SHT_NOBITS) {
780 bss_addr = ALIGN(bss_addr, align);
781 sechdrs[i].sh_addr = bss_addr;
782 bss_addr += sechdrs[i].sh_size;
783 continue;
784 }
785
786 curr_load_addr = ALIGN(curr_load_addr, align);
787 offset = curr_load_addr - load_addr;
788 /* We already modifed ->sh_offset to keep src addr */
789 src = (char *)sechdrs[i].sh_offset;
790 memcpy(buf_addr + offset, src, sechdrs[i].sh_size);
791
792 if (sechdrs[i].sh_flags & SHF_EXECINSTR &&
793 pi->ehdr->e_entry >= sechdrs[i].sh_addr &&
794 pi->ehdr->e_entry < (sechdrs[i].sh_addr
795 + sechdrs[i].sh_size)) {
796 kbuf->image->start -= sechdrs[i].sh_addr;
797 kbuf->image->start += curr_load_addr
> 798 }
799
800 /* Store load address and source address of section */
801 sechdrs[i].sh_addr = curr_load_addr;
802
803 /*
804 * This section got copied to temporary buffer. Update
805 * ->sh_offset accordingly.
806 */
807 sechdrs[i].sh_offset = (unsigned long)(buf_addr + offset);
808
809 /* Advance to the next address */
810 curr_load_addr += sechdrs[i].sh_size;
811 }
812
813 return 0;
814 }
815
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30838 bytes --]
next prev parent reply other threads:[~2018-02-28 22:49 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-26 15:16 [PATCH 00/11] kexec_file: Clean up purgatory load Philipp Rudo
2018-02-26 15:16 ` [PATCH 01/11] kexec_file: Silence compile warnings Philipp Rudo
2018-02-26 15:16 ` [PATCH 02/11] kexec_file: Remove checks in kexec_purgatory_load Philipp Rudo
2018-02-26 15:16 ` [PATCH 03/11] kexec_file: Make purgatory_info->ehdr const Philipp Rudo
2018-02-26 15:16 ` [PATCH 04/11] kexec_file: Search symbols in read-only kexec_purgatory Philipp Rudo
2018-02-26 15:16 ` [PATCH 05/11] kexec_file: Use read-only sections in arch_kexec_apply_relocations* Philipp Rudo
2018-02-28 15:37 ` kbuild test robot
2018-02-28 16:32 ` kbuild test robot
2018-02-26 15:16 ` [PATCH 06/11] kexec_file: Split up __kexec_load_puragory Philipp Rudo
2018-02-26 15:16 ` [PATCH 07/11] kexec_file: Simplify kexec_purgatory_setup_sechdrs 1 Philipp Rudo
2018-02-28 22:49 ` kbuild test robot [this message]
2018-02-26 15:16 ` [PATCH 08/11] kexec_file: Simplify kexec_purgatory_setup_sechdrs 2 Philipp Rudo
2018-03-09 3:18 ` Dave Young
2018-03-09 9:54 ` Philipp Rudo
2018-02-26 15:16 ` [PATCH 09/11] kexec_file: Remove mis-use of sh_offset field Philipp Rudo
2018-03-09 3:14 ` Dave Young
2018-03-09 10:02 ` Philipp Rudo
2018-03-12 7:42 ` Dave Young
2018-03-12 9:42 ` Philipp Rudo
2018-02-26 15:16 ` [PATCH 10/11] kexec_file: Allow archs to set purgatory load address Philipp Rudo
2018-02-28 15:50 ` kbuild test robot
2018-02-28 16:02 ` kbuild test robot
2018-02-26 15:16 ` [PATCH 11/11] kexec_file: Move purgatories sha256 to common code Philipp Rudo
2018-03-09 4:43 ` Dave Young
2018-03-09 10:11 ` Philipp Rudo
2018-03-09 5:19 ` [PATCH 00/11] kexec_file: Clean up purgatory load Dave Young
2018-03-09 5:33 ` Dave Young
2018-03-09 10:13 ` Philipp Rudo
2018-03-09 14:25 ` Philipp Rudo
2018-03-12 7:40 ` Dave Young
2018-03-14 9:51 ` Philipp Rudo
2018-03-15 7:34 ` Dave Young
2018-03-15 10:13 ` Philipp Rudo
2018-03-16 6:41 ` Dave Young
2018-03-20 9:39 ` Philipp Rudo
2018-03-20 9:49 ` Dave Young
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=201803010616.VP399fem%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=bauerman@linux.vnet.ibm.com \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=heiko.carstens@de.ibm.com \
--cc=kbuild-all@01.org \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mpe@ellerman.id.au \
--cc=prudo@linux.vnet.ibm.com \
--cc=schwidefsky@de.ibm.com \
--cc=takahiro.akashi@linaro.org \
--cc=vgoyal@redhat.com \
--cc=x86@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 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).