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]
Date:	Mon, 08 Jun 2015 16:44:02 +0100
From:	David Woodhouse <dwmw2@...radead.org>
To:	Joerg Roedel <joro@...tes.org>
Cc:	"Li, Zhen-Hua" <zhen-hual@...com>, indou.takao@...fujitsu.com,
	bhe@...hat.com, vgoyal@...hat.com, dyoung@...hat.com,
	iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
	linux-pci@...r.kernel.org, kexec@...ts.infradead.org,
	alex.williamson@...hat.com, ddutile@...hat.com,
	ishii.hironobu@...fujitsu.com, bhelgaas@...gle.com,
	doug.hatch@...com, jerry.hoemann@...com, tom.vaden@...com,
	li.zhang6@...com, lisa.mitchell@...com, billsumnerlinux@...il.com,
	rwright@...com
Subject: Re: [PATCH v11 04/10] iommu/vt-d: functions to copy data from old
 mem

On Mon, 2015-06-08 at 17:21 +0200, Joerg Roedel wrote:
> Hi David,
> 
> On Mon, Jun 08, 2015 at 03:15:35PM +0100, David Woodhouse wrote:
> > Surely this isn't specific to the Intel IOMMU? Shouldn't it live
> > elsewhere — either in generic IOMMU code or perhaps in generic kexec
> > support code?
> 
> I put a bigger rework of this on-top of Zhen-Hua's patches, you can find
> the result in my x86/vt-d branch. With my patches I also removed this
> pointer collecting concept and do the iomap_cache and iounmap calls
> before the spin-lock is taken, so this problem is now solved
> differently.
> 
> > And I think you're misusing VTD_PAGE_{SHIFT,MASK} when you should be
> > using the normal PAGE_{SHIFT,MASK}.
> 
> I think VT_PAGE_* is correct, since the VT-d driver also runs on ia64.
> There the system page-size is different from the VT-d page-size.

That's the problem. In  __iommu_load_from_oldmem we start with a
physical address in 'from', convert to a VT-d PFN in 'pfn':

+       pfn = from >> VTD_PAGE_SHIFT;

.. and then proceed to pass that pfn to non-VT-d functions like
page_is_ram() and pfn_to_kaddr() which really need their input pfn
values to be in terms of PAGE_SHIFT not VTD_PAGE_SHIFT.

But it looks like you've completely eliminated that now (including the
page_is_ram check). So although it *was* wrong, it doesn't matter now.

> >  And shouldn't physical addresses be phys_addr_t?
> 
> This is changed where appropriate, I hope.

OK. In fact once it's purely internal to intel-iommu.c it doesn't
matter as much since we don't put page tables in high memory on 32-bit
machines.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@...el.com                              Intel Corporation

Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5691 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ