From nobody Tue Nov 11 08:34:40 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.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 (zoho.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=1569426650; cv=none; d=zoho.com; s=zohoarc; b=cI8H5x0bDCXm3RiU+6o6WdbHzrrFl0PAHIXOXKLRJrvQq1uP9B7mKWUO+PP7nkpdfmOb1evNWtixTBYUtkkMkGj/8XnvKJtNEIL0iIZMBSUPnvnI4VXuM4a2de+YTmPd2E8X9jeliGfuk1wYWFz9t8ZawX9F8kreYVKj8NRc9lI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569426650; 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:ARC-Authentication-Results; bh=AYOnCzGL00fDtUiWmv/Ej4EH5MOgFR+QKrSQ1x1dD0g=; b=GfnRkRb7DzoS3+WwG7U44R0yVjsEFszDwMUemR8SNq8fnASiFi//CgbdBUMKyuynGJS/l+iXo9136//IytkHtyM24LlfTBn2THQiHUPzTdzxJtQIDFHe/EbiOOuDNoWVXs59x+BpjIs/1q4J9mhgTVFe/Tcv1ASx6OeoDt8El+M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.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 1569426650604209.99598945937237; Wed, 25 Sep 2019 08:50:50 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iD9Y0-0000sV-CD; Wed, 25 Sep 2019 15:49:44 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iD9Xy-0000rO-TX for xen-devel@lists.xenproject.org; Wed, 25 Sep 2019 15:49:42 +0000 Received: from mga12.intel.com (unknown [192.55.52.136]) by localhost (Halon) with ESMTPS id 12ae8a4c-dfac-11e9-9637-12813bfff9fa; Wed, 25 Sep 2019 15:49:35 +0000 (UTC) Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 08:49:33 -0700 Received: from tlengyel-mobl2.amr.corp.intel.com (HELO localhost.localdomain) ([10.252.129.153]) by orsmga006.jf.intel.com with ESMTP; 25 Sep 2019 08:49:33 -0700 X-Inumbo-ID: 12ae8a4c-dfac-11e9-9637-12813bfff9fa X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,548,1559545200"; d="scan'208";a="193812668" From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Wed, 25 Sep 2019 08:48:47 -0700 Message-Id: <8e1eedcf984b7948683fe2a2cf5cb1d2b6c5a674.1569425745.git.tamas.lengyel@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [RFC PATCH for-next 09/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 d5ecb77679..60057fd3ed 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -1317,7 +1317,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(d, gfn, @@ -1327,7 +1327,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