linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Balbir Singh <sblbir@amazon.com>,
	tglx@linutronix.de, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, jpoimboe@redhat.com,
	tony.luck@intel.com, keescook@chromium.org,
	benh@kernel.crashing.org, x86@kernel.org, dave.hansen@intel.com,
	thomas.lendacky@amd.com, Balbir Singh <sblbir@amazon.com>
Subject: Re: [PATCH v5 4/6] arch/x86/kvm: Refactor L1D flushing
Date: Tue, 5 May 2020 21:29:04 +0800	[thread overview]
Message-ID: <202005052105.LDHP5Zeq%lkp@intel.com> (raw)
In-Reply-To: <20200504041343.9651-5-sblbir@amazon.com>

Hi Balbir,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tip/auto-latest]
[also build test WARNING on linus/master v5.7-rc4 next-20200505]
[cannot apply to kvm/linux-next tip/x86/core]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Balbir-Singh/Optionally-flush-L1D-on-context-switch/20200505-044116
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 9a31ac1743a00b816d5393acf61ce16713d319a1

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

>> arch/x86/kernel/l1d_flush.c:7:8: warning: Local variable 'l1d_flush_pages' shadows outer variable [shadowVariable]
    void *l1d_flush_pages = NULL;
          ^
   arch/x86/kernel/l1d_flush.c:83:14: note: Shadowed declaration
   static void *l1d_flush_pages;
                ^
   arch/x86/kernel/l1d_flush.c:7:8: note: Shadow variable
    void *l1d_flush_pages = NULL;
          ^

vim +/l1d_flush_pages +7 arch/x86/kernel/l1d_flush.c

5228007f200e15 Balbir Singh 2020-05-04   3  
604f3d173bf63d Balbir Singh 2020-05-04   4  static void *l1d_flush_alloc_pages(void)
5228007f200e15 Balbir Singh 2020-05-04   5  {
5228007f200e15 Balbir Singh 2020-05-04   6  	struct page *page;
5228007f200e15 Balbir Singh 2020-05-04  @7  	void *l1d_flush_pages = NULL;
5228007f200e15 Balbir Singh 2020-05-04   8  	int i;
5228007f200e15 Balbir Singh 2020-05-04   9  
5228007f200e15 Balbir Singh 2020-05-04  10  	/*
5228007f200e15 Balbir Singh 2020-05-04  11  	 * This allocation for l1d_flush_pages is not tied to a VM/task's
5228007f200e15 Balbir Singh 2020-05-04  12  	 * lifetime and so should not be charged to a memcg.
5228007f200e15 Balbir Singh 2020-05-04  13  	 */
5228007f200e15 Balbir Singh 2020-05-04  14  	page = alloc_pages(GFP_KERNEL, L1D_CACHE_ORDER);
5228007f200e15 Balbir Singh 2020-05-04  15  	if (!page)
5228007f200e15 Balbir Singh 2020-05-04  16  		return NULL;
5228007f200e15 Balbir Singh 2020-05-04  17  	l1d_flush_pages = page_address(page);
5228007f200e15 Balbir Singh 2020-05-04  18  
5228007f200e15 Balbir Singh 2020-05-04  19  	/*
5228007f200e15 Balbir Singh 2020-05-04  20  	 * Initialize each page with a different pattern in
5228007f200e15 Balbir Singh 2020-05-04  21  	 * order to protect against KSM in the nested
5228007f200e15 Balbir Singh 2020-05-04  22  	 * virtualization case.
5228007f200e15 Balbir Singh 2020-05-04  23  	 */
5228007f200e15 Balbir Singh 2020-05-04  24  	for (i = 0; i < 1u << L1D_CACHE_ORDER; ++i) {
5228007f200e15 Balbir Singh 2020-05-04  25  		memset(l1d_flush_pages + i * PAGE_SIZE, i + 1,
5228007f200e15 Balbir Singh 2020-05-04  26  				PAGE_SIZE);
5228007f200e15 Balbir Singh 2020-05-04  27  	}
5228007f200e15 Balbir Singh 2020-05-04  28  	return l1d_flush_pages;
5228007f200e15 Balbir Singh 2020-05-04  29  }
5228007f200e15 Balbir Singh 2020-05-04  30  

:::::: The code at line 7 was first introduced by commit
:::::: 5228007f200e157bfc7a4add32def7c7f32c0550 arch/x86/kvm: Refactor l1d flush lifecycle management

:::::: TO: Balbir Singh <sblbir@amazon.com>
:::::: CC: 0day robot <lkp@intel.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

  reply	other threads:[~2020-05-05 13:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04  4:13 [PATCH v5 0/6] Optionally flush L1D on context switch Balbir Singh
2020-05-04  4:13 ` [PATCH v5 1/6] arch/x86/kvm: Refactor l1d flush lifecycle management Balbir Singh
2020-05-04  4:13 ` [PATCH v5 2/6] arch/x86/kvm: Refactor tlbflush and l1d flush Balbir Singh
2020-05-04  4:13 ` [PATCH v5 3/6] arch/x86/mm: Refactor cond_ibpb() to support other use cases Balbir Singh
2020-05-04  4:13 ` [PATCH v5 4/6] arch/x86/kvm: Refactor L1D flushing Balbir Singh
2020-05-05 13:29   ` kbuild test robot [this message]
2020-05-04  4:13 ` [PATCH v5 5/6] Optionally flush L1D on context switch Balbir Singh
2020-05-04 18:39   ` Kees Cook
2020-05-04 23:14     ` Singh, Balbir
2020-05-05 20:34       ` Kees Cook
2020-05-04  4:13 ` [PATCH v5 6/6] Documentation: Add L1D flushing Documentation Balbir Singh

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=202005052105.LDHP5Zeq%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=dave.hansen@intel.com \
    --cc=jpoimboe@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sblbir@amazon.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=tony.luck@intel.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).