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 15E97E743FE for ; Fri, 29 Sep 2023 09:30:05 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fAluBrBNuYgdMYyAh9wvrtN7quuS8LkMJUMdf9pDCoI=; b=duFtZKcaAcxLNd RIqjmgLJTaYbeUGg//uwONCw/pchX06OI4SktNlZ7X4E7ySlADjZzb3aij+n4Hf2sUKVP2GrSY/LJ CZGcKIu+zP3ECs2MRj557eDBzTv8AFpzbuSqU3CJYyK4KvWZD+Nx1c3eg7lwB0v3IsJOE0cld1H2z EKA2f8TgoKChnwiai6OFHbFl79Ne/e4n20TRsS/9qebBwOwpLYDmmq0ha0yoYt9RUqg4+382IfRk5 xPJsWIHzBzROzkGtYT4rHHXD0lMsLVu3J2hWAvTAvzKtO/YQsEjwFnz8rkvyeCfM0VN96iJTd5VbO WTzxzmXiCkEU9xrT+bWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qm9oS-007Suh-1u; Fri, 29 Sep 2023 09:29:32 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qm9oP-007Stz-18 for linux-arm-kernel@lists.infradead.org; Fri, 29 Sep 2023 09:29:31 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id F08B4CE23E4; Fri, 29 Sep 2023 09:29:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 315D1C433C8; Fri, 29 Sep 2023 09:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695979764; bh=aTVDfMrpvoQxbs2F2fAU74KL3jCAgxkyD3bdzXkB8OY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EGNOFHNQxdi/7IZ+eBiP70sWnzgRMvZzks5mXPosAhKT48iqDWBb7hc0ioxj+I9aT Cceb364iuBebyiWYt+lp5tkLm0rpuUMSdsVIvRWDUFLTKMApB9ihLQ+4wPFN55O17e EBxp+rm+YBnATNH15GnykmmeZVtRltixT8EbIPNZm5l6GvW8qhu6VL/0R7j1EERk5R A239uflY9K3qCLcKVSXd3Pc9vLnXxboEVvaSbDzyMrdgBUDEu9TN+6DPhsJ4fc53GD VQlBN4ipprpl/O/MxH0wGuOMAxgotbCvZBw7oodOfChLQ+T/Q5at3gkTyHzOhzCMsP ON6x4eiNMG/8w== Received: from [85.255.233.37] (helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qm9oH-00HCg9-Rb; Fri, 29 Sep 2023 10:29:22 +0100 Date: Fri, 29 Sep 2023 10:29:20 +0100 Message-ID: <87fs2xmiof.wl-maz@kernel.org> From: Marc Zyngier To: Kristina Martsenko Cc: Oliver Upton , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Vladimir Murzin , Colton Lewis , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/2] KVM: arm64: Support for Arm v8.8 memcpy instructions in KVM guests In-Reply-To: <6687f58c-0da9-0583-2dc1-2089f292b745@arm.com> References: <20230922112508.1774352-1-kristina.martsenko@arm.com> <6687f58c-0da9-0583-2dc1-2089f292b745@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 85.255.233.37 X-SA-Exim-Rcpt-To: kristina.martsenko@arm.com, oliver.upton@linux.dev, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, vladimir.murzin@arm.com, coltonlewis@google.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230929_022929_734766_C3774516 X-CRM114-Status: GOOD ( 31.73 ) 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 Thu, 28 Sep 2023 17:55:39 +0100, Kristina Martsenko wrote: > > On 27/09/2023 07:00, Oliver Upton wrote: > > Hi Kristina, > > Hi Oliver, > > > > > On Fri, Sep 22, 2023 at 12:25:06PM +0100, Kristina Martsenko wrote: > >> Hi, > >> > >> This is v2 of the series to allow using the new Arm memory copy instructions > >> in KVM guests. See v1 for more information [1]. > > > > > > Thanks for sending out the series. I've been thinking about what the > > architecture says for MOPS, and I wonder if what's currently in the > > Arm ARM is clear enough for EL1 software to be written robustly. > > > > While HCRX_EL2.MCE2 allows the hypervisor to intervene on MOPS > > exceptions from EL1, there's no such control for EL0. So when vCPU > > migration occurs EL1 could get an unexpected MOPS exception, even for a > > process that was pinned to a single (virtual) CPU implementation. > > > > Additionally, the wording of I_NXHPS seems to suggest that EL2 handling > > of MOPS exceptions is only expected in certain circumstances where EL1 is > > incapable of handling an exception. Is the unwritten expectation then > > that EL1 software should tolerate 'unexpected' MOPS exceptions from EL1 > > and EL0, even if EL1 did not migrate the PE context? > > > > Perhaps I'm being pedantic, but I'd really like for there to be some > > documentation that suggests MOPS exceptions can happen due to context > > migration done by a higher EL as that is the only option in the context > > of virtualization. > > That's a good point. This shouldn't affect Linux guests as Linux is > always able to handle a MOPS exception coming from EL0. But it would > affect any non-Linux guest that pins all its EL0 tasks and doesn't > implement a handler. It's not clear to me what the expectation for > guests is, I'll ask the architects to clarify and get back to you. My understanding is that MCE2 should always be set if the hypervisor can migrate vcpus across implementations behind EL1's back, and that in this context, EL1 never sees such an exception. I guess the only case where we could let EL1 handle such exception is by only setting MCE2 on the first entry into the guest after a vcpu migration (and clear it after that). Is it worth the effort? Absolutely not. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel