Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp630276pxb; Tue, 5 Apr 2022 16:34:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+VfqBfQCmj5MDaivhfgUl93xg3IfkUkMjRStFf1p7yBwVo3futZNhL0bwr2g1qM/KHuk6 X-Received: by 2002:a17:90b:3886:b0:1c7:c935:4447 with SMTP id mu6-20020a17090b388600b001c7c9354447mr6877854pjb.196.1649201646629; Tue, 05 Apr 2022 16:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649201646; cv=none; d=google.com; s=arc-20160816; b=zvm4SpP61tbRzKOHmDvzUE28xvx0ziylvdoK8kDC7yX+vzbbbY2WsSZuhaU8utzAp4 tpZWVNiENH9tdJwh0036OMpVEmzP+amS8sDq9Q/B73kvgayTTE/enBKIm/x+pqoTL4kh Mcq9BXlUoZz0c41Df5jj499nJJQcTkgweaL/G7tcSEG9ssE8s192epX1IMf0oD+lrSUD nTVEp4stOXQ/d+/Lu+9DxI8aWQw6xQ1hu4nkhuLYPYqmOQmbrwyfJBHAsxQIcFo4i0QX TphbuFAh9DTLW7wsuP3h+JzfsIkZT+19RwlhZNBYwbWlNSBFnrCagYjPY9+TQmea9QdG Bx1g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+zxvHQ3HpOGDVzvIHaderaXW261l9yM9haI5JS2Raig=; b=d6WS5UDiR3RpJMSJfH7we/W+JcUEtdh/QvRTimz3rYwMZHd04YbLcSXQvv0tZ1OdcI Ra51YYknvSzDI7t6oWdilXBFSMeh2VcLZHmF4lHMw6cBR3Qu/A/JqIlDdj3plaz5VjQw HScgj2ntyH2MQBl3brDWtrwr3+VCioiPQWe6BRA8BFwJA/lviceuWUp+mbBTU2Ldqtpy NvLmChim/gi+guzS+qVIMjQxt5MM0g9eaqgwjUdX0jGOHct53bQ068htMZ148HDICd1p z0mfAACBqpnWKZAXAeBJV0EoFiCEe+Hc6WNH7LV31XATk1gPOLAQs4FB9EI5UdmlVz6Q twFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zFBOHa2f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id oo11-20020a17090b1c8b00b001bd14e0302csi4412305pjb.4.2022.04.05.16.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:34:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zFBOHa2f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6114D127BEC; Tue, 5 Apr 2022 16:18:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387162AbiDEOaX (ORCPT + 99 others); Tue, 5 Apr 2022 10:30:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240305AbiDEJeC (ORCPT ); Tue, 5 Apr 2022 05:34:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AA936E34B; Tue, 5 Apr 2022 02:23:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A6CB16165C; Tue, 5 Apr 2022 09:23:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2FCEC385A2; Tue, 5 Apr 2022 09:23:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150621; bh=/vSptA5YddKrMRYEVwozcLIsPiINX27TrXq69pfeqmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zFBOHa2fxaiXd01QzwZCuF+2ArZcMEqmsscE9Y/145DO9e8VHVbb2zPHcOdZS+Ref jQeqjgnfAkI9Ce5O5Mok6nYJsWmPRWOCAdXx08MiTU05ApUkDTJU5nENQ96MOizu4k NBWzs69g/ya+wCG4zZ/rc+O0eyuc+zKN12YqnT4o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Gruenbacher , Anand Jain Subject: [PATCH 5.15 119/913] powerpc/kvm: Fix kvm_use_magic_page Date: Tue, 5 Apr 2022 09:19:41 +0200 Message-Id: <20220405070343.394194028@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Andreas Gruenbacher commit 0c8eb2884a42d992c7726539328b7d3568f22143 upstream. When switching from __get_user to fault_in_pages_readable, commit 9f9eae5ce717 broke kvm_use_magic_page: like __get_user, fault_in_pages_readable returns 0 on success. Fixes: 9f9eae5ce717 ("powerpc/kvm: Prefer fault_in_pages_readable function") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Andreas Gruenbacher Signed-off-by: Anand Jain Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/kernel/kvm.c +++ b/arch/powerpc/kernel/kvm.c @@ -669,7 +669,7 @@ static void __init kvm_use_magic_page(vo on_each_cpu(kvm_map_magic_page, &features, 1); /* Quick self-test to see if the mapping works */ - if (!fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) { + if (fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) { kvm_patching_worked = false; return; }