Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2028369pxa; Sun, 16 Aug 2020 20:52:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2hqM52v8RfLFIM3+HKg9wXmcP+VMV+8ey4j8Oy4sdzFjvBxRIZIwVR6WX759mwiXE28Mw X-Received: by 2002:a17:906:9984:: with SMTP id af4mr13792064ejc.90.1597636372358; Sun, 16 Aug 2020 20:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597636372; cv=none; d=google.com; s=arc-20160816; b=EW1Mwb1GUSUO+0ipmqVHOMSCyNG42vJGhY2iZDkjnVdGn1EnJQJb2DS0pp52opW5wx 9j6S9z+1OlSh5Av8lAEjnrjoGcOpwt6888kMaJHvSf60H7XdOV8ER3pWaoRrR+WN7jnN Jkz4+ANkuLON6bNTbMIKZJLutSopXWHNBrNUizN+meUxnvMZ2SPTPAp5AbJT9ZUR2OZL LtYUA/p0T/27mStpQcpjTbBnLgMcfBXke6cGW4vHa9LXUDCCx9CD/zJaARq2qlE9LvON zGKJFVjN4cCoyT8jyXiLJP9dnwOMP1inHh0rLtvwM8IYEVC4nO4Glh6r8f6w83Mw4qv0 Ee7Q== 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=3dPixjS5tVR6qb1SmEaUISQ7Vf4I674EOS3uP+vH9TQ=; b=oPVCiDUlRot8H15w953EtNu6/SChooZuLR5SVcJ6dljjpJUPtx7Ab4SOyaeyr5U2B8 GzYBBTScFPtLH40vkFI5Lq5LG8LqDqzHIhZtV+X4+PyLKDf/OaUmShPM/B+pYGjCwEbz 148aCs+K5wspqS4wKJhFJ4kJbDknvbEpct68u8X1nh0nvwspQF2MBKXUhNvhfFlzyu64 b6+xNYDyD5UZgZ6atctfU5KkqU0ARlqCwcTMxfENXvE9dNZcDNPI8veFwFLSEZh1FHox EuwpEHBTn14uS9vc450ihOH8mONC8TOiwwFyeebQdjofIEaWtnwoL3FIthESgGURxfR0 HA6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=l3yc9oba; 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 s21si10575472ejm.557.2020.08.16.20.52.29; Sun, 16 Aug 2020 20:52:52 -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=l3yc9oba; 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 S1727871AbgHQDuE (ORCPT + 99 others); Sun, 16 Aug 2020 23:50:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727813AbgHQDt7 (ORCPT ); Sun, 16 Aug 2020 23:49:59 -0400 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 31213C061345; Sun, 16 Aug 2020 20:49:59 -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 3D253200D1; Mon, 17 Aug 2020 03:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1597636198; bh=kL2YUnCYl8qwBpA6tmpQUNRMhCovsao/yjQt7sCo0Bo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l3yc9obazAd+ebc31MIheSBo1LGXzc2+BKtmErfwYN0nOQcBzgiqjToLCjPtMBla5 XLW5DctmBESfPdkcLgW9zf61XDVzByrtDNg1OLOwyTXOtkyfsBpVp4ADs6G2PkPA5R 4sTtWQsiHGEiZUY575dw0j5IXTHocCOTdN55ROmXU3dyfMmo5kr26TvOf3lfhPLIka bWAH/Yhte3hphyj3IgKBXYXDcVsNm6Bs0ce8lR46GGqw43a9jTtp9Kme2mU2Ds6snq k6tau/J34MKdQT+8Ou59wP0+2LOdKrV7lHRN+dzZABA/ooP+sQDozNm1kWFrT4UYFy eQ/5qA7R6GUvA== From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , Huacai Chen , Aleksandar Markovic , Paul Burton , Serge Semin , WANG Xuerui , =?UTF-8?q?=E5=91=A8=E7=90=B0=E6=9D=B0=20=28Zhou=20Yanjie=29?= , Liangliang Huang , afzal mohammed , Ingo Molnar , Peter Xu , "Peter Zijlstra (Intel)" , Sergey Korolev , Alexey Malahov , Anup Patel , Marc Zyngier , "Rafael J. Wysocki" , Jens Axboe , Steven Price , Michael Kelley , Mike Leach , Ulf Hansson , Atish Patra , Ming Lei , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH 7/7] MIPS: KVM: Don't use htimer when INTIMER is disabled Date: Mon, 17 Aug 2020 11:46:46 +0800 Message-Id: <20200817034701.3515721-8-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.28.0.rc1 In-Reply-To: <20200817034701.3515721-1-jiaxun.yang@flygoat.com> References: <20200817034701.3515721-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 When INTIMER is disabled by host, the GT compare interrupt will be ignored. Signed-off-by: Jiaxun Yang --- arch/mips/kvm/vz.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/kvm/vz.c b/arch/mips/kvm/vz.c index 9d03bd0a604a..1d2140f7461a 100644 --- a/arch/mips/kvm/vz.c +++ b/arch/mips/kvm/vz.c @@ -341,6 +341,12 @@ static bool kvm_vz_should_use_htimer(struct kvm_vcpu *vcpu) if (kvm_mips_count_disabled(vcpu)) return false; + if (cpu_has_extimer) { + /* Guest htimer compare interrupt will be ignored if INTIMER is disabled */ + if (!(read_c0_config6() & LOONGSON_CONF6_INTIMER)) + return false; + } + /* Chosen frequency must match real frequency */ if (mips_hpt_frequency != vcpu->arch.count_hz) return false; -- 2.28.0.rc1