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: <ada3at3aocb.fsf@cisco.com>
Date:	Fri, 11 Jan 2008 16:18:12 -0800
From:	Roland Dreier <rdreier@...co.com>
To:	"Pallipadi, Venkatesh" <venkatesh.pallipadi@...el.com>
Cc:	"Andi Kleen" <andi@...stfloor.org>, <ebiederm@...ssion.com>,
	<torvalds@...ux-foundation.org>, <gregkh@...e.de>,
	<airlied@...net.ie>, <davej@...hat.com>, <mingo@...e.hu>,
	<tglx@...utronix.de>, <hpa@...or.co>,
	<linux-kernel@...r.kernel.org>,
	"Siddha, Suresh B" <suresh.b.siddha@...el.com>
Subject: Re: [patch 09/11] PAT x86: Add ioremap_wc support

 > >I don't think that's a good idea. Drivers should be able to 
 > >detect this somehow.
 > >Handling UC mappings as WC will probably give very poor results.

 > It is the other way. ioremap_wc aliases to ioremap_nocache.
 > This was based on earlier feedback from Roland.

 > >From: Roland Dreier [mailto:rdreier@...co.com] 
 > >I think ioremap_wc() needs to be available on all archs for this to be
 > >really useful to drivers.  It can be a fallback to ioremap_nocache()
 > >everywhere except 64-bit x86, but it's not nice for every driver that
 > >wants to use this to need an "#ifdef X86" or whatever.

Yes... my basic point is simply that the kernel interfaces to this WC
stuff must be available on all architectures, even if it's stubbed out
on architectures that don't support write-combining or where it hasn't
been implemented yet.  I think the only sane way to stub it out is to
fall back to uncached...

It's not going to be useful if drivers need crazy #ifdefs to decide
whether to use ioremap_wc(), pgprot_writecombine() or whatever.  Just
look at the mess in drm_io_prot() in drm_vm.c to see what I want to
avoid.

Just to be explicit, my interest in this is that I want to be able to
merge the patch below and have the mlx4 driver still build and work on
every arch that has PCI support:

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index d8287d9..5eac9c6 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -381,8 +381,7 @@ static int mlx4_ib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
 				       PAGE_SIZE, vma->vm_page_prot))
 			return -EAGAIN;
 	} else if (vma->vm_pgoff == 1 && dev->dev->caps.bf_reg_size != 0) {
-		/* FIXME want pgprot_writecombine() for BlueFlame pages */
-		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
 
 		if (io_remap_pfn_range(vma, vma->vm_start,
 				       to_mucontext(context)->uar.pfn +

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ