Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2653313imj; Mon, 11 Feb 2019 06:31:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IamH+Xx6SWY/ICCVye54UseGSwSvgp3rRzk20NAcxeU7QszwgZCbL0G4Ce/gNxaQjZRPlwi X-Received: by 2002:a62:4886:: with SMTP id q6mr37919157pfi.182.1549895472012; Mon, 11 Feb 2019 06:31:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895472; cv=none; d=google.com; s=arc-20160816; b=OltEZuHL/PFyvqlFecLKdN0M2gKHd2e+vkWC4rhqQ1RoYnES6Eoddt3oft23T4nT4O 4MlKNIQOnMFjQRU7CHeELIuZdJl/iEQbjlOQhHw7ZuPiQ30v5fl/BnKnPmz6r/CLYNDU M5AaQI5duhjjIrPTNbTIac8M1yyDZKpdP+xiYOM8gupeFLUVbENGNbxqisBQMHOweMbH yVaQfRjXs1VblBvonIU7+6AwwgimZh8D9R+Bt2oCL50TBut7Nlc9gAfWrf+oGg8fUJ4E +DmGD2vF6IFyrA2cKcpyxZYNt77xUgkjZcSX9dGl+NaiFlDLfpSb/e3j3zxSrVu6fWv2 eNIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j3ibKO2OESCCyy0anl13xSTqRf8My51yy7yNOWokxyM=; b=uBvt3OUMQACNKBFkRJJscIcWNXe0oBaN7DZ3TJwlYmkrIga1hFQuHFHUlw0lRLzXPo DGGmZyIktsRffQ0X7hQWEi5AaC28mjHNpspsJEFWZVOzSANxWRz8+DCMMEzMYt/2HxG0 Gfj0NiT8p6zho6sfZ3sMZn5ljVXnW1j8izi12GTux6HQOjClSDXBhsYL/NjJ8sMMvTy9 tK9u3VuUk41ZXOM2VvBNU5wt+jhjbsaXLTgwe+zhkRR8disu8yR1G9PktCuQeYPG/O7P aEa+jldaLw+pOrtArTWww97lrz3FZ598J2RRxoRobE7jmipzlauPqMQYnm7c4nuJ/lrA Q+rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RpDP98lb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si9921817plt.356.2019.02.11.06.30.56; Mon, 11 Feb 2019 06:31:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RpDP98lb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729916AbfBKO2z (ORCPT + 99 others); Mon, 11 Feb 2019 09:28:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:34872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728690AbfBKO2y (ORCPT ); Mon, 11 Feb 2019 09:28:54 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 04CA720675; Mon, 11 Feb 2019 14:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895333; bh=1HpzyshGXFjumtVxFzluG04FSUIjtLRCxJSKgAPboYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RpDP98lbz/MMQm3LOUsSqw5BlAlzEGHlg8DIZaIPajWq7Jgw8stHXs9k/nizdsnrg pQNHbOzPpWgMlB2fD7p9C391URq8wVUzf1sOjneUy4Q7Z1biAzTXlzw5SeCm+eaMeO FFM9E6NBq20OoTI1JAeETRdGnYujiz99QQuojGoA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suraj Jitindar Singh , Paul Mackerras , Sasha Levin Subject: [PATCH 4.20 170/352] KVM: PPC: Book3S: Only report KVM_CAP_SPAPR_TCE_VFIO on powernv machines Date: Mon, 11 Feb 2019 15:16:37 +0100 Message-Id: <20190211141857.868461181@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 693ac10a88a2219bde553b2e8460dbec97e594e6 ] The kvm capability KVM_CAP_SPAPR_TCE_VFIO is used to indicate the availability of in kernel tce acceleration for vfio. However it is currently the case that this is only available on a powernv machine, not for a pseries machine. Thus make this capability dependent on having the cpu feature CPU_FTR_HVMODE. [paulus@ozlabs.org - fixed compilation for Book E.] Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras Signed-off-by: Sasha Levin --- arch/powerpc/kvm/powerpc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 2869a299c4ed..75e2e471442f 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -543,8 +543,11 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) #ifdef CONFIG_PPC_BOOK3S_64 case KVM_CAP_SPAPR_TCE: case KVM_CAP_SPAPR_TCE_64: - /* fallthrough */ + r = 1; + break; case KVM_CAP_SPAPR_TCE_VFIO: + r = !!cpu_has_feature(CPU_FTR_HVMODE); + break; case KVM_CAP_PPC_RTAS: case KVM_CAP_PPC_FIXUP_HCALL: case KVM_CAP_PPC_ENABLE_HCALL: -- 2.19.1