From nobody Sun May 5 03:56:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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=1616103446; cv=none; d=zohomail.com; s=zohoarc; b=jImkAPrYY78Ql/jTw5O32pi7RuUv1qkuh+/9SfLDi1rbuYEjqWCPt0MPFSGg0ygm6YgtD8xOzNDZfZ3xSani2lqaPsmb02+W7PelNbmhV40BZnLTdFHHsKld+NCUbFbKz5OSm/ppjwWA2vw2Q5aLFjAHhu4Ju2o72oRoVuDSJh8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616103446; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=IjTuS47e5wU/6+tRtCyJiW0Lx2FSlZimsynRAH+H1tw=; b=Dak8eQY7Q0BymhxdcH6GaBGAncOlQYHhzvqVgXicH+JfXiok0Bb0RK7e3hE31Rq0Sn3FYFpLyZjlQ5WLC9lWFjhiPqW8t66IqNg5AIiE+Y4MTIQUgIijdince2/MbyzS9PLY1ULmR66DbvUn8jsSAlmoUh9gw5+ghrHuXlnnk+Y= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1616103446209745.1434381983057; Thu, 18 Mar 2021 14:37:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.99096.188239 (Exim 4.92) (envelope-from ) id 1lN0K0-0006mO-C0; Thu, 18 Mar 2021 21:36:48 +0000 Received: by outflank-mailman (output) from mailman id 99096.188239; Thu, 18 Mar 2021 21:36:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lN0K0-0006mH-8z; Thu, 18 Mar 2021 21:36:48 +0000 Received: by outflank-mailman (input) for mailman id 99096; Thu, 18 Mar 2021 21:36:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lN0Jy-0006mC-Ty for xen-devel@lists.xenproject.org; Thu, 18 Mar 2021 21:36:46 +0000 Received: from mga11.intel.com (unknown [192.55.52.93]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 94e665e2-818a-49b0-8076-167991c15e4d; Thu, 18 Mar 2021 21:36:44 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 14:36:43 -0700 Received: from uscipion-mobl.amr.corp.intel.com (HELO ubuntu.localdomain) ([10.212.120.33]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 14:36:41 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 94e665e2-818a-49b0-8076-167991c15e4d IronPort-SDR: khfWbVH43/eYuUSi6uwRCy2I7RtfVRvxv4znCh2qkKShJ1gefAipzOIQ1e3yYpTOyeNBFwRPhn zk1ygg1pxDiQ== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="186421945" X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="186421945" IronPort-SDR: U3WcM3RW5tct+EwOFvhYDnoFepoNdbX8jUezrZ0exlGXn0LN8oytr5OXtGmd1BqpN/VTY0udx6 q6xf2j/LVnIw== X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="523408007" From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Cc: Tamas K Lengyel , Tamas K Lengyel , Jan Beulich , Andrew Cooper , George Dunlap , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH for-4.15] x86/mem_sharing: copy parent VM's hostp2m's max_mapped_pfn during forking Date: Thu, 18 Mar 2021 14:36:32 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When creating a VM fork copy the parent VM's hostp2m max_mapped_pfn value. = Some toolstack relies on the XENMEM_maximum_gpfn value to establish the maximum addressable physical memory in the VM and for forks that have not yet been unpaused that value is not going to reflect the correct max gpfn that's possible to populate into the p2m. This patch fixes the issue. Signed-off-by: Tamas K Lengyel Reviewed-by from someone in the community. Reviewed-by: Andrew Cooper --- xen/arch/x86/mm/mem_sharing.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index 00ada05c10..98b14f7b0a 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -1761,6 +1761,7 @@ static int copy_settings(struct domain *cd, struct do= main *d) return rc; =20 copy_tsc(cd, d); + p2m_get_hostp2m(cd)->max_mapped_pfn =3D p2m_get_hostp2m(d)->max_mapped= _pfn; =20 return rc; } --=20 2.25.1