From: "Michael S. Tsirkin" <mst@redhat.com>
To: Yufeng Wang <r4o5m6e8o@163.com>
Cc: "Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
"Yuedong Wang" <wyd20130109@163.com>
Subject: Re: [PATCH v2 2/2] tools: virtio: Fix no definition of dma_map_page_attrs
Date: Wed, 10 Dec 2025 04:00:40 -0500 [thread overview]
Message-ID: <20251210035947-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20251207142807.10808-1-r4o5m6e8o@163.com>
On Sun, Dec 07, 2025 at 10:28:07PM +0800, Yufeng Wang wrote:
> Fix tools/virtio compiler error, port over the definition
> of dma_map_page_attrs, dma_unmap_page_attrs, dev_WARN_ONCE
>
> v2: remove do {} while (0).
>
> Fixes: 447beec8065b ("virtio_ring: switch to use dma_{map|unmap}_page()")
> Signed-off-by: Yufeng Wang <r4o5m6e8o@163.com>
> Tested-by: Yuedong Wang <wyd20130109@163.com>
Can you pls check whether
https://lore.kernel.org/all/cover.1764873799.git.mst@redhat.com/
addresses the issues for you?
Thanks!
> ---
> tools/virtio/linux/dma-mapping.h | 3 +++
> tools/virtio/linux/kernel.h | 1 +
> 2 files changed, 4 insertions(+)
>
> diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h
> index 095958461788..de251a1f0c37 100644
> --- a/tools/virtio/linux/dma-mapping.h
> +++ b/tools/virtio/linux/dma-mapping.h
> @@ -22,6 +22,7 @@ enum dma_data_direction {
> #define dma_free_coherent(d, s, p, h) kfree(p)
>
> #define dma_map_page(d, p, o, s, dir) (page_to_phys(p) + (o))
> +#define dma_map_page_attrs(d, p, o, s, dir, a) (page_to_phys(p) + (o))
>
> #define dma_map_single(d, p, s, dir) (virt_to_phys(p))
> #define dma_map_single_attrs(d, p, s, dir, a) (virt_to_phys(p))
> @@ -29,6 +30,8 @@ enum dma_data_direction {
>
> #define dma_unmap_single(d, a, s, r) do { (void)(d); (void)(a); (void)(s); (void)(r); } while (0)
> #define dma_unmap_page(d, a, s, r) do { (void)(d); (void)(a); (void)(s); (void)(r); } while (0)
> +#define dma_unmap_page_attrs(d, a, s, r, t) \
> + do { (void)(d); (void)(a); (void)(s); (void)(r); (void)(t); } while (0)
>
> #define sg_dma_address(sg) (0)
> #define sg_dma_len(sg) (0)
> diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
> index 6702008f7f5c..460df937ba9d 100644
> --- a/tools/virtio/linux/kernel.h
> +++ b/tools/virtio/linux/kernel.h
> @@ -134,6 +134,7 @@ static inline void *krealloc_array(void *p, size_t new_n, size_t new_size, gfp_t
> #define dev_err(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
> #define dev_warn(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
> #define dev_warn_once(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
> +#define dev_WARN_ONCE(dev, condition, format, ...) fprintf(stderr, format, ## __VA_ARGS__)
>
> #define min(x, y) ({ \
> typeof(x) _min1 = (x); \
> --
> 2.43.0
next prev parent reply other threads:[~2025-12-10 9:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-06 3:23 [PATCH 2/2] tools: virtio: Fix no definition of dma_map_page_attrs Yufeng Wang
2025-12-07 14:28 ` [PATCH v2 " Yufeng Wang
2025-12-10 9:00 ` Michael S. Tsirkin [this message]
2025-12-10 15:40 ` r4o5m6e8o
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=20251210035947-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=r4o5m6e8o@163.com \
--cc=virtualization@lists.linux.dev \
--cc=wyd20130109@163.com \
--cc=xuanzhuo@linux.alibaba.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 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).