From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B8AAC35250 for ; Sun, 9 Feb 2020 13:44:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E60020715 for ; Sun, 9 Feb 2020 13:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581255890; bh=mvO6U7s1SpTZ18RR1qqEp0A0yGB+jjFU98lwGaxB7oQ=; h=Subject:To:Cc:From:Date:List-ID:From; b=heHSJMBnSXobmK3dmxve0qVQdo380TFD/lWNHjoDYAz3hmsr4NmnMpylr76uptqGz d3ewMiWd1BL28abQZ+Db5bTNj6ipwUKk26n3yMpJ4JFhEbsWpjwXCW+nGFcIj+AhNp GYP181hM7YxiFkZujcxf92SriwH0AVZSerncwJt0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727663AbgBINot (ORCPT ); Sun, 9 Feb 2020 08:44:49 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:54767 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727654AbgBINot (ORCPT ); Sun, 9 Feb 2020 08:44:49 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E34B421D51; Sun, 9 Feb 2020 08:44:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 09 Feb 2020 08:44:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=zgxxV3 h/jqIOx/dEyyT9QU/MFBvoOx7MSmN2kDJF6Yg=; b=3azKUXqQBUpiiCbyQCEj5w m/vGCBfx7kjs++q45ySSxfRawKm73fsdn5VII4WdO3STdbmUIY4V3OsXdQ7ZqPWT IaODubk7ZiEjF1vMctcauQTnr5dlWnusftcBQKKIOXB5UDBzGPNuikrTQBIoKY/X PL9pGByxK+IUnUEA7XRdPZZLzoLH7elCOyN+5k/enxvy428vPcgsCE2fMjcJC58y j4YUm8+YgvWfi9QNUNVhjrvSlR7KWTbfh2vwdjwQB+7wnyCkjp2WvqJbfjc+X3Zd 7b3Sxp6kd6E877wD1MC9nzZNAz9BbHO20k+lmb71udPODM3gdS360PIVd+QFAvyQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrheelgdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepfeekrdelkedrfeejrddufeehnecuvehluhhsthgvrhfuihiivgepvddune curfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (unknown [38.98.37.135]) by mail.messagingengine.com (Postfix) with ESMTPA id B3CD23280059; Sun, 9 Feb 2020 08:44:47 -0500 (EST) Subject: FAILED: patch "[PATCH] KVM: Play nice with read-only memslots when querying host" failed to apply to 4.4-stable tree To: sean.j.christopherson@intel.com, pbonzini@redhat.com Cc: From: Date: Sun, 09 Feb 2020 13:36:58 +0100 Message-ID: <15812518181610@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 42cde48b2d39772dba47e680781a32a6c4b7dc33 Mon Sep 17 00:00:00 2001 From: Sean Christopherson Date: Wed, 8 Jan 2020 12:24:38 -0800 Subject: [PATCH] KVM: Play nice with read-only memslots when querying host page size Avoid the "writable" check in __gfn_to_hva_many(), which will always fail on read-only memslots due to gfn_to_hva() assuming writes. Functionally, this allows x86 to create large mappings for read-only memslots that are backed by HugeTLB mappings. Note, the changelog for commit 05da45583de9 ("KVM: MMU: large page support") states "If the largepage contains write-protected pages, a large pte is not used.", but "write-protected" refers to pages that are temporarily read-only, e.g. read-only memslots didn't even exist at the time. Fixes: 4d8b81abc47b ("KVM: introduce readonly memslot") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson [Redone using kvm_vcpu_gfn_to_memslot_prot. - Paolo] Signed-off-by: Paolo Bonzini diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f6f8ffc2e865..eb3709d55139 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1409,7 +1409,7 @@ unsigned long kvm_host_page_size(struct kvm_vcpu *vcpu, gfn_t gfn) size = PAGE_SIZE; - addr = kvm_vcpu_gfn_to_hva(vcpu, gfn); + addr = kvm_vcpu_gfn_to_hva_prot(vcpu, gfn, NULL); if (kvm_is_error_hva(addr)) return PAGE_SIZE;