From patchwork Thu Apr 4 20:23:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barret Rhoden X-Patchwork-Id: 10886269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1AC9E922 for ; Thu, 4 Apr 2019 20:24:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07CC928AE3 for ; Thu, 4 Apr 2019 20:24:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F003128AF2; Thu, 4 Apr 2019 20:24:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A2F228AE3 for ; Thu, 4 Apr 2019 20:24:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730855AbfDDUYQ (ORCPT ); Thu, 4 Apr 2019 16:24:16 -0400 Received: from mail-qk1-f202.google.com ([209.85.222.202]:36644 "EHLO mail-qk1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730848AbfDDUYI (ORCPT ); Thu, 4 Apr 2019 16:24:08 -0400 Received: by mail-qk1-f202.google.com with SMTP id y64so3221364qka.3 for ; Thu, 04 Apr 2019 13:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=xCLL7LcnK/EfAdZPNNEYIgclrtC6A/GQfyjKs9KqXfk=; b=R6urs1OnBmpgDtETpgp5lhwN1bbIvjyh0T0PxRNx8AMkjoOKTYS9L6pfHJyaINvgN7 6b/xo1AdfuHQtR/rADaYjHn9OD+lUYOKAjswnTZk1i9hmpJZmN85/ye6cFy847HPXBxV KIw+51PUdGPSAn1SfUVM8fOpwqx1xk9zRzuv8ifLhbp4jrRVYgPQrmV9yeDdBehA9UYC UoV5bJn1NAF3i7HknTXqzXSXjATIV+iVOKdzFGZyHbJ1BIXZJJeGa5RBrtpecLdXwSjo 17lzlrVHY0ubvY9k6NzTm/HPm5ua31iKV43twrPTLhHdyuBXjn1gycxqgcA6kEMROM63 w4fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=xCLL7LcnK/EfAdZPNNEYIgclrtC6A/GQfyjKs9KqXfk=; b=lV13YNtOBnbOtJQl4POY5RkYPTabeH1Qa2FWA0RgVbMcbXEkeMXEmr8jBDd+r/ozQO Oc74d0QNrzYCoj3keUjHoZYULSL4qg5cIKZfo8dszAt1Veh1MAIbslnzoy2QKObJkamN XnW9Y77d+M4redWFCNO6Vhog2vl0jf1o8wHPKdEQC/mbM9WMLcZGHB2nWQmlyShaBetL TXC+qg9CZkYmDBosvu3RReZGV56tq+BSqHnto6vVKpKQ6p4FlA/GQuavnZ0LOouoVMmD /XXFswxcXSH3nh1H7SmHa7heBUplBqP777qrr7BBY1whL3w74EGHfRZw5sSy//vNbh5M FNLQ== X-Gm-Message-State: APjAAAVMHpOwRbLWfKkx6oG5rfpfqD4F8/QbJ5d/3WX3fM9HSNv5fGYp 4giqyDHGrIRNIg+ZAMXy0zseZa+P X-Google-Smtp-Source: APXvYqznMxtqI38l39KsNnxVYhuotW8fBQzlZRNiusEEq702paDjnOTBVACaULock+UYMm0yj6YtKIA1 X-Received: by 2002:ac8:24d2:: with SMTP id t18mr1266663qtt.1.1554409446885; Thu, 04 Apr 2019 13:24:06 -0700 (PDT) Date: Thu, 4 Apr 2019 16:23:45 -0400 In-Reply-To: <20190404202345.133553-1-brho@google.com> Message-Id: <20190404202345.133553-4-brho@google.com> Mime-Version: 1.0 References: <20190404202345.133553-1-brho@google.com> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog Subject: [PATCH v3 3/3] kvm: remove redundant PageReserved() check From: Barret Rhoden To: Paolo Bonzini , Dan Williams , David Hildenbrand , Dave Jiang , Alexander Duyck Cc: linux-nvdimm@lists.01.org, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, yu.c.zhang@intel.com, yi.z.zhang@intel.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP kvm_is_reserved_pfn() already checks PageReserved(). Signed-off-by: Barret Rhoden Reviewed-by: David Hildenbrand --- virt/kvm/kvm_main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 55fe8e20d8fd..c44985375e7f 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1782,12 +1782,8 @@ EXPORT_SYMBOL_GPL(kvm_release_pfn_dirty); void kvm_set_pfn_dirty(kvm_pfn_t pfn) { - if (!kvm_is_reserved_pfn(pfn)) { - struct page *page = pfn_to_page(pfn); - - if (!PageReserved(page)) - SetPageDirty(page); - } + if (!kvm_is_reserved_pfn(pfn)) + SetPageDirty(pfn_to_page(pfn)); } EXPORT_SYMBOL_GPL(kvm_set_pfn_dirty);