From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFA44C2BA83 for ; Thu, 13 Feb 2020 15:56:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85FF7222C2 for ; Thu, 13 Feb 2020 15:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581609408; bh=6BvIOzEilr42zeZ5zmuT/u0bTWUdZpnU7Nz+IlT1MaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=160VGoa4JTv58STGbgd5c3VAXvioxYZVh4uyQnNQ/8hDOkNRvUC91CbXM5SUT7kZq J4x3xNSpA7hXdKOq6Jh5TC73xOO8vdneSLFBYV5G9Gyp+PgtNzUe26YBy67EfMfOuj dNFv9F8lyxr/L82dTfjKKgc0GY2IUKnANv+NdZ/E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387648AbgBMP4f (ORCPT ); Thu, 13 Feb 2020 10:56:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:41074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728995AbgBMPZ0 (ORCPT ); Thu, 13 Feb 2020 10:25:26 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5BC0524691; Thu, 13 Feb 2020 15:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607525; bh=6BvIOzEilr42zeZ5zmuT/u0bTWUdZpnU7Nz+IlT1MaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tZBeiDIFCRf6Bjr6jWhhZLRSVkJLD4ApSPBRUfKAUPXIPSg7g/ZDFu330Utn95s7W Ib5FAUNErEmZ9+r8b0QmDDQoY4uNhIpnyxjfIIms45iKNCkzR3uSGdFD8iUZY6z8Ca aOwFODu2XaH2ZmG29znNtl4JPbs4s6H5cTuurgN8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juergen Gross , Boris Ostrovsky Subject: [PATCH 4.14 077/173] xen/balloon: Support xend-based toolstack take two Date: Thu, 13 Feb 2020 07:19:40 -0800 Message-Id: <20200213151952.968884331@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151931.677980430@linuxfoundation.org> References: <20200213151931.677980430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Juergen Gross commit eda4eabf86fd6806eaabc23fb90dd056fdac037b upstream. Commit 3aa6c19d2f38be ("xen/balloon: Support xend-based toolstack") tried to fix a regression with running on rather ancient Xen versions. Unfortunately the fix was based on the assumption that xend would just use another Xenstore node, but in reality only some downstream versions of xend are doing that. The upstream xend does not write that Xenstore node at all, so the problem must be fixed in another way. The easiest way to achieve that is to fall back to the behavior before commit 96edd61dcf4436 ("xen/balloon: don't online new memory initially") in case the static memory maximum can't be read. This is achieved by setting static_max to the current number of memory pages known by the system resulting in target_diff becoming zero. Fixes: 3aa6c19d2f38be ("xen/balloon: Support xend-based toolstack") Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Cc: # 4.13 Signed-off-by: Boris Ostrovsky Signed-off-by: Greg Kroah-Hartman --- drivers/xen/xen-balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/xen/xen-balloon.c +++ b/drivers/xen/xen-balloon.c @@ -82,7 +82,7 @@ static void watch_target(struct xenbus_w "%llu", &static_max) == 1)) static_max >>= PAGE_SHIFT - 10; else - static_max = new_target; + static_max = balloon_stats.current_pages; target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0 : static_max - balloon_stats.target_pages;