Linux virtualization list
 help / color / mirror / Atom feed
* [PATCH] vhost: use pr_err for vq_err
@ 2024-05-16  7:46 Peng Fan (OSS)
  2024-05-16 12:33 ` Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan (OSS) @ 2024-05-16  7:46 UTC (permalink / raw)
  To: mst, jasowang, virtualization, eperezma
  Cc: linux-kernel, kvm, netdev, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Use pr_err to print out error message without enabling DEBUG. This could
make people catch error easier.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/vhost/vhost.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index bb75a292d50c..0bff436d1ce9 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -248,7 +248,7 @@ void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,
 			  struct vhost_iotlb_map *map);
 
 #define vq_err(vq, fmt, ...) do {                                  \
-		pr_debug(pr_fmt(fmt), ##__VA_ARGS__);       \
+		pr_err(pr_fmt(fmt), ##__VA_ARGS__);       \
 		if ((vq)->error_ctx)                               \
 				eventfd_signal((vq)->error_ctx);\
 	} while (0)
-- 
2.37.1


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

* Re: [PATCH] vhost: use pr_err for vq_err
  2024-05-16  7:46 [PATCH] vhost: use pr_err for vq_err Peng Fan (OSS)
@ 2024-05-16 12:33 ` Michael S. Tsirkin
  2024-05-16 12:36   ` Peng Fan
  0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2024-05-16 12:33 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: jasowang, virtualization, eperezma, linux-kernel, kvm, netdev,
	Peng Fan

On Thu, May 16, 2024 at 03:46:29PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Use pr_err to print out error message without enabling DEBUG. This could
> make people catch error easier.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

This isn't appropriate: pr_err must not be triggerable
by userspace. If you are debugging userspace, use a debugging
kernel, it's that simple.


> ---
>  drivers/vhost/vhost.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
> index bb75a292d50c..0bff436d1ce9 100644
> --- a/drivers/vhost/vhost.h
> +++ b/drivers/vhost/vhost.h
> @@ -248,7 +248,7 @@ void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,
>  			  struct vhost_iotlb_map *map);
>  
>  #define vq_err(vq, fmt, ...) do {                                  \
> -		pr_debug(pr_fmt(fmt), ##__VA_ARGS__);       \
> +		pr_err(pr_fmt(fmt), ##__VA_ARGS__);       \
>  		if ((vq)->error_ctx)                               \
>  				eventfd_signal((vq)->error_ctx);\
>  	} while (0)
> -- 
> 2.37.1


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

* RE: [PATCH] vhost: use pr_err for vq_err
  2024-05-16 12:33 ` Michael S. Tsirkin
@ 2024-05-16 12:36   ` Peng Fan
  0 siblings, 0 replies; 3+ messages in thread
From: Peng Fan @ 2024-05-16 12:36 UTC (permalink / raw)
  To: Michael S. Tsirkin, Peng Fan (OSS)
  Cc: jasowang@redhat.com, virtualization@lists.linux-foundation.org,
	eperezma@redhat.com, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, netdev@vger.kernel.org

> Subject: Re: [PATCH] vhost: use pr_err for vq_err
> 
> On Thu, May 16, 2024 at 03:46:29PM +0800, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Use pr_err to print out error message without enabling DEBUG. This
> > could make people catch error easier.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> 
> This isn't appropriate: pr_err must not be triggerable by userspace. If you are
> debugging userspace, use a debugging kernel, it's that simple.

I see, then drop this patch.

Thanks,
Peng.
> 
> 
> > ---
> >  drivers/vhost/vhost.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index
> > bb75a292d50c..0bff436d1ce9 100644
> > --- a/drivers/vhost/vhost.h
> > +++ b/drivers/vhost/vhost.h
> > @@ -248,7 +248,7 @@ void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,
> >  			  struct vhost_iotlb_map *map);
> >
> >  #define vq_err(vq, fmt, ...) do {                                  \
> > -		pr_debug(pr_fmt(fmt), ##__VA_ARGS__);       \
> > +		pr_err(pr_fmt(fmt), ##__VA_ARGS__);       \
> >  		if ((vq)->error_ctx)                               \
> >  				eventfd_signal((vq)->error_ctx);\
> >  	} while (0)
> > --
> > 2.37.1


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

end of thread, other threads:[~2024-05-16 12:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16  7:46 [PATCH] vhost: use pr_err for vq_err Peng Fan (OSS)
2024-05-16 12:33 ` Michael S. Tsirkin
2024-05-16 12:36   ` Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox