Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2722382imj; Mon, 11 Feb 2019 07:31:04 -0800 (PST) X-Google-Smtp-Source: AHgI3Iadw49HqGBLxiW5kCAz6DdAK8fyfWkJaY9VKnZq4C8uz/mv5Ma944+GrCG7oNMtzzHmbbPf X-Received: by 2002:a17:902:8602:: with SMTP id f2mr25687600plo.263.1549899064368; Mon, 11 Feb 2019 07:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549899064; cv=none; d=google.com; s=arc-20160816; b=qF0yONGP6SP5tL34ibUotn3L8OOXGMWiHChzRUxZpHcTjEUK2v8YJgNScq4uDtBU8k RhdtKlZDqWPN+E3snqle0HoW1/AHPEY1Y5KcJdjNKEgYIQ+dt0evjGSm/DfAEjKEtAVr X4x3zBgnt5TsHk2iC75CGszBcJpxT2zgeUiBA/Z1dvGKf8/00EVwmb6awgzQasKa7uWZ U/k1dp3846Tj0LB0QJSoFzNlKzjDtFfCnaVMIv33zZjWp6/oZJm5N8fOxStzmXYZVMqK xBmTuVy2vOZBVbI4MJeMaO+BwI23nmf4tODvfgiepFKG3zO/q2AowfK+ELY+DGggRnJL YejQ== 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=iT7rIEsu/v3whvD3esuctmY6Yubq7oTA6x7bf9KqLUs=; b=oU2eQuDdhpoD1wHXl82+rtaN48bouEenrS4M5ZQkJj2+F4fHjKVEyzuxc75Q0JDkdx 7RzycgJbZDG8Agz1vaXOop98ivD4W97QlWflspwHmH0AQHysIdCtQgbMm+q7LlDAwvTR rDztSvyNUHnj+wqc3aAId2hUqWMuWIcZqctVI+oHpLAcmkH+8abas4IPwtWLT2xbs+Rp 2vjWQgIma5CxrOlrB46FPBO+UxJLiVhG7RppOwUgXhHL6qP3FrMJg+voLOInHj9dIup5 halKw6lhY7TVzCGfZxCU0VJN6tbcan5XI2EfuLNtfeHGgDMR9lqI43dzmrEkVRnoY2eO 6a0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fIbYTv8g; 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 l30si10941310plg.113.2019.02.11.07.30.47; Mon, 11 Feb 2019 07:31:04 -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=fIbYTv8g; 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 S2389563AbfBKO6a (ORCPT + 99 others); Mon, 11 Feb 2019 09:58:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:46124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389137AbfBKO62 (ORCPT ); Mon, 11 Feb 2019 09:58:28 -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 B068C2229E; Mon, 11 Feb 2019 14:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897108; bh=n97XlS3EzI0RzRedH3IqMN/pBek4r37pfhohJoIQcuw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fIbYTv8gV5IkB6C+pAW/omcSks8HcKStvs7MVbkBs5Z4B/6BcF2jANnpE3ZNz/4Tn uTXmqqL2zDAHnZriFBCq+uvHh5xv5RFhSlRQwlQdOGP/9dwKDE6L290fCk5CKgcVPo sRZROpRrelGdV2L4ZDGXPuxH9yC/5Oo09h8fRPo8= 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.14 094/205] KVM: PPC: Book3S: Only report KVM_CAP_SPAPR_TCE_VFIO on powernv machines Date: Mon, 11 Feb 2019 15:18:12 +0100 Message-Id: <20190211141834.780546494@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 ecb45361095b..a35995a6b34a 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -540,8 +540,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