From nobody Mon Feb 9 19:09:47 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1577722376; cv=none; d=zohomail.com; s=zohoarc; b=I36i7yHRxZQx8CYKq9EroC6NAE/nTUZS8HuEhNI0gJfEBBdBANZBJLkkRFvlS9T+5RX1dPXghU97QGwe6pu7ZRjxeQcCghAB6USCqIcN9B/RJjZ++R/pQF5zV6zqY/g+AkDzeESDGktQ2lGtc84hLscQ5RV1EV/rAxo6arANUuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577722376; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3FU7QGMxsrw211xM2JM7KkKSghcvMQcIJanDjiaOFv4=; b=Y3Q5QGIa9/xRKVTtv8/N+Pk/9d/ZekIReGp7IzPNXxhTVH9hRQNfZz1U7SvQA4mowUWkUu32491ta68lRX2T8SrMvqVoi48UnD3qvf0F2gBaJ2jnZKK5wcA47GimFkgyH5C8BU9kg6SQ8Gik9LoPAvEBkNho5hJUwuB2LO46XLI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1577722376434587.922516626173; Mon, 30 Dec 2019 08:12:56 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ilxeD-00024k-Jq; Mon, 30 Dec 2019 16:12:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ilxeC-00024e-Tl for xen-devel@lists.xenproject.org; Mon, 30 Dec 2019 16:12:00 +0000 Received: from mga14.intel.com (unknown [192.55.52.115]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 196ad99e-2b1f-11ea-88e7-bc764e2007e4; Mon, 30 Dec 2019 16:11:56 +0000 (UTC) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Dec 2019 08:11:55 -0800 Received: from tlengyel-mobl2.amr.corp.intel.com (HELO localhost.localdomain) ([10.254.94.206]) by orsmga003.jf.intel.com with ESMTP; 30 Dec 2019 08:11:54 -0800 X-Inumbo-ID: 196ad99e-2b1f-11ea-88e7-bc764e2007e4 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,375,1571727600"; d="scan'208";a="221167330" From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Mon, 30 Dec 2019 08:11:31 -0800 Message-Id: <32e7f9ffc37da3445080a6901a638a43805765de.1577721845.git.tamas.lengyel@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 07/18] x86/mem_sharing: Use INVALID_MFN and p2m_is_shared in relinquish_shared_pages X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Tamas K Lengyel , Tamas K Lengyel , Wei Liu , George Dunlap , Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" While using _mfn(0) is of no consequence during teardown, INVALID_MFN is the correct value that should be used. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/mm/mem_sharing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index 3aa61c30e6..95e75ff298 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -1326,7 +1326,7 @@ int relinquish_shared_pages(struct domain *d) break; =20 mfn =3D p2m->get_entry(p2m, _gfn(gfn), &t, &a, 0, NULL, NULL); - if ( mfn_valid(mfn) && t =3D=3D p2m_ram_shared ) + if ( mfn_valid(mfn) && p2m_is_shared(t) ) { /* Does not fail with ENOMEM given the DESTROY flag */ BUG_ON(__mem_sharing_unshare_page( @@ -1336,7 +1336,7 @@ int relinquish_shared_pages(struct domain *d) * unshare. Must succeed: we just read the old entry and * we hold the p2m lock. */ - set_rc =3D p2m->set_entry(p2m, _gfn(gfn), _mfn(0), PAGE_ORDER_= 4K, + set_rc =3D p2m->set_entry(p2m, _gfn(gfn), INVALID_MFN, PAGE_OR= DER_4K, p2m_invalid, p2m_access_rwx, -1); ASSERT(!set_rc); count +=3D 0x10; --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel