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 8A753C433DB for ; Wed, 10 Feb 2021 11:39:00 +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 4A4E564DAF for ; Wed, 10 Feb 2021 11:39:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A4E564DAF 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.83570.155811 (Exim 4.92) (envelope-from ) id 1l9npb-0002go-E2; Wed, 10 Feb 2021 11:38:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 83570.155811; Wed, 10 Feb 2021 11:38:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l9npb-0002gh-Ak; Wed, 10 Feb 2021 11:38:51 +0000 Received: by outflank-mailman (input) for mailman id 83570; Wed, 10 Feb 2021 11:38:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l9npa-0002gc-8f for xen-devel@lists.xenproject.org; Wed, 10 Feb 2021 11:38:50 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6a207d90-c8a2-4938-a808-4c2306cce00f; Wed, 10 Feb 2021 11:38:49 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B28C9AC97; Wed, 10 Feb 2021 11:38:48 +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: 6a207d90-c8a2-4938-a808-4c2306cce00f 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=1612957128; 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=jxAulCg55OWg0eLoqRjD1nST8G5UM5JmrxqpCT4vzDQ=; b=E+nIenkiWB+i6+JPpyCmAQDwpiA49BD33fpAaq7YU6559w/1c0oUgueP3tPcJ5EU0FLAUI xCvua0EBPQOraHYY0b0+YsSzLdOXpN3pRatybiD0JW7l0bRHUGlG6kMGBm3waEFjI09tJ0 udXAAf2tt8U6i++kp4nIHc4JmWBakvM= Subject: Re: [for-4.15][PATCH v2 1/5] xen/x86: p2m: Don't map the special pages in the IOMMU page-tables To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Cc: xen-devel@lists.xenproject.org, hongyxia@amazon.co.uk, iwj@xenproject.org, Julien Grall , Andrew Cooper , Wei Liu , Julien Grall References: <20210209152816.15792-1-julien@xen.org> <20210209152816.15792-2-julien@xen.org> <5bf0a2de-3f0e-8860-7bc7-f667437aa3a7@suse.com> From: Jan Beulich Message-ID: <65797b03-7bd8-92e9-b6c7-e8eccde9f8ba@suse.com> Date: Wed, 10 Feb 2021 12:38:48 +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: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? There's no memory assigned to the guest yet, so there's nothing to map afaics. Jan