All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gavin Shan <gshan@redhat.com>
To: Marc Zyngier <maz@kernel.org>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	catalin.marinas@arm.com, bgardon@google.com, shuah@kernel.org,
	andrew.jones@linux.dev, will@kernel.org, dmatlack@google.com,
	oliver.upton@linux.dev, peterx@redhat.com, pbonzini@redhat.com,
	zhenyzha@redhat.com, shan.gavin@gmail.com
Subject: Re: [PATCH v3 2/6] KVM: x86: Move declaration of kvm_cpu_dirty_log_size() to kvm_dirty_ring.h
Date: Mon, 26 Sep 2022 09:09:34 +1000	[thread overview]
Message-ID: <b226886c-3fc3-8f31-2e91-c4a6e1865097@redhat.com> (raw)
In-Reply-To: <877d1sio31.wl-maz@kernel.org>

Hi Marc,

On 9/25/22 5:12 AM, Marc Zyngier wrote:
> On Thu, 22 Sep 2022 01:32:10 +0100,
> Gavin Shan <gshan@redhat.com> wrote:
>>
>> Not all architectures like ARM64 need to override the function. Move
>> its declaration to kvm_dirty_ring.h to avoid the following compiling
>> warning on ARM64 when the feature is enabled.
>>
>>    arch/arm64/kvm/../../../virt/kvm/dirty_ring.c:14:12:        \
>>    warning: no previous prototype for 'kvm_cpu_dirty_log_size' \
>>    [-Wmissing-prototypes]                                      \
>>    int __weak kvm_cpu_dirty_log_size(void)
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Gavin Shan <gshan@redhat.com>
>> ---
>>   arch/x86/include/asm/kvm_host.h | 2 --
>>   arch/x86/kvm/mmu/mmu.c          | 2 ++
>>   include/linux/kvm_dirty_ring.h  | 1 +
>>   3 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
>> index 2c96c43c313a..4c0fd517282b 100644
>> --- a/arch/x86/include/asm/kvm_host.h
>> +++ b/arch/x86/include/asm/kvm_host.h
>> @@ -2082,8 +2082,6 @@ static inline int kvm_cpu_get_apicid(int mps_cpu)
>>   #define GET_SMSTATE(type, buf, offset)		\
>>   	(*(type *)((buf) + (offset) - 0x7e00))
>>   
>> -int kvm_cpu_dirty_log_size(void);
>> -
>>   int memslot_rmap_alloc(struct kvm_memory_slot *slot, unsigned long npages);
>>   
>>   #define KVM_CLOCK_VALID_FLAGS						\
>> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
>> index e418ef3ecfcb..b3eb6a3627ec 100644
>> --- a/arch/x86/kvm/mmu/mmu.c
>> +++ b/arch/x86/kvm/mmu/mmu.c
>> @@ -1349,10 +1349,12 @@ void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm,
>>   		kvm_mmu_write_protect_pt_masked(kvm, slot, gfn_offset, mask);
>>   }
>>   
>> +#ifdef CONFIG_HAVE_KVM_DIRTY_RING
> 
> I think you can drop the ifdeffery, as HAVE_KVM_DIRTY_RING is
> unconditionally selected by the arch Kconfig.
> 

Yeah, I think so. Lets drop it in v4, which will be rebased on top
of your v2 series.

>>   int kvm_cpu_dirty_log_size(void)
>>   {
>>   	return kvm_x86_ops.cpu_dirty_log_size;
>>   }
>> +#endif
>>   
>>   bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm,
>>   				    struct kvm_memory_slot *slot, u64 gfn,
>> diff --git a/include/linux/kvm_dirty_ring.h b/include/linux/kvm_dirty_ring.h
>> index 906f899813dc..8c6755981c9b 100644
>> --- a/include/linux/kvm_dirty_ring.h
>> +++ b/include/linux/kvm_dirty_ring.h
>> @@ -71,6 +71,7 @@ static inline bool kvm_dirty_ring_soft_full(struct kvm_dirty_ring *ring)
>>   
>>   #else /* CONFIG_HAVE_KVM_DIRTY_RING */
>>   
>> +int kvm_cpu_dirty_log_size(void);
>>   u32 kvm_dirty_ring_get_rsvd_entries(void);
>>   int kvm_dirty_ring_alloc(struct kvm_dirty_ring *ring, int index, u32 size);
> 

Thanks,
Gavin


WARNING: multiple messages have this Message-ID (diff)
From: Gavin Shan <gshan@redhat.com>
To: Marc Zyngier <maz@kernel.org>
Cc: kvm@vger.kernel.org, catalin.marinas@arm.com,
	andrew.jones@linux.dev, will@kernel.org, shan.gavin@gmail.com,
	bgardon@google.com, dmatlack@google.com, pbonzini@redhat.com,
	zhenyzha@redhat.com, shuah@kernel.org,
	kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH v3 2/6] KVM: x86: Move declaration of kvm_cpu_dirty_log_size() to kvm_dirty_ring.h
Date: Mon, 26 Sep 2022 09:09:34 +1000	[thread overview]
Message-ID: <b226886c-3fc3-8f31-2e91-c4a6e1865097@redhat.com> (raw)
In-Reply-To: <877d1sio31.wl-maz@kernel.org>

Hi Marc,

On 9/25/22 5:12 AM, Marc Zyngier wrote:
> On Thu, 22 Sep 2022 01:32:10 +0100,
> Gavin Shan <gshan@redhat.com> wrote:
>>
>> Not all architectures like ARM64 need to override the function. Move
>> its declaration to kvm_dirty_ring.h to avoid the following compiling
>> warning on ARM64 when the feature is enabled.
>>
>>    arch/arm64/kvm/../../../virt/kvm/dirty_ring.c:14:12:        \
>>    warning: no previous prototype for 'kvm_cpu_dirty_log_size' \
>>    [-Wmissing-prototypes]                                      \
>>    int __weak kvm_cpu_dirty_log_size(void)
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Gavin Shan <gshan@redhat.com>
>> ---
>>   arch/x86/include/asm/kvm_host.h | 2 --
>>   arch/x86/kvm/mmu/mmu.c          | 2 ++
>>   include/linux/kvm_dirty_ring.h  | 1 +
>>   3 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
>> index 2c96c43c313a..4c0fd517282b 100644
>> --- a/arch/x86/include/asm/kvm_host.h
>> +++ b/arch/x86/include/asm/kvm_host.h
>> @@ -2082,8 +2082,6 @@ static inline int kvm_cpu_get_apicid(int mps_cpu)
>>   #define GET_SMSTATE(type, buf, offset)		\
>>   	(*(type *)((buf) + (offset) - 0x7e00))
>>   
>> -int kvm_cpu_dirty_log_size(void);
>> -
>>   int memslot_rmap_alloc(struct kvm_memory_slot *slot, unsigned long npages);
>>   
>>   #define KVM_CLOCK_VALID_FLAGS						\
>> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
>> index e418ef3ecfcb..b3eb6a3627ec 100644
>> --- a/arch/x86/kvm/mmu/mmu.c
>> +++ b/arch/x86/kvm/mmu/mmu.c
>> @@ -1349,10 +1349,12 @@ void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm,
>>   		kvm_mmu_write_protect_pt_masked(kvm, slot, gfn_offset, mask);
>>   }
>>   
>> +#ifdef CONFIG_HAVE_KVM_DIRTY_RING
> 
> I think you can drop the ifdeffery, as HAVE_KVM_DIRTY_RING is
> unconditionally selected by the arch Kconfig.
> 

Yeah, I think so. Lets drop it in v4, which will be rebased on top
of your v2 series.

>>   int kvm_cpu_dirty_log_size(void)
>>   {
>>   	return kvm_x86_ops.cpu_dirty_log_size;
>>   }
>> +#endif
>>   
>>   bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm,
>>   				    struct kvm_memory_slot *slot, u64 gfn,
>> diff --git a/include/linux/kvm_dirty_ring.h b/include/linux/kvm_dirty_ring.h
>> index 906f899813dc..8c6755981c9b 100644
>> --- a/include/linux/kvm_dirty_ring.h
>> +++ b/include/linux/kvm_dirty_ring.h
>> @@ -71,6 +71,7 @@ static inline bool kvm_dirty_ring_soft_full(struct kvm_dirty_ring *ring)
>>   
>>   #else /* CONFIG_HAVE_KVM_DIRTY_RING */
>>   
>> +int kvm_cpu_dirty_log_size(void);
>>   u32 kvm_dirty_ring_get_rsvd_entries(void);
>>   int kvm_dirty_ring_alloc(struct kvm_dirty_ring *ring, int index, u32 size);
> 

Thanks,
Gavin

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  reply	other threads:[~2022-09-25 23:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  0:32 [PATCH v3 0/6] KVM: arm64: Enable ring-based dirty memory tracking Gavin Shan
2022-09-22  0:32 ` Gavin Shan
2022-09-22  0:32 ` [PATCH v3 1/6] KVM: x86: Introduce KVM_REQ_RING_SOFT_FULL Gavin Shan
2022-09-22  0:32   ` Gavin Shan
2022-09-22  0:32 ` [PATCH v3 2/6] KVM: x86: Move declaration of kvm_cpu_dirty_log_size() to kvm_dirty_ring.h Gavin Shan
2022-09-22  0:32   ` Gavin Shan
2022-09-24 19:12   ` Marc Zyngier
2022-09-24 19:12     ` Marc Zyngier
2022-09-25 23:09     ` Gavin Shan [this message]
2022-09-25 23:09       ` Gavin Shan
2022-09-22  0:32 ` [PATCH v3 3/6] KVM: arm64: Enable ring-based dirty memory tracking Gavin Shan
2022-09-22  0:32   ` Gavin Shan
2022-09-24 20:27   ` Marc Zyngier
2022-09-24 20:27     ` Marc Zyngier
2022-09-25 23:13     ` Gavin Shan
2022-09-25 23:13       ` Gavin Shan
2022-09-22  0:32 ` [PATCH v3 4/6] KVM: selftests: Use host page size to map ring buffer in dirty_log_test Gavin Shan
2022-09-22  0:32   ` Gavin Shan
2022-09-22  0:32 ` [PATCH v3 5/6] KVM: selftests: Clear dirty ring states between two modes " Gavin Shan
2022-09-22  0:32   ` Gavin Shan
2022-09-22  0:32 ` [PATCH v3 6/6] KVM: selftests: Automate choosing dirty ring size " Gavin Shan
2022-09-22  0:32   ` Gavin Shan

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=b226886c-3fc3-8f31-2e91-c4a6e1865097@redhat.com \
    --to=gshan@redhat.com \
    --cc=andrew.jones@linux.dev \
    --cc=bgardon@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=shan.gavin@gmail.com \
    --cc=shuah@kernel.org \
    --cc=will@kernel.org \
    --cc=zhenyzha@redhat.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 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.