Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3479610imu; Sun, 11 Nov 2018 16:03:25 -0800 (PST) X-Google-Smtp-Source: AJdET5dSK83r/fmDL7+AJa6rS9YklO3PxJeDX7TRWhul6//n6CyOKCPFi7njaUqMehCaaD+GcCPp X-Received: by 2002:a62:d452:: with SMTP id u18-v6mr9724817pfl.32.1541981005391; Sun, 11 Nov 2018 16:03:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981005; cv=none; d=google.com; s=arc-20160816; b=r2KdNJCFZCU8RjTx8oLeyiMc6DwsLCb/GVpKXjDnXLWKoORBCwnD4g6UJF6mD3Tkf1 sCaCgNJ1YzX27i3aACgr8A91WZcR9B0zqfoH6V1uS4mOPUAinkULnTDPzWM9/g77kxlg eQ0KbazDhqsS/cClDQyP0oVjAldNg3to5/e4YdSOj1Qis4SkbTL4b5oB4F02rAxgTNUP /7kiIl/XDKSSCHvxQB2T/UozJ1MPcqMqyjLKYg/d6c0GjDESQcnSTCDlMELS0th0zHr7 u/ARX1Yh8nQiBeOLxvKVl/IqrXvh1pmXv9UJo7xALTMwZNRXtpZx5LzQTEGG7m0F/Se7 4cSw== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NY8/NLCidXUj7Nl4OIvn3y4TW7V/1QdiRNzQX9H86mI=; b=IEsoJ75bqrIb6oAHnOthkTExBXEP2k8bo5lAa0hcGopZDJDz0rNuutYOZPq/AhTKa+ b47PoEfEpwFmAfW45oFgGwgQSNGS+wBA6PElxtwKZoS1Xpp0NzWFRl/MIY1RvDAQExzE 9SIhOU/k0GvVnmJUzxoMGKppvhf+WVEGOb75EdjhdMVLvXC4hBnjlfvM997wnsCuZWoA 8bxcV5Zaue2lmF46Dm124ljuMwGGPhHHPoi4oe2pGNeMho1ewvcUa1eX8/z1H4qTv//c vIVz+2r9535x+XnTW1we+RFjHqisU6fCXcu+DGg8hjeJpk0tuADBoSobXvm055xdaxxL 3IoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YrlkOyYN; 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 a59-v6si12343489plc.48.2018.11.11.16.03.10; Sun, 11 Nov 2018 16:03:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=YrlkOyYN; 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 S1732378AbeKLJvz (ORCPT + 99 others); Mon, 12 Nov 2018 04:51:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:35400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732225AbeKLIR5 (ORCPT ); Mon, 12 Nov 2018 03:17:57 -0500 Received: from localhost (unknown [206.108.79.134]) (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 AE27521104; Sun, 11 Nov 2018 22:28:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975281; bh=vNa8hbAlRQCaqQa8Lg2MDvg9oBZog1Wkhtx8icx9nYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YrlkOyYNhKNMWX41sXIL5KsZpzWAIxbR1Z2eMyK+DaPCul9Rxu+470fMQx4TBCJy0 xsR+CTXP6rS/77fgU/WkKw5QJzGDcDkI7KYScnSXIdQOqqfe8QSKqT/EbrMaYuK/56 A455+qnuk6AJFF0bf6kk36ktk1nn6mYDBURjQq6s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Boris Ostrovsky , Juergen Gross Subject: [PATCH 4.19 202/361] xen/balloon: Support xend-based toolstack Date: Sun, 11 Nov 2018 14:19:09 -0800 Message-Id: <20181111221648.682442311@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Boris Ostrovsky commit 3aa6c19d2f38be9c6e9a8ad5fa8e3c9d29ee3c35 upstream. Xend-based toolstacks don't have static-max entry in xenstore. The equivalent node for those toolstacks is memory_static_max. Fixes: 5266b8e4445c (xen: fix booting ballooned down hvm guest) Signed-off-by: Boris Ostrovsky Cc: # 4.13 Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman --- drivers/xen/xen-balloon.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/drivers/xen/xen-balloon.c +++ b/drivers/xen/xen-balloon.c @@ -76,12 +76,15 @@ static void watch_target(struct xenbus_w if (!watch_fired) { watch_fired = true; - err = xenbus_scanf(XBT_NIL, "memory", "static-max", "%llu", - &static_max); - if (err != 1) - static_max = new_target; - else + + if ((xenbus_scanf(XBT_NIL, "memory", "static-max", + "%llu", &static_max) == 1) || + (xenbus_scanf(XBT_NIL, "memory", "memory_static_max", + "%llu", &static_max) == 1)) static_max >>= PAGE_SHIFT - 10; + else + static_max = new_target; + target_diff = (xen_pv_domain() || xen_initial_domain()) ? 0 : static_max - balloon_stats.target_pages; }