Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2623914rdb; Wed, 4 Oct 2023 06:58:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETEqS0bZqKxV85cMO9k9jn3gcnT1YbsD9n1ldoN7Mp1q60RL3PXbI5kEW6o5PZEcXntMaq X-Received: by 2002:a05:6a00:852:b0:68f:efc2:ba3d with SMTP id q18-20020a056a00085200b0068fefc2ba3dmr3023262pfk.33.1696427917989; Wed, 04 Oct 2023 06:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696427917; cv=none; d=google.com; s=arc-20160816; b=bGJcJqDIwWPiptnNjjfB/OhOJrknzvRAeSUr4zgERWBDg3HshB6pKB3FsFkJiWQDy6 jFcQpfGQtcBhlwhg8Vfnj8tLNICo4Csqg2b2TWSoNEc+EiDVcKB40kQti8Ss37U4Tl9+ soRSrT6GalNmoozJPy/VhXS2fGvn454dTI51qc5YTE2XdNakwHufH5G1SH6YJfPOS2YJ e5j03KBfYuDvT4J3UTBnUhyZKBOHylh/ALYInajEt2inmmQ0TTP9hAhLaIOttbH1j0b9 htKKtqtv8sBHWFWF6dB83sLJBsi6D5k47YBQxKgdv8JIAwsmFEehv+Wt18z3gpjIg+Nn Sigg== 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=dQjv+4dLAyKFQ4Y7DVW3GVFJ29/7FnSR+W/7ZDHhKww=; fh=Uzbkrzyqq1UIrg4R8bjETmZKXdntWn8dYk244TDKrEs=; b=G7+r5nbb+uTSMqVjvklBqrM9J7JFwn067/ZCdVd+zkA7BkSuEFylVn5zTakreNKXJD FIeF87FyA7uZoo25H8fVz9rNgJhg1Ho/WopV0aaDCgzrvlqbulbNq9ivPdADJSGPzjHz s4wxdt/Y7bO6InmawgEKEYrcuXUHQaKXhj40TZxNhT8RxJ5/337AWKzYVUc5X/eTZQ9E ZiNEk+49jHR2vfRMDBPMSOobN+Z3H5WkVB2+kNYfHap2xXtLfrrSSHnaWX0fLBElEJbd 6bhKF5RtKchR16H0KNkUizgEzXNdL0yPRWVkjO3AfVeT14AyqCBV0PV0UFhSWJC177X7 4/3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XMUoiT4+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h184-20020a6383c1000000b00563e9d3d78csi3596875pge.422.2023.10.04.06.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 06:58:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XMUoiT4+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id B69F8834F761; Wed, 4 Oct 2023 06:58:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242727AbjJDN6d (ORCPT + 99 others); Wed, 4 Oct 2023 09:58:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242722AbjJDN6a (ORCPT ); Wed, 4 Oct 2023 09:58:30 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 765DFA1 for ; Wed, 4 Oct 2023 06:58:27 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A2DBC433BA; Wed, 4 Oct 2023 13:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696427907; bh=A2wSvAtglc0Xbc7LGJotQhQdmM583IU5oJ9LjFKKIu4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XMUoiT4+427ztGhRxk115JYCnj0NYYS5KaPouxlDY2jkbexB3TxuttvTRJ8xJh/RT REuqKr2zlup7x12KVOnxGLThyv0tmPRFlygQGe2NFUh+B9eVAbFC5BRZWdiWXpRcjS tQ4Geoh6wOC47VKnYt2qS+qKd+qlIZlXMnsu8U4BjrsZuri/VFpEG/OEjoY23qpb2V 8sJRMFNONtutiz+SNKVHVJIi5oOdncUphCJgUIMIA7+cNwJ05n1QXCEVbyOG/WBY3O o7ir1F2mKTRcqOBHMOrYUJ2Xvp1SvcgutbXAaIUguhkWrmMZHrVsv5f8G1DQEkaaj3 eR7jrU9emW33w== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1qo2OO-0014oA-Fx; Wed, 04 Oct 2023 14:58:24 +0100 Date: Wed, 04 Oct 2023 14:58:22 +0100 Message-ID: <86h6n6o5fl.wl-maz@kernel.org> From: Marc Zyngier To: Catalin Marinas Cc: Kristina Martsenko , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Zenghui Yu , Will Deacon , Vladimir Murzin , Colton Lewis , linux-kernel@vger.kernel.org, Oliver Upton Subject: Re: [PATCH v2 1/2] KVM: arm64: Add handler for MOPS exceptions In-Reply-To: References: <20230922112508.1774352-1-kristina.martsenko@arm.com> <20230922112508.1774352-2-kristina.martsenko@arm.com> <87sf734ofv.wl-maz@kernel.org> <9f731870-ed36-d2e4-378b-f7fbf338ebd6@arm.com> <87h6ndmixh.wl-maz@kernel.org> <0f99fa65-c8c1-5d5c-d9b0-5436b7592656@arm.com> <86ttr9nkey.wl-maz@kernel.org> 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/29.1 (aarch64-unknown-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: 185.219.108.64 X-SA-Exim-Rcpt-To: catalin.marinas@arm.com, kristina.martsenko@arm.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, will@kernel.org, vladimir.murzin@arm.com, coltonlewis@google.com, linux-kernel@vger.kernel.org, oliver.upton@linux.dev 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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 06:58:37 -0700 (PDT) On Tue, 03 Oct 2023 15:29:42 +0100, Catalin Marinas wrote: > > The way the architecture works, either with or without Kristina's > single-step change, a debugger would get confused. At least for EL0, I > find the proposed (well, upstreamed) approach more predictable - it > always restarts from the prologue in case of migration between CPUs with > different MOPS implementation (which is not just theoretical AFAIK). > It's more like these three instructions are a bigger CISC one ;) (though > the CPU can step through its parts). > > A more transparent approach would have been to fully emulate the > instructions in the kernel and advance the PC as expected but I don't > think that's even possible. An implementation may decide to leave some > bytes to be copied by the epilogue but we can't know that in software, > it's a microarchitecture thing. > > There is the case of EL1 debugging itself (kgdb) and it triggers a MOPS > exception to EL2. It would look weird for the guest but I guess the only > other option is to disable MCE2 and let EL1 handle the mismatch MOPS > option itself (assuming it knows how to; it should be fine for Linux). I > think I still prefer Kristina's proposal for KVM as more generic, with > the downside of breaking less usual cases like the kernel > single-stepping itself. I don't disagree at all. My issue isn't with Kristina's patches, which are absolutely fine. It has more to do with the shape of the FEAT_MOPS extension itself, which exposes uarch details to SW instead of abstracting them. But I've now ranted about it for close to two weeks, and it is time for me to move on... ;-) M. -- Without deviation from the norm, progress is not possible.