Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E76E1C433DB for ; Wed, 10 Feb 2021 11:46:03 +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 9C7BC64E40 for ; Wed, 10 Feb 2021 11:46:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C7BC64E40 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.83575.155838 (Exim 4.92) (envelope-from ) id 1l9nwK-0003kE-EE; Wed, 10 Feb 2021 11:45:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 83575.155838; Wed, 10 Feb 2021 11:45: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 1l9nwK-0003k7-Ax; Wed, 10 Feb 2021 11:45:48 +0000 Received: by outflank-mailman (input) for mailman id 83575; Wed, 10 Feb 2021 11:45:46 +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.92) (envelope-from ) id 1l9nwI-0003jy-L0 for xen-devel@lists.xenproject.org; Wed, 10 Feb 2021 11:45:46 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1850729e-a164-4b33-a415-7e53541065b6; Wed, 10 Feb 2021 11:45:45 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 958E4ACB7; Wed, 10 Feb 2021 11:45:44 +0000 (UTC) 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: 1850729e-a164-4b33-a415-7e53541065b6 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1612957544; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MALmJZYxkvItDYeYSbDrpDApSanAyKVOqrMAYZr3qm8=; b=TZnxQS6E/iSaMtvK4/6lK2L25855gulmlQ7TMtdmS74PPjEmf1B0602UQLp8VHFzyXxwUS yCUKRvpYfmsZrgnpc8CyDQcpuehZt9aM7PILSY+HZ9+eR7TAeC8d2tCYKtSP7/LbDBJOZN 7DseA114+iJpu7nmJMBXfnm5o24tU8w= Subject: Re: [for-4.15][PATCH v2 1/5] xen/x86: p2m: Don't map the special pages in the IOMMU page-tables To: Julien Grall Cc: xen-devel@lists.xenproject.org, hongyxia@amazon.co.uk, iwj@xenproject.org, Julien Grall , Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <20210209152816.15792-1-julien@xen.org> <20210209152816.15792-2-julien@xen.org> <5bf0a2de-3f0e-8860-7bc7-f667437aa3a7@suse.com> <65797b03-7bd8-92e9-b6c7-e8eccde9f8ba@suse.com> From: Jan Beulich Message-ID: <71c4150a-0b81-cdc3-b752-814f58cb5ca4@suse.com> Date: Wed, 10 Feb 2021 12:45:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 10.02.2021 12:40, Julien Grall wrote: > On 10/02/2021 11:38, Jan Beulich wrote: >> On 10.02.2021 12:34, Roger Pau Monné wrote: >>> On Wed, Feb 10, 2021 at 12:10:09PM +0100, Jan Beulich wrote: >>>> On 10.02.2021 09:29, Roger Pau Monné wrote: >>>>> I get the feeling this is just papering over an existing issue instead >>>>> of actually fixing it: IOMMU page tables need to be properly freed >>>>> during early failure. >>>> >>>> I take a different perspective: IOMMU page tables shouldn't >>>> get created (yet) at all in the course of >>>> XEN_DOMCTL_createdomain - this op is supposed to produce an >>>> empty container for a VM. >>> >>> The same would apply for CPU page-tables then, yet they seem to be >>> created and populating them (ie: adding the lapic access page) doesn't >>> leak such entries, which points at an asymmetry. Either we setup both >>> tables and handle freeing them properly, or we set none of them. >> >> Where would CPU page tables get created from at this early stage? > > When mapping the APIC page in the P2M. I don't think you can get away > with removing it completely. It doesn't need putting in the p2m this early. It would be quite fine to defer this until e.g. the first vCPU gets created. Jan