From mboxrd@z Thu Jan 1 00:00:00 1970 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 6CA5EC46467 for ; Mon, 16 Jan 2023 09:32:39 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.478500.741735 (Exim 4.92) (envelope-from ) id 1pHLqv-0004QP-48; Mon, 16 Jan 2023 09:32:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 478500.741735; Mon, 16 Jan 2023 09:32:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHLqv-0004QI-0m; Mon, 16 Jan 2023 09:32:29 +0000 Received: by outflank-mailman (input) for mailman id 478500; Mon, 16 Jan 2023 09:32:27 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHLqt-0004QC-J7 for xen-devel@lists.xenproject.org; Mon, 16 Jan 2023 09:32:27 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pHLqt-0001SZ-AO; Mon, 16 Jan 2023 09:32:27 +0000 Received: from 54-240-197-238.amazon.com ([54.240.197.238] helo=[192.168.9.85]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pHLqt-0004H3-4a; Mon, 16 Jan 2023 09:32:27 +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=EUmlqLYuI7kybKU7uph9Vinh1iqxbE7SF94BU9Q6j6w=; b=TywtCwmdmgNHEyO8AZmfiq063U /ks2x40Ai/iE2Uawf2N2HRGn1laPFOaDV0urAiUOKNoDC8gDo8NOJjz+6IQb/UKgP9KDMIRZt08oH 1Xft1BTVQNZl9LN0uzZ2U4zW0N1EN0dMA6n1Bz8GI8Dt8ktH1q9v4cCX1TQGFenL+mf0=; Message-ID: <18b23f77-6d51-0851-5a58-b19d790b09cc@xen.org> Date: Mon, 16 Jan 2023 09:32:25 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v4 13/14] xen/arm64: mm: Rework switch_ttbr() Content-Language: en-US To: Michal Orzel , xen-devel@lists.xenproject.org Cc: Luca.Fancellu@arm.com, Julien Grall , Stefano Stabellini , Bertrand Marquis , Volodymyr Babchuk References: <20230113101136.479-1-julien@xen.org> <20230113101136.479-14-julien@xen.org> <19559eed-525e-206f-c8ac-f9902f610714@amd.com> From: Julien Grall In-Reply-To: <19559eed-525e-206f-c8ac-f9902f610714@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 16/01/2023 09:23, Michal Orzel wrote: > Hi Julien, Hi Michal, > On 13/01/2023 11:11, Julien Grall wrote: >> diff --git a/xen/arch/arm/arm64/mm.c b/xen/arch/arm/arm64/mm.c >> index 798ae93ad73c..2ede4e75ae33 100644 >> --- a/xen/arch/arm/arm64/mm.c >> +++ b/xen/arch/arm/arm64/mm.c >> @@ -120,6 +120,36 @@ void update_identity_mapping(bool enable) >> BUG_ON(rc); >> } >> >> +extern void switch_ttbr_id(uint64_t ttbr); >> + >> +typedef void (switch_ttbr_fn)(uint64_t ttbr); >> + >> +void __init switch_ttbr(uint64_t ttbr) >> +{ >> + vaddr_t id_addr = virt_to_maddr(switch_ttbr_id); > Shouldn't id_addr be of type paddr_t? No because... > >> + switch_ttbr_fn *fn = (switch_ttbr_fn *)id_addr; ... here it will be used as a virtual address. >> + lpae_t pte; >> + >> + /* Enable the identity mapping in the boot page tables */ >> + update_identity_mapping(true); > Could you please add an empty line here? Sure. Cheers, -- Julien Grall