All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: Replace the number of page entries per page with PT64_ENT_PER_PAGE macro
@ 2016-03-01 14:49 Lan Tianyu
  2016-03-01 15:16 ` Lan, Tianyu
  2016-03-01 15:22 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Lan Tianyu @ 2016-03-01 14:49 UTC (permalink / raw)
  To: gleb, pbonzini, tglx, mingo, hpa, x86; +Cc: Lan Tianyu, kvm, linux-kernel

This patch is to make code more readable.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
 arch/x86/include/asm/kvm_host.h | 2 +-
 arch/x86/kvm/mmu.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 44adbb8..b91a08a 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -265,7 +265,7 @@ struct kvm_mmu_page {
 	/* The page is obsolete if mmu_valid_gen != kvm->arch.mmu_valid_gen.  */
 	unsigned long mmu_valid_gen;
 
-	DECLARE_BITMAP(unsync_child_bitmap, 512);
+	DECLARE_BITMAP(unsync_child_bitmap, PT64_ENT_PER_PAGE);
 
 #ifdef CONFIG_X86_32
 	/*
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 95a955d..d51441b 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1806,7 +1806,7 @@ static int __mmu_unsync_walk(struct kvm_mmu_page *sp,
 {
 	int i, ret, nr_unsync_leaf = 0;
 
-	for_each_set_bit(i, sp->unsync_child_bitmap, 512) {
+	for_each_set_bit(i, sp->unsync_child_bitmap, PT64_ENT_PER_PAGE) {
 		struct kvm_mmu_page *child;
 		u64 ent = sp->spt[i];
 
-- 
1.8.4.rc0.1.g8f6a3e5.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: Replace the number of page entries per page with PT64_ENT_PER_PAGE macro
  2016-03-01 14:49 [PATCH] KVM: Replace the number of page entries per page with PT64_ENT_PER_PAGE macro Lan Tianyu
@ 2016-03-01 15:16 ` Lan, Tianyu
  2016-03-01 15:22 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: Lan, Tianyu @ 2016-03-01 15:16 UTC (permalink / raw)
  To: gleb, pbonzini, tglx, mingo, hpa, x86; +Cc: kvm, linux-kernel

Sorry. Miss some other modifications and please ignore this version.

On 3/1/2016 10:49 PM, Lan Tianyu wrote:
> This patch is to make code more readable.
>
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
> ---
>   arch/x86/include/asm/kvm_host.h | 2 +-
>   arch/x86/kvm/mmu.c              | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index 44adbb8..b91a08a 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -265,7 +265,7 @@ struct kvm_mmu_page {
>   	/* The page is obsolete if mmu_valid_gen != kvm->arch.mmu_valid_gen.  */
>   	unsigned long mmu_valid_gen;
>
> -	DECLARE_BITMAP(unsync_child_bitmap, 512);
> +	DECLARE_BITMAP(unsync_child_bitmap, PT64_ENT_PER_PAGE);
>
>   #ifdef CONFIG_X86_32
>   	/*
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 95a955d..d51441b 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -1806,7 +1806,7 @@ static int __mmu_unsync_walk(struct kvm_mmu_page *sp,
>   {
>   	int i, ret, nr_unsync_leaf = 0;
>
> -	for_each_set_bit(i, sp->unsync_child_bitmap, 512) {
> +	for_each_set_bit(i, sp->unsync_child_bitmap, PT64_ENT_PER_PAGE) {
>   		struct kvm_mmu_page *child;
>   		u64 ent = sp->spt[i];
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: Replace the number of page entries per page with PT64_ENT_PER_PAGE macro
  2016-03-01 14:49 [PATCH] KVM: Replace the number of page entries per page with PT64_ENT_PER_PAGE macro Lan Tianyu
  2016-03-01 15:16 ` Lan, Tianyu
@ 2016-03-01 15:22 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2016-03-01 15:22 UTC (permalink / raw)
  To: Lan Tianyu
  Cc: kbuild-all, gleb, pbonzini, tglx, mingo, hpa, x86, Lan Tianyu,
	kvm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2168 bytes --]

Hi Lan,

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on v4.5-rc6 next-20160301]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Lan-Tianyu/KVM-Replace-the-number-of-page-entries-per-page-with-PT64_ENT_PER_PAGE-macro/20160301-230910
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-randconfig-x013-201609 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/list.h:8:0,
                    from include/linux/preempt.h:10,
                    from include/linux/hardirq.h:4,
                    from include/linux/kvm_host.h:10,
                    from arch/x86/kvm/../../../virt/kvm/kvm_main.c:21:
>> arch/x86/include/asm/kvm_host.h:268:38: error: 'PT64_ENT_PER_PAGE' undeclared here (not in a function)
     DECLARE_BITMAP(unsync_child_bitmap, PT64_ENT_PER_PAGE);
                                         ^
   include/linux/kernel.h:67:30: note: in definition of macro 'DIV_ROUND_UP'
    #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
                                 ^
   include/linux/types.h:10:21: note: in expansion of macro 'BITS_TO_LONGS'
     unsigned long name[BITS_TO_LONGS(bits)]
                        ^
>> arch/x86/include/asm/kvm_host.h:268:2: note: in expansion of macro 'DECLARE_BITMAP'
     DECLARE_BITMAP(unsync_child_bitmap, PT64_ENT_PER_PAGE);
     ^

vim +/PT64_ENT_PER_PAGE +268 arch/x86/include/asm/kvm_host.h

   262		unsigned int unsync_children;
   263		struct kvm_rmap_head parent_ptes; /* rmap pointers to parent sptes */
   264	
   265		/* The page is obsolete if mmu_valid_gen != kvm->arch.mmu_valid_gen.  */
   266		unsigned long mmu_valid_gen;
   267	
 > 268		DECLARE_BITMAP(unsync_child_bitmap, PT64_ENT_PER_PAGE);
   269	
   270	#ifdef CONFIG_X86_32
   271		/*

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 24889 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-01 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 14:49 [PATCH] KVM: Replace the number of page entries per page with PT64_ENT_PER_PAGE macro Lan Tianyu
2016-03-01 15:16 ` Lan, Tianyu
2016-03-01 15:22 ` kbuild test robot

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.