From patchwork Fri Feb 28 13:27:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11412255 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D5A91395 for ; Fri, 28 Feb 2020 13:29:27 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5A0D62469D for ; Fri, 28 Feb 2020 13:29:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="HpjPcDNd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A0D62469D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j7fgr-0006Se-Fk; Fri, 28 Feb 2020 13:28:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j7fgq-0006SR-Ti for xen-devel@lists.xenproject.org; Fri, 28 Feb 2020 13:28:28 +0000 X-Inumbo-ID: 33e3572c-5a2e-11ea-9c17-bc764e2007e4 Received: from smtp-fw-33001.amazon.com (unknown [207.171.190.10]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 33e3572c-5a2e-11ea-9c17-bc764e2007e4; Fri, 28 Feb 2020 13:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1582896508; x=1614432508; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IIPO1W2DLOiz3N+ViDmVAGukygPguvOI3oWjQG1Lv4Y=; b=HpjPcDNdWy4p8HJlqpkRaibqqmnhwUY28V9Jocl5luOrlbyHT5rwwJcU H1RrbPxUaFbotzktVMd0yUjrh+N9ix+3upkhWJqjbwNf9xKi2SyhVUAlF 0k0HHDKFx/C3Pled98wSTA8U7ETGSqBGYWqUgbPxGRLvld/97GcaP3KEF w=; IronPort-SDR: vVEokuDxccK8SkLKiE57P7eK2rBJ8ByHHn1dO9+b4ID6nrwBHg+956DFgsYij6KisgqCrYIEG/ 9tpx6+zw/mSw== X-IronPort-AV: E=Sophos;i="5.70,496,1574121600"; d="scan'208";a="29495744" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2b-55156cd4.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 28 Feb 2020 13:28:27 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-55156cd4.us-west-2.amazon.com (Postfix) with ESMTPS id A89BBA2D35; Fri, 28 Feb 2020 13:28:26 +0000 (UTC) Received: from EX13D32EUC002.ant.amazon.com (10.43.164.94) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Fri, 28 Feb 2020 13:28:12 +0000 Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D32EUC002.ant.amazon.com (10.43.164.94) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 28 Feb 2020 13:28:11 +0000 Received: from u2f063a87eabd5f.cbg10.amazon.com (10.125.106.135) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 28 Feb 2020 13:28:09 +0000 From: Paul Durrant To: Date: Fri, 28 Feb 2020 13:27:45 +0000 Message-ID: <20200228132749.2929-3-pdurrant@amazon.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200228132749.2929-1-pdurrant@amazon.com> References: <20200228132749.2929-1-pdurrant@amazon.com> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH 2/6] x86 / p2m: remove page_list check in p2m_alloc_table X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Andrew Cooper , Paul Durrant , George Dunlap , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There does not seem to be any justification for refusing to create the domain's p2m table simply because it may have assigned pages. Particularly it prevents the prior allocation of PGC_extra pages. Signed-off-by: Paul Durrant --- Cc: Jan Beulich Cc: Andrew Cooper Cc: George Dunlap Cc: Wei Liu Cc: "Roger Pau Monné" v2: - New in v2 --- xen/arch/x86/mm/p2m.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 3719deae77..9fd4b115be 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -695,14 +695,6 @@ int p2m_alloc_table(struct p2m_domain *p2m) p2m_lock(p2m); - if ( p2m_is_hostp2m(p2m) - && !page_list_empty(&d->page_list) ) - { - P2M_ERROR("dom %d already has memory allocated\n", d->domain_id); - p2m_unlock(p2m); - return -EINVAL; - } - if ( pagetable_get_pfn(p2m_get_pagetable(p2m)) != 0 ) { P2M_ERROR("p2m already allocated for this domain\n");