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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0556FC76196 for ; Tue, 11 Apr 2023 16:58:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229517AbjDKQ6I (ORCPT ); Tue, 11 Apr 2023 12:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjDKQ6G (ORCPT ); Tue, 11 Apr 2023 12:58:06 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 467BB198 for ; Tue, 11 Apr 2023 09:58:05 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4BED4D75; Tue, 11 Apr 2023 09:58:49 -0700 (PDT) Received: from [10.1.38.164] (e126864.cambridge.arm.com [10.1.38.164]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 04A943F73F; Tue, 11 Apr 2023 09:58:01 -0700 (PDT) Message-ID: Date: Tue, 11 Apr 2023 17:57:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 04/10] arm64: mops: document boot requirements for MOPS Content-Language: en-US To: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Mark Rutland , Mark Brown , Luis Machado , Vladimir Murzin , linux-kernel@vger.kernel.org References: <20230216160012.272345-1-kristina.martsenko@arm.com> <20230216160012.272345-5-kristina.martsenko@arm.com> <61b0e30a-568c-d7f6-7b67-e9fc8b68de25@arm.com> From: Kristina Martsenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/04/2023 11:50, Catalin Marinas wrote: > On Fri, Mar 24, 2023 at 01:00:43AM +0000, Kristina Martsenko wrote: >> On 17/03/2023 15:07, Catalin Marinas wrote: >>> On Thu, Feb 16, 2023 at 04:00:06PM +0000, Kristina Martsenko wrote: >>>> + For CPUs with Memory Copy and Memory Set instructions (FEAT_MOPS): >>>> + >>>> + - If the kernel is entered at EL1 and EL2 is present: >>>> + >>>> + - HCRX_EL2.MSCEn (bit 11) must be initialised to 0b1. >>>> + >>>> + - HCRX_EL2.MCE2 (bit 10) must be initialised to 0b0. >>> >>> Regarding MCE2, does EL1 actually care if EL2 wants to handle all the >>> memcpy/memset exceptions? >> >> Note that this series does not add support for mops in guests yet. > > You mean there's no KVM support. But Linux may be run under a different > hypervisor (e.g. Hyper-V) as a guest. > >> I think booting.txt can be updated when that support is added. > > In booting.txt, when you say the kernel entered at EL1, it implies that > it may be run as a guest under a random hypervisor. > > So maybe we should detail the MCE2 requirement a bit, saying that it can > be either 0 or 1 but, for the latter, the hypervisor must handle the > corresponding exceptions. That makes sense. I was going to add this, but then realized that MCE2 only traps memcpy exceptions from EL1, not EL0, so it does not have any effect with this series. So I think we can just drop the MCE2 requirement entirely for now and specify the requirement later when we add memcpy instructions into the kernel itself. Thanks, Kristina 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2740AC77B6F for ; Tue, 11 Apr 2023 16:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IqGpYZliTGtZ+3rvErvFNIafCR4yMu+A2SOxrq95cMg=; b=JuidbYOrXD0z+J 1MPdmfIdLhJIVtnJOivmd16zT+nTj3MflWonB3x/jP2VtYRPcpRY7HlFTdPKtS90/Util072z+11k L4cQ3j9+h/oE06XbnzvkbJna/3g3fCZrV7QKR+7luFoodFTXgK4ICw362uVU3+av7o1P2eDKF+Ry8 pTE+/m8D0sfqV1wx6DHB5L78bDpD8QayeTBPCozaR/7O7jY9/kXMWp9xSAcBIuupQXE+G8gwqhxkS qRO3icd8VwMP0rixf+wjsgxb9GEQCS7Y6NwJEYJJBSQchPebDBMxmE9twBVBWO8yZ+76RFLhz3kV3 z7HGJCeerNjuUfpC4Ojw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmHJt-000dgB-2O; Tue, 11 Apr 2023 16:58:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmHJq-000dez-19 for linux-arm-kernel@lists.infradead.org; Tue, 11 Apr 2023 16:58:12 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4BED4D75; Tue, 11 Apr 2023 09:58:49 -0700 (PDT) Received: from [10.1.38.164] (e126864.cambridge.arm.com [10.1.38.164]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 04A943F73F; Tue, 11 Apr 2023 09:58:01 -0700 (PDT) Message-ID: Date: Tue, 11 Apr 2023 17:57:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 04/10] arm64: mops: document boot requirements for MOPS Content-Language: en-US To: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Mark Rutland , Mark Brown , Luis Machado , Vladimir Murzin , linux-kernel@vger.kernel.org References: <20230216160012.272345-1-kristina.martsenko@arm.com> <20230216160012.272345-5-kristina.martsenko@arm.com> <61b0e30a-568c-d7f6-7b67-e9fc8b68de25@arm.com> From: Kristina Martsenko In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230411_095810_465759_EFE575D5 X-CRM114-Status: GOOD ( 18.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 04/04/2023 11:50, Catalin Marinas wrote: > On Fri, Mar 24, 2023 at 01:00:43AM +0000, Kristina Martsenko wrote: >> On 17/03/2023 15:07, Catalin Marinas wrote: >>> On Thu, Feb 16, 2023 at 04:00:06PM +0000, Kristina Martsenko wrote: >>>> + For CPUs with Memory Copy and Memory Set instructions (FEAT_MOPS): >>>> + >>>> + - If the kernel is entered at EL1 and EL2 is present: >>>> + >>>> + - HCRX_EL2.MSCEn (bit 11) must be initialised to 0b1. >>>> + >>>> + - HCRX_EL2.MCE2 (bit 10) must be initialised to 0b0. >>> >>> Regarding MCE2, does EL1 actually care if EL2 wants to handle all the >>> memcpy/memset exceptions? >> >> Note that this series does not add support for mops in guests yet. > > You mean there's no KVM support. But Linux may be run under a different > hypervisor (e.g. Hyper-V) as a guest. > >> I think booting.txt can be updated when that support is added. > > In booting.txt, when you say the kernel entered at EL1, it implies that > it may be run as a guest under a random hypervisor. > > So maybe we should detail the MCE2 requirement a bit, saying that it can > be either 0 or 1 but, for the latter, the hypervisor must handle the > corresponding exceptions. That makes sense. I was going to add this, but then realized that MCE2 only traps memcpy exceptions from EL1, not EL0, so it does not have any effect with this series. So I think we can just drop the MCE2 requirement entirely for now and specify the requirement later when we add memcpy instructions into the kernel itself. Thanks, Kristina _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel