2003-03-24 16:32:23

by Dave Jones

[permalink] [raw]
Subject: [x86-64] Add missing tlb flush after change_page_attr

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/arch/x86_64/kernel/pci-gart.c linux-2.5/arch/x86_64/kernel/pci-gart.c
--- bk-linus/arch/x86_64/kernel/pci-gart.c 2003-03-08 09:56:51.000000000 +0000
+++ linux-2.5/arch/x86_64/kernel/pci-gart.c 2003-03-18 21:19:53.000000000 +0000
@@ -419,6 +419,7 @@ static __init int init_k8_gatt(agp_kern_
panic("Cannot allocate GATT table");
memset(gatt, 0, gatt_size);
change_page_attr(virt_to_page(gatt), gatt_size/PAGE_SIZE, PAGE_KERNEL_NOCACHE);
+ global_flush_tlb();
agp_gatt_table = gatt;

for_all_nb(dev) {


2003-03-24 17:22:53

by Andi Kleen

[permalink] [raw]
Subject: Re: [x86-64] Add missing tlb flush after change_page_attr

On Mon, 2003-03-24 at 17:41, [email protected] wrote:
> diff -urpN --exclude-from=/home/davej/.exclude bk-linus/arch/x86_64/kernel/pci-gart.c linux-2.5/arch/x86_64/kernel/pci-gart.c
> --- bk-linus/arch/x86_64/kernel/pci-gart.c 2003-03-08 09:56:51.000000000 +0000
> +++ linux-2.5/arch/x86_64/kernel/pci-gart.c 2003-03-18 21:19:53.000000000 +0000
> @@ -419,6 +419,7 @@ static __init int init_k8_gatt(agp_kern_
> panic("Cannot allocate GATT table");
> memset(gatt, 0, gatt_size);
> change_page_attr(virt_to_page(gatt), gatt_size/PAGE_SIZE, PAGE_KERNEL_NOCACHE);
> + global_flush_tlb();
> agp_gatt_table = gatt;
>
> for_all_nb(dev) {

No it needs to be completely removed. the pci aperture is supposed to be
cachable (unlike the AGP aperture) That's still a trace of an earlier
design.

-Andi


2003-03-24 19:58:27

by Thomas Schlichter

[permalink] [raw]
Subject: Re: [x86-64] Add missing tlb flush after change_page_attr

Am Montag, 24. M?rz 2003 17:41 schrieb [email protected]:
> diff -urpN --exclude-from=/home/davej/.exclude
bk-linus/arch/x86_64/kernel/pci-gart.c
linux-2.5/arch/x86_64/kernel/pci-gart.c
> --- bk-linus/arch/x86_64/kernel/pci-gart.c 2003-03-08 09:56:51.000000000
+0000
> +++ linux-2.5/arch/x86_64/kernel/pci-gart.c 2003-03-18 21:19:53.000000000
+0000
> @@ -419,6 +419,7 @@ static __init int init_k8_gatt(agp_kern_
> panic("Cannot allocate GATT table");
> memset(gatt, 0, gatt_size);
> change_page_attr(virt_to_page(gatt), gatt_size/PAGE_SIZE,
PAGE_KERNEL_NOCACHE);
> + global_flush_tlb();
> agp_gatt_table = gatt;
>
> for_all_nb(dev) {

The global_flush_tlb() for the change_page_attr() is already present about 20
lines below...

2003-03-25 00:14:42

by Thomas Schlichter

[permalink] [raw]
Subject: [PATCH][x86-64] make the pci aperture cachable

Am Montag, 24. M?rz 2003 18:32 schrieb Andi Kleen:
> On Mon, 2003-03-24 at 17:41, [email protected] wrote:
> > diff -urpN --exclude-from=/home/davej/.exclude
bk-linus/arch/x86_64/kernel/pci-gart.c
linux-2.5/arch/x86_64/kernel/pci-gart.c
> > --- bk-linus/arch/x86_64/kernel/pci-gart.c 2003-03-08 09:56:51.000000000
+0000
> > +++ linux-2.5/arch/x86_64/kernel/pci-gart.c 2003-03-18 21:19:53.000000000
+0000
> > @@ -419,6 +419,7 @@ static __init int init_k8_gatt(agp_kern_
> > panic("Cannot allocate GATT table");
> > memset(gatt, 0, gatt_size);
> > change_page_attr(virt_to_page(gatt), gatt_size/PAGE_SIZE,
PAGE_KERNEL_NOCACHE);
> > + global_flush_tlb();
> > agp_gatt_table = gatt;
> >
> > for_all_nb(dev) {
>
> No it needs to be completely removed. the pci aperture is supposed to be
> cachable (unlike the AGP aperture) That's still a trace of an earlier
> design.
>
> -Andi

As this patch has been applied anyway here is a patch to make the pci aperture
cachable for 2.5.66.

Thomas Schlichter


Attachments:
(No filename) (0.00 B)
signed data
(No filename) (189.00 B)
signature
Download all attachments

2003-03-25 01:37:15

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH][x86-64] make the pci aperture cachable

> As this patch has been applied anyway here is a patch to make the pci aperture
> cachable for 2.5.66.

It actually needs a different change. This is just the fallback path
when your BIOS didn't set up an aperture (no AGP port). In case of an
existing aperture it needs to remap the IOMMU half.

I fixed it now in my tree.

-Andi