Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 98A9FC433F5 for ; Sat, 19 Mar 2022 16:00:15 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.292423.496694 (Exim 4.92) (envelope-from ) id 1nVbUQ-0008Mj-JU; Sat, 19 Mar 2022 15:59:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 292423.496694; Sat, 19 Mar 2022 15:59:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nVbUQ-0008Mc-GY; Sat, 19 Mar 2022 15:59:38 +0000 Received: by outflank-mailman (input) for mailman id 292423; Sat, 19 Mar 2022 15:59:37 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nVbUP-0008MW-C2 for xen-devel@lists.xenproject.org; Sat, 19 Mar 2022 15:59:37 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nVbUP-0003gx-3S; Sat, 19 Mar 2022 15:59:37 +0000 Received: from home.octic.net ([81.187.162.82] helo=[10.0.1.102]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nVbUO-0006T8-Rw; Sat, 19 Mar 2022 15:59:36 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=Z0daPzM+BvS/I4W929gyCo8+vlXUmNoOZUIgyrJTD/U=; b=EdlyTSZC7Jp0wtjr84PYCES8Xr lb2cNT3+a36IAsFRpEhnIdgWVRhM+0PN1Wfa6u8o19YkM2zASDN0p5hu82ioVvpMVhYzqDt58qiB2 64jOmIMPR0wLn0EW8tcjZk1GIBXW/UudlWgyZPPRZVg/jnDvdnonlvDTufHVDooGFMcI=; Message-ID: <3e97abc3-3a4e-b5b1-a46d-e05d04730d2d@xen.org> Date: Sat, 19 Mar 2022 15:59:34 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v3 09/19] xen/arm32: mm: Check if the virtual address is shared before updating it To: xen-devel@lists.xenproject.org Cc: Julien Grall , Stefano Stabellini , Bertrand Marquis , Volodymyr Babchuk References: <20220221102218.33785-1-julien@xen.org> <20220221102218.33785-10-julien@xen.org> From: Julien Grall In-Reply-To: <20220221102218.33785-10-julien@xen.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 21/02/2022 10:22, Julien Grall wrote: > From: Julien Grall > > Only the first 2GB of the virtual address space is shared between all > the page-tables on Arm32. > > There is a long outstanding TODO in xen_pt_update() stating that the > function can only work with shared mapping. Nobody has ever called > the function with private mapping, however as we add more callers > there is a risk to mess things up. > > Introduce a new define to mark the end of the shared mappings and use > it in xen_pt_update() to verify if the address is correct. > > Note that on Arm64, all the mappings are shared. Some compiler may > complain about an always true check, so the new define is not introduced > for arm64 and the code is protected with an #ifdef. > > Signed-off-by: Julien Grall > > --- > Changes in v2: > - New patch > --- > xen/arch/arm/include/asm/config.h | 4 ++++ > xen/arch/arm/mm.c | 11 +++++++++-- While I working on removing the identity mapping, I realized this patch is actually getting in my way for arm32. I am planning to have multiple region that are shared, but still a single unshared region (the domheap mapping area). So I will rework the patch to check is the address is part of the unshared region. I will drop the patch from the series and move it to the next one. Cheers, -- Julien Grall