From nobody Fri Nov 29 16:30:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1632908578; cv=pass; d=zohomail.com; s=zohoarc; b=miTF62pqxfZgCmgHpB+1JOL4qjamAl/T7vB3fFCvFHTN9CgjRV3T8VTOghNqogS0vYp0Alu7jYlg2XjRowyPoDb8OxnQOsGAD7gF1t1GLy5Zoin+bWCbxP5vKPQx+Eh0+s914cbYJ1gPUmGETRQ+YqZ5z1wn9hLLKCxYDPyjhBk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632908578; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oLIHrV3tAS35bw50cNvZyc6rMif9PxUtegze2vI4lwY=; b=XhP34mZiod+GM2e1H2oSt3M4Y76p8ogtEMursV9Vfa1FbUxSjbpKkB3+4OELyMcn3iosniFyF1ihdb2biQAR5RZiXZE7JVxLmJm3TC4TBBA8OjswApRjY9X4dpeHloPJ7gwkoEJ8r3FOdiIIlNkZTCenVFAAAradHL3pCTndgHw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1632908578824909.2099141246014; Wed, 29 Sep 2021 02:42:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.198956.352717 (Exim 4.92) (envelope-from ) id 1mVW6r-0003My-Ou; Wed, 29 Sep 2021 09:42:41 +0000 Received: by outflank-mailman (output) from mailman id 198956.352717; Wed, 29 Sep 2021 09:42:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVW6r-0003Mr-Lu; Wed, 29 Sep 2021 09:42:41 +0000 Received: by outflank-mailman (input) for mailman id 198956; Wed, 29 Sep 2021 09:42:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVW6q-0003Mj-Gw for xen-devel@lists.xenproject.org; Wed, 29 Sep 2021 09:42:40 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 01a44e8a-43e1-40b0-ac43-f9a34e6c3f33; Wed, 29 Sep 2021 09:42:39 +0000 (UTC) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03lp2057.outbound.protection.outlook.com [104.47.8.57]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-11-f8SUCLSMMBS9Ghzb7whrQg-1; Wed, 29 Sep 2021 11:42:37 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB7152.eurprd04.prod.outlook.com (2603:10a6:800:12b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13; Wed, 29 Sep 2021 09:42:36 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4566.014; Wed, 29 Sep 2021 09:42:36 +0000 Received: from [10.156.60.236] (37.24.206.209) by FR3P281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.7 via Frontend Transport; Wed, 29 Sep 2021 09:42:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 01a44e8a-43e1-40b0-ac43-f9a34e6c3f33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1632908558; 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=oLIHrV3tAS35bw50cNvZyc6rMif9PxUtegze2vI4lwY=; b=VgGKXLu+fY+Qb3WxUUdcZjxYZwNl8Uf3GvqXwr3TZNlBhDU9QdA1MEPZx52hfgwtApim2G UdBrL65H0Nk7uYiSuR1s7EJwC2WWgP1Dhg/s5Z6UP0mN3HuxyAqb0x5ZP6eIX/ab099dCC I4i0nRWwQPlAzuubFliMnj7+7MUBSUs= X-MC-Unique: f8SUCLSMMBS9Ghzb7whrQg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GOhnbwJ6RW4GGHpRGXWyDQR8HD0efmyGHTSmFA1GUppXsd+kZoSoeOSUuCfKuUYeJ87IQPh9teeINy4/HRE7lMWKO3dRf2875LbO4SoNwNVrSa4tiIVKkqiGUbWTQKRePPnrrXI0nx6EsdjwzpyLVwdCkUs/GUL+xTAivvB46B20GiL50b7ajrB46sv3qN1gwCLEJ6yA9Ooe10UqhPu7OtE63+cwnQyP4ocH4w+67ESCDVCUMZgBhYCQX7XbuqsXljjYW7pMSFrVBzn2SqPenIvV4+S5xGr3NrqPDXB+/gqiiS5hNRK4rYdhrQ7bUZQVfgZ+FVOK7zfHoxlrRM7gDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=oLIHrV3tAS35bw50cNvZyc6rMif9PxUtegze2vI4lwY=; b=TbAPriCDm+1TWb9PRb7gdUnhZPs94+R+0U7PlQ906ThB8+hc0hP7b07532LtejwVMRzzkxnQsLDKYiFRYPOIoiatkaUHgIYwUFUNlc5Pb5HyS1V0F81fXgYBIV4Ch+Lx/kt0wQ8s9JonFmPWA1SzEp2iIJ7R/Il0+cqV4qKHmrb9qupUJ4Flw+jyisoomICosW8idKm1K8wZmJSeP+0bANgE3yCeAOsHVXW1O+Ajl/ziYHvs7qZYf8I7sZXB1i+wPUV+mnNJH4P27aecQmX0mxbOULEmVkxoby+KAsbn/OES/rXyWYRVwuHbtzCB5EaKU7sd21n4rHgiOFfjpAVqAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH 1/3] x86/PV: make '0' debug key dump Dom0's stacks again From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2a14f2d0-2a53-287f-da36-dfb054c7f944@suse.com> Message-ID: <268da650-1261-0ac6-9908-7916f0b4d2ec@suse.com> Date: Wed, 29 Sep 2021 11:42:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2a14f2d0-2a53-287f-da36-dfb054c7f944@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR3P281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1d::20) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5d9e66e2-a46f-4efc-36c1-08d9832d7805 X-MS-TrafficTypeDiagnostic: VI1PR04MB7152: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zM9e/6QihDAFCTwJt+Rvv7YlzATzQXgmqDSk4U4yQDCo3FETTNUX0P42Hb80iKAdx82cHmOhmw0dqKMEjLp8A9udPLAZkj1O+6DbMp/us76tNX4EZucdQQUlF2DL2vL10wjiZGuuhDF9hM80vEVVUL8pWtg3mDXI39C2nhzOBaW2TndrIp2a0LHyPWYP39YghQv2aJAAcKh5S9H98hpaue+tLwaEXaYtMXqorA4+HuPvdBRAtr91C2VISLDBqmTEqHCfro+0jWicoqf8a1eoJws5Mi5L1PWVGbokfDyBpaMZh5MEbupJF2MkehM/bn1/0ayBmAKLGdeTraPIrhFRjYdqlTsSjcoyBNv8JNF7GnQPU9nUVB4sxtfGfmCeHiugtIoVX07mLzg1CWrrKRbTS3zxMZwUc8WGwGfGf51AphpOlBoOToOmCd7+EPjcFnc5LaMTCqqUWw/z1NLMS4mUnRtWoKgI2hzNw6euYYDfHWwHC0KeBA5q0RsAkTQ4c+TdpTMVxnSoMkGQO8qbKftIcDDOgHhkg/7BA/OQ/FuBxPlhZeGsQR/FlImd1noQVPS5a8PnXhKBWlqYp5BHkUAjAtbVM/Bkpv4ElV9XJJXb8An1Nf5ESrmFxjaw3E+fhvNMu5bmJT+F/1OIf8kyJ42ne/nO0PjYeZIwUM5WK1ucHJtpG2bwGm4ibT7AdyVIvkPDuP4I/8VVRKCsTrpO4aaf9yz947cM69/jIy7UvdZCIUA0nMFlOUqsneFOmpHdDUid X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(31686004)(66946007)(508600001)(956004)(2616005)(4326008)(186003)(6916009)(36756003)(86362001)(2906002)(5660300002)(83380400001)(8936002)(8676002)(31696002)(16576012)(316002)(38100700002)(54906003)(26005)(6486002)(66556008)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YkdEYlREbXhDS2xsYkxsRFZyTjdzNnI2Uk91WGdDam1Nb2xHWVUydnBYRlR1?= =?utf-8?B?NW5VT3pHaUI2MFBjRkhpR0JLck84cng3WW9nblkrem42d3p1OXV2OVMzay9H?= =?utf-8?B?SHU4bFRCQy9taGNRL0lpbkRhWlIyZzR2T0xPQm5TdXQzWWdYc3l4MExjUUY2?= =?utf-8?B?ZVVSYjhPc3BQd3hKTmVBaVQveTMxSE10TjY3ZXFLaFVhU25QdWxRblpZbVk2?= =?utf-8?B?Rytnd2haWHY4Q29qV1EwbllyQlVkK0NpOUZoWkk0aHQwN3NGa0dyV2h1V1Zr?= =?utf-8?B?ZXdGcG41RG1xNFRYbjFxaEpRNHcveVVBWXpFWXNJaHYzMkpHR1Zxam5mYWxF?= =?utf-8?B?VXFpTDZJbzJsZmo1Wk0wSDhqK0hZZHVNcW9TLzNwN0FvdWUxRmRNcTBpWmtr?= =?utf-8?B?dEUvMnNjMVdwRmpmSHYwUGlRQVdyZHZlMThxSVRkU3ZXdWV6Z2daamltSE1O?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VqM0FEeWhyMUhJc25jQndESW40?= =?utf-8?B?Q0xjM1RHS1hWTVluRVFFenI3a2pnaVVueXJqWGZreU8xa0p4b3g0eXFxalZN?= =?utf-8?B?c09SL0VnRDBWUVZ2WHRpUmZhN1ZENk5ZQW1sUHYrSnNyNEJWMEpxMkIwWVJY?= =?utf-8?B?K2lBOFJBYlBTck44ZTVvVTNGelVCOVpWYi9iSE5Vb2hJRjZmQ2s5YzZMemVO?= =?utf-8?B?TS9ybHBETWRMU1VlMW9RYlQyblpiK3VOby8yVWEzK3ZWazF1akZxODlQU0dZ?= =?utf-8?B?a0I1eXp5czJDaWRBd2ZzVVJtTnRabG1WWlF6VFo2SGpEOGprQWY1TXBBRkdI?= =?utf-8?B?c0xUYnd0SmJYbFpoQ09rUTYrT09Bd2JLTVJBZjN2REFPNE56OXRuQm1xQnpR?= =?utf-8?Q?PScLhkxEnZ9+SUzlktvEQTp4ym+xwV+TyChW5Oe?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d9e66e2-a46f-4efc-36c1-08d9832d7805 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2021 09:42:36.0590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i+QiDNiXxTVZ0rDwTT+UpNSjUeB6aeIjrAULzH2vNt5QkSlxCuK/wUaZhYxNl/h46xrcWv8a7E46OIqyVCyHtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7152 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1632908580652100001 Content-Type: text/plain; charset="utf-8" The conversion to __get_guest() failed to account for the fact that for remote vCPU-s dumping gets done through a pointer obtained from map_domain_page(): __get_guest() arranges for (apparent) accesses to hypervisor space to cause #GP(0). Fixes: 6a1d72d3739e ('x86: split __{get,put}_user() into "guest" and "unsaf= e" variants') Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monn=C3=A9 --- Using get_unsafe() might be an option as well, instead of the added extra conditional. --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -275,7 +275,9 @@ static void compat_show_guest_stack(stru { if ( (((long)stack - 1) ^ ((long)(stack + 1) - 1)) & mask ) break; - if ( __get_guest(addr, stack) ) + if ( stack_page ) + addr =3D *stack; + else if ( __get_guest(addr, stack) ) { if ( i !=3D 0 ) printk("\n "); @@ -344,7 +346,9 @@ static void show_guest_stack(struct vcpu { if ( (((long)stack - 1) ^ ((long)(stack + 1) - 1)) & mask ) break; - if ( __get_guest(addr, stack) ) + if ( stack_page ) + addr =3D *stack; + else if ( __get_guest(addr, stack) ) { if ( i !=3D 0 ) printk("\n "); From nobody Fri Nov 29 16:30:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1632908599; cv=pass; d=zohomail.com; s=zohoarc; b=cKf0+60ZYnkmyXtT1AnjIiRtnI/AtUjuCRX/lakC5dLGoELvrnCzH11Xww3E81Gp+OfmOc64w/+kPZT42/PSiv1OuZh/pwuuZadz1cn+IHoJLGkZV2deYt/e3KyYOU/Zi9lW0p7Ara4NYiWIBSaQ0x8b7viIlQv2WKCqSThGBlQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632908599; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Y7ccXA22nntJPvmIaAdNM7vs28zhnf2Wqchn+7jd8mY=; b=k4lG5UAbb0s7OGtwJbj5s3U3eq2ttMWGXb1CYh8QoTlA4RyaXg/0FsjPpPj2ykm9VAJbhZIpZAB9tBsTZ35LxlnudsR8QLWRrfvzKE6Rqaz3i6YDw0cuxX078akxrsUhbcez5NryDwHBp1tvb1vEHow0Hb7v6ltHRHCL4Gs/Kv0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1632908599057216.4167860797428; Wed, 29 Sep 2021 02:43:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.198961.352728 (Exim 4.92) (envelope-from ) id 1mVW7E-0003sv-4H; Wed, 29 Sep 2021 09:43:04 +0000 Received: by outflank-mailman (output) from mailman id 198961.352728; Wed, 29 Sep 2021 09:43:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVW7D-0003sm-Vq; Wed, 29 Sep 2021 09:43:03 +0000 Received: by outflank-mailman (input) for mailman id 198961; Wed, 29 Sep 2021 09:43:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVW7C-0003rE-Kp for xen-devel@lists.xenproject.org; Wed, 29 Sep 2021 09:43:02 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a2af4adc-2109-11ec-bce0-12813bfff9fa; Wed, 29 Sep 2021 09:43:01 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01lp2054.outbound.protection.outlook.com [104.47.2.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-24-lanrSw__Njytv9-yh5Do4w-1; Wed, 29 Sep 2021 11:42:59 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB3120.eurprd04.prod.outlook.com (2603:10a6:802:e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Wed, 29 Sep 2021 09:42:56 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4566.014; Wed, 29 Sep 2021 09:42:56 +0000 Received: from [10.156.60.236] (37.24.206.209) by FR3P281CA0013.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Wed, 29 Sep 2021 09:42:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a2af4adc-2109-11ec-bce0-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1632908580; 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=Y7ccXA22nntJPvmIaAdNM7vs28zhnf2Wqchn+7jd8mY=; b=ljjRPDW5u1dQbR7uDFYL1RCts44lqVduLvAjgef2gI0xpi9M+bAqgtmcxigtB8PUBqaece jlyWMdUKJ8yGu4EyC0Tykk77sJCRsaxnezL4Kqd6jjZt8suxjkXeHiRp8lfU0uTL9tXNpc tR6pvJLnknZVfJ7995U+qlRmGW+QlkY= X-MC-Unique: lanrSw__Njytv9-yh5Do4w-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YRtGTDVearZ/+MjEozVlI3PIqqe/quFylaWisaQiEz3rndBeaWcB7aVPNH/1wkSu70g5Z/7sB+OCGmHzrubNQIUovpAKnLOQMRh/4Je0rjppDwZja7ibGwN2RP9xByASS3axQGej+LubUdZ+Kv5dYpSZnVEVo0YcdWyoF9a/9A3RKnFbfmP9zIZXdmGXzFjHM1pRvgxQIJjR9pztdL+9tyXnjpy8Vxs4Jv+cmpkSEtkTn9zgtk/yMDlJ1h69ihRYEqk1NWclPc7CvRKZfShZUdI10Ca0l28hW1AYJtmBKwQiWtPOMPaTm6dHL/rW7UQH/2Pdqh50/V1bIzgAUGCLYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Y7ccXA22nntJPvmIaAdNM7vs28zhnf2Wqchn+7jd8mY=; b=cOzLO5BBOgxZ1teDP8yhZNedntYQ7d/3BOlwhf4rXpPa0tHXdlCPtD/dw682wyAtOaMl+/6matDsiSZX7jTfdml/l6vmpPtOihkAtYRT9pJGVwiZccMhQ2iRL8P+0f4OyMjFCSEkBGjStsyTsOuL/6iO5NHEVScsvvayGZegFXt11waLJro1ALZnQoLKRuixDa29UsRGCFqTzEHHqb8eGxlISpftKVp6UIG/Pdo9qYW+yrv1S0K/wJiiKbocgOFi139s3173K7pJQbsfLEMvzkJnvlwyK7rCUWQWNe/BKsWNLO6OjvAz8cAl+m53i3C9asSDJ1hmr8Bsli++FIPPHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH 2/3] x86/PV: replace assertions in '0' debug key stack dumping From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2a14f2d0-2a53-287f-da36-dfb054c7f944@suse.com> Message-ID: <5ab88195-660e-5d73-cc34-67734ae161fa@suse.com> Date: Wed, 29 Sep 2021 11:42:54 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2a14f2d0-2a53-287f-da36-dfb054c7f944@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR3P281CA0013.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1d::18) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 937547cd-7f96-4ba6-6399-08d9832d8403 X-MS-TrafficTypeDiagnostic: VI1PR04MB3120: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SVN65TBD2eDwJXpIDni64FCxegQrh/xmGe/7zCh/Zm0+HuXGgb2FOO5DYFPfJF3+tq/RL/K4NaFuEhdrjpxUA02KBSA/leFz1iwl0yRRwGj0MoQoLzddFL4pOlGDux0Jq+KHmaQEPCRvqHIvdsmQ6UNMlNk/xmo5blZpWU7nMHixW8xDAIr4O62VrgbLA/scX4pyYjXWyIAPCy4yFTwEuk+qxGWBi+1PzPzB80QQaNsrFEKQTgS0TTh8NS/IfXyRZbBa0z0fDG0Z6/UQLQvnzDnmNzPAzav3/iRcrYEbIe4+ypu4R9UIT+L71udk3CL2zUNiru4e+gXeQzqJF8nysgaKsAhK0blRhLttd0PM72pvxjaE6empy8NP7lbvwanqsIDD5rLsmdrP4sYWgsx9YPE5AM0QSqLEbzfL2hmtwtbRNF7RUw3UH/7TS7wnKus6Oez8kcffbZAze5U5Nz6C62w9xOgmNHO/bMbU0tNaO4kKZfW5qMBJfPhBBFprdp8F8BusREI2cjkv3qyX5JJ6GsSK2rXijZv1/ivrbmWCICw16wtGhAnpgaRCV1tUOchnWO1lSXhuP+kehYbv5EtMnn/4Bb0Cyxdv+7Ib+v3hhqZOdAoEydVjBl8RQO7eoOCUB6LtUofFJYQmZu43qRL8hB+h0eF8nQb9K7n8NBWuEcPJPav7FwwXWODVPAOLxdTlx5p4LAu2Uj9jHRRu0Ut0pcd8uzTn48ewpqesdi9PXGM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(66556008)(66946007)(16576012)(6916009)(54906003)(86362001)(2906002)(4326008)(31696002)(956004)(2616005)(36756003)(83380400001)(66476007)(316002)(26005)(8676002)(8936002)(6486002)(5660300002)(38100700002)(186003)(508600001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?a3lCYjZyUHlPMlRER0hTdUJlZjRNTVJnN1dGOCtwSjd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ba6-6399-08d9832d8403 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2021 09:42:56.1807 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i4KUhHJMOq4vR5HFvK8DLn/FfFoqRaT/9MyLvBxQpEEdojunTwg80kZan0fyli44pN1RO4TYLt6hyU55C5orSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3120 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1632908600007100001 Content-Type: text/plain; charset="utf-8" While it was me to add them, I'm afraid I don't see justification for the assertions: A vCPU may very well have got preempted while in user mode. Limit compat guest user mode stack dumps to the containing page (like is done when using do_page_walk()), and suppress their dumping altogether for 64-bit Dom0. Fixes: cc0de53a903c ("x86: improve output resulting from sending '0' over s= erial") Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monn=C3=A9 --- An alternative to suppressing the dump for 64-bit would be to make do_page_fault() guest-user-mode aware. --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -254,7 +254,6 @@ static void compat_show_guest_stack(stru struct vcpu *vcpu; unsigned long mfn; =20 - ASSERT(guest_kernel_mode(v, regs)); mfn =3D read_cr3() >> PAGE_SHIFT; for_each_vcpu( v->domain, vcpu ) if ( pagetable_get_pfn(vcpu->arch.guest_table) =3D=3D mfn ) @@ -269,6 +268,8 @@ static void compat_show_guest_stack(stru } mask =3D PAGE_SIZE; } + else if ( !guest_kernel_mode(v, regs) ) + mask =3D PAGE_SIZE; } =20 for ( i =3D 0; i < debug_stack_lines * 8; i++ ) @@ -328,7 +329,12 @@ static void show_guest_stack(struct vcpu { struct vcpu *vcpu; =20 - ASSERT(guest_kernel_mode(v, regs)); + if ( !guest_kernel_mode(v, regs) ) + { + printk("User mode stack\n"); + return; + } + vcpu =3D maddr_get_owner(read_cr3()) =3D=3D v->domain ? v : NULL; if ( !vcpu ) { From nobody Fri Nov 29 16:30:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1632908633; cv=pass; d=zohomail.com; s=zohoarc; b=SjIgOQWjwSXBPjGFkPPR/V9/x/VwUOM8KWSILneoECvL3Kob5JBpunmlyliTrp4UsMAz5A7/nbMLNS5ho34A0mflE9Qbevh+xH66Tlznl0n9eGmNq8KdsUmftoKJrejxxss4w612BFs8+mZiNUwC2dT7uirxrRpYyROD1Q/ke70= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632908633; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AublGjh33/bNoaWEfJ8R3GvMAzXTnFnEdFM3kcKmyl8=; b=T8Y20eUa+KjxQ0tzbk7CyWcnCXkHKt6acNir1d7B8xYRjIBYgxA7k+zpUV2diOYuwewGe07UZZp8vyhJwOheKK93+5WA6fzbt47TWvo5lCW7X3S5KfnXLk23QwnoE/SPSxZU1zuF4wT3rJwHzACWzuN1YsdEVpeaL0vGIzexRKs= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1632908633843556.6746890638296; Wed, 29 Sep 2021 02:43:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.198969.352739 (Exim 4.92) (envelope-from ) id 1mVW7n-0004a9-Hx; Wed, 29 Sep 2021 09:43:39 +0000 Received: by outflank-mailman (output) from mailman id 198969.352739; Wed, 29 Sep 2021 09:43:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVW7n-0004a0-Eq; Wed, 29 Sep 2021 09:43:39 +0000 Received: by outflank-mailman (input) for mailman id 198969; Wed, 29 Sep 2021 09:43:38 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVW7m-0004Zq-LY for xen-devel@lists.xenproject.org; Wed, 29 Sep 2021 09:43:38 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a51f58e9-2f41-45b2-9694-77ebc0d8c3ab; Wed, 29 Sep 2021 09:43:37 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01lp2055.outbound.protection.outlook.com [104.47.2.55]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-30-drNc4Ob3PL-ghuOg8DSjYw-1; Wed, 29 Sep 2021 11:43:35 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB3120.eurprd04.prod.outlook.com (2603:10a6:802:e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Wed, 29 Sep 2021 09:43:34 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4566.014; Wed, 29 Sep 2021 09:43:34 +0000 Received: from [10.156.60.236] (37.24.206.209) by AS9PR06CA0145.eurprd06.prod.outlook.com (2603:10a6:20b:467::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Wed, 29 Sep 2021 09:43:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a51f58e9-2f41-45b2-9694-77ebc0d8c3ab DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1632908616; 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=AublGjh33/bNoaWEfJ8R3GvMAzXTnFnEdFM3kcKmyl8=; b=gDPKnL3JmeqZtyivP+NLwt1kaMqGrT24uM+SwJinRiGX85DIH/NSTnNt/PEL3EfRUC59um DQDGUiGQnN8VwDbzlh4W7Dqx/WdWuxrob+K50KXGH3XXqKQy+bvPOWKBgaosqIyagfad3f +lJ+/KONVCOxqRO+CCguE2x0HDvhv6c= X-MC-Unique: drNc4Ob3PL-ghuOg8DSjYw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U1F6iLcDOY3Qb5MxIPl5VfyaDbRi4fBvyHlSxfBrrgNilvwnPih2vHny/LQRiG/QSUBhGvcuX4BJt+iz0pncJLqjFMyt6lNVi1RJRgXXVxr5pe23V7DCdiVgSgs9Z2cCqde5Yyd3Cmjh/c1R92pbOp8+uqucfV1qPnh9rPyj95jDHS5pIVVDxHi1PYfff/TH9RiY3YHESB/Vlf/Tt/QEdsDV7+hQpk4pg2YlU8kpkpb9KWvVQwKyZKJSgPWJx66gtycvTkIEe/8LL7UQ1wL0qY7laAGbw4VMySNiR1VcnNadqlWw0HkT8zV68Nn4xOApK/xiib2urOSHmC+Z8KV0Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AublGjh33/bNoaWEfJ8R3GvMAzXTnFnEdFM3kcKmyl8=; b=dztgOZDVSYUmEY3ERFwq1/HnaeOV2ps+k6rSSkCA61sKbMdPP1DKmuNiKPgJzzm/VArRAWGQaBX8ssv7D8J3MM/dm9sqUKXtxV6tugJq1uTSh8BW1Czag9sOtJsoGZHsGizt9xrq8ngBfp49qcKjKkjmZvCIeRGg4W7Ii7/TId81vL1Bd0PuMNAD6H0xqwR4oqNBJ8QuBgr64CBPqp55M0y4waexwsR+mYT6lpmqPiED62x7vTmFI7mkQbk2SbogiOVv0C7TJTSxHr991HjDDlksutvzRmb6EaNYMd2HlFemavZDzdf3hqLpYQUdNLUnDh0lDL7VedoKlu+UWEZupg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH 3/3] x86/PV: drop "vcpu" local variable from show_guest_stack() From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <2a14f2d0-2a53-287f-da36-dfb054c7f944@suse.com> Message-ID: <6dad4cfb-708d-027b-0fa1-77bb39319fe6@suse.com> Date: Wed, 29 Sep 2021 11:43:32 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <2a14f2d0-2a53-287f-da36-dfb054c7f944@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AS9PR06CA0145.eurprd06.prod.outlook.com (2603:10a6:20b:467::27) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89cc0893-c283-434c-344b-08d9832d9ad6 X-MS-TrafficTypeDiagnostic: VI1PR04MB3120: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 67nxH89wlRlubXJu4n2Gn5yP094aZQONQxTCAcWDAbipwxncqljfTkTq4gRzjWgcD6D94QAexl6ZVCoove8CzevfZJIyZaNia2vruKlgSyO6FIvAMi32dXhGyYlgH1A10WehUW/QsqQv3LFwQhAZoZnee9NM8zWgTGlut13g2EG0fa29l+WFerP9xWeF/75A5Ud0jHLZuloJOueONdS/CSSGEIPxRgAOeFNtwB7sOzmOErYPLL2swRZl4FgvHhByM5sMaUBwQKB6C0VIYF1SNDk7qq9WTzUsBKA+981vDANMhaN6Akbid+FronD2x/ikan6IMF5v0fKXDPMkrCCBbhsnWuPWNl7tNURHoRC9M+m1za36WTtQ9+anIaT9ioeokzgq5aDojQes04gOjM4S7vLNX4sMs12ZVUWZX1frIcdC1buZa/ku5GubqRshmkdkWHaG77JTNbKzPa2TQtIoRJxF8U22c1weQq1iLjXE3jL4giUqOcjze7OzQy9pXrymbKW4FJn+c63qxWUiL75aW2CkuaCemQh65/66TqdgFbMiSpLCrPyTgWhSebTkcfaw/YE/RsAFGX4QLTa/7l+DufMtQbE9zyqEkR47ayG+Aa5hWxQbezRqjHZZyookTXCQR+RTT7vDkwAeDYEObK0JokEwDED53eAST7Lb3imd5YO7ue7ml2qen1WCA/ik0oSQi9u/Uo09hUDqgNwwGXOuNNCcxsLiD1iyUPBFnMVACi8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(66556008)(66946007)(16576012)(4744005)(6916009)(54906003)(86362001)(2906002)(4326008)(31696002)(956004)(2616005)(36756003)(66476007)(316002)(26005)(8676002)(8936002)(6486002)(5660300002)(38100700002)(186003)(508600001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UXlDR3c5OHN1YnRlRnpjNDA4OFBkTjVVekd4bjlzQ3hqMFNDRjE3S3JDS2JW?= =?utf-8?B?dG1QMVBZekNMMS94WDAxTHpBNjhiTlU0WEx4K3E1L2pHdHhad3RxQ1pIS3Ew?= =?utf-8?B?aUNOdENLTWk0Z29Hb3R0MTdKVHdSQ3prYVQ4MUJ3clFmelltbXF0c25xWXB4?= =?utf-8?B?SjNpcGthNlErMXcxc2p4ZGVFNHlRUTlZWGhlY1hDeGp5cll4RGFmVXRZUC94?= =?utf-8?B?cUJnLzJCQWh6R01yS1E2N0NlMDdSc1F4dXdGaXg0RHdwQnc3aEc4ejcxV0c2?= =?utf-8?B?N0ZJNWdVY1N0RHZiUm9Dd0REWjNPOFBjSUJpL012MjBCM2lubjF3cE5hQUhu?= =?utf-8?B?SXdEK3lhVFJjT3JmVE0rNDg4ZStwZGkwL29CQnpDWkxuVWs2cG1tczFIYkFo?= =?utf-8?B?R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LzY3b296LzZXdzBKWHBF?= =?utf-8?B?MXI2U1p4R2E3cVk4bjJIaE5SSmt0WXVvL0VBbVR1Z0VzQVFJbmxTdnI4Y2hl?= =?utf-8?B?VmhVT0l1MVVNQTNQc2Q0c1RkVExWV0F1MVFJYWdDNkNmTTRpYytEYnlobDJL?= =?utf-8?B?cXBQeUo2S3k5cWVYUGlmM0ZmWjM5MmJLRnU2aW5udHdGcjhLSEdGM3pHWnFl?= =?utf-8?B?V2h6eWQ1YzI1UEN5RllVZGQ4RG0xWGc5dGNadXEyTTFSaTJMMUZMWXpJZVFT?= =?utf-8?B?SzlGMmp4UUxRL0dBRkx6cXRyV0tnd1NzaW9vMUo3ZVh3OUY0cFhMb2hhc1hv?= =?utf-8?B?QnNnSC95a0tsd0V6WFUrRmRMd3Yrb3J1R0RoQ2dPSThMVmpjbW0yeHpUSnlR?= =?utf-8?B?cHBzZzZ0aTdjQlJ2anB6WVlZNkJ2LzRmb2IwLzRMSUZqRitMWEdWbnFFQlk0?= =?utf-8?Q?hfNTyXWHCFk+wpBv1DDD3nTGIHlEhy3Fog0Tv4q?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89cc0893-c283-434c-344b-08d9832d9ad6 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2021 09:43:34.4751 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: phtsauR9LWLyIiwRZwJodX85sgDCFWqCROI1f4Clu1GF+nO0FyMIpS/CzRB7CraeDbKw4sqC7eve2CUwMN1sVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3120 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1632908634440100001 Content-Type: text/plain; charset="utf-8" It's not really needed and has been misleading me more than once to try and spot its "actual" use(s). It should really have been dropped when the 32-bit specific logic was purged from here. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monn=C3=A9 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -327,16 +327,13 @@ static void show_guest_stack(struct vcpu =20 if ( v !=3D current ) { - struct vcpu *vcpu; - if ( !guest_kernel_mode(v, regs) ) { printk("User mode stack\n"); return; } =20 - vcpu =3D maddr_get_owner(read_cr3()) =3D=3D v->domain ? v : NULL; - if ( !vcpu ) + if ( maddr_get_owner(read_cr3()) !=3D v->domain ) { stack_page =3D stack =3D do_page_walk(v, (unsigned long)stack); if ( (unsigned long)stack < PAGE_SIZE )