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.2 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,URIBL_BLOCKED,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 E846CC433FE for ; Tue, 8 Dec 2020 18:47:46 +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 9D9FF23B51 for ; Tue, 8 Dec 2020 18:47:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D9FF23B51 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org 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.47667.84356 (Exim 4.92) (envelope-from ) id 1kmi1S-0004Ts-C8; Tue, 08 Dec 2020 18:47:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 47667.84356; Tue, 08 Dec 2020 18:47: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 1kmi1S-0004Tl-8L; Tue, 08 Dec 2020 18:47:38 +0000 Received: by outflank-mailman (input) for mailman id 47667; Tue, 08 Dec 2020 18:47:37 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kmi1R-0004Tg-G1 for xen-devel@lists.xenproject.org; Tue, 08 Dec 2020 18:47:37 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kmi1Q-0006Tv-7c; Tue, 08 Dec 2020 18:47:36 +0000 Received: from [54.239.6.186] (helo=a483e7b01a66.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kmi1Q-0007gh-0V; Tue, 08 Dec 2020 18:47: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: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=ENT6h8UNCHRxBm/mDi0sAcFmAXX8XKWlD5w1KWH69tE=; b=GKCWh5zCmqOJn6hamSdwxs5nSK RuwBJnBodx314KjyZVwgRuWJFrKJxwdeLNGGAhKpKUOaAW3iSYB46D2ZdL0es1R54rSYebBzSx+d6 glgtp+N4sqjzQLN0VsKsBlMasbx1A1CbDRlje4hCkMMXIOM/NK4r6vrsHHwH7lRtm7Go=; Subject: Re: [PATCH] xen/arm: Add workaround for Cortex-A53 erratum #845719 To: Bertrand Marquis Cc: Michal Orzel , "xen-devel@lists.xenproject.org" , Stefano Stabellini , Volodymyr Babchuk , Wei Chen References: <20201208072327.11890-1-michal.orzel@arm.com> <5D1B5771-A6B3-4F5E-81A1-864DBC8787B4@arm.com> From: Julien Grall Message-ID: Date: Tue, 8 Dec 2020 18:47:34 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <5D1B5771-A6B3-4F5E-81A1-864DBC8787B4@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit On 08/12/2020 14:38, Bertrand Marquis wrote: > Hi Julien, > >> On 8 Dec 2020, at 09:47, Julien Grall wrote: >> >> Hi, >> >> On 08/12/2020 07:23, Michal Orzel wrote: >>> When executing in aarch32 state at EL0, a load at EL0 from a >>> virtual address that matches the bottom 32 bits of the virtual address >>> used by a recent load at (aarch64) EL1 might return incorrect data. >>> The workaround is to insert a write of the contextidr_el1 register >>> on exception return to an aarch32 guest. >> >> I am a bit confused with this comment. In the previous paragraph, you are suggesting that the problem is an interaction between EL1 AArch64 and EL0 AArch32. But here you seem to imply the issue only happen when running a AArch32 guest. >> >> Can you clarify it? > > This can happen when switching from an aarch64 guest to an aarch32 guest so not only when there is interaction. Right, but the context switch will write to CONTEXTIDR_EL1. So this case should already be handled. Xen will never switch from AArch64 EL1 to AArch32 EL0 without a context switch (the inverse can happen if we inject an exception to the guest). Reading the Cortex-A53 SDEN, it sounds like this is an OS and not Hypervisor problem. In fact, Linux only seems to workaround it when switching in the OS side rather than the hypervisor. Therefore, I am not sure to understand why we need to workaroud it in Xen. Cheers, -- Julien Grall