lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080117210301.GC12631@alberich.amd.com>
Date:	Thu, 17 Jan 2008 22:03:01 +0100
From:	"Andreas Herrmann3" <andreas.herrmann3@....com>
To:	"Ingo Molnar" <mingo@...e.hu>
cc:	"Venki Pallipadi" <venkatesh.pallipadi@...el.com>, ak@....de,
	ebiederm@...ssion.com, rdreier@...co.com,
	torvalds@...ux-foundation.org, gregkh@...e.de, airlied@...net.ie,
	davej@...hat.com, tglx@...utronix.de, hpa@...or.com,
	akpm@...ux-foundation.org, arjan@...radead.org,
	jesse.barnes@...el.com, davem@...emloft.net,
	linux-kernel@...r.kernel.org, suresh.b.siddha@...el.com
Subject: Re: [patch 0/4] x86: PAT followup - Incremental changes and bug
 fixes

On Thu, Jan 17, 2008 at 09:36:00PM +0100, Ingo Molnar wrote:
> 
> * Andreas Herrmann3 <andreas.herrmann3@....com> wrote:
> 
> > For the failed devices I get:
> > 
> >   sata_sil 0000:00:12.0: version 2.3
> >   ACPI: PCI Interrupt 0000:00:12.0[A] -> GSI 22 (level, low) -> IRQ 22
> >   ioremap_nocache: addr c0403000, size 200
> >   swapper:1 conflicting cache attribute c0403000-c0404000 uncached<->default
> >   ACPI: PCI interrupt for device 0000:00:12.0 disabled
> 
> hm, is the problem that the two devices share the same physical page, 
> and thus get an overlapping area?

Yes.

Meanwhile I have figured out that it is some ACPI stuff that maps the page cached.
I've changed the ioremap's in drivers/acpi/osl.c to ioremap_nocache.
See attached patch.

Now the machine boots without conflicts.

  ACPI: EC: Look up EC in DSDT
  ioremap_nocache: addr c0403104, size fc
  ioremap_nocache: addr 77e7ade1, size 3
  ioremap_nocache: addr 77e7af04, size 1

...

  sata_sil 0000:00:12.0: version 2.3
  ACPI: PCI Interrupt 0000:00:12.0[A] -> GSI 22 (level, low) -> IRQ 22
  ioremap_nocache: addr c0403000, size 200
  scsi0 : sata_sil
  scsi1 : sata_sil
  ata1: SATA max UDMA/100 mmio m512@...0403000 tf 0xc0403080 irq 22
  ata2: SATA max UDMA/100 mmio m512@...0403000 tf 0xc04030c0 irq 22
  ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

  ...

dmesg-output is attached.


> as an intermediate fix, how about following the attribute of the already 
> existing mapping, instead of rejecting the ioremap due to the conflict? 
> I.e. something like below?

I guess it is not a good idea to use an existing cachable attribute if the
IO-region is non-prefetchable. And in this example there are 3 devices
which are potentially affected:

  00:12.0 IDE interface: ATI Technologies Inc 4379 Serial ATA Controller (rev 80) (
     ...
        Memory at c0403000 (32-bit, non-prefetchable) [size=512]
     ...

  00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 82)
     ...
          Memory at c0403400 (32-bit, non-prefetchable) [size=1K]
     ...

  00:14.5 Multimedia audio controller: ATI Technologies Inc IXP SB400 AC'97 Audio Controller (rev 80)
     ...
          Memory at c0403800 (32-bit, non-prefetchable) [size=256]
     ...

BTW, is there a need for osl.c to map all regions as cached?


Regards,

Andreas

---
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 1f1ec4a..175e6a4 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -221,7 +221,7 @@ void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
 		/*
 		* ioremap checks to ensure this is in reserved space
 		*/
-		return ioremap((unsigned long)phys, size);
+		return ioremap_nocache((unsigned long)phys, size);
 	else
 		return __acpi_map_table((unsigned long)phys, size);
 }
@@ -437,7 +437,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
 	u32 dummy;
 	void __iomem *virt_addr;
 
-	virt_addr = ioremap(phys_addr, width);
+	virt_addr = ioremap_nocache(phys_addr, width);
 	if (!value)
 		value = &dummy;
 
@@ -465,7 +465,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
 {
 	void __iomem *virt_addr;
 
-	virt_addr = ioremap(phys_addr, width);
+	virt_addr = ioremap_nocache(phys_addr, width);
 
 	switch (width) {
 	case 8:

View attachment "dmesg.log" of type "text/plain" (23109 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ