From patchwork Mon Dec 12 15:32:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lai Jiangshan X-Patchwork-Id: 2881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2309727wrr; Mon, 12 Dec 2022 07:35:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6hFN5d76FS/i6khnCAwPWqOeSKnN+GDGa/KMBFfuwiSAPTFVlZ4P4RAIzTqjpdQLPP6YJn X-Received: by 2002:aa7:db10:0:b0:46c:ecb8:e703 with SMTP id t16-20020aa7db10000000b0046cecb8e703mr15485925eds.22.1670859332797; Mon, 12 Dec 2022 07:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670859332; cv=none; d=google.com; s=arc-20160816; b=ltOj8CVrIHdqBZcAhJqhGxqcd6CGqKYHguONI+nnmawTdh5elO5MlyI7bZNhghy5W5 7/0t4C5X5dhzP2wg7ZrGsjA+CriYe+QE2QK8WJg9hRo4R0IKiego22tQw9OSkM4m70JJ SqZCggUmei9L35LPvbpvCxw0I8h6E/IoAncMV29cX22kotG/v6Qr/fbdAeSPXgxfBYZ0 /bqFxdglFNP00dYMiuXjOxrCCURaRipKEWDcIG0u+uiUNjcwJc2mCKH+sPqnv2kL9aSj eUv+dPyza6W/er6A8XzpvRpn7i23yYoMR4Elw6RpUDibzpT0IPYTnlNI+Ex11eY67ypX fanQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dswdc8a03OJ4PZCgPN86bzdDFhJyMWhC2nUfUROyko4=; b=CWHzeQc9L23RXd5qRXF/1aDUn57Ab2EShNinPQF8F7tW6MtxTokqUaqBJB8K1h37Yl tnwgR5YNijC8lAjkHVeJ5+2wNGI4CTnl74ZcOy8ky44EyNHOi+K7R0MLcbAyScsnNqOJ ECqo/WbUEq16ikJOJnSsyEoYxntM6Smnd+QXGbGuDS7K0F8dN8FX2QNFyBqbEKo2sdzl IpyfPmo4XlYXf4PG3JY5QfM1JJzchJ2ozQR0+Yw3fdewtow+yrm1iYF6pe3mgGyi11Xf lavX/nKJ1/Svn2uYnk4b0UZJyPW10muBpmN2HzYduhNBj2kGs/Pp/SCO5PmKqxt8OPPe 2h2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kp+Ud8kO; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f22-20020aa7d856000000b00462c7bbc03esi7328413eds.114.2022.12.12.07.35.09; Mon, 12 Dec 2022 07:35:32 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=kp+Ud8kO; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232108AbiLLPbD (ORCPT + 99 others); Mon, 12 Dec 2022 10:31:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231715AbiLLPbB (ORCPT ); Mon, 12 Dec 2022 10:31:01 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E5CBDF6D for ; Mon, 12 Dec 2022 07:31:00 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id fy4so173568pjb.0 for ; Mon, 12 Dec 2022 07:31:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dswdc8a03OJ4PZCgPN86bzdDFhJyMWhC2nUfUROyko4=; b=kp+Ud8kOL2ExTdDIV+vpnRU2GZmmaCyk8O8bZFjjCdE7XizYCdqVUmGe7P9qUrnyDT LH86TfsdXK/rIPvw621tAv2HRyzc7TTIUGXG3lahls2Kj4nwh28KG0EOOIRLpad5+17/ 8e5KctNEjiB8yYWe70pjyZoaD7lBMGFPR5N7FPThkB/cKRc14SwySSE1Bb6ctTAqZn+h skOlKGWeqhkGOprcicltuqF5qCDip2NlK4ny64rwzY+75VIkSSY3kXEnc8f4Rqqr/A55 RJIPuk7whAVJ13JJCLuJJ1tPEi+K8Rb3Blq+TMo5IYoHW7gWJQKLcffcOlSFZWYr8JRm FCmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dswdc8a03OJ4PZCgPN86bzdDFhJyMWhC2nUfUROyko4=; b=Ip0UFjM2HpyHX7yJIU8aBwFMUy5Mjf4tVLph0uKEY16SoDIXtmWzIB152hjOnT234N PdSn/BwO9fhns5RTc0bMbl0FOmWYjPXmvSTORONBdOhfCBOii773yqJ+KZv+HPaozA62 ep5fa5MRAI9pcFlRSUkIxcGmO2QGw7sH/9xLFXlAhbNiMOHQPYHniF7+WZscte9tNhOm bJDp7eRb9wYmogrTSYGFoVVzH881A5Y9w3usShVOOnx9xKdAfIXQDbIuTEGUofW3AANT 0fCzyJqD7kKuQIvgyuR6cHjDaqmp5SUkwZ98zlxwNId9VVhQoyGhSQTMERycOdlXpzAG zqNQ== X-Gm-Message-State: ANoB5pklr3PSCgaijGF4Xtr51Ue91wPAavJU82eCeajdpBnHkRp8UR5O lJ1QjvNmWOs8NNhmmFRP1Bi5V0ZKCKM= X-Received: by 2002:a17:903:24b:b0:189:62fd:140e with SMTP id j11-20020a170903024b00b0018962fd140emr17961798plh.29.1670859059606; Mon, 12 Dec 2022 07:30:59 -0800 (PST) Received: from localhost ([47.88.5.130]) by smtp.gmail.com with ESMTPSA id p8-20020a1709027ec800b001893a002107sm6538031plb.0.2022.12.12.07.30.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2022 07:30:59 -0800 (PST) From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: Paolo Bonzini , Sean Christopherson , Lai Jiangshan Subject: [PATCH 0/2] kvm: x86/mmu: Skip adding write-access for spte in FNAME(sync_page) and remove shadow_host_writable_mask Date: Mon, 12 Dec 2022 23:32:03 +0800 Message-Id: <20221212153205.3360-1-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752022996085488738?= X-GMAIL-MSGID: =?utf-8?q?1752022996085488738?= From: Lai Jiangshan shadow_host_writable_mask is used only in FNAME(sync_page) for adding write-access for spte which can be added in later page fault. Skip adding it and save a bit from spte. Lai Jiangshan (2): kvm: x86/mmu: Reduce the update to the spte in FNAME(sync_page) kvm: x86/mmu: Remove useless shadow_host_writable_mask arch/x86/kvm/mmu/paging_tmpl.h | 26 +++++++++++++++++++++-- arch/x86/kvm/mmu/spte.c | 8 +------ arch/x86/kvm/mmu/spte.h | 38 +++++++++++----------------------- 3 files changed, 37 insertions(+), 35 deletions(-)