From patchwork Wed Apr 5 00:12:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 13201059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C2D0C76188 for ; Wed, 5 Apr 2023 00:13:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.518193.804462 (Exim 4.92) (envelope-from ) id 1pjqlg-0002xv-8K; Wed, 05 Apr 2023 00:12:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 518193.804462; Wed, 05 Apr 2023 00:12:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pjqlg-0002xo-5M; Wed, 05 Apr 2023 00:12:52 +0000 Received: by outflank-mailman (input) for mailman id 518193; Wed, 05 Apr 2023 00:12:50 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pjqle-0002xi-ID for xen-devel@lists.xen.org; Wed, 05 Apr 2023 00:12:50 +0000 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [2607:f8b0:4864:20::62a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 97e26084-d346-11ed-b464-930f4c7d94ae; Wed, 05 Apr 2023 02:12:47 +0200 (CEST) Received: by mail-pl1-x62a.google.com with SMTP id le6so32869820plb.12 for ; Tue, 04 Apr 2023 17:12:47 -0700 (PDT) Received: from localhost ([122.172.85.8]) by smtp.gmail.com with ESMTPSA id jn22-20020a170903051600b0019a95baaaa6sm8852381plb.222.2023.04.04.17.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 17:12:42 -0700 (PDT) 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: 97e26084-d346-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680653566; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OWw80btV/vkY8XMbURM92c6D4GYeLA/5q3xU6Aoi0EQ=; b=vR5dx0yJebVkrvv+aB71InjcvrW6v9q0rNb2PTlKa4lWPnr4/+1CT8KntvSHFQKpCM siaDKPZwRnkot4U8RUR7yYpA9CR+79a+NByNqKCtWM8XTMRw7aQ+4NXSgLSHbK0ZGE50 QPgCl4tZtf45W8+N9nUlXaG6eFFXj8MPsvunicqk18zheXGfYpoV+f5uKDHDy00GGHhZ Ouz/Q5yQrF5BC8YUFzktg3F9hE3rKvbZtGqxMOZ1cLD7mQPziXcKw6Tv6t2hTlB5FJZM O4zNi823xfywpse/OuLgtWfVK9WPUeINoe/ziK2zK2CAr/UlvgUI5QTAqYf2Fm32YanH mMRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680653566; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OWw80btV/vkY8XMbURM92c6D4GYeLA/5q3xU6Aoi0EQ=; b=4108WNwuCYfF/epZqox5Xyu1aP5matl6SCPcbeJ4v0m/Sk0M8D5G9Anj0IYiiVcfJB IQQOUmzuSSwDf1Sfh9mUqm4Ch8Azve8JDb15w2pcK4sCIZZjeZ+yvvj85L5gJ78IkXrH /qwZNByua02iD2cxqRUWgSMfxSLTtLjlE+RMm8B5Q+YGR/ZQ0nfurnpfweEs+CKDZRuq Zz/dpTukqwgZONRGTThXENQ2mIzyfrSQseVG93zLgxrvERGXCcgA1X08IOa145aeRuZt RrslJGIjcwuWktnzSaEMvn5KJheyFWRnMURRZkO3tFA7v8gbWxP5lPumwJSI718Zwrw3 WiBA== X-Gm-Message-State: AAQBX9cpEsa513P8xGij+CB1pcKHbPofYvTwKwoB/nVXG0O2U84J7fMf sCj7Jl5oZwWXtzM8oDZoF3quT7pP6CG/3u2fQOQ= X-Google-Smtp-Source: AKy350bnELvarxqhwrfDobQ4HgHVzxA23wxmz2u35PJ8qLOp7TTqjYlqBLgYLfiN6mn/KoxMHgp9gg== X-Received: by 2002:a17:90a:1902:b0:240:5c43:7766 with SMTP id 2-20020a17090a190200b002405c437766mr4844628pjg.4.1680653566069; Tue, 04 Apr 2023 17:12:46 -0700 (PDT) From: Viresh Kumar To: xen-devel@lists.xen.org, Juergen Gross , Julien Grall , Anthony PERARD Cc: Viresh Kumar , Vincent Guittot , stratos-dev@op-lists.linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Mathieu Poirier , Oleksandr Tyshchenko , Erik Schilling Subject: [PATCH V2 1/2] docs: Allow generic virtio device types to contain device-id Date: Wed, 5 Apr 2023 05:42:35 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 For generic virtio devices, where we don't need to add compatible or other special DT properties, the type field is set to "virtio,device". But this misses the case where the user sets the type with a valid virtio device id as well, like "virtio,device26" for file system device. Update documentation to support that as well. Fixes: dd54ea500be8 ("docs: add documentation for generic virtio devices") Signed-off-by: Viresh Kumar Reviewed-by: Oleksandr Tyshchenko --- V1->V2: New patch. docs/man/xl.cfg.5.pod.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index 10f37990be57..ea20eac0ba32 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -1608,8 +1608,9 @@ example, "type=virtio,device22" for the I2C device, whose device-tree binding is L -For generic virtio devices, where we don't need to set special or compatible -properties in the Device Tree, the type field must be set to "virtio,device". +For other generic virtio devices, where we don't need to set special or +compatible properties in the Device Tree, the type field must be set to +"virtio,device" or "virtio,device", where "N" is the virtio device id. =item B From patchwork Wed Apr 5 00:12:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 13201060 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F08BC761A6 for ; Wed, 5 Apr 2023 00:13:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.518194.804472 (Exim 4.92) (envelope-from ) id 1pjqli-0003Cq-H8; Wed, 05 Apr 2023 00:12:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 518194.804472; Wed, 05 Apr 2023 00:12:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pjqli-0003Cj-Dd; Wed, 05 Apr 2023 00:12:54 +0000 Received: by outflank-mailman (input) for mailman id 518194; Wed, 05 Apr 2023 00:12:53 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pjqlh-0002xi-H7 for xen-devel@lists.xen.org; Wed, 05 Apr 2023 00:12:53 +0000 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [2607:f8b0:4864:20::102d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9a5e91b4-d346-11ed-b464-930f4c7d94ae; Wed, 05 Apr 2023 02:12:51 +0200 (CEST) Received: by mail-pj1-x102d.google.com with SMTP id j13so32305906pjd.1 for ; Tue, 04 Apr 2023 17:12:51 -0700 (PDT) Received: from localhost ([122.172.85.8]) by smtp.gmail.com with ESMTPSA id z3-20020a170902ee0300b001a1ea1d6d6esm8851436plb.290.2023.04.04.17.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 17:12:48 -0700 (PDT) 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: 9a5e91b4-d346-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680653570; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mYxdQefgqzq2X8Q8qR8DL2/WAeN3DrYXWhA7psmOG80=; b=tzmH9TBXP3GLNCGLUPpOx4TttKCBmol8VdJA6+UQj486ul/mT6/7hcIp6NJQc4wMbq WfrnQHg0d5FE8BoZ+pORuig9piAflF/mel91+K1+Mb5MkgBp+E4vzEupCjnuuiRSeaUX sRR6x0OfIml2X7W/sZqZrwDJ4uIL2NfsQ/4s72WUpB43/9QfiBpV2M2YUJw11AtvFYEW nv66L+qr4kJQ5ganRgEFds/KFds1DLRrf5fFhiu/A2+2UYdPxH258Q/hzgiOn2wWIwM/ 1Ldud6iAarCJ2TmueSghvBXJ4lUdwxT03TM96N4q02SHBzvW0L4kDw1EnL6wqlCOOWMF KQlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680653570; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mYxdQefgqzq2X8Q8qR8DL2/WAeN3DrYXWhA7psmOG80=; b=GUu6wSDAMyEFpzl5D4lur6Bfuwm6xfpmJQLDL1YaXjXiVvyTFG5+yiIBOj844Ak61W fCa6+JA4NyN6mhUg99UajP5Y8dB1H5k32NmOph+pTDIlZeHwuXi+Axb5SKVimS70tlHb umRuMFVdNVBzNWCUI2KhAhjqBkFC66Aw+ZqNcVbc7zcQdmqDHDMQXAlrSC7yw7n8Uf/w vg5U3w9KtMn+6ug6Llo4VGaieK5Tsy26ufecm6OD1HEMrQVsxsdYigTmbaoxGoEpzSUy D6yajaSofqK0QlqBLKXDLLCgeuM2V6yV8ipBGiPWjNIXePZACicGgcD+IcCnNXciBHAH cFfw== X-Gm-Message-State: AAQBX9cwOIOvRrRqV5v25Tv2wxT49ySgIeZtpcTvCM0rlkkbO7c5KqqR Aeedze2Kq57twibw7hPeizJDyeIYu3MtMNsOX8E= X-Google-Smtp-Source: AKy350b5vjoTBYkLa2izjFoNXcHxKSMw3SrIT5qvguVpK4gjXabDgou1jc1K8ftTFJBNnxwFcqQy9w== X-Received: by 2002:a17:90b:3b8a:b0:237:161d:f5ac with SMTP id pc10-20020a17090b3b8a00b00237161df5acmr4435401pjb.36.1680653570386; Tue, 04 Apr 2023 17:12:50 -0700 (PDT) From: Viresh Kumar To: xen-devel@lists.xen.org, Juergen Gross , Julien Grall , Anthony PERARD Cc: Viresh Kumar , Vincent Guittot , stratos-dev@op-lists.linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Mathieu Poirier , Oleksandr Tyshchenko , Erik Schilling Subject: [PATCH V2 2/2] libxl: fix matching of generic virtio device Date: Wed, 5 Apr 2023 05:42:36 +0530 Message-Id: <62f2603d8b3fba1efb236063a0819fb95285b0ae.1680653504.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 The strings won't be an exact match, as we are only looking to match the prefix here, i.e. "virtio,device". This is already done properly in libxl_virtio.c file, lets do the same here too. Fixes: 43ba5202e2ee ("libxl: add support for generic virtio device") Signed-off-by: Viresh Kumar Reviewed-by: Oleksandr Tyshchenko --- V1->V2: Add the missing fixes tag. tools/libs/light/libxl_arm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c index ddc7b2a15975..97c80d7ed0fa 100644 --- a/tools/libs/light/libxl_arm.c +++ b/tools/libs/light/libxl_arm.c @@ -1033,10 +1033,14 @@ static int make_virtio_mmio_node_device(libxl__gc *gc, void *fdt, uint64_t base, } else if (!strcmp(type, VIRTIO_DEVICE_TYPE_GPIO)) { res = make_virtio_mmio_node_gpio(gc, fdt); if (res) return res; - } else if (strcmp(type, VIRTIO_DEVICE_TYPE_GENERIC)) { - /* Doesn't match generic virtio device */ - LOG(ERROR, "Invalid type for virtio device: %s", type); - return -EINVAL; + } else { + int len = sizeof(VIRTIO_DEVICE_TYPE_GENERIC) - 1; + + if (strncmp(type, VIRTIO_DEVICE_TYPE_GENERIC, len)) { + /* Doesn't match generic virtio device */ + LOG(ERROR, "Invalid type for virtio device: %s", type); + return -EINVAL; + } } return fdt_end_node(fdt);