[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V1 1/6] arm/xen: Introduce xen_setup_dma_ops()
 
- To: Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>
 
- From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
 
- Date: Sat, 23 Apr 2022 09:32:24 -0700
 
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,	linux-arm-kernel@xxxxxxxxxxxxxxxxxxx,	Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>,	Stefano Stabellini <sstabellini@xxxxxxxxxx>,	Russell King <linux@xxxxxxxxxxxxxxx>,	Catalin Marinas <catalin.marinas@xxxxxxx>,	Will Deacon <will@xxxxxxxxxx>,	Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>,	Juergen Gross <jgross@xxxxxxxx>,	Logan Gunthorpe <logang@xxxxxxxxxxxx>,	David Hildenbrand <david@xxxxxxxxxx>,	Martin Oliveira <martin.oliveira@xxxxxxxxxxxxx>,	Kees Cook <keescook@xxxxxxxxxxxx>,	Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>,	Julien Grall <julien@xxxxxxx>,	"Michael S. Tsirkin" <mst@xxxxxxxxxx>,	Christoph Hellwig <hch@xxxxxxxxxxxxx>
 
- Delivery-date: Sat, 23 Apr 2022 16:32:58 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
On Fri, Apr 22, 2022 at 07:50:58PM +0300, Oleksandr Tyshchenko wrote:
> +#ifndef _ASM_ARM_XEN_OPS_H
> +#define _ASM_ARM_XEN_OPS_H
> +
> +#include <xen/swiotlb-xen.h>
> +
> +static inline void xen_setup_dma_ops(struct device *dev)
> +{
> +#ifdef CONFIG_XEN
> +     if (xen_swiotlb_detect())
> +             dev->dma_ops = &xen_swiotlb_dma_ops;
> +#endif
Maybe create a proper !CONFIG_XEN stub for xen_swiotlb_detect instead
of the ifdef here, but otherwise this looks good to me.
 
    
     |