Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp358774rwb; Wed, 28 Sep 2022 03:50:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Hdy2VR2B++ihyD4IrUH686F514kwpAMLkonUwjTFB7OJK20bdI6bFEH0zTidBgx2mZNld X-Received: by 2002:a05:6402:5190:b0:44f:2924:78f4 with SMTP id q16-20020a056402519000b0044f292478f4mr31898297edd.217.1664362246387; Wed, 28 Sep 2022 03:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664362246; cv=none; d=google.com; s=arc-20160816; b=jp4BRv5zOGxgdT8EjB2obbyE5Na+tlTAX9USgJ6cDpI1Zkp9Wl7WHkjdC6FvaBup/v TOxbKI0r+Tqkb2esEGGQ4Gg/L4ssdgWlkwRoFY6ngICu5hYcYAC6qmFdCLfGWDVOYBjK ycoAo62jY+yaHTzInQIt2Xv2GF2VqQvw9kD2ejXN7CXZ2SQxbZQRAU6ZRIulwsq+afs0 EN/OMq+0C4cA2ecz0D+MyV7SYiERCqLbGHkGRy8MoaWG7EoRpC4kw6Xrb65rMBRQZTav +YIrH4Ks5irWzl0KrCGNJ3QFaohSWquE+f4gJKvnmUtHfHgU3gt738weAh6N89w61WUY 5lbA== 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=dJBBpD7cpo8yGcBrgcvubajr1ReVy1noJassHtrWe70=; b=Eec4slTInpsAOX6H/4gJHGR96ipH4rYsKdghccfUeB10cVuUIEboB3/SWkrGKwEqJk Owi+0GFJVA/3ZXYAwz0jlhokMn2VcXm+F5WsfEXFLJI6w23m8kR8uvNN8gnJjXZNgu3v /KFUOPavYDsms2K9mBGyJiNMkEEUwkfTBScghPPkjdSF1c0k0TsU0AJ/2vQ/zIKxyFNV yTYNZeD73/4s8pQpd07AiMrZMCcKcqO4ny2nu/p6yuSLVXNRO1BLV2tC/unbvEtfPjKy cPZlXu2ZWycNZYb9fzHc3yXhovkY/cACoz4F05pa9CMIP1MkGt4g599dHtmF1yLPWHZ+ SOVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="o/aX5kL6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a056402254f00b00446ce49ddf6si3597659edb.96.2022.09.28.03.50.18; Wed, 28 Sep 2022 03:50:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="o/aX5kL6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233648AbiI1KkU (ORCPT + 99 others); Wed, 28 Sep 2022 06:40:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233693AbiI1KkJ (ORCPT ); Wed, 28 Sep 2022 06:40:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A10502657B for ; Wed, 28 Sep 2022 03:40:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F0F8961DF2 for ; Wed, 28 Sep 2022 10:40:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57F45C433C1; Wed, 28 Sep 2022 10:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664361606; bh=3OlAOaBEucQdk6L8MDDnhqGqP1Abnek8vfO+0TZSSqM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=o/aX5kL6a1a7qgG9wFBeAX7p0tkKi3ubcDkLHi+moH4yxN9TfMTEuD/9eDq08aqs7 url400grUoEe4eyQOHVIy+FiB7dAmab8EwRShiQ+M8nYDqXokCTnBZX2sKWjLsR2h7 r/b8wyMc0PvCr2gu/zQtGc+SbN6Uh7rPhOmvBIVMV2vObrtxbCo/8jiEul9GOcMbRc Fts+ysARw97B8+jichqAu/n1FLjLe8dWiVZnK/QJT9ddcCaLiUcLo77hK2Y8cojU2v ntKcOUbiU87sFovAD5VuMq7/plLoY0jyaYcAm18feTDwQWhmvS0QD2l51SyMJrG/mM Eg189wdkfu3qg== 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 1odUU0-00DFSl-5o; Wed, 28 Sep 2022 11:40:04 +0100 Date: Wed, 28 Sep 2022 06:40:03 -0400 Message-ID: <86pmff7pfg.wl-maz@kernel.org> From: Marc Zyngier To: Mingwei Zhang Cc: Oliver Upton , Catalin Marinas , Will Deacon , James Morse , Alexandru Elisei , Suzuki K Poulose , Linux ARM , "moderated list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)" , LKML Subject: Re: [PATCH] KVM: arm64: Cleanup the __get_fault_info() to take out the code that validates HPFAR In-Reply-To: References: <20220927002715.2142353-1-mizhang@google.com> <86zgel6rz8.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/27.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: mizhang@google.com, oliver.upton@linux.dev, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, 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=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Mingwei, On Tue, 27 Sep 2022 13:48:52 -0400, Mingwei Zhang wrote: > > > > > Honestly, I'd refrain from such changes *unless* they enable something > > else. The current code is well understood by people hacking on it, and > > although I don't mind revamping it, it has to be for a good reason. > > > > I'd be much more receptive to such a change if it was a prefix to > > something that actually made a significant change. > > > > Thanks, > > > > M. > > > Hi Marc, > > Thanks for the feedback. I am not sure about the style of the KVM ARM > side. But in general I think mixing the generic code for ARM and > specific CPU errata handling is misleading. For instance, in this > case: > > + if ((esr & ESR_ELx_FSC_TYPE) == FSC_PERM) > + return false; > + > + if (cpus_have_final_cap(ARM64_WORKAROUND_834220)) > + return false; > > As shown it would be much cleaner to separate the two cases as the > former case is suggested in ARMv8 Spec D13.2.55. The latter case would > definitely come from a different source. I think we're talking at cross purposes. I don't object to the change per se. I simply question its value *in isolation*. One of the many things that makes the kernel hard to maintain is churn. Refactoring just for the sake of it *is* churn. In this case, cosmetic churn. But if you make this is part of something touching this area and improving things from a functional perspective, then I'll happily merge it. Thanks, M. -- Without deviation from the norm, progress is not possible.