From patchwork Wed Nov 14 21:51:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barret Rhoden X-Patchwork-Id: 10683265 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 2136213BF for ; Wed, 14 Nov 2018 22:46:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C00E29D1A for ; Wed, 14 Nov 2018 22:46:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF6802BDC9; Wed, 14 Nov 2018 22:46:49 +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 A054729D1A for ; Wed, 14 Nov 2018 22:46:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728411AbeKOIv6 (ORCPT ); Thu, 15 Nov 2018 03:51:58 -0500 Received: from mail-yw1-f74.google.com ([209.85.161.74]:38643 "EHLO mail-yw1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728393AbeKOIv6 (ORCPT ); Thu, 15 Nov 2018 03:51:58 -0500 Received: by mail-yw1-f74.google.com with SMTP id v11-v6so9707390ywv.5 for ; Wed, 14 Nov 2018 14:46:47 -0800 (PST) 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=cef6YNlIU1qhqW6QfENAl8n18Yhm93q9fZZO+r6oQn0=; b=t7HWcSySxUpO/OZdd5gwxbvVhUTog5gHX0Cq0W3jWFJ8gs/5iH5jhylAWeqcu9uzCx ksb/W0m5Omr+FwduH5FwBuwQmdkakggEOJBYBk90mW9uRLgSHz7am3k5c6qB/yk0MYdl WA6oik/LsDoixfzHWqSwqk6ddkxH2wjww0xI3b8VYw4YD4GefiBNQMKRVCJdI2ZlIARq 6ybykly4+8x/M5IWUeIAMuEDE3ZeFpgWZtIv1fND5ujnvNFbhy294N8A/3L3mgwmphLz wfUeKDy933l8XM6JHYShKMNZW3kxfxMozztfGcY1S7ySG1xGwvVgjhle3K7XTa4G59mj qrHQ== 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=cef6YNlIU1qhqW6QfENAl8n18Yhm93q9fZZO+r6oQn0=; b=ZJF8ut9A6HCdwjRp1bsoSbv7X61uKQMcZj2cHX/BZgOQ4Bfj73C95Dc0IPvYOrtR8o O4hDWoRjH2jQvS7ufToj8+PKbtNWwRKlkBRnhCIwWtxb98YzbbqBL1m2F+u2G7Nhm9mv NEkBa/WVahpbafb50BAHcmVjtDxN7LoRF9b8DVnGbM/YZSd6zZJMBB8HKDJSe+dg0ImC 6U2LUkcJtkx/kcENa4mmLGismRlfSw7oYQJuR9ay0+I6lkWs+wou2TZ1JFjMaPltPQTu JoToRDIMkeecQ7YrBSy1TMQELMogl6xa7yNPqK+fY1qg9e3Lnag5LBiZ5N3rzfT+Uu/M cZjg== X-Gm-Message-State: AGRZ1gK/HzdHrpq6urTRGpwjqW+BSrAuH+oiXxNwji+2Z15MwxVtr26D q+A+V4+z+fxgDT8DUwcdQBjp90Wa X-Google-Smtp-Source: AJdET5fNHqW6uc/jnFI/Gp6AlfYsKcuiR7tSCSnpn/Rthe6786N1XCmZCOlfQ9LKEnrlCDJ9sUINBAqS X-Received: by 2002:a81:5f55:: with SMTP id t82-v6mr1740879ywb.24.1542232389390; Wed, 14 Nov 2018 13:53:09 -0800 (PST) Date: Wed, 14 Nov 2018 16:51:55 -0500 In-Reply-To: <20181114215155.259978-1-brho@google.com> Message-Id: <20181114215155.259978-4-brho@google.com> Mime-Version: 1.0 References: <20181109203921.178363-1-brho@google.com> <20181114215155.259978-1-brho@google.com> X-Mailer: git-send-email 2.19.1.1215.g8438c0b245-goog Subject: [PATCH v2 3/3] kvm: remove redundant PageReserved() check From: Barret Rhoden To: Dan Williams , Dave Jiang , Ross Zwisler , Vishal Verma , Paolo Bonzini , " =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= " , Thomas Gleixner , Ingo Molnar , Borislav Petkov Cc: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, "H. Peter Anvin" , x86@kernel.org, kvm@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 2679e476b6c3..e0ea6d7dac14 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1700,12 +1700,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);