From nobody Thu May 9 02:06:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1706635809; cv=none; d=zohomail.com; s=zohoarc; b=S8jsciez3znttQ+AfIfxWw5iH4VncrO5/ukg4kUF5CecWjsjYeiY1PKo8IxdvJFP8MT6JBFFjAu3eVNNvynsQF5rAVn/n+iJoVJb9nbgYDVokQgK7R7uEmz+6FAD93oQrCfbEuxrbNBiZxb9pTof/doveOsapafiq0lwyThz4YA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706635809; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YUsBRa33zDNhna1IY2kSXXVWAQohLzBiuT+6OdS+yss=; b=aA3uFyB+BddDLpsbw5bP09vZf6ScLN2KXbQVgAlBNOgNuEbUaPLZ4h6EYPBsAKD76o9PKP74+53prOn+UIKRMBhcVsAk0/iy72CgwTpcQKBt3Th77Gud58WpSQzrNbRni/s4ONICg3DFSfRTHGtgN6Arp8cyVgcqKuzcu1rVk0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1706635809632313.6986834786609; Tue, 30 Jan 2024 09:30:09 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.673651.1048054 (Exim 4.92) (envelope-from ) id 1rUrvh-0006bg-Ka; Tue, 30 Jan 2024 17:29:49 +0000 Received: by outflank-mailman (output) from mailman id 673651.1048054; Tue, 30 Jan 2024 17:29:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rUrvh-0006bZ-I0; Tue, 30 Jan 2024 17:29:49 +0000 Received: by outflank-mailman (input) for mailman id 673651; Tue, 30 Jan 2024 17:29:48 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rUrvg-0006bR-0v for xen-devel@lists.xenproject.org; Tue, 30 Jan 2024 17:29:48 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rUrvf-0004fN-Jx; Tue, 30 Jan 2024 17:29:47 +0000 Received: from 54-240-197-224.amazon.com ([54.240.197.224] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1rUrvf-0008Ft-9w; Tue, 30 Jan 2024 17:29:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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:MIME-Version:Message-Id:Date: Subject:Cc:To:From; bh=YUsBRa33zDNhna1IY2kSXXVWAQohLzBiuT+6OdS+yss=; b=1Qf15y EUEA2XgnFY4Ync8YizcwsKjNMMUZGcvOtLCGzvPVE55uqjyISYe8L04jt4qHz8fKfKDoc9EIL6gaF cyNRnT/yXta3IK7VLyufamHvnEbi2CQaexcRllEUzMSAZNTsUFkDWsNa1xjmeFMfejV1Ui4TXxnwf 4Go9C6VaE0c=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: julien@xen.org, Julien Grall , Stefano Stabellini , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Oleksandr Tyshchenko Subject: [PATCH] xen/arm: Properly clean update to init_ttbr and smp_up_cpu Date: Tue, 30 Jan 2024 17:29:42 +0000 Message-Id: <20240130172942.52175-1-julien@xen.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1706635811500100001 Content-Type: text/plain; charset="utf-8" From: Julien Grall Recent rework to the secondary boot code modified how init_ttbr and smp_up_cpu are accessed. Rather than directly accessing them, we are using a pointer to them. The helper clean_dcache() is expected to take the variable in parameter and then clean its content. As we now pass a pointer to the variable, we will clean the area storing the address rather than the content itself. Switch to use clean_dcache_va_range() to avoid casting the pointer. Fixes: a5ed59e62c6f ("arm/mmu: Move init_ttbr to a new section .data.idmap") Fixes: 9a5114074b04 ("arm/smpboot: Move smp_up_cpu to a new section .data.i= dmap) Reported-by: Oleksandr Tyshchenko Signed-off-by: Julien Grall Reviewed-by: Bertrand Marquis Tested-by: Oleksandr Tyshchenko --- xen/arch/arm/mmu/smpboot.c | 2 +- xen/arch/arm/smpboot.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/mmu/smpboot.c b/xen/arch/arm/mmu/smpboot.c index bc91fdfe3331..4ffc8254a44b 100644 --- a/xen/arch/arm/mmu/smpboot.c +++ b/xen/arch/arm/mmu/smpboot.c @@ -88,7 +88,7 @@ static void set_init_ttbr(lpae_t *root) * init_ttbr will be accessed with the MMU off, so ensure the update * is visible by cleaning the cache. */ - clean_dcache(ptr); + clean_dcache_va_range(ptr, sizeof(uint64_t)); =20 unmap_domain_page(ptr); } diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 119bfa3160ad..a84e706d77da 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -449,7 +449,7 @@ static void set_smp_up_cpu(unsigned long mpidr) * smp_up_cpu will be accessed with the MMU off, so ensure the update * is visible by cleaning the cache. */ - clean_dcache(ptr); + clean_dcache_va_range(ptr, sizeof(unsigned long)); =20 unmap_domain_page(ptr); =20 --=20 2.40.1