Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp302288ybt; Thu, 9 Jul 2020 23:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1Rc4+593OC1egKQg7N6O9Z4eNN+2L++4pIIClXSi4xPRdSfs6E6FwhxibvVY+JV8S+Wa+ X-Received: by 2002:a17:906:38da:: with SMTP id r26mr57959805ejd.120.1594362890637; Thu, 09 Jul 2020 23:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594362890; cv=none; d=google.com; s=arc-20160816; b=FX/TyFlTiIBwrmmTvBBZbsnxpC3kRnLocO8xPt23x1VlF32bcb/0ACaqklA+uBgMWO JCGKcmZgPyMokKLWi9yshYvMjly5/3CKyqISdBrjBlcfCQrs+71BuXyrqE4uwn8ql1vZ oadFijCfxeFf1LYwxStl05vasQfBYhPO9xx501FQjjVNNxf0/Bpu8JiaK7yAD2PELKNu GyZNSe3E6kVggMOhzyj9ySi3y8wyXXNsuIdFH9JLNE8oiPIchDenuPwSinB8Ir22Pzn+ jgKnDmebKzf3AJaDPSRUmPuqqUO0YGQO4IB287g3Cry+anEepJM8lOfz8dSRTPgnydIy T3Ng== 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=yP8ZV3M5itHQT1E87mTrbVQC/8a3I5Ouq+M6YTyGlkU=; b=LMut68AxHe1LhscJalT6CpvXeGDEsWWP7KeCaVbpwbYJLEvgVETqegCJgt2M/9wpQP slPHDYQ+LmfVmc4cDqXCg3O815U+4ZdX5PwmkqRnENxIGAvV/CBizrmN9QluOBmJlp8J gaLqWjoQQKs2za4jN+hG8+1iS5e10Qf5NFaceuD0SylXwiwBagxoUEgpDvXN9/sFJ142 8h20RnB4ikMYQIh5PPlPazbnLX6lavYmGaMWH7kkRPOUUqxNFNGCum1/zMy967jX55PP vSKYoVFk+yFRj+ck6QEZM7FgvXooJ8j5FmEVfzG1nPGrnhIMcdlTmHkZtIM8qrNc+3tM dqaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=MB9O6R2R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si3552678ejr.359.2020.07.09.23.34.27; Thu, 09 Jul 2020 23:34:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=MB9O6R2R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727780AbgGJGd3 (ORCPT + 99 others); Fri, 10 Jul 2020 02:33:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbgGJGd2 (ORCPT ); Fri, 10 Jul 2020 02:33:28 -0400 X-Greylist: delayed 60 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 09 Jul 2020 23:33:28 PDT Received: from vultr.net.flygoat.com (vultr.net.flygoat.com [IPv6:2001:19f0:6001:3633:5400:2ff:fe8c:553]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88554C08C5CE; Thu, 9 Jul 2020 23:33:28 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2001:da8:20f:4430:250:56ff:fe9a:7470]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id B49E41FF17; Fri, 10 Jul 2020 06:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1594362808; bh=CCzGY+EXCa8vttsd31JrkpEa2N54sPjPX3YfSo2cRN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MB9O6R2Rj9qUc3bq6wHtwUgVS1AlTYXJMmthLtiF+nXKVX6DUJTy+PdxJGRnUkLAk uLObB46PzTRRSvhZ3lvOclpxsoEc48HWHTxed8spSZyIlBUt93fsKCdZxk9lcRnJZF sP+E8eUuuLFuGwmYqIw20OI06r0jIKQH6itB50t9parqhlAnC5mK5JFjaUQUfeZJ4/ zcmso5h3lQgN+53WTFoMBVX1mapYszcm0COAB2ZqE5S8mkT+FRuZ0EDxCnOfnF8hVg ux5X8W2Xp2OoxYALqmevJiOYlxUs26VzR+Mj1hDjNLZF6gkmNzNn/k8vOu9M3dDoXM FtnEe7vsJ0Y8Q== From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , Michal Simek , Masahiro Yamada , Paul Walmsley , Andrew Morton , Paul Burton , Alexander Lobakin , Aleksandar Markovic , Jason Wang , Paolo Bonzini , Huacai Chen , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: [RFC PATCH 2/3] MIPS: KVM: Limit Trap-and-Emulate to MIPS32R2 only Date: Fri, 10 Jul 2020 14:30:17 +0800 Message-Id: <20200710063047.154611-3-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200710063047.154611-1-jiaxun.yang@flygoat.com> References: <20200710063047.154611-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After tons of fixes to get Trap-and-Emulate build on Loongson64, I've got panic on host machine when trying to run a VM. I found that it can never work on 64bit systems. Revewing the code, it looks like R6 can't supportrd by TE as well. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig | 1 + arch/mips/kvm/Kconfig | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 6bc577f34da1..1bf115a08dad 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2183,6 +2183,7 @@ endchoice config KVM_GUEST bool "KVM Guest Kernel" + depends on CPU_MIPS32_R2 depends on BROKEN_ON_SMP help Select this option if building a guest kernel for KVM (Trap & Emulate) diff --git a/arch/mips/kvm/Kconfig b/arch/mips/kvm/Kconfig index 2bf02d849a3a..032b3fca6cbb 100644 --- a/arch/mips/kvm/Kconfig +++ b/arch/mips/kvm/Kconfig @@ -37,10 +37,11 @@ choice config KVM_MIPS_TE bool "Trap & Emulate" + depends on CPU_MIPS32_R2 help Use trap and emulate to virtualize 32-bit guests in user mode. This does not require any special hardware Virtualization support beyond - standard MIPS32/64 r2 or later, but it does require the guest kernel + standard MIPS32 r2 or later, but it does require the guest kernel to be configured with CONFIG_KVM_GUEST=y so that it resides in the user address segment. -- 2.27.0