Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3612870ybn; Fri, 27 Sep 2019 08:47:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvHqtfubFtJlh7gsTkGANxbPP1+H+wyjSBV+vYwR04TMvRRWghN6hmYYdoD6Y4qqOSRytN X-Received: by 2002:a17:906:24c8:: with SMTP id f8mr8366521ejb.119.1569599247917; Fri, 27 Sep 2019 08:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569599247; cv=none; d=google.com; s=arc-20160816; b=ITJikvd1IT+hiIqVx3Qkwqk5njg46D1Jcf4jHoMfiZkr5AbQEVgtziQhFdPYmKSW3p pnN8QPFvwb4K5T097b208uycZCErDSDzQyvY6qWTXXHmnGabUUaCT9qQA49N8PIZhUi/ 29umb8CylQuAQiSilrXKsGVKRcwrG1ow95YrMym6jP4FflbVBfDhqnfkyg8X98SmpYix NB5E+7awlZtwb8Ls3itXxiDykrKK4fMj+qUzFBkZf4uEG26AY9WorsYdUJINH3rxwfR5 l2FTFutN5dL0MVvcpPMZBiRfBvykgwJE91wknAR9tlfK7X9+Zw0nzscKaBK+VLMMz561 3k+Q== 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 :message-id:date:subject:cc:to:from; bh=LkNI6u/z/C/eZ7nSlU6Jf2CQAUIUwPgDB/+5ArpeZsE=; b=spWPYMHITwNEJcvLuSw/1fG1/hZ8ZjLwdWl94Vz/OF+xlbITJ/KszHefw34GDY3B4z ApQK3BYjExit0cPu9lflDO/kzRJCu+jy60flK9CxDU+C9sN9Sn+FBzlchfMR1hglHIyb JOYDfy16TdpJetN/5Rr119bRsuvCGJtHdFC5YmFi5TZAQz56hmOFb/v5jNe6m6x+h72d mAip+8gMysUJV1Zi/Bsm4I18h2vwa1G/8d/c4jKfB+dW0mpiQ7JiRfzZ9QzCES2dbzRs tfLmlgiP2kKOTg95thn6pSyaFtuszzNH6dHH5rpjVKWquXxNWGsDR+0xEOHAkDlOflcR RfOA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oq3si3002840ejb.220.2019.09.27.08.47.01; Fri, 27 Sep 2019 08:47:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727624AbfI0Pqe (ORCPT + 99 others); Fri, 27 Sep 2019 11:46:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53852 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727289AbfI0Pqe (ORCPT ); Fri, 27 Sep 2019 11:46:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF3208980E5; Fri, 27 Sep 2019 15:46:33 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-169.ams2.redhat.com [10.36.116.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBB3D60BF3; Fri, 27 Sep 2019 15:46:29 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, xen-devel@lists.xenproject.org, David Hildenbrand , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , stable@vger.kernel.org, Boris Ostrovsky , Juergen Gross , Stefano Stabellini Subject: [PATCH v1] xen/balloon: Set pages PageOffline() in balloon_add_region() Date: Fri, 27 Sep 2019 17:46:28 +0200 Message-Id: <20190927154628.8480-1-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Fri, 27 Sep 2019 15:46:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are missing a __SetPageOffline(), which is why we can get !PageOffline() pages onto the balloon list, where alloc_xenballooned_pages() will complain: page:ffffea0003e7ffc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0xffffe00001000(reserved) raw: 000ffffe00001000 dead000000000100 dead000000000200 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: VM_BUG_ON_PAGE(!PageOffline(page)) ------------[ cut here ]------------ kernel BUG at include/linux/page-flags.h:744! invalid opcode: 0000 [#1] SMP NOPTI Reported-by: Marek Marczykowski-Górecki Tested-by: Marek Marczykowski-Górecki Fixes: 77c4adf6a6df ("xen/balloon: mark inflated pages PG_offline") Cc: stable@vger.kernel.org # v5.1+ Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Signed-off-by: David Hildenbrand --- drivers/xen/balloon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 05b1f7e948ef..29f6256363db 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -687,6 +687,7 @@ static void __init balloon_add_region(unsigned long start_pfn, /* totalram_pages and totalhigh_pages do not include the boot-time balloon extension, so don't subtract from it. */ + __SetPageOffline(page); __balloon_append(page); } -- 2.21.0