Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7949365rdb; Thu, 4 Jan 2024 13:01:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHI74hAmL3DupmwvmywaduAWcg+liEunusI953r/AwxNbQoOgVNpuUwRJT3PeWirKQd6Sl8 X-Received: by 2002:a05:6102:3d08:b0:466:9bff:2ef8 with SMTP id i8-20020a0561023d0800b004669bff2ef8mr1619575vsv.62.1704402096080; Thu, 04 Jan 2024 13:01:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704402096; cv=none; d=google.com; s=arc-20160816; b=MDwd6N1qqqpgGmQ8+6X9woBb34rIUdNC3AQJgY0Rh7kMnT/Q6EOhRSgVwG5pakcAsC FWX3ChOWIOmhdPMYcJ6y2ArCyc5tAG3l3x86woiGxBmwFFK8e1aDEaXLG3q0wEd+Km1Q CJDq1cTAJj7R+niloP1AiyzVXLPAlbry4UMtjt8uGJ14ZOLAMLqzd99uC77VUaQqKj5J UUy9mEKJh0DbtljFmPVRvPCI01KWGVra3ug14gOaKu1tHmwMBuZABcQ/mh56boJ6m4jd vQkYQtEGp61GqzMEgOGSRuAbW5+Ab/+beDwrUshoOt3aJynN1XFphEO0j5x0Ox3lFG3K BsNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YPVgRV/8ao3J2YIK03QpOJTZI+xUh5KxC9+6PtmG1vk=; fh=pKLw49o1pP0SY9YEaKlux6HxiBC+YsvGbUMS21a1ifI=; b=WZ5fpxf331PbaEjtrnDwwcVgbu1TWRNTz5pHXujaOtJFX62GzrVPD/B1yK3cL6omn3 7eHARCd3m8edVOkNBNYKrFq7nIGCKVXF0P0XpoL8RaCTjdkyvckOzuB0FqnqX5+/JJ/a K6QTWyNyzoJwNG0ZN6pA8ksjQx+8bbqNU8bIYIy5YWl19iY5k190vYznYZ6q+U12+/yQ WL4m5DNClXJ6MMGfn5z+A4w5pqrntoAeje0066ysJnAclrVwqErpfYz41RrzRBSV43l2 oNW6IiL7x3C/+LlL21AUaGep8vN24356bWL7m1HSowIMRm50JJX2xxy9o6sB0cZLvZRM Eljg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AkAZ7oMk; spf=pass (google.com: domain of linux-kernel+bounces-17216-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17216-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s26-20020a056102301a00b00466dd79721fsi29003vsa.442.2024.01.04.13.01.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 13:01:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17216-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AkAZ7oMk; spf=pass (google.com: domain of linux-kernel+bounces-17216-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17216-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CB3381C22946 for ; Thu, 4 Jan 2024 21:01:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB46C2D624; Thu, 4 Jan 2024 21:00:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AkAZ7oMk" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90C4C2C877 for ; Thu, 4 Jan 2024 21:00:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704402006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YPVgRV/8ao3J2YIK03QpOJTZI+xUh5KxC9+6PtmG1vk=; b=AkAZ7oMkC3+W2/AkXynjuwt+sAUjxoGtiruyXAObTWDziwfTGeX+QNP9EEOCePqb6RNavj TJFTyvaj8ufmstw6Rn6EHbudwmWPQoS0nw43LXsXl5GJ7d0onOyvLXuXNCm9IejrHWu0bj 7h/jaUTtdpaiLq52upV85QpzTJyoZ4I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-358-aDmS3lvqNvSbq7FZuw-cTg-1; Thu, 04 Jan 2024 16:00:00 -0500 X-MC-Unique: aDmS3lvqNvSbq7FZuw-cTg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 66FE78B27A4; Thu, 4 Jan 2024 21:00:00 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4584D1121306; Thu, 4 Jan 2024 21:00:00 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: ajones@ventanamicro.com, Thomas Bogendoerfer Subject: [PATCH 2/4] MIPS: introduce Kconfig for MIPS VZ Date: Thu, 4 Jan 2024 15:59:57 -0500 Message-Id: <20240104205959.4128825-3-pbonzini@redhat.com> In-Reply-To: <20240104205959.4128825-1-pbonzini@redhat.com> References: <20240104205959.4128825-1-pbonzini@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Since MIPS/KVM only supports hardware virtualization using MIPS VZ, do not enable KVM blindly. Use a new Kconfig symbol CPU_SUPPORTS_VZ and do not enable it for R2 processors. Cc: Thomas Bogendoerfer Signed-off-by: Paolo Bonzini --- arch/mips/Kconfig | 9 +++++++++ arch/mips/kvm/Kconfig | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 797ae590ebdb..3eb3239013d9 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -1250,6 +1250,7 @@ config CPU_LOONGSON64 select CPU_SUPPORTS_HIGHMEM select CPU_SUPPORTS_HUGEPAGES select CPU_SUPPORTS_MSA + select CPU_SUPPORTS_VZ select CPU_DIEI_BROKEN if !LOONGSON3_ENHANCEMENT select CPU_MIPSR2_IRQ_VI select DMA_NONCOHERENT @@ -1389,6 +1390,7 @@ config CPU_MIPS32_R5 select CPU_SUPPORTS_32BIT_KERNEL select CPU_SUPPORTS_HIGHMEM select CPU_SUPPORTS_MSA + select CPU_SUPPORTS_VZ select HAVE_KVM select MIPS_O32_FP64_SUPPORT help @@ -1405,6 +1407,7 @@ config CPU_MIPS32_R6 select CPU_SUPPORTS_32BIT_KERNEL select CPU_SUPPORTS_HIGHMEM select CPU_SUPPORTS_MSA + select CPU_SUPPORTS_VZ select HAVE_KVM select MIPS_O32_FP64_SUPPORT help @@ -1459,6 +1462,7 @@ config CPU_MIPS64_R5 select CPU_SUPPORTS_HUGEPAGES select CPU_SUPPORTS_MSA select MIPS_O32_FP64_SUPPORT if 32BIT || MIPS32_O32 + select CPU_SUPPORTS_VZ select HAVE_KVM help Choose this option to build a kernel for release 5 or later of the @@ -1477,6 +1481,7 @@ config CPU_MIPS64_R6 select CPU_SUPPORTS_HUGEPAGES select CPU_SUPPORTS_MSA select MIPS_O32_FP64_SUPPORT if 32BIT || MIPS32_O32 + select CPU_SUPPORTS_VZ select HAVE_KVM help Choose this option to build a kernel for release 6 or later of the @@ -1492,6 +1497,7 @@ config CPU_P5600 select CPU_SUPPORTS_HIGHMEM select CPU_SUPPORTS_MSA select CPU_SUPPORTS_CPUFREQ + select CPU_SUPPORTS_VZ select CPU_MIPSR2_IRQ_VI select CPU_MIPSR2_IRQ_EI select HAVE_KVM @@ -1614,6 +1620,7 @@ config CPU_CAVIUM_OCTEON select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN select MIPS_L1_CACHE_SHIFT_7 + select CPU_SUPPORTS_VZ select HAVE_KVM help The Cavium Octeon processor is a highly integrated chip containing @@ -1969,6 +1976,8 @@ config CPU_SUPPORTS_ADDRWINCFG config CPU_SUPPORTS_HUGEPAGES bool depends on !(32BIT && (PHYS_ADDR_T_64BIT || EVA)) +config CPU_SUPPORTS_VZ + bool config MIPS_PGD_C0_CONTEXT bool depends on 64BIT diff --git a/arch/mips/kvm/Kconfig b/arch/mips/kvm/Kconfig index 2eb119e78b6e..1156112ffa13 100644 --- a/arch/mips/kvm/Kconfig +++ b/arch/mips/kvm/Kconfig @@ -17,7 +17,7 @@ if VIRTUALIZATION config KVM tristate "Kernel-based Virtual Machine (KVM) support" - depends on HAVE_KVM + depends on CPU_SUPPORTS_VZ depends on MIPS_FP_SUPPORT select EXPORT_UASM select PREEMPT_NOTIFIERS -- 2.39.1