Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1350553rwb; Tue, 27 Sep 2022 11:46:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7u5fTuQdH5TU++a1dpgpzbgx+4xPQmYwAP9EA8y4mLU18uWwS1NaEyNwiQUrZH1T3wvB4N X-Received: by 2002:a17:907:94d6:b0:782:b10a:7e91 with SMTP id dn22-20020a17090794d600b00782b10a7e91mr19235616ejc.220.1664304360676; Tue, 27 Sep 2022 11:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664304360; cv=none; d=google.com; s=arc-20160816; b=Snqxw7hJFaWVBlm9SZg1tA31qomEQQsK+ED8aiiqyrxP52QGdvKmSlYY8Rz35icoIb IvR54Y8UkqBtrhFv/4DZelvphW7YY5UuCOpkEAWMtU1g+dZZQCJCLLfdZAhJI/Dt7zTP DMgoLnNB39zd4Z/4tCfCxXLp9nzMeccZFhtDoeaFGrnhEjeUwb5EoxyUB4DKKm0drQVM skdj1thJgs20rT8+i+fzDo/oSFocPiWzlCCPbG5w0FqwnLtWDSJ95l3y1kdequTCP5gV +kkczW9N+aO7d67GxQfZx+ehfYQwL1i2zX3bEU1Xkdm220KfPG1gfYxwQ2NXMRkDphtj LBJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aH5zY6y4AfoLNMJw/j/1E8ilTfiC2ZGSCFZ+mICKnl8=; b=mub1gZWF0RFA1x1JfBtPgTOjKGstInZCjAoGZ++VtI9XNacQp7RLp4rxpiB+cyxCfw WNKBGxej/Gu7xvx+h5eLb++cydM3Dl8s44fB0Zay3Y7vENeEcYN2mD+O/taqrJIeRlo0 7+feFqvpOV+D6olA/5q8c9x9NUM90OMNNgtLLd5OmHgmO6rc0mUfDcKQwbWS7NBT5yjF i34ihMN7DluIQMYgOlJoYUH6ykEwxNW6zGhkev98YhrslMt0+X8MpJCFoXEp0hPYb8V0 qahFdYj0e1gbxmlI6BC/6YOYEmTjNe+Wc0JcAPgLvpsNjJ6Bo4OrSAb4mJXHG7Mslcub SEDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hjD82U6Q; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a29-20020a50c31d000000b00456efe7cbd9si1935517edb.591.2022.09.27.11.45.29; Tue, 27 Sep 2022 11:46:00 -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=@google.com header.s=20210112 header.b=hjD82U6Q; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233524AbiI0Rua (ORCPT + 99 others); Tue, 27 Sep 2022 13:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233196AbiI0RuE (ORCPT ); Tue, 27 Sep 2022 13:50:04 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DFF380BDC for ; Tue, 27 Sep 2022 10:49:04 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id y9so5468428ily.11 for ; Tue, 27 Sep 2022 10:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=aH5zY6y4AfoLNMJw/j/1E8ilTfiC2ZGSCFZ+mICKnl8=; b=hjD82U6QZ7vWgB3aKUqxIHx7uLRDY+PcY/enPg2cqnqmZKGLg4UhLPDXuZUQ6qwhZW qfLu5LSwOMwVVD2uSOk7Iswfy6MJfHCd7IUHXvNmD2astnQzod0kSvrvsjszWrJQIiUn 8HEuA9jyZX/DB95xq2FOExGaCSjljxjNeIaeOgq6mOXTq5guJsCvo0+B82B/AmO3BWG/ HxeuIWKqNAsMmoDcjS9ER3j0EZkomrD0ZSPKVGqo3V8Q4PG41UGwDovBo7hIYwstXQyH MVnEN9crkiX4tRX4a4lekaK9IXHW7M4I9z/UQIt0JaCZz2qtANOK2mfmenzAjWc/i6xO BcOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=aH5zY6y4AfoLNMJw/j/1E8ilTfiC2ZGSCFZ+mICKnl8=; b=1lej7gTrNQO7QG3IWC138lsqFwKu9ocYn3OjgjBzbfqbikNVDHYjW+DSphdeBGvqlR 3QNGETkYn4Cgaa1eFwy9hiaSwn3dEyHf5sE5ox4CPPIeQ4h4wY8gddMXr6eLQApwl8V2 hc9Vjn3e7bW0k6107cUDcvC18Qz2BXpYjyqEsNRvwYPHk8MgXC/DH+EUnMNxK876L2dj CeDO96LMNW5WhkRakKxXJrsYrVJEsCGo85jYf4MNQ1ZQa3DKG1aIskO2R58UxBMYgQ7P hLpsNNDzjdeAI/CEHBV91a4gW3cNlYA7XQCxuzDt3x0D9NKgYQiZ/5Y9B1PmBJaLzRYC No/w== X-Gm-Message-State: ACrzQf2f8nLYo1MhN7KA+ujR3TlhxockQXaVUlM0z+epZwXTD1dQZt+f 3LEHQpqXvPu0rEyQuAvksteAzgHtD8PgcZKdopQ2IQ== X-Received: by 2002:a05:6e02:1bcc:b0:2f7:2d36:36b1 with SMTP id x12-20020a056e021bcc00b002f72d3636b1mr10950913ilv.240.1664300943591; Tue, 27 Sep 2022 10:49:03 -0700 (PDT) MIME-Version: 1.0 References: <20220927002715.2142353-1-mizhang@google.com> <86zgel6rz8.wl-maz@kernel.org> In-Reply-To: <86zgel6rz8.wl-maz@kernel.org> From: Mingwei Zhang Date: Tue, 27 Sep 2022 10:48:52 -0700 Message-ID: Subject: Re: [PATCH] KVM: arm64: Cleanup the __get_fault_info() to take out the code that validates HPFAR To: Marc Zyngier 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 > > 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. But I also don't have a strong opinion pushing this one. So, let me pull it back then :)