Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16154008rwd; Mon, 26 Jun 2023 06:31:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5OY2QR8ABTS99hB138oAg0/0klZobjaY9EHEyP/rKawczJcoTD+fEJtOlHaVM30dClnU3R X-Received: by 2002:aa7:c9d0:0:b0:51d:9a0f:129c with SMTP id i16-20020aa7c9d0000000b0051d9a0f129cmr1934507edt.6.1687786268494; Mon, 26 Jun 2023 06:31:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687786268; cv=pass; d=google.com; s=arc-20160816; b=DSvIkaTTffJa4gxEzAG3fOj2M+DAVJ3bQESNP/bPiQCc+Vwl4RvBvdJpaBOmsVIbQr tfs0R8ux05z5qCdwiBfykoI1uFICa6wAFusELqxNTpzb4t1Qpl7+NEgAXwcSFYYnItK8 WLQeOcQyMiInrgAQU6a8VPxViokBazw+u5Tl/sNBLm1UMN9a109GVwsGr0riijN5dnj1 FmcFm8R8n3rvHkQTIj9esnkoeryKguQ9ZHq1LiWszIwa3yJzTp0EjZpNnCYBSz1Uf/fo E0/vufWyDQnCHKnvTRb0YO18fR0YNgH5cefRuC6oDvCz7PhDse9xnJac/cFUfLP5lyRL dGqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=1YYsqb8fAGwighP0b6BGte+MLWO683Qx6jkr8ncM5BA=; fh=wVNOy8iERbXOKKZ2IEmfoiytbBJtwcV9aopKfsGMn1U=; b=n158FMSg0mOURSAXEFkcJ5eESpHp9nwZmv2HCrC8uOqe1a8jLpXHRDCcZPvgorQ0Wo uWZk223HcujlG8w6POx6qmnkhRExi52k30V6hNLYE2VG0Gto5aivjH+MAXFbpmVCqJi5 pMJRbpXZNy53rf6/xUgDM7Kx0sL0als6BkOUDvemi/AhJ5qI4fGTe0Y3m4Ox8X70Osy5 0XsYrSeUEEc0KO/POFcMcJY9bnQxuH5xypHsXVV2092jBHljPxHBjlNRaAbaojor60HN wEAsEarzoh1cDTpHMcHMQhMGbVWQp7BaZSF/T1IyvCgbzsb9jJBWQdMgaxE3GvYssAKw 5w/g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=y0JIJXq+; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l22-20020aa7cad6000000b0051bec072038si2508359edt.260.2023.06.26.06.30.30; Mon, 26 Jun 2023 06:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=y0JIJXq+; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230484AbjFZNR2 (ORCPT + 99 others); Mon, 26 Jun 2023 09:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230382AbjFZNRU (ORCPT ); Mon, 26 Jun 2023 09:17:20 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2063.outbound.protection.outlook.com [40.107.21.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4D2B1A2 for ; Mon, 26 Jun 2023 06:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PrftI9YAseXHsl4ZzUA6Z0AOhQXTg8BoEVkty0KAgIxiSyKTywVwGq/L1eccJusWnleddboaEZAYaBosEMnf4BEeo8JCuc8erzkgBDLPGJSuDVRYym90IaTz4s4QE2qssH9q8nC+UABz5xAzSXL+fyD4BOpF6briLFsWl/rSG9UCm1uDneEcYjmfM/skw17xLQt902mVTQyHbYxleKryMetj43Ml2cB+pXLSHH3/Xq4UYEa+GkMthDDAHZyKxSZZscFeaMT27jymncANmwqqAuqP5EO+rVEyA48xSd4WvYrlW+XTmDCKeCWHhZmzvQtsMXLuvktiEMgYlVV/xkjepA== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1YYsqb8fAGwighP0b6BGte+MLWO683Qx6jkr8ncM5BA=; b=IXJBNCpvUfxPETEKcVpJaNcmJSmh79Cy/aIS/CQM6b2jsQurFuZ9DKrtog5VsAZT23RJRAGiBblsL6fdZsQg/j3icoUClDu3SyPmxjEy4EHwNN/JBs+zKoFngpZ+ZYpq3x1djOhdxXl+rRqdD91xmvfPMFxIc7anE+gBzb12Dc1cUOYf7Cc5UaLnSqtDkitEOkhbt2FctHX97P32SvtugjNSV8sSyOMm20GCv28Tk6DCTdOUDxgnV1rNyRJtPGBCZ+xrZR9xmvHVrv6ghzLnK6vVdqqGxybDjfPiJt8gPXMWNlZXuScF/tIWHiiPDQ0gauC7dV4qQ9kcisvTIJBNbQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1YYsqb8fAGwighP0b6BGte+MLWO683Qx6jkr8ncM5BA=; b=y0JIJXq+4pzOGKTOu56AhDvwACmnz2W6kMJ3GUf3dmyCA+q58Mq8Q26dhCrmMvQMYVC1NTwARKkoAImiXHJWQx+599sRvYCOnMD3BHoAHHRAvQVIyuLNOPnEqY5AywEmAPP95loBRIn3OQEpFPpYCrPesjnb4VHqdKdIl96TeAiY4OgCGYVfObKSdYGL+GpL/41EmzPI1Kh98593ek3UTpd4Th/4PTFnk2m/vPZK7cYA3VENRhEEVSlLgt0qtte7gXiAbdfdcnkmnYkVJiL979X0KFErF2bi5Z7KWakTXKgqLAKT8NkFHlPlTqTao4EcoBv2NgC1nD83I2ON/afPEA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from AM0PR0402MB3395.eurprd04.prod.outlook.com (2603:10a6:208:1a::16) by AM9PR04MB8555.eurprd04.prod.outlook.com (2603:10a6:20b:436::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Mon, 26 Jun 2023 13:17:10 +0000 Received: from AM0PR0402MB3395.eurprd04.prod.outlook.com ([fe80::551e:9fcf:5b65:ca5b]) by AM0PR0402MB3395.eurprd04.prod.outlook.com ([fe80::551e:9fcf:5b65:ca5b%2]) with mapi id 15.20.6521.026; Mon, 26 Jun 2023 13:17:09 +0000 Message-ID: <551a1594-9c8b-d447-6bf3-a4a208d5550f@suse.com> Date: Mon, 26 Jun 2023 15:17:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 2/2] xen/virtio: Avoid use of the dom0 backend in dom0 Content-Language: en-US To: Oleksandr Tyshchenko Cc: "xen-devel@lists.xenproject.org" , "linux-kernel@vger.kernel.org" , "jgross@suse.com" , "sstabellini@kernel.org" References: <20230621131214.9398-1-petr.pavlu@suse.com> <20230621131214.9398-3-petr.pavlu@suse.com> <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com> From: Petr Pavlu In-Reply-To: <15e31609-6c45-7372-76ee-0adf7a64fe88@epam.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0121.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9d::12) To AM0PR0402MB3395.eurprd04.prod.outlook.com (2603:10a6:208:1a::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR0402MB3395:EE_|AM9PR04MB8555:EE_ X-MS-Office365-Filtering-Correlation-Id: 1968c6f5-7125-4b43-090d-08db7647a57c X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oAY+yaBua0SAjbp0ARjtBlOO3Zo9SlO1oAvREc7ZQ18lZsln8zlOQyzKC1J61WjzQ20mq/lCucewmOF6QH8Uq6bU2Bx2EAzQC1oyYKksjCCNfgzzYzlEiXTNcKsxa+rDyXLAaqy2tNh780LiXSd0r9kdAIxUpLTVke3s/s2iN51dKYLBSlg/Qp/qokopLHG4OpGbfGQmwt2l+oCpGyT7Qb/DcLlQH3sb2oBFNyJHJJyIROUUghVTSbr5VltNMu7y/s6Kt/76nk882O52QV3krnM8OQvSumfZAmCoCFxzmUQPlokwefExAaBz8+4e8JyBjOSLmGHsZwJfqKWA71qP0BZcIipXxb9APpYRji6JxW5nYNHMs8FXyvHGLDewQrTItKj2NpgmKbypw8JVchp9zHi/vEfgxaerowXSjfiVzTxy9G2lZwI8/G6zsx45FmBkhSvhj0+S5RAWAXLaKyxp4FEEefiehGgBY/IcRXCJYS+PPEasvGz4hjhkCjBRaquThzWdCmQKs2JmVUsyPGQ7+9vg3oJTuCsU20FIOVVPLB6A19DGkHdVIPxxz+U4h86yVrFEk8n3ciT859Ol/4ib7AfGN5bGH6w4IkmFsfKSbGIfVNdJH9S2u1HOJ1RxxFjY7ov5zwZqxdmiHoUhIxfIpA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR0402MB3395.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(136003)(396003)(366004)(346002)(451199021)(31686004)(2906002)(66946007)(478600001)(6916009)(66556008)(66476007)(6486002)(4326008)(316002)(31696002)(54906003)(86362001)(186003)(83380400001)(6512007)(36756003)(6506007)(2616005)(26005)(38100700002)(8936002)(53546011)(55236004)(41300700001)(8676002)(5660300002)(44832011)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bU1YMXRBYkIyajBhRmVWWWtDT1MrS2N5cmM3MCs3TUd1dHNwaWpET3lBeFJW?= =?utf-8?B?YXNsRWFZaGpaaWlqYTFxdlQrb29SWDk1UGQ2aFp3cTVoeVJqV05kZFRNaGxa?= =?utf-8?B?VExWYlVZT21HZVhZTCtLa0F2Sm9HbURUS1Q0Z0FnUTJycFFpdVVHY2hKK3Ny?= =?utf-8?B?cDFEWlFTMFlRejgvVVlCRHdxMUF3d0xNL0ZxaUlvbk9sd1AvSzZhZlRBZDdj?= =?utf-8?B?NVMvdWRPS0hISW9HdHc3dzFWZVJQYTVQZ1RZRTFUWWg0YXR3TlgyRDlUK2Qy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rVmlyYzVLWm1ObUxFM05PVWFa?= =?utf-8?Q?Qr8pLopspSK2YiJ9Dhj1d4F1g?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1968c6f5-7125-4b43-090d-08db7647a57c X-MS-Exchange-CrossTenant-AuthSource: AM0PR0402MB3395.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2023 13:17:09.7523 (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: XpI9INJF8jhfrkQz5HsSNLXr9MId8BPE4tA2FI0c/jSkUZblz8j9SRCsxA7mN4jTeImagp5KSse1jxSvYAZFww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8555 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/21/23 19:58, Oleksandr Tyshchenko wrote: > On 21.06.23 16:12, Petr Pavlu wrote: >> When attempting to run Xen on a QEMU/KVM virtual machine with virtio >> devices (all x86_64), dom0 tries to establish a grant for itself which >> eventually results in a hang during the boot. >> >> The backtrace looks as follows, the while loop in __send_control_msg() >> makes no progress: >> >> #0 virtqueue_get_buf_ctx (_vq=_vq@entry=0xffff8880074a8400, len=len@entry=0xffffc90000413c94, ctx=ctx@entry=0x0 ) at ../drivers/virtio/virtio_ring.c:2326 >> #1 0xffffffff817086b7 in virtqueue_get_buf (_vq=_vq@entry=0xffff8880074a8400, len=len@entry=0xffffc90000413c94) at ../drivers/virtio/virtio_ring.c:2333 >> #2 0xffffffff8175f6b2 in __send_control_msg (portdev=, port_id=0xffffffff, event=0x0, value=0x1) at ../drivers/char/virtio_console.c:562 >> #3 0xffffffff8175f6ee in __send_control_msg (portdev=, port_id=, event=, value=) at ../drivers/char/virtio_console.c:569 >> #4 0xffffffff817618b1 in virtcons_probe (vdev=0xffff88800585e800) at ../drivers/char/virtio_console.c:2098 >> #5 0xffffffff81707117 in virtio_dev_probe (_d=0xffff88800585e810) at ../drivers/virtio/virtio.c:305 >> #6 0xffffffff8198e348 in call_driver_probe (drv=0xffffffff82be40c0 , drv=0xffffffff82be40c0 , dev=0xffff88800585e810) at ../drivers/base/dd.c:579 >> #7 really_probe (dev=dev@entry=0xffff88800585e810, drv=drv@entry=0xffffffff82be40c0 ) at ../drivers/base/dd.c:658 >> #8 0xffffffff8198e58f in __driver_probe_device (drv=drv@entry=0xffffffff82be40c0 , dev=dev@entry=0xffff88800585e810) at ../drivers/base/dd.c:800 >> #9 0xffffffff8198e65a in driver_probe_device (drv=drv@entry=0xffffffff82be40c0 , dev=dev@entry=0xffff88800585e810) at ../drivers/base/dd.c:830 >> #10 0xffffffff8198e832 in __driver_attach (dev=0xffff88800585e810, data=0xffffffff82be40c0 ) at ../drivers/base/dd.c:1216 >> #11 0xffffffff8198bfb2 in bus_for_each_dev (bus=, start=start@entry=0x0 , data=data@entry=0xffffffff82be40c0 , >> fn=fn@entry=0xffffffff8198e7b0 <__driver_attach>) at ../drivers/base/bus.c:368 >> #12 0xffffffff8198db65 in driver_attach (drv=drv@entry=0xffffffff82be40c0 ) at ../drivers/base/dd.c:1233 >> #13 0xffffffff8198d207 in bus_add_driver (drv=drv@entry=0xffffffff82be40c0 ) at ../drivers/base/bus.c:673 >> #14 0xffffffff8198f550 in driver_register (drv=drv@entry=0xffffffff82be40c0 ) at ../drivers/base/driver.c:246 >> #15 0xffffffff81706b47 in register_virtio_driver (driver=driver@entry=0xffffffff82be40c0 ) at ../drivers/virtio/virtio.c:357 >> #16 0xffffffff832cd34b in virtio_console_init () at ../drivers/char/virtio_console.c:2258 >> #17 0xffffffff8100105c in do_one_initcall (fn=0xffffffff832cd2e0 ) at ../init/main.c:1246 >> #18 0xffffffff83277293 in do_initcall_level (command_line=0xffff888003e2f900 "root", level=0x6) at ../init/main.c:1319 >> #19 do_initcalls () at ../init/main.c:1335 >> #20 do_basic_setup () at ../init/main.c:1354 >> #21 kernel_init_freeable () at ../init/main.c:1571 >> #22 0xffffffff81f64be1 in kernel_init (unused=) at ../init/main.c:1462 >> #23 0xffffffff81001f49 in ret_from_fork () at ../arch/x86/entry/entry_64.S:308 >> #24 0x0000000000000000 in ?? () >> >> Fix the problem by preventing xen_grant_init_backend_domid() from >> setting dom0 as a backend when running in dom0. >> >> Fixes: 035e3a4321f7 ("xen/virtio: Optimize the setup of "xen-grant-dma" devices") > > > I am not 100% sure whether the Fixes tag points to precise commit. If I > am not mistaken, the said commit just moves the code in the context > without changing the logic of CONFIG_XEN_VIRTIO_FORCE_GRANT, this was > introduced before. I see, the tag should better point to 7228113d1fa0 ("xen/virtio: use dom0 as default backend for CONFIG_XEN_VIRTIO_FORCE_GRANT") which introduced the original logic to use dom0 as backend. Commit 035e3a4321f7 ("xen/virtio: Optimize the setup of "xen-grant-dma" devices") is relevant in sense that it extended when this logic is active by adding an OR check for xen_pv_domain(). > > >> Signed-off-by: Petr Pavlu >> --- >> drivers/xen/grant-dma-ops.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/xen/grant-dma-ops.c b/drivers/xen/grant-dma-ops.c >> index 76f6f26265a3..29ed27ac450e 100644 >> --- a/drivers/xen/grant-dma-ops.c >> +++ b/drivers/xen/grant-dma-ops.c >> @@ -362,7 +362,9 @@ static int xen_grant_init_backend_domid(struct device *dev, >> if (np) { >> ret = xen_dt_grant_init_backend_domid(dev, np, backend_domid); >> of_node_put(np); >> - } else if (IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT) || xen_pv_domain()) { >> + } else if ((IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT) || >> + xen_pv_domain()) && >> + !xen_initial_domain()) { > > The commit lgtm, just one note: > > > I would even bail out early in xen_virtio_restricted_mem_acc() instead, > as I assume the same issue could happen on Arm with DT (although there > we don't guess the backend's domid, we read it from DT and quite > unlikely we get Dom0 being in Dom0 with correct DT). > > Something like: > > @@ -416,6 +421,10 @@ bool xen_virtio_restricted_mem_acc(struct > virtio_device *dev) > { > domid_t backend_domid; > > + /* Xen grant DMA ops are not used when running as initial domain */ > + if (xen_initial_domain()) > + return false; > + > if (!xen_grant_init_backend_domid(dev->dev.parent, > &backend_domid)) { > xen_grant_setup_dma_ops(dev->dev.parent, backend_domid); > return true; > (END) > > > > If so, that commit subject would need to be updated accordingly. > > Let's see what other reviewers will say. Ok, makes sense. Thanks, Petr