Re: [PATCH 2/6] iommu/amd: Implement DOMAIN_ATTR_GEOMETRY attribute

From: Ohad Ben-Cohen
Date: Fri Jan 27 2012 - 06:00:22 EST


On Fri, Jan 27, 2012 at 12:26 PM, Joerg Roedel <joerg.roedel@xxxxxxx> wrote:
> I fell also uncomfortable with the missing type-safety of this
> interface. But the alternative is to have dedicated functions for
> set/get each attribute. Well, it depends on how many attributes we have
> in the end, but given that the PAMU guys already have need for a number
> of hardware specific attributes it is likely that having individual
> functions makes the api too complex in the end.
>
> But probably we can replace the 'void *data' with a 'union
> domain_attr'? This will give us some type-safety.
>

I was thinking that since the geometry concept is actually handled by
the core itself, it could probably have its own dedicated function.

Not sure how many other functions like that we might end up having
eventually, but I personally prefer the dedicated API over a single
multiplexer which is prone to error and (somewhat) harder to
debug/read.

Real vendor-specific attributes do probably justifies an all-catch
attribute API, I agree. Though we should probably try to minimize
them, and where possible, implement them in the core too, for the
benefit of everyone.

Thanks,
Ohad.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/