Re: [PATCH 1/5] iommu/virtio: Break out bypass identity support into a global static

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 11, 2025 at 04:43:55PM -0800, Jacob Pan wrote:
> > +static int viommu_send_attach_req(struct viommu_dev *viommu, struct
> > device *dev,
> > +				  struct virtio_iommu_req_attach
> > *req) +{
> > +	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
> > +	int ret;
> > +	int i;
> nit: coding style inconsistent within this patch. Inverted xmas tree
> here.

Ok

> > +	/* Reserve an ID to use as the bypass domain */
> > +	if (virtio_has_feature(viommu->vdev,
> > VIRTIO_IOMMU_F_BYPASS_CONFIG)) {
> > +		viommu->identity_domain_id = viommu->first_domain;
> > +		viommu->first_domain++;
> Could also use ida_alloc() instead of special treatment, it would be
> consistent with the paging identity domain ID.

Could do, but that would allocate memory and we already have
first_domain which is free

Thanks,
Jason




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux