On Wed, Oct 26, 2016 at 03:47:04PM +0800, Peter Xu wrote: > +static inline void vtd_writel(unsigned int reg, uint32_t value) > +{ > + *(uint32_t *)(Q35_HOST_BRIDGE_IOMMU_ADDR + reg) = value; > +} > + > +static inline void vtd_writeq(unsigned int reg, uint64_t value) > +{ > + *(uint64_t *)(Q35_HOST_BRIDGE_IOMMU_ADDR + reg) = value; > +} > + > +static inline uint32_t vtd_readl(unsigned int reg) > +{ > + return *(uint32_t *)(Q35_HOST_BRIDGE_IOMMU_ADDR + reg); > +} > + > +static inline uint64_t vtd_readq(unsigned int reg) > +{ > + return *(uint64_t *)(Q35_HOST_BRIDGE_IOMMU_ADDR + reg); > +} Is it safe to use memory dereference here? By contrast, Linux seems uses read*()/write*() accessors. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html