Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3702970imu; Mon, 28 Jan 2019 09:18:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN7AeQrJOzBvGINC54Ow7k4u8FZo3jphPtB89W5ZNCCkRkUaLIseocwisrmyf553yKq88Fti X-Received: by 2002:a63:cf48:: with SMTP id b8mr20920120pgj.17.1548695894086; Mon, 28 Jan 2019 09:18:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695894; cv=none; d=google.com; s=arc-20160816; b=g4bxS41OAghG11jruBkrAv80d82gs1dZbxvTJril0S4dhZhfIJ8I7aFnN8qfxe6/4f ld1At7MjsD1tZkSNfCWm3txtiBGduZbuG7+JLkllta/3Fl6E+fVWQIm3kUaPCQgr/dJe 6QKDkuJlwsbxcF2oHKI3IA2g3zFqVtyy0M1wkiznOhYeAVPSYTdLXgqxhcLNILnce6z1 rFfWWOkunqlbc4xBdMLb0rTGrLmH2+v0IfW1uzpdw4RcP4Q5zfvsNy7/fl4OGlkMpXG0 g4e/CBUILrHeo8Jh2vsCivqXsLTLEzE7KSw7GxiUlVYyKc0Yp16oB4He3AvM+47Yz6RM k5OA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8bxxu8D7psJCEz1iexpDuGPqBzV6Ep+Cf7sHH6xIAIo=; b=GK5iM/JmM1TlkVT7YtAT2xKGa6VxPW9GR8Zs0o7nX3WF8bpZwAByOV9MoX8fwIZunc Po96S3Gs76yTQ1RHmcrEkv/Fox5sMPGRE+KfJTJu6FE2w04AaoYWGQ5bT0Ov4XthVCeX K7qJXSE/XzZKRaA0YCiaf2XhxsjS/kb24BQw3F31+F9g1zDVN6WZrP9SNp2roFm4BxwI WCPXlotEoa0WXXxtgfvqPMNdH3LPKJI7T6pL6OxAahzFV138FGFZM9NWjYJJMc0F6daV rFNGjCB9Gh6li6ERDRVWEXWdxRBP47yx6SUH/Ewjr4GKOCqas2GHt9RfRsxtP7q7LyPX gonw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RA6KN2bN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si32824026plr.211.2019.01.28.09.17.58; Mon, 28 Jan 2019 09:18:14 -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=RA6KN2bN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732281AbfA1RQZ (ORCPT + 99 others); Mon, 28 Jan 2019 12:16:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:55170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732019AbfA1QGZ (ORCPT ); Mon, 28 Jan 2019 11:06:25 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 996F82147A; Mon, 28 Jan 2019 16:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691584; bh=kXdt6UGzGUpD9Wk6kxDIfLA9UIO+/ipOdmLbqafxQe8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RA6KN2bNu1Yggl+pKsIg8tuJbqML8lBY86898CkBtsWkKBvFRAAS+naTrPLfh6WC7 yVLFnmaCEvOr+bDwe8G3zLasdS4hdQcnS+33mERfPCa3+pxISIH8dSpIjNQ16VE/zm haVm/P5NRG2IQUgXem6OmzU3r8RsFHtuBbP1zeVc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Suraj Jitindar Singh , Paul Mackerras , Sasha Levin , kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 4.19 150/258] KVM: PPC: Book3S: Only report KVM_CAP_SPAPR_TCE_VFIO on powernv machines Date: Mon, 28 Jan 2019 10:57:36 -0500 Message-Id: <20190128155924.51521-150-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suraj Jitindar Singh [ 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 eba5756d5b41..79b79408d92e 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