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 B9466C35250 for ; Sun, 9 Feb 2020 13:44:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D43420715 for ; Sun, 9 Feb 2020 13:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581255881; bh=gpU+4ZisiF1dL1/Dja5ZJplzLKeDNR6CBpoIkHvPkiM=; h=Subject:To:Cc:From:Date:List-ID:From; b=vimWKge/AIHZZFyMyJvCi8H+TRWcTNpEJkLEYxCdCWxfw6Pg8hhCbCjbWXigk8Zne AQrmvToGg6q0PC7uFHl+ItROyjJNSofiF12kmtSpHf5Fxbi0vB+klH4LdXU0PkBMnm /l+SJJlObBaVJ5kCGOERD3H3tkOCGv/B2dY17uIA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727778AbgBINol (ORCPT ); Sun, 9 Feb 2020 08:44:41 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:43129 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727663AbgBINok (ORCPT ); Sun, 9 Feb 2020 08:44:40 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B6E1121D51; Sun, 9 Feb 2020 08:44:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 09 Feb 2020 08:44:39 -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=iat59n bkGOIXwF+bj/MjKT7gslihtM+tKukZTzWm+Lo=; b=BIv80R/2YVrDLmZgAaRnek M/fySpYvBcIzlG1BkrFg2TJ+VxIMJCiPd9wJroifx0iGQibHcqwadvNz3VONyWaL +aBvQ7OXAmJ5YsUxe2y96RsGXdjEnfAQn38ufruI8dfzRukHL+onxPtbrc/e4+3J OlvfCltTDVN8e/Cvwo95stzwyq1loUHOW/Mn5tXEtVYmI0QgtgrfIUoMU6KauJU3 UsFpV+2IX7QgpXrQsHTebeGurGsDmWtkoDZkxJuoEgX+ZnZkJP/yVUgsGoqDkfLX AKs6yshCDbkdHeddONho2ZTmzcgM7fraK7Ds+K8N7mKWmtvVU3+k+Yq55jdbAx5Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrheelgdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepfeekrdelkedrfeejrddufeehnecuvehluhhsthgvrhfuihiivgepvddtne curfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (unknown [38.98.37.135]) by mail.messagingengine.com (Postfix) with ESMTPA id 743E730606FB; Sun, 9 Feb 2020 08:44:38 -0500 (EST) Subject: FAILED: patch "[PATCH] KVM: Play nice with read-only memslots when querying host" failed to apply to 4.9-stable tree To: sean.j.christopherson@intel.com, pbonzini@redhat.com Cc: From: Date: Sun, 09 Feb 2020 13:36:56 +0100 Message-ID: <1581251816206188@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.9-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;