Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6311177pxv; Thu, 29 Jul 2021 11:17:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ4xuIieZOiwDzXLfdXsfS3hyGaD9d8KsH0ynqePxgvwOG5CrdfZMErefX4fcgTUhGGHnS X-Received: by 2002:a05:6638:41a7:: with SMTP id az39mr5566525jab.52.1627582673645; Thu, 29 Jul 2021 11:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627582673; cv=none; d=google.com; s=arc-20160816; b=VgnUNGdhW1tw63TQG7ecKqsp1MXlNQb08chPHlO32KnJHBiH0PiERjpBQjjsCkEAgg ETK0CZPncSS4JUvYxMRzOUDU1r3E/apOwyJxhK9OnniAt4kswbYfGUTFyKLorgxzdJfN sKJkm/eTqXtoW7gqLjsmkWSsO0DeZMjjp+9N/GeuctwYvNUV38XGZisGUmsZzz/0Ocjs uNhxmDGHMLZmsdflFjOBb2rrAEqGXOD/sV6R0Waye/k+enXbPTHQCY8vLC/FbtPz5fBc PXvThRBoLwVTd5picRd0B2Cw3aajRaD0PiosciYoxQO+rZlMGn0NohOp6TbX/cICb8Kj mYZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QcT13ioi7Udva2v8xy7VeLWfKV+j8bNd/FwGrC91o0U=; b=e/ddy4C9ur5qP69G04brVdan0SMvssaPyq31F1pr+ZoSeg0/II8tOYaJ4jERDMLfiU ueehQmssB74BYH2eL9hK9DA/JJ4Q6lxV3DsSWhUwka6KwoA4aU6TuqLLiJbjnZkxZdDs DyPRWi8kjuFitt5OfA2SW6NkQGi6NFV0wHvVF9D0cpwbvImfWu/nOeA/RnA3yW3s814r SeJesV+cUY3CX7fD6OAF8PGtBQRRLpQlL+lKTT5qvnPjP1cKWrtm+pJAWTsJFh6bCzFJ snuWTf1NqxVZSNAe47QTKYgcCLEkt1J8GJkjwPDmiBmQq5Jyh7/7r6s/0udBEPkueXgE VXKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lQMP3cDF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d16si4250114ilf.64.2021.07.29.11.17.39; Thu, 29 Jul 2021 11:17:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lQMP3cDF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229657AbhG2SRB (ORCPT + 99 others); Thu, 29 Jul 2021 14:17:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbhG2SRA (ORCPT ); Thu, 29 Jul 2021 14:17:00 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52829C0613C1 for ; Thu, 29 Jul 2021 11:16:57 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id u9-20020a17090a1f09b029017554809f35so16915724pja.5 for ; Thu, 29 Jul 2021 11:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QcT13ioi7Udva2v8xy7VeLWfKV+j8bNd/FwGrC91o0U=; b=lQMP3cDFPKZ8xlFcPqczF1/tYUNJ8XQbVOyl5sgdq8YD1lbmSAqbRy4Yqh7/kd8tag WAvK0fWXX6IBAifWgdo6pPDSBXhhwEd4vLh4lpETMHUNw5orLWkUS2Jx6y4Bq618MIkJ IT+zD+l7fRHEb9bv3gmfkOZAOSbQTmuPk9/8B6+RBgpCTDHpxqkXNb9kwpoB915n2tzD 0kDAsuVVL+s6ISQxaY2sZQXceXaZeEu/pmx16Ig+G4R4FhfjvjnxisF5X3mbt027jgjP sJ+w/4SBb3pjtj6i/eLFxxC2rNjNvORKLFmW+reRQN/RYUz3beInyiEDzNe7avclDUNq daGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QcT13ioi7Udva2v8xy7VeLWfKV+j8bNd/FwGrC91o0U=; b=c2O6xZjg8V8kT1ZrBrGPll2C3ydxw8qlViSZ1oOEN6IKbD5QdTFnY8bG5KVCjXEbcH sTCTomAU1qU5IRwnIjwKpYI0zvv4B74RLTU0v0fExMI5isGvoW/4mT/y6/7vayB6ZOe6 mJMw2KO2ucYvA/FVZww+i4KL5IA2VW1Q9wzVMawQEbCzoKiwlYET1+0DYuYzZKlVFPPM 8Riaz4KYgZ9lI90XDigLZPe/yFRIz3LvvfWT35Kz++9+7HPtKFGE1yLgfuZcv1FvM/J/ nYotgy8GqRbzu7eeZaKi25iT2Eqye8o9a5ixwxzlSBTwp1tOswTJBonQWB/++zxJ8TTI f3cA== X-Gm-Message-State: AOAM5314OFQmOsHnheicZ1q+/U+Za3iG3IPTxcSGl9Ub3dZ9IKgMw9if Qls25rsC8uNaO6LLWXpZohs6RA== X-Received: by 2002:a17:902:eb43:b029:12c:76bc:d85f with SMTP id i3-20020a170902eb43b029012c76bcd85fmr4030830pli.23.1627582616701; Thu, 29 Jul 2021 11:16:56 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id 21sm4146091pfh.103.2021.07.29.11.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 11:16:55 -0700 (PDT) Date: Thu, 29 Jul 2021 18:16:52 +0000 From: Sean Christopherson To: Mingwei Zhang Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Ben Gardon , Jing Zhang Subject: Re: [PATCH v2 1/3] KVM: x86/mmu: Remove redundant spte present check in mmu_set_spte Message-ID: References: <20210726175357.1572951-1-mizhang@google.com> <20210726175357.1572951-2-mizhang@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210726175357.1572951-2-mizhang@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 26, 2021, Mingwei Zhang wrote: > Drop an unnecessary is_shadow_present_pte() check when updating the rmaps > after installing a non-MMIO SPTE. set_spte() is used only to create > shadow-present SPTEs, e.g. MMIO SPTEs are handled early on, mmu_set_spte() > runs with mmu_lock held for write, i.e. the SPTE can't be zapped between > writing the SPTE and updating the rmaps. > > Opportunistically combine the "new SPTE" logic for large pages and rmaps. > > No functional change intended. > > Suggested-by: Ben Gardon > Signed-off-by: Mingwei Zhang > --- Reviewed-by: Sean Christopherson