Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3873602imc; Thu, 14 Mar 2019 07:13:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJIDCg8kaGTdnhnj9G+mzqdHXFLb3zmmR2uY9AJBj9xMxrKXS+SH7REHE2sDebgwYXoy2d X-Received: by 2002:a63:d706:: with SMTP id d6mr32088203pgg.367.1552572824369; Thu, 14 Mar 2019 07:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552572824; cv=none; d=google.com; s=arc-20160816; b=gzl3FwsOjGTPKNt/UyfzLUB01Eas+SwTX9zVl/bGEpfUuHF3cMzrAvSwy8NAHzkORI B1w77+PYfMtBJQWYrdmXvumDqTeOuiC6cC2SOkuXd5XdB9lquml94amV45MTjiouQxqi QF9+BzTGhYfZaYxaboBn5St69jb3zE7PRCbMgcpqVYCnGTK7bOEGMV7CytZdo8Xqc8xC Qx1uBpCB3/k05xw353JVkYtHqQDYsNhcBT1NHmUKLVRyuYohNW0Zlt2K28f4Ih5rlOJU OnCGbe0pAcbusnCxihFMZtJctLbrFejzUvuwyEj7mFLb59N9iQ+KCjlTBelZQdPO+mqH 5cdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=5lvB8izfEMoAkCDQAuLlEU4fXWY647iGWhNKwihE/TU=; b=bAUVJm3T7p+bsdC44fxYjDZx7IZxm2dgKA6kZLkFYLNLXiD1MZKr5I1qvLGvOv5xHS 19rUD3ft8QOoytn9npmF5zSlrGT0oFrGnqP3Qip/MDdTlJQgQQvJvu3b1uRt65wRJWPu ZGXI6WescYq5b375L+OX1ohn9rxbZNMbm3H7YhIIBGc8SBCM8LuBOlqE8LtkCYSO4NMR k9tje16OC2GF0TDpuTHe1rDCCpsZ7GwH58kWyUmgAB3moSgcfR9VsAqmvIFHddeq+cxo WuvCBmk4c3bXt5l5QDkRY0IUi+AGa29lMtBS5ap7Awj1iMTh8fbBe1KQnVKfMmUUoMRs d8RA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q24si7254855pfh.127.2019.03.14.07.13.27; Thu, 14 Mar 2019 07:13:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727547AbfCNOMu (ORCPT + 99 others); Thu, 14 Mar 2019 10:12:50 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45256 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbfCNOMt (ORCPT ); Thu, 14 Mar 2019 10:12:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4017E80D; Thu, 14 Mar 2019 07:12:49 -0700 (PDT) Received: from [10.37.12.84] (unknown [10.37.12.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CAC713F59C; Thu, 14 Mar 2019 07:12:45 -0700 (PDT) Subject: Re: [Xen-devel] xen: Can't insert balloon page into VM userspace (WAS Re: [linux-linus bisection] complete test-arm64-arm64-xl-xsm) To: Juergen Gross , David Hildenbrand , Boris Ostrovsky , Andrew Cooper , Matthew Wilcox Cc: k.khlebnikov@samsung.com, Stefano Stabellini , Kees Cook , Konrad Rzeszutek Wilk , "VMware, Inc." , osstest service owner , "linux-kernel@vger.kernel.org" , linux-mm@kvack.org, Julien Freche , Nadav Amit , xen-devel@lists.xenproject.org References: <80211e70-5f54-9421-8e8f-2a4fc758ce39@arm.com> <46118631-61d4-adb6-6ffc-4e7c62ea3da9@arm.com> <20190312171421.GJ19508@bombadil.infradead.org> <45323ea0-2a50-8891-830e-e1f8a8ed23ea@citrix.com> <9a40e1ff-7605-e822-a1d2-502a12d0fba7@redhat.com> <6f8aca6c-355b-7862-75aa-68fe566f76fb@redhat.com> From: Julien Grall Message-ID: Date: Thu, 14 Mar 2019 14:12:43 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 3/14/19 8:37 AM, Juergen Gross wrote: > On 12/03/2019 20:46, David Hildenbrand wrote: >> On 12.03.19 19:23, David Hildenbrand wrote: >> >> I guess something like this could do the trick if I understood it correctly: >> >> diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c >> index 39b229f9e256..d37dd5bb7a8f 100644 >> --- a/drivers/xen/balloon.c >> +++ b/drivers/xen/balloon.c >> @@ -604,6 +604,7 @@ int alloc_xenballooned_pages(int nr_pages, struct >> page **pages) >> while (pgno < nr_pages) { >> page = balloon_retrieve(true); >> if (page) { >> + __ClearPageOffline(page); >> pages[pgno++] = page; >> #ifdef CONFIG_XEN_HAVE_PVMMU >> /* >> @@ -645,8 +646,10 @@ void free_xenballooned_pages(int nr_pages, struct >> page **pages) >> mutex_lock(&balloon_mutex); >> >> for (i = 0; i < nr_pages; i++) { >> - if (pages[i]) >> + if (pages[i]) { >> + __SetPageOffline(pages[i]); >> balloon_append(pages[i]); >> + } >> } >> >> balloon_stats.target_unpopulated -= nr_pages; >> >> >> At least this way, the pages allocated (and thus eventually mapped to >> user space) would not be marked, but the other ones would remain marked >> and could be excluded by makedumptool. >> > > I think this patch should do the trick. Julien, could you give it a > try? On x86 I can't reproduce your problem easily as dom0 is PV with > plenty of unpopulated pages for grant memory not suffering from > missing "offline" bit. Sure. I managed to get the console working with the patch suggested by David. Feel free to add my tested-by if when you resend it as is. Cheers, -- Julien Grall