All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] KVM: PPC: Book3S: Ratelimit copy data failure error messages
@ 2017-02-16 17:22 ` Vipin K Parashar
  0 siblings, 0 replies; 8+ messages in thread
From: Vipin K Parashar @ 2017-02-16 17:10 UTC (permalink / raw)
  To: kvm-ppc; +Cc: linuxppc-dev, kvm

kvm_ppc_mmu_book3s_32/64 xlat() logs "KVM can't copy data" error
upon failing to copy user data to kernel space. This floods kernel
log once such fails occur in short time period. Ratelimit this
error to avoid flooding kernel logs upon copy data failures.

Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
---
 arch/powerpc/kvm/book3s_32_mmu.c | 3 ++-
 arch/powerpc/kvm/book3s_64_mmu.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_32_mmu.c b/arch/powerpc/kvm/book3s_32_mmu.c
index a2eb6d3..1992676 100644
--- a/arch/powerpc/kvm/book3s_32_mmu.c
+++ b/arch/powerpc/kvm/book3s_32_mmu.c
@@ -224,7 +224,8 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr,
 	ptem = kvmppc_mmu_book3s_32_get_ptem(sre, eaddr, primary);
 
 	if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
-		printk(KERN_ERR "KVM: Can't copy data from 0x%lx!\n", ptegp);
+		printk_ratelimited(KERN_ERR
+			"KVM: Can't copy data from 0x%lx!\n", ptegp);
 		goto no_page_found;
 	}
 
diff --git a/arch/powerpc/kvm/book3s_64_mmu.c b/arch/powerpc/kvm/book3s_64_mmu.c
index b9131aa..7015357 100644
--- a/arch/powerpc/kvm/book3s_64_mmu.c
+++ b/arch/powerpc/kvm/book3s_64_mmu.c
@@ -265,7 +265,8 @@ static int kvmppc_mmu_book3s_64_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
 		goto no_page_found;
 
 	if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
-		printk(KERN_ERR "KVM can't copy data from 0x%lx!\n", ptegp);
+		printk_ratelimited(KERN_ERR
+			"KVM: Can't copy data from 0x%lx!\n", ptegp);
 		goto no_page_found;
 	}
 
-- 
2.7.4

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

* [PATCH v2] KVM: PPC: Book3S: Ratelimit copy data failure error messages
@ 2017-02-16 17:22 ` Vipin K Parashar
  0 siblings, 0 replies; 8+ messages in thread
From: Vipin K Parashar @ 2017-02-16 17:22 UTC (permalink / raw)
  To: kvm-ppc; +Cc: linuxppc-dev, kvm

kvm_ppc_mmu_book3s_32/64 xlat() logs "KVM can't copy data" error
upon failing to copy user data to kernel space. This floods kernel
log once such fails occur in short time period. Ratelimit this
error to avoid flooding kernel logs upon copy data failures.

Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
---
 arch/powerpc/kvm/book3s_32_mmu.c | 3 ++-
 arch/powerpc/kvm/book3s_64_mmu.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_32_mmu.c b/arch/powerpc/kvm/book3s_32_mmu.c
index a2eb6d3..1992676 100644
--- a/arch/powerpc/kvm/book3s_32_mmu.c
+++ b/arch/powerpc/kvm/book3s_32_mmu.c
@@ -224,7 +224,8 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr,
 	ptem = kvmppc_mmu_book3s_32_get_ptem(sre, eaddr, primary);
 
 	if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
-		printk(KERN_ERR "KVM: Can't copy data from 0x%lx!\n", ptegp);
+		printk_ratelimited(KERN_ERR
+			"KVM: Can't copy data from 0x%lx!\n", ptegp);
 		goto no_page_found;
 	}
 
diff --git a/arch/powerpc/kvm/book3s_64_mmu.c b/arch/powerpc/kvm/book3s_64_mmu.c
index b9131aa..7015357 100644
--- a/arch/powerpc/kvm/book3s_64_mmu.c
+++ b/arch/powerpc/kvm/book3s_64_mmu.c
@@ -265,7 +265,8 @@ static int kvmppc_mmu_book3s_64_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
 		goto no_page_found;
 
 	if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
-		printk(KERN_ERR "KVM can't copy data from 0x%lx!\n", ptegp);
+		printk_ratelimited(KERN_ERR
+			"KVM: Can't copy data from 0x%lx!\n", ptegp);
 		goto no_page_found;
 	}
 
-- 
2.7.4


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

* Re: [PATCH v2] KVM: PPC: Book3S: Ratelimit copy data failure error messages
  2017-02-16 17:22 ` Vipin K Parashar
@ 2017-02-23  9:26   ` Vipin K Parashar
  -1 siblings, 0 replies; 8+ messages in thread
From: Vipin K Parashar @ 2017-02-23  9:14 UTC (permalink / raw)
  To: kvm-ppc; +Cc: linuxppc-dev, kvm

This patch uses "printk_ratelimited" in place of
"printk_ratelimit" used in v1


On Thursday 16 February 2017 10:40 PM, Vipin K Parashar wrote:
> kvm_ppc_mmu_book3s_32/64 xlat() logs "KVM can't copy data" error
> upon failing to copy user data to kernel space. This floods kernel
> log once such fails occur in short time period. Ratelimit this
> error to avoid flooding kernel logs upon copy data failures.
>
> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
> ---
>   arch/powerpc/kvm/book3s_32_mmu.c | 3 ++-
>   arch/powerpc/kvm/book3s_64_mmu.c | 3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s_32_mmu.c b/arch/powerpc/kvm/book3s_32_mmu.c
> index a2eb6d3..1992676 100644
> --- a/arch/powerpc/kvm/book3s_32_mmu.c
> +++ b/arch/powerpc/kvm/book3s_32_mmu.c
> @@ -224,7 +224,8 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr,
>   	ptem = kvmppc_mmu_book3s_32_get_ptem(sre, eaddr, primary);
>
>   	if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
> -		printk(KERN_ERR "KVM: Can't copy data from 0x%lx!\n", ptegp);
> +		printk_ratelimited(KERN_ERR
> +			"KVM: Can't copy data from 0x%lx!\n", ptegp);
>   		goto no_page_found;
>   	}
>
> diff --git a/arch/powerpc/kvm/book3s_64_mmu.c b/arch/powerpc/kvm/book3s_64_mmu.c
> index b9131aa..7015357 100644
> --- a/arch/powerpc/kvm/book3s_64_mmu.c
> +++ b/arch/powerpc/kvm/book3s_64_mmu.c
> @@ -265,7 +265,8 @@ static int kvmppc_mmu_book3s_64_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
>   		goto no_page_found;
>
>   	if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
> -		printk(KERN_ERR "KVM can't copy data from 0x%lx!\n", ptegp);
> +		printk_ratelimited(KERN_ERR
> +			"KVM: Can't copy data from 0x%lx!\n", ptegp);
>   		goto no_page_found;
>   	}
>

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

* Re: [PATCH v2] KVM: PPC: Book3S: Ratelimit copy data failure error messages
@ 2017-02-23  9:26   ` Vipin K Parashar
  0 siblings, 0 replies; 8+ messages in thread
From: Vipin K Parashar @ 2017-02-23  9:26 UTC (permalink / raw)
  To: kvm-ppc; +Cc: linuxppc-dev, kvm

This patch uses "printk_ratelimited" in place of
"printk_ratelimit" used in v1


On Thursday 16 February 2017 10:40 PM, Vipin K Parashar wrote:
> kvm_ppc_mmu_book3s_32/64 xlat() logs "KVM can't copy data" error
> upon failing to copy user data to kernel space. This floods kernel
> log once such fails occur in short time period. Ratelimit this
> error to avoid flooding kernel logs upon copy data failures.
>
> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
> ---
>   arch/powerpc/kvm/book3s_32_mmu.c | 3 ++-
>   arch/powerpc/kvm/book3s_64_mmu.c | 3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s_32_mmu.c b/arch/powerpc/kvm/book3s_32_mmu.c
> index a2eb6d3..1992676 100644
> --- a/arch/powerpc/kvm/book3s_32_mmu.c
> +++ b/arch/powerpc/kvm/book3s_32_mmu.c
> @@ -224,7 +224,8 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr,
>   	ptem = kvmppc_mmu_book3s_32_get_ptem(sre, eaddr, primary);
>
>   	if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
> -		printk(KERN_ERR "KVM: Can't copy data from 0x%lx!\n", ptegp);
> +		printk_ratelimited(KERN_ERR
> +			"KVM: Can't copy data from 0x%lx!\n", ptegp);
>   		goto no_page_found;
>   	}
>
> diff --git a/arch/powerpc/kvm/book3s_64_mmu.c b/arch/powerpc/kvm/book3s_64_mmu.c
> index b9131aa..7015357 100644
> --- a/arch/powerpc/kvm/book3s_64_mmu.c
> +++ b/arch/powerpc/kvm/book3s_64_mmu.c
> @@ -265,7 +265,8 @@ static int kvmppc_mmu_book3s_64_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
>   		goto no_page_found;
>
>   	if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
> -		printk(KERN_ERR "KVM can't copy data from 0x%lx!\n", ptegp);
> +		printk_ratelimited(KERN_ERR
> +			"KVM: Can't copy data from 0x%lx!\n", ptegp);
>   		goto no_page_found;
>   	}
>


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

* Re: [PATCH v2] KVM: PPC: Book3S: Ratelimit copy data failure error messages
  2017-02-16 17:22 ` Vipin K Parashar
@ 2017-02-23 10:08   ` Balbir Singh
  -1 siblings, 0 replies; 8+ messages in thread
From: Balbir Singh @ 2017-02-23 10:08 UTC (permalink / raw)
  To: Vipin K Parashar, kvm-ppc; +Cc: linuxppc-dev, kvm



On 17/02/17 04:10, Vipin K Parashar wrote:
> kvm_ppc_mmu_book3s_32/64 xlat() logs "KVM can't copy data" error
> upon failing to copy user data to kernel space. This floods kernel
> log once such fails occur in short time period. Ratelimit this
> error to avoid flooding kernel logs upon copy data failures.
> 
> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
> ---

What causes the flooding, can it be triggered on demand from user
space? I presume you'll need to have permissions to /dev/kvm to
trigger it? Could you clarify the scope, is it just called
during emulation with KVM_PR?

Balbir Singh.

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

* Re: [PATCH v2] KVM: PPC: Book3S: Ratelimit copy data failure error messages
@ 2017-02-23 10:08   ` Balbir Singh
  0 siblings, 0 replies; 8+ messages in thread
From: Balbir Singh @ 2017-02-23 10:08 UTC (permalink / raw)
  To: Vipin K Parashar, kvm-ppc; +Cc: linuxppc-dev, kvm



On 17/02/17 04:10, Vipin K Parashar wrote:
> kvm_ppc_mmu_book3s_32/64 xlat() logs "KVM can't copy data" error
> upon failing to copy user data to kernel space. This floods kernel
> log once such fails occur in short time period. Ratelimit this
> error to avoid flooding kernel logs upon copy data failures.
> 
> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
> ---

What causes the flooding, can it be triggered on demand from user
space? I presume you'll need to have permissions to /dev/kvm to
trigger it? Could you clarify the scope, is it just called
during emulation with KVM_PR?

Balbir Singh.

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

* Re: [PATCH v2] KVM: PPC: Book3S: Ratelimit copy data failure error messages
  2017-02-16 17:22 ` Vipin K Parashar
@ 2017-02-23 10:08   ` Balbir Singh
  -1 siblings, 0 replies; 8+ messages in thread
From: Balbir Singh @ 2017-02-23 10:08 UTC (permalink / raw)
  To: Vipin K Parashar, kvm-ppc; +Cc: linuxppc-dev, kvm



On 17/02/17 04:10, Vipin K Parashar wrote:
> kvm_ppc_mmu_book3s_32/64 xlat() logs "KVM can't copy data" error
> upon failing to copy user data to kernel space. This floods kernel
> log once such fails occur in short time period. Ratelimit this
> error to avoid flooding kernel logs upon copy data failures.
> 
> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
> ---

What causes the flooding, can it be triggered on demand from user
space? I presume you'll need to have permissions to /dev/kvm to
trigger it? Could you clarify the scope, is it just called
during emulation with KVM_PR?

Balbir Singh.

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

* Re: [PATCH v2] KVM: PPC: Book3S: Ratelimit copy data failure error messages
@ 2017-02-23 10:08   ` Balbir Singh
  0 siblings, 0 replies; 8+ messages in thread
From: Balbir Singh @ 2017-02-23 10:08 UTC (permalink / raw)
  To: Vipin K Parashar, kvm-ppc; +Cc: linuxppc-dev, kvm



On 17/02/17 04:10, Vipin K Parashar wrote:
> kvm_ppc_mmu_book3s_32/64 xlat() logs "KVM can't copy data" error
> upon failing to copy user data to kernel space. This floods kernel
> log once such fails occur in short time period. Ratelimit this
> error to avoid flooding kernel logs upon copy data failures.
> 
> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
> ---

What causes the flooding, can it be triggered on demand from user
space? I presume you'll need to have permissions to /dev/kvm to
trigger it? Could you clarify the scope, is it just called
during emulation with KVM_PR?

Balbir Singh.

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

end of thread, other threads:[~2017-02-23 10:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 17:10 [PATCH v2] KVM: PPC: Book3S: Ratelimit copy data failure error messages Vipin K Parashar
2017-02-16 17:22 ` Vipin K Parashar
2017-02-23  9:14 ` Vipin K Parashar
2017-02-23  9:26   ` Vipin K Parashar
2017-02-23 10:08 ` Balbir Singh
2017-02-23 10:08   ` Balbir Singh
2017-02-23 10:08 ` Balbir Singh
2017-02-23 10:08   ` Balbir Singh

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.