From nobody Wed May 1 22:10:34 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1562906732; cv=none; d=zoho.com; s=zohoarc; b=E5DI+ckTA6HPDu/DiIpPee05x4Z0MoWEdk4P1ze1o9KIbt4Zlcqi/dPsaGuwa7uYDs1U1XF65pXPgvzuHH+SRAP2ej786Y5jT9iSQw/3aUi2/M8Vvbr7/6Wm7W4AZTjfgfJeqcwh9onGd1wePsbmaM6sUA5nlC+PJfeLswKfd/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562906732; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=53ze7MPQEXoUQSnX2+4wgM6oA7qxy4JmQXzyV/aHjPI=; b=GlSxMI7GDA2yX4RE8xKvrRtZR10T11dboe1SCycv61inRfXywY4zQtADN/JX1mTSF1Ol4Q+Qsm81QN4FRoGu8eBX00RKvK3XAKEjImnr1DPCq+BlsPjpsqbHyRddjPEAGVuwO9H9BlEwu7du7g1VBZVSE+RNpTaOcrCfO0ntaN4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1562906732924378.72397288479647; Thu, 11 Jul 2019 21:45:32 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hlnPc-0006Kr-0g; Fri, 12 Jul 2019 04:44:00 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hlnPa-0006Km-Ve for xen-devel@lists.xenproject.org; Fri, 12 Jul 2019 04:43:59 +0000 Received: from userp2120.oracle.com (unknown [156.151.31.85]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id a8de8c81-a45f-11e9-8980-bc764e045a96; Fri, 12 Jul 2019 04:43:57 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6C4dH4j056602; Fri, 12 Jul 2019 04:43:35 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2tjm9r3d9k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 04:43:35 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6C4gWQZ162744; Fri, 12 Jul 2019 04:43:34 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2tpefcvn8u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 04:43:34 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x6C4hUXJ012299; Fri, 12 Jul 2019 04:43:32 GMT Received: from z2.cn.oracle.com (/10.182.69.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Jul 2019 21:43:30 -0700 X-Inumbo-ID: a8de8c81-a45f-11e9-8980-bc764e045a96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=uw9ARe8x7QtRm6OOT1c/IbRl5bsJpRHqHU8DP7hvV60=; b=pQPEW7Dx4el+JBLPt8X5lkuRVGTKaPyBnwXZoCQOAJekYwf8Y7K3H1fIMkpvvELMZmuA Li1Ucgf0pXYPFe92BXDYi+6ztpdw5dbxpOnFCTIKkXiqP/bQpTzS3sbx+/7+S2yWfPBO o/o3yFhFXl8262oWh/I04NkRq4MluTsLOIQyXkKiHaBCso8scqH52BBz4hgipWQ4Xd4+ RkDrSj2dPUEoMfzb53xFUmHuyGmc8CGhBZu68mYfr2r1cMxbjYpsa/8U0M0r+dogTrxZ lYQzmPH/+YWoWRqkz+tYCgoub1bWlFFFnoWQPgztequYVPW4o1tAWaCRRqh1v3Md+ykQ zQ== From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Date: Thu, 11 Jul 2019 12:47:18 +0800 Message-Id: <1562820438-30328-1-git-send-email-zhenzhong.duan@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907120047 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907120046 Subject: [Xen-devel] [PATCH] xen/pv: Fix a boot up hang triggered by int3 self test X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Peter Zijlstra , x86@kernel.org, Zhenzhong Duan , srinivas.eeda@oracle.com, Ingo Molnar , Borislav Petkov , xen-devel@lists.xenproject.org, Boris Ostrovsky , Thomas Gleixner MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Commit 7457c0da024b ("x86/alternatives: Add int3_emulate_call() selftest") reveals a bug in XEN PV int3 assemble code. There is a double pop of register R11 and RCX currupting the exception frame, one in xen_int3 and the other in xen_xenint3. We see below hang at bootup: general protection fault: 0000 [#1] SMP NOPTI CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.2.0+ #6 RIP: e030:int3_magic+0x0/0x7 Call Trace: alternative_instructions+0x3d/0x12e check_bugs+0x7c9/0x887 ?__get_locked_pte+0x178/0x1f0 start_kernel+0x4ff/0x535 ?set_init_arg+0x55/0x55 xen_start_kernel+0x571/0x57a Fix it by removing xen_xenint3. Signed-off-by: Zhenzhong Duan Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov --- arch/x86/include/asm/traps.h | 2 +- arch/x86/xen/enlighten_pv.c | 2 +- arch/x86/xen/xen-asm_64.S | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h index 7d6f3f3..f2bd284 100644 --- a/arch/x86/include/asm/traps.h +++ b/arch/x86/include/asm/traps.h @@ -40,7 +40,7 @@ asmlinkage void xen_divide_error(void); asmlinkage void xen_xennmi(void); asmlinkage void xen_xendebug(void); -asmlinkage void xen_xenint3(void); +asmlinkage void xen_int3(void); asmlinkage void xen_overflow(void); asmlinkage void xen_bounds(void); asmlinkage void xen_invalid_op(void); diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 4722ba2..2138d69 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -596,7 +596,7 @@ struct trap_array_entry { =20 static struct trap_array_entry trap_array[] =3D { { debug, xen_xendebug, true }, - { int3, xen_xenint3, true }, + { int3, xen_int3, true }, { double_fault, xen_double_fault, true }, #ifdef CONFIG_X86_MCE { machine_check, xen_machine_check, true }, diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S index 1e9ef0b..ebf610b 100644 --- a/arch/x86/xen/xen-asm_64.S +++ b/arch/x86/xen/xen-asm_64.S @@ -32,7 +32,6 @@ xen_pv_trap divide_error xen_pv_trap debug xen_pv_trap xendebug xen_pv_trap int3 -xen_pv_trap xenint3 xen_pv_trap xennmi xen_pv_trap overflow xen_pv_trap bounds --=20 1.8.3.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel