From patchwork Wed Sep 30 22:12:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Tai X-Patchwork-Id: 11810379 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CCED92C for ; Wed, 30 Sep 2020 22:14:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4580420719 for ; Wed, 30 Sep 2020 22:14:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="af6iHoGu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="zVGbNSyl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4580420719 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=1GycIxejXmGHys0/W3Id121aSFs7BHgzj/ce19tdAKc=; b=af6iHoGu/Q/GQjyG8Xl3LKUqy9 W6RHSFWlItFKuMK5f0OAZVccNgn1Ky/6Vsmg7w/HgMP2liZhjuVhJ0qy5dp1Q2oSoEIxvCANicyQm uXJIxtzyB2fTnAaiHXA+65cblV2YorzZHU4UHnHuMSgzbyc9uQ/P6v5wNsvNnzo3DuikCtQXbpt+a vfCBO2dueb8rpVUAoewDhft84Lo/S10G2LIQtcjLZw4yhyBPZ8+N9j0OOOJa2ngUpDo6UcRelgLN0 Sqk4dxfZ2cOK1Q/RVSn/JLnUC+v+LI2B7GVREsVEiRuIHDWoff2h5tvxt/xpKC1lZ6hcEFlWRljBk Sm56libA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNkLH-000500-DD; Wed, 30 Sep 2020 22:12:55 +0000 Received: from aserp2130.oracle.com ([141.146.126.79]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNkLF-0004zg-9f for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2020 22:12:54 +0000 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08UMA59o133073; Wed, 30 Sep 2020 22:12:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2020-01-29; bh=djWsOShf+02bZz82qBkoZE9ucpn4vqY+77IN/a6iH2s=; b=zVGbNSylMfdh1LJtRsrVbQtDe3b7mteOGVhcQdlskWa1IEBXKU3+wpUewsZwOC9cTZNE rkaTPFzaN3SmnlEWVx9H9Ev5sDhqf7oTFFEfet/JJM3i5Jttf1LrrWq7GRvkMkH2WCi8 p82RffYi6JtZ7afnSzHkQdk646J6hU5/B6Sgb6uA1ONrP5BbdIQpBlmpwhMIHAD8gAbm kLLbJ+jJWrY5jRmwWAKMpy3amxNqopdyJHfjhfPGm/J6lId7pQsojdWYYWz7U2lPWVfL 0eNUDU4yKShWJt14MMFxSorV4lPauIjr7ELbFGlIfeZRLcwFhX7+FhAEHZoyRi8F9oJA bA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 33su5b34j3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 30 Sep 2020 22:12:41 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08UMAnr9067284; Wed, 30 Sep 2020 22:12:40 GMT Received: from pps.reinject (localhost [127.0.0.1]) by userp3020.oracle.com with ESMTP id 33tfdupwhe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 30 Sep 2020 22:12:40 +0000 Received: from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08UMCdMH071129; Wed, 30 Sep 2020 22:12:39 GMT Received: from brm-x62-20.us.oracle.com (brm-x62-20.us.oracle.com [10.80.150.35]) by userp3020.oracle.com with ESMTP id 33tfdupwh3-1; Wed, 30 Sep 2020 22:12:39 +0000 From: Thomas Tai To: maz@kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH] KVM: arm64: Fixes ARM VM hangs at boot Date: Wed, 30 Sep 2020 16:12:39 -0600 Message-Id: <20200930221239.488744-1-thomas.tai@oracle.com> X-Mailer: git-send-email 2.18.4 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9760 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 spamscore=0 clxscore=1011 mlxscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300177 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200930_181253_433214_D59D3599 X-CRM114-Status: GOOD ( 21.06 ) X-Spam-Score: -1.4 (-) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [141.146.126.79 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [141.146.126.79 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.5 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thomas.tai@oracle.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When using the latest kernel v5.9-rc7 on an ARM server, VMs could hang at boot with no output. The commit a0e50aa3f4a8 removed asm(ALTERNATIVE("isb", "nop", ARM64_WORKAROUND_SPECULATIVE_AT)), it looks like isb is still needed for non ARM64_WORKAROUND_SPECULATIVE_AT host when switching to guest. The code fragment for the original patch: - /* __load_guest_stage2() includes an ISB for the workaround. */ - __load_guest_stage2(kvm); - asm(ALTERNATIVE("isb", "nop", ARM64_WORKAROUND_SPECULATIVE_AT)); + __load_guest_stage2(mmu); The code should have been: - /* __load_guest_stage2() includes an ISB for the workaround. */ - __load_guest_stage2(kvm); - asm(ALTERNATIVE("isb", "nop", ARM64_WORKAROUND_SPECULATIVE_AT)); + __load_guest_stage2(mmu); + asm(ALTERNATIVE("isb", "nop", ARM64_WORKAROUND_SPECULATIVE_AT)); ie, the workaround is still needed. Fixes: a0e50aa3f4a8 ("KVM: arm64: Factor out stage 2 page table data from struct kvm") Signed-off-by: Thomas Tai --- arch/arm64/kvm/hyp/nvhe/tlb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kvm/hyp/nvhe/tlb.c b/arch/arm64/kvm/hyp/nvhe/tlb.c index 69eae60..536496e 100644 --- a/arch/arm64/kvm/hyp/nvhe/tlb.c +++ b/arch/arm64/kvm/hyp/nvhe/tlb.c @@ -32,6 +32,7 @@ static void __tlb_switch_to_guest(struct kvm_s2_mmu *mmu, } __load_guest_stage2(mmu); + asm(ALTERNATIVE("isb", "nop", ARM64_WORKAROUND_SPECULATIVE_AT)); } static void __tlb_switch_to_host(struct tlb_inv_context *cxt)