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

From: Joerg Roedel
Date: Mon Jan 30 2012 - 09:24:30 EST


On Fri, Jan 27, 2012 at 03:22:43PM -0600, Scott Wood wrote:

> OK, so there's a geometry that is read-only, and potentially a
> driver-specific geometry that is read/write. The default config for
> PAMU would likely be a 1 MiB aperture in which the dma api can do
> arbitrary 4k mappings -- this fits within the get generic geometry
> operation.

Better: There is a read-only geometry for _all_ IOMMUs. Some IOMMUs may
also allow to write the geometry, like PAMU.

> Should generic get geometry return an error if the driver-specific
> geometry has been set to something that doesn't fit within the generic
> geometry model?

A domain can only have one geometry. So if you set a new geometry
subsequent calls to get_attr will return the new geometry.

> I said a generic attribute (not GART specific) -- but if we're never
> going to use the generic geometry struct for a set operation, bundling
> it should be OK.

The generic struct should be used to set the geometry. But you can read
out the old geometry and set force_aperture to the same value in the new
geometry. Drivers should actually return -EINVAL when the user tries to
set an unsupported value for force_aperture.

> No, at this point I'm just trying to follow the API development while
> tending to other tasks. I think Varun is working on the code for now.

Okay, maybe it is better to follow a 'release early, release often'
model here. So we can work out the issues together.


Joerg

--
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632

--
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/