From: kernel test robot <lkp@intel.com>
To: Justinien Bouron <jbouron@amazon.com>,
Andrew Morton <akpm@linux-foundation.org>,
Baoquan He <bhe@redhat.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Petr Mladek <pmladek@suse.com>,
Mario Limonciello <mario.limonciello@amd.com>,
Marcos Paulo de Souza <mpdesouza@suse.com>,
Alexander Graf <graf@amazon.com>,
Steven Chen <chenste@linux.microsoft.com>,
Yan Zhao <yan.y.zhao@intel.com>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Gunnar Kudrjavets <gunnarku@amazon.com>
Subject: Re: [PATCH] kexec_core: Remove superfluous page offset handling in segment loading
Date: Thu, 11 Sep 2025 21:24:23 +0800 [thread overview]
Message-ID: <202509112118.1NElSKNk-lkp@intel.com> (raw)
In-Reply-To: <20250910163116.49148-1-jbouron@amazon.com>
Hi Justinien,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.17-rc5 next-20250911]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Justinien-Bouron/kexec_core-Remove-superfluous-page-offset-handling-in-segment-loading/20250911-003354
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20250910163116.49148-1-jbouron%40amazon.com
patch subject: [PATCH] kexec_core: Remove superfluous page offset handling in segment loading
config: x86_64-buildonly-randconfig-004-20250911 (https://download.01.org/0day-ci/archive/20250911/202509112118.1NElSKNk-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250911/202509112118.1NElSKNk-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509112118.1NElSKNk-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/kexec_core.c:745:16: warning: variable 'maddr' set but not used [-Wunused-but-set-variable]
745 | unsigned long maddr;
| ^
1 warning generated.
vim +/maddr +745 kernel/kexec_core.c
2965faa5e03d1e Dave Young 2015-09-09 739
07d24902977e47 Alexander Graf 2025-06-10 740 static int kimage_load_cma_segment(struct kimage *image, int idx)
07d24902977e47 Alexander Graf 2025-06-10 741 {
07d24902977e47 Alexander Graf 2025-06-10 742 struct kexec_segment *segment = &image->segment[idx];
07d24902977e47 Alexander Graf 2025-06-10 743 struct page *cma = image->segment_cma[idx];
07d24902977e47 Alexander Graf 2025-06-10 744 char *ptr = page_address(cma);
07d24902977e47 Alexander Graf 2025-06-10 @745 unsigned long maddr;
07d24902977e47 Alexander Graf 2025-06-10 746 size_t ubytes, mbytes;
07d24902977e47 Alexander Graf 2025-06-10 747 int result = 0;
07d24902977e47 Alexander Graf 2025-06-10 748 unsigned char __user *buf = NULL;
07d24902977e47 Alexander Graf 2025-06-10 749 unsigned char *kbuf = NULL;
07d24902977e47 Alexander Graf 2025-06-10 750
07d24902977e47 Alexander Graf 2025-06-10 751 if (image->file_mode)
07d24902977e47 Alexander Graf 2025-06-10 752 kbuf = segment->kbuf;
07d24902977e47 Alexander Graf 2025-06-10 753 else
07d24902977e47 Alexander Graf 2025-06-10 754 buf = segment->buf;
07d24902977e47 Alexander Graf 2025-06-10 755 ubytes = segment->bufsz;
07d24902977e47 Alexander Graf 2025-06-10 756 mbytes = segment->memsz;
07d24902977e47 Alexander Graf 2025-06-10 757 maddr = segment->mem;
07d24902977e47 Alexander Graf 2025-06-10 758
07d24902977e47 Alexander Graf 2025-06-10 759 /* Then copy from source buffer to the CMA one */
07d24902977e47 Alexander Graf 2025-06-10 760 while (mbytes) {
07d24902977e47 Alexander Graf 2025-06-10 761 size_t uchunk, mchunk;
07d24902977e47 Alexander Graf 2025-06-10 762
b4cdefb6ef1453 Justinien Bouron 2025-09-10 763 mchunk = min_t(size_t, mbytes, PAGE_SIZE);
07d24902977e47 Alexander Graf 2025-06-10 764 uchunk = min(ubytes, mchunk);
07d24902977e47 Alexander Graf 2025-06-10 765
07d24902977e47 Alexander Graf 2025-06-10 766 if (uchunk) {
07d24902977e47 Alexander Graf 2025-06-10 767 /* For file based kexec, source pages are in kernel memory */
07d24902977e47 Alexander Graf 2025-06-10 768 if (image->file_mode)
07d24902977e47 Alexander Graf 2025-06-10 769 memcpy(ptr, kbuf, uchunk);
07d24902977e47 Alexander Graf 2025-06-10 770 else
07d24902977e47 Alexander Graf 2025-06-10 771 result = copy_from_user(ptr, buf, uchunk);
07d24902977e47 Alexander Graf 2025-06-10 772 ubytes -= uchunk;
07d24902977e47 Alexander Graf 2025-06-10 773 if (image->file_mode)
07d24902977e47 Alexander Graf 2025-06-10 774 kbuf += uchunk;
07d24902977e47 Alexander Graf 2025-06-10 775 else
07d24902977e47 Alexander Graf 2025-06-10 776 buf += uchunk;
07d24902977e47 Alexander Graf 2025-06-10 777 }
07d24902977e47 Alexander Graf 2025-06-10 778
07d24902977e47 Alexander Graf 2025-06-10 779 if (result) {
07d24902977e47 Alexander Graf 2025-06-10 780 result = -EFAULT;
07d24902977e47 Alexander Graf 2025-06-10 781 goto out;
07d24902977e47 Alexander Graf 2025-06-10 782 }
07d24902977e47 Alexander Graf 2025-06-10 783
07d24902977e47 Alexander Graf 2025-06-10 784 ptr += mchunk;
07d24902977e47 Alexander Graf 2025-06-10 785 maddr += mchunk;
07d24902977e47 Alexander Graf 2025-06-10 786 mbytes -= mchunk;
07d24902977e47 Alexander Graf 2025-06-10 787
07d24902977e47 Alexander Graf 2025-06-10 788 cond_resched();
07d24902977e47 Alexander Graf 2025-06-10 789 }
07d24902977e47 Alexander Graf 2025-06-10 790
07d24902977e47 Alexander Graf 2025-06-10 791 /* Clear any remainder */
07d24902977e47 Alexander Graf 2025-06-10 792 memset(ptr, 0, mbytes);
07d24902977e47 Alexander Graf 2025-06-10 793
07d24902977e47 Alexander Graf 2025-06-10 794 out:
07d24902977e47 Alexander Graf 2025-06-10 795 return result;
07d24902977e47 Alexander Graf 2025-06-10 796 }
07d24902977e47 Alexander Graf 2025-06-10 797
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
parent reply other threads:[~2025-09-11 13:24 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20250910163116.49148-1-jbouron@amazon.com>]
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=202509112118.1NElSKNk-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=chenste@linux.microsoft.com \
--cc=graf@amazon.com \
--cc=gunnarku@amazon.com \
--cc=jbouron@amazon.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=mario.limonciello@amd.com \
--cc=mpdesouza@suse.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pmladek@suse.com \
--cc=rafael.j.wysocki@intel.com \
--cc=yan.y.zhao@intel.com \
/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