2009-07-22 15:32:55

by Pavel Vasilyev

[permalink] [raw]
Subject: GART_IOMMU without AGP

In the kernel configuration, if I choose x86_64 and PCI, then choose the item
"Garth IOMMU support", which, in turn, chooses not to switch off, support for
AGP. But many IOMMU system does not have AGP bus.

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 738bdc6..410369d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -585,7 +585,6 @@ config GART_IOMMU
bool "GART IOMMU support" if EMBEDDED
default y
select SWIOTLB
- select AGP
depends on X86_64 && PCI
---help---
Support for full DMA access of devices with 32bit memory access only

Signed-off-by: Pavel Vasilyev <[email protected]>


2009-07-22 21:37:53

by Dave Jones

[permalink] [raw]
Subject: Re: GART_IOMMU without AGP

On Wed, Jul 22, 2009 at 07:26:49PM +0400, Pavel Vasilyev wrote:
> In the kernel configuration, if I choose x86_64 and PCI, then choose the item
> "Garth IOMMU support", which, in turn, chooses not to switch off, support for
> AGP. But many IOMMU system does not have AGP bus.

The lack of AGP slots doesn't mean a lack of AGP bus.
It's part of the K8 on-CPU northbridge.

Dave

2009-07-22 21:58:19

by Pavel Vasilyev

[permalink] [raw]
Subject: Re: GART_IOMMU without AGP

On Thursday 23 July 2009 01:37:46 Dave Jones wrote:
> The lack of AGP slots doesn't mean a lack of AGP bus.
> It's part of the K8 on-CPU northbridge.

Fine. But if I do not have AGP-card, why do I need the support of bus AGP? :)
It may allow the user to the toggle on or off when needed.


Attachments:
(No filename) (288.00 B)
signature.asc (194.00 B)
This is a digitally signed message part.
Download all attachments

2009-07-22 22:16:47

by Alan

[permalink] [raw]
Subject: Re: GART_IOMMU without AGP

On Wed, 22 Jul 2009 17:37:46 -0400
Dave Jones <[email protected]> wrote:

> On Wed, Jul 22, 2009 at 07:26:49PM +0400, Pavel Vasilyev wrote:
> > In the kernel configuration, if I choose x86_64 and PCI, then choose the item
> > "Garth IOMMU support", which, in turn, chooses not to switch off, support for
> > AGP. But many IOMMU system does not have AGP bus.
>
> The lack of AGP slots doesn't mean a lack of AGP bus.
> It's part of the K8 on-CPU northbridge.

And the user is selecting CONFIG_AGP to select AGP devices rather than to
demonstrate their deep guru grade knowledge of K8 northbridges. Not only
that but CONFIG_AGP controls the display of AGP video card options so it
is a selection for offered devices not really an internal detail.

So I think Pavel is right here.

2009-07-22 22:34:18

by Andi Kleen

[permalink] [raw]
Subject: Re: GART_IOMMU without AGP

Dave Jones <[email protected]> writes:

> On Wed, Jul 22, 2009 at 07:26:49PM +0400, Pavel Vasilyev wrote:
> > In the kernel configuration, if I choose x86_64 and PCI, then choose the item
> > "Garth IOMMU support", which, in turn, chooses not to switch off, support for
> > AGP. But many IOMMU system does not have AGP bus.
>
> The lack of AGP slots doesn't mean a lack of AGP bus.
> It's part of the K8 on-CPU northbridge.

Right.

One thing that could be done today is to remove the "if EMBEDDED" for
GART_IOMMU though. I don't think it's still deserved, as long as
SWIOTLB is enabled.

-Andi

--
[email protected] -- Speaking for myself only.

2009-07-22 22:28:19

by Dave Jones

[permalink] [raw]
Subject: Re: GART_IOMMU without AGP

On Wed, Jul 22, 2009 at 11:17:38PM +0100, Alan Cox wrote:
> On Wed, 22 Jul 2009 17:37:46 -0400
> Dave Jones <[email protected]> wrote:
>
> > On Wed, Jul 22, 2009 at 07:26:49PM +0400, Pavel Vasilyev wrote:
> > > In the kernel configuration, if I choose x86_64 and PCI, then choose the item
> > > "Garth IOMMU support", which, in turn, chooses not to switch off, support for
> > > AGP. But many IOMMU system does not have AGP bus.
> >
> > The lack of AGP slots doesn't mean a lack of AGP bus.
> > It's part of the K8 on-CPU northbridge.
>
> And the user is selecting CONFIG_AGP to select AGP devices rather than to
> demonstrate their deep guru grade knowledge of K8 northbridges.

The user isn't selecting it at all. IOMMU is because it knows better than
the user. "I'll turn this on for you, so that I don't corrupt your hard
disk when you load a video driver" seems eminently sensible to me.

> Not only
> that but CONFIG_AGP controls the display of AGP video card options so it
> is a selection for offered devices not really an internal detail.

CONFIG_AGP has _nothing_ to do with video card options.
It's entirely about the aperture.

Dave

2009-07-22 22:25:07

by Dave Jones

[permalink] [raw]
Subject: Re: GART_IOMMU without AGP

On Thu, Jul 23, 2009 at 01:58:06AM +0400, Pavel Vasilyev wrote:
> On Thursday 23 July 2009 01:37:46 Dave Jones wrote:
> > The lack of AGP slots doesn't mean a lack of AGP bus.
> > It's part of the K8 on-CPU northbridge.
>
> Fine. But if I do not have AGP-card, why do I need the support of bus AGP? :)
> It may allow the user to the toggle on or off when needed.

For those that _do_ have an AGP bus, it's mandatory, as the
aperture needs to be shared between IOMMU and video.

Removing the select creates a potential for people to load video drivers
that don't come with the kernel to corrupt data as soon as something
writes using the IOMMU.

For those that don't have an agp bus, it costs about 20k of code.
Is this really that big a concern ?

Dave

2009-07-22 22:43:11

by Alan

[permalink] [raw]
Subject: Re: GART_IOMMU without AGP

> Removing the select creates a potential for people to load video drivers
> that don't come with the kernel to corrupt data as soon as something
> writes using the IOMMU.

"Video drivers that don't come with the kernel"

How about some specifics ?

2009-07-22 23:05:16

by Pavel Vasilyev

[permalink] [raw]
Subject: Re: GART_IOMMU without AGP

On Thursday 23 July 2009 02:28:07 Dave Jones wrote:
[cut]
> > Not only
> > that but CONFIG_AGP controls the display of AGP video card options so it
> > is a selection for offered devices not really an internal detail.
>
> CONFIG_AGP has _nothing_ to do with video card options.

For example, proprietary nvidia driver needed struct agp_bridges,
exported from drivers/char/agp/backend.c

After loading the nvidia, load agpgart (if CONFIG_AGP set as module)

2009-07-22 23:15:48

by Pavel Vasilyev

[permalink] [raw]
Subject: Re: GART_IOMMU without AGP

On Thursday 23 July 2009 02:17:38 you wrote:
> On Wed, 22 Jul 2009 17:37:46 -0400
>
> Dave Jones <[email protected]> wrote:
> > On Wed, Jul 22, 2009 at 07:26:49PM +0400, Pavel Vasilyev wrote:
> > > In the kernel configuration, if I choose x86_64 and PCI, then choose
> > > the item "Garth IOMMU support", which, in turn, chooses not to switch
> > > off, support for AGP. But many IOMMU system does not have AGP bus.
> >
> > The lack of AGP slots doesn't mean a lack of AGP bus.
> > It's part of the K8 on-CPU northbridge.
>
> And the user is selecting CONFIG_AGP to select AGP devices rather than to
> demonstrate their deep guru grade knowledge of K8 northbridges. Not only
> that but CONFIG_AGP controls the display of AGP video card options so it
> is a selection for offered devices not really an internal detail.
>
> So I think Pavel is right here.


May be next logic

IF ( GART_IOMMU == TRUE )
THEN
IF ( AGP == TRUE )
THEN
AGP_AMD64 = TRUE;
FI
FI

Now

IF ( GART_IOMMU == TRUE )
THEN
AGP = TRUE;'
AGP_AMD64 = TURE;
FI


And in bytes is

-rw-r--r-- 1 root root 54322 Jul 23 01:21 agpgart.ko
-rw-r--r-- 1 root root 19745 Jil 23 01:21 amd64-agp.ko

is 74067 bytes :)