Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8441421ybl; Thu, 16 Jan 2020 16:58:35 -0800 (PST) X-Google-Smtp-Source: APXvYqyWSqonneHSynGmLR7kk6gkBh37FBbadKb5PotTYrhnDsdDrdpAjziqFOGfSUhfAMenxurj X-Received: by 2002:a05:6830:1248:: with SMTP id s8mr4386374otp.202.1579222715042; Thu, 16 Jan 2020 16:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579222715; cv=none; d=google.com; s=arc-20160816; b=n3lou7c0kolR++E8Y8aLCBDC/Mxtu7cWW4eF7k7Xaoj+hnKlTakIhz1TLxDud7p5KH u5uMG7/kYF0v1bzMdme09+pTmoyuBW2Fy2hL3ht4Lw4ycSb0oG6TsW9NwxjHrMsPgHpC sRSLx5FfNUC7KegbHkuSUiCvIrxtEFR3xCLZS6/aQ42X9sY3VLMw+kNzOhUsCADop8cZ 0Je7K2fUvuiDNQFJBofQHf8lWEhJ56Hko37AxlI1ZpTWJJlL9biCCEgaerXVxeixtit1 MQo20gM1sxe3K3TqFWVZlaMadZ3rg561ryeAEe+DOkY44vTznv4n0Y/7tQ1pZKIDjY87 UDjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=JF0RmMN/vOMvZvcr7XY0SUHP+5lZuXzapRJoCpSCW64=; b=Fco74/2XKDw9ESeY7NL7ew++18sl4O2zz5t+vcZRv6VcKuN6Rhpw7uvYw5VJcS1qyv E/1UnJJUMqx5VubruKEzhBL47b412rUKvV0OPtkOv1KAGTZKQhwWz2z0JtXCRsvywC/i UBtPRMTa2iqMKq3VEkmGpQN5zYQY3WL0y+F2VTVUzJDmLK25mFUx4na54newWqQVVxT/ mXUsuMRKpFqjaT3OGHkNlqPov2fgofqQ3EJks6A60D0vK0y1PpvLN2X+R2nXS1cwfSf8 UtfcvdipwMzGxKCLyHHSUeIiPvyIHaxIqLL+I0kSLtjdfDDDwHbNFdCzGYrBy1G5lP3W CeGw== 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 a205si12865535oii.95.2020.01.16.16.58.23; Thu, 16 Jan 2020 16:58:35 -0800 (PST) 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 S2389722AbgAPTL4 (ORCPT + 99 others); Thu, 16 Jan 2020 14:11:56 -0500 Received: from mx2.suse.de ([195.135.220.15]:42846 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387668AbgAPRAJ (ORCPT ); Thu, 16 Jan 2020 12:00:09 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7A0E7B2EDC; Thu, 16 Jan 2020 17:00:07 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini , stable@vger.kernel.org Subject: [PATCH] xen/balloon: Support xend-based toolstack take two Date: Thu, 16 Jan 2020 18:00:04 +0100 Message-Id: <20200116170004.14373-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 5266b8e4445c ("xen: fix booting ballooned down hvm guest") in case the static memory maximum can't be read. Fixes: 3aa6c19d2f38be ("xen/balloon: Support xend-based toolstack") Signed-off-by: Juergen Gross Cc: # 4.13 --- drivers/xen/xen-balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c index 6d12fc368210..a8d24433c8e9 100644 --- a/drivers/xen/xen-balloon.c +++ b/drivers/xen/xen-balloon.c @@ -94,7 +94,7 @@ static void watch_target(struct xenbus_watch *watch, "%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; -- 2.16.4