public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: david.vrabel@citrix•com (David Vrabel)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v5 12/22] xen/balloon: Don't rely on the page granularity is the same for Xen and Linux
Date: Fri, 2 Oct 2015 15:09:08 +0100	[thread overview]
Message-ID: <560E9004.8030604@citrix.com> (raw)
In-Reply-To: <1443609937-25278-13-git-send-email-julien.grall@citrix.com>

On 30/09/15 11:45, Julien Grall wrote:
> For ARM64 guests, Linux is able to support either 64K or 4K page
> granularity. Although, the hypercall interface is always based on 4K
> page granularity.
> 
> With 64K page granularity, a single page will be spread over multiple
> Xen frame.
> 
> To avoid splitting the page into 4K frame, take advantage of the
> extent_order field to directly allocate/free chunk of the Linux page
> size.
> 
> Note that PVMMU is only used for PV guest (which is x86) and the page
> granularity is always 4KB. Some BUILD_BUG_ON has been added to ensure
> that because the code has not been modified.

This causes a BUG() in x86 PV guests when decreasing the reservation.

Xen says:

(XEN) d0v2 Error pfn 0: rd=0 od=32753 caf=8000000000000001
taf=7400000000000001
(XEN) memory.c:250:d0v2 Bad page free for domain 0

And Linux BUGs with:

[   82.032654] kernel BUG at
/anfs/drall/scratch/davidvr/x86/linux/drivers/xen/balloon.c:540!

Which is a non-zero return value from the decrease_reservation hypercall.

The frame_list[] has been incorrectly populated.  The below patch fixes
it for me.  Please test as well.

--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -504,9 +504,10 @@ static enum bp_state decrease_reservation(unsigned
long nr_pages, gfp_t gfp)
 	 * Setup the frame, update direct mapping, invalidate P2M,
 	 * and add to balloon.
 	 */
+	i = 0;
 	list_for_each_entry_safe(page, tmp, &pages, lru) {
 		/* XENMEM_decrease_reservation requires a GFN */
-		frame_list[i] = xen_page_to_gfn(page);
+		frame_list[i++] = xen_page_to_gfn(page);

 #ifdef CONFIG_XEN_HAVE_PVMMU
 		/*

David

  reply	other threads:[~2015-10-02 14:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 10:45 [PATCH v5 00/22] xen/arm64: Add support for 64KB page in Linux Julien Grall
2015-09-30 10:45 ` [PATCH v5 01/22] net/xen-netback: xenvif_gop_frag_copy: move GSO check out of the loop Julien Grall
2015-09-30 10:45 ` [PATCH v5 02/22] arm/xen: Drop pte_mfn and mfn_pte Julien Grall
2015-09-30 10:45 ` [PATCH v5 03/22] xen: Add Xen specific page definition Julien Grall
2015-09-30 10:45 ` [PATCH v5 04/22] xen/grant: Introduce helpers to split a page into grant Julien Grall
2015-09-30 10:45 ` [PATCH v5 05/22] xen/grant: Add helper gnttab_page_grant_foreign_access_ref_one Julien Grall
2015-09-30 10:50   ` Julien Grall
2015-09-30 10:45 ` [PATCH v5 06/22] block/xen-blkfront: Split blkif_queue_request in 2 Julien Grall
2015-09-30 10:45 ` [PATCH v5 07/22] block/xen-blkfront: Store a page rather a pfn in the grant structure Julien Grall
2015-09-30 10:45 ` [PATCH v5 08/22] block/xen-blkfront: split get_grant in 2 Julien Grall
2015-09-30 10:45 ` [PATCH v5 09/22] xen/biomerge: Don't allow biovec's to be merged when Linux is not using 4KB pages Julien Grall
2015-09-30 10:45 ` [PATCH v5 10/22] xen/xenbus: Use Xen page definition Julien Grall
2015-09-30 10:45 ` [PATCH v5 11/22] tty/hvc: xen: Use xen " Julien Grall
2015-09-30 10:45 ` [PATCH v5 12/22] xen/balloon: Don't rely on the page granularity is the same for Xen and Linux Julien Grall
2015-10-02 14:09   ` David Vrabel [this message]
2015-10-02 14:31     ` Julien Grall
2015-10-02 14:52       ` Julien Grall
2015-10-02 15:18         ` Boris Ostrovsky
2015-10-02 15:19         ` [Xen-devel] " David Vrabel
2015-09-30 10:45 ` [PATCH v5 13/22] xen/events: fifo: Make it running on 64KB granularity Julien Grall
2015-09-30 10:45 ` [PATCH v5 14/22] xen/grant-table: " Julien Grall
2015-09-30 10:45 ` [PATCH v5 15/22] block/xen-blkfront: Make it running on 64KB page granularity Julien Grall
2015-09-30 10:45 ` [PATCH v5 16/22] block/xen-blkback: " Julien Grall
2015-09-30 10:45 ` [PATCH v5 17/22] net/xen-netfront: " Julien Grall
2015-09-30 10:45 ` [PATCH v5 18/22] net/xen-netback: " Julien Grall
2015-09-30 10:45 ` [PATCH v5 19/22] xen/privcmd: Add support for Linux " Julien Grall
2015-09-30 10:45 ` [PATCH v5 20/22] arm/xen: Add support for " Julien Grall
2015-09-30 10:45 ` [PATCH v5 21/22] xen/swiotlb: Pass addresses rather than frame numbers to xen_arch_need_swiotlb Julien Grall
2015-09-30 10:45 ` [PATCH v5 22/22] xen/swiotlb: Add support for 64KB page granularity Julien Grall
2015-09-30 11:32 ` [PATCH v5 00/22] xen/arm64: Add support for 64KB page in Linux Mark Rutland
2015-09-30 11:45   ` Julien Grall
2015-09-30 13:04     ` Mark Rutland
2015-10-01 15:15 ` [Xen-devel] " David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560E9004.8030604@citrix.com \
    --to=david.vrabel@citrix$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox