From: Michael S. Tsirkin Date: Thu, 12 Apr 2012 13:38:00 +0000 (+0300) Subject: virtio_balloon: fix handling of PAGE_SIZE != 4k X-Git-Tag: v3.4-rc4~38^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ccc9372ed0fab33d20f10be3c1efd5776ff5913;p=pandora-kernel.git virtio_balloon: fix handling of PAGE_SIZE != 4k As reported by David Gibson, current code handles PAGE_SIZE != 4k completely wrong which can lead to guest memory corruption errors: - page_to_balloon_pfn is wrong: e.g. on system with 64K page size it gives the same pfn value for 16 different pages. - we also need to convert back to linux pfns when we free. - for each linux page we need to tell host about multiple balloon pages, but code only adds one pfn to the array. This patch fixes all that, tested with a 64k ppc64 kernel. Reported-by: David Gibson Tested-by: David Gibson Signed-off-by: Michael S. Tsirkin --- Reading git-diff-tree failed