]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xen/m2p: do not reuse kmap_op->dev_bus_addr
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 12 Sep 2012 11:44:30 +0000 (12:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 17:39:12 +0000 (10:39 -0700)
commit927766ff00c2f45847b77c9732c2e130313e0d0e
tree0046b8453722a1ad6de146edabb36dad2fd016ca
parent8534c2b953b7ac2f54a025c62d3057d67f72a888
xen/m2p: do not reuse kmap_op->dev_bus_addr

commit 2fc136eecd0c647a6b13fcd00d0c41a1a28f35a5 upstream.

If the caller passes a valid kmap_op to m2p_add_override, we use
kmap_op->dev_bus_addr to store the original mfn, but dev_bus_addr is
part of the interface with Xen and if we are batching the hypercalls it
might not have been written by the hypervisor yet. That means that later
on Xen will write to it and we'll think that the original mfn is
actually what Xen has written to it.

Rather than "stealing" struct members from kmap_op, keep using
page->index to store the original mfn and add another parameter to
m2p_remove_override to get the corresponding kmap_op instead.
It is now responsibility of the caller to keep track of which kmap_op
corresponds to a particular page in the m2p_override (gntdev, the only
user of this interface that passes a valid kmap_op, is already doing that).

Reported-and-Tested-By: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/xen/page.h
arch/x86/xen/p2m.c
drivers/block/xen-blkback/blkback.c
drivers/xen/gntdev.c
drivers/xen/grant-table.c
include/xen/grant_table.h