Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3797512rdh; Fri, 29 Sep 2023 02:36:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdY7bKrLd3Sy9D9YNGnCYWvFPs7o+oAuSFWjWW1Fuyo7YfKIrRSu/XwJLkhi9+B5gj/ECp X-Received: by 2002:a05:6a20:100f:b0:15e:a46f:fcfc with SMTP id gs15-20020a056a20100f00b0015ea46ffcfcmr3168950pzc.21.1695980202916; Fri, 29 Sep 2023 02:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695980202; cv=none; d=google.com; s=arc-20160816; b=Q2EHcaSrfVVYUweQAuJL9JNHRV8kHD9TIXSeGVUiH/v4L9W2ffENpnU/bbilpC7nZw TJP3YYEzA0R2JnciTglka1b8r2Sl1qy5Aix0lBEHBjYp47TQ2k6cOvH75PcBz6L9iPWu gC8hJNF2OrnjmUWsZvY1XUuzKuu056YnxgzrDW2Hl1MAoEbMrMdnd7JxEiIFJYZYQ9QJ K1rdIwjjkymjqy+K3TxDkGzzcKU+nUzg50wjlkLcnOm3tCFe1f7GGLpGUa3I6KmNV6zE LNtRjh5hfLLAz75WX/KjeHEu+jYlsdLRvlPsGS64JhifbtDY9zrkW/b1cPZUCRLi2a/y GRzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=hiUHPw+US7t4eut9RurZsTJh+zvlP4enBbFVM/0AgkY=; fh=7CC/KVZrk+IBbga/TX4QGad1ClYZ0hvkKEErLAEIwio=; b=lnDaRMgiD6bX7dnLib9fFFLM5JetPlfvCuLb10bYHdAuI1QjAhYw07++gsyApfCcpE JlqBPRL8hIuxZaI8jYOgOFjMnC13+4/Z4a/YduY41JwqQudJvt9cIuR6aqx4/svSUfdM t6b0CXF+WS6DtaG+xAf2kORcGxOzB+qoCUtlf6BmgSkCjOE4Rbe0QCu2JmqjZuusW6r7 K0tHNsvtJmn5allQEoTbPf/P/tokpvuAXXa3SMkyFh+Nb01eDY+rydFhPUdUogr5ca+l ZqSzP8n9mCDAJ+RhhVnOK//9KLlHlhDoYVE1VPfaxiOf5INFZAAG0DY+tie4DK/NGBni LVjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EGNOFHNQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h18-20020a170902f55200b001a6ef92d441si13919007plf.599.2023.09.29.02.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 02:36:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EGNOFHNQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 04ACB832054B; Fri, 29 Sep 2023 02:29:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbjI2J31 (ORCPT + 99 others); Fri, 29 Sep 2023 05:29:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232663AbjI2J30 (ORCPT ); Fri, 29 Sep 2023 05:29:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9114E193 for ; Fri, 29 Sep 2023 02:29:24 -0700 (PDT) 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") Content-Type: text/plain; charset=US-ASCII 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-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 29 Sep 2023 02:29:37 -0700 (PDT) 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.