Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp912840lqt; Tue, 19 Mar 2024 07:33:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2XnHd/b3uVXjhTtj+xX+E2H4U2IteCHpmpPL2jmMiVXkTAL5w3INssFXlTQB2tl8XkX4ihhWu5xmpbfihmE6bLSpoWFFF7KzELMUDnA== X-Google-Smtp-Source: AGHT+IFLCmiBobK4mBdlV5oFwKetzQcNwEMUZJLN/7CWQ9DBtr3q30JSQxquWV+s3uz0EbKwR6R+ X-Received: by 2002:aca:2315:0:b0:3c3:902e:3a4a with SMTP id e21-20020aca2315000000b003c3902e3a4amr2881223oie.17.1710858804945; Tue, 19 Mar 2024 07:33:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710858804; cv=pass; d=google.com; s=arc-20160816; b=PN+GPgxOm8RvwKor5p+/p1qyjlGvmMBYMgud1M8oFe06kI1CunTY42vZGxGpffRGb7 dR48JkiXQHGwl19TlXBK9awbQKF/PeWDOdpmNbUilPMr2TLbule+Kv6JWdDCDPjmOGeL 3BDN5A3sYlcnqi87wCzc6MMbi/sy1m/Fe1d+rbc9YL1Dao4jD/J70UnEpLtoqCDoGc8p 5vPaV19AhqFh3zrrvGs1ws5JBX/SLMulreBDk1AUDldpEuzU7rDX4YhCgHcONlnf2CAS bmN+4Y7fNOz8UM6IjEWlWzSgnJdLWoBkaCtAGbsgFGMT0sDuB4Iub/AV6shZAme3OV3r ZWzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=7chCwmjvcKwdRDMg/KUnuBlj1+hgueNS7eq72Sg7bgc=; fh=eulCrYuY4zK7Gxr6B+4yAHyThWGi9/x0Te9WMho9aNk=; b=hQRxyVq7NPMLtQ4aBmsILkPBfz8BKURAy3eRrJDbbgBcXHSXyDmXD8knKEQvEcEMuX 0+QK8/nPgSjxFobEVdDrOirgCUEu+zNHhpY1N0hhoOe6vTyFSS1NMzIE3nv5AM1rE4d7 xiRxkGui4e4TgH58d8f3bu4PLb0xf/QjUPKJIqyLf9+wQmmyBOlBduqzSEUP8z5kLda9 qwdX1FLhSjACKWPGNKRD7VWBdiYi9A3LeGd269mGwjptyxev0O/QcYj8ugEHc3Yk1h7q nnjvC4jkybUfHJ93OQlu5taBrWmnCCP/I78wyJtKfuEE5aS/3nsehbEuEJ18dIlLq0r2 H6dg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=n4FfMuZW; arc=pass (i=1 spf=pass spfdomain=amazon.co.uk dkim=pass dkdomain=amazon.com dmarc=pass fromdomain=amazon.com); spf=pass (google.com: domain of linux-kernel+bounces-107652-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107652-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id hr10-20020a05621423ca00b00695dca052a8si5919528qvb.24.2024.03.19.07.33.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 07:33:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107652-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=n4FfMuZW; arc=pass (i=1 spf=pass spfdomain=amazon.co.uk dkim=pass dkdomain=amazon.com dmarc=pass fromdomain=amazon.com); spf=pass (google.com: domain of linux-kernel+bounces-107652-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107652-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 979A91C21B9E for ; Tue, 19 Mar 2024 14:33:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58A46200D2; Tue, 19 Mar 2024 14:33:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="n4FfMuZW" Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6A9746BF; Tue, 19 Mar 2024 14:33:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=99.78.197.217 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710858797; cv=none; b=EijuFsBTyGND5n8O4se67FtB9J9A6/rmLI08c8lcEGeBMhbni4KT8/+nM48vgEnEgKfzJCt25RIooQM1Tlk7cOyE0jVVQ96WxsBLdcyzQdMsWB4OQ74G6ujRC5MWGvoyz+WF7o5HZzcdCRxRE1ntNxXOe5Q0JadDws7dRh60WSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710858797; c=relaxed/simple; bh=YR9u0M+uAknRosLbOW4CUsSV41e8LH2Ktv9Ou+XCzac=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=KZKEhZA3SOXBGXKVUJ/3pY1TQsBzZfKxyJStQv6lGocBZ2zbvz1U+Xnz/uLyZ+2h6DAwnuzDCDJeN+cPOeJNPyKW3Wj16MQguzVPGdCa21H4p0+7IoJGAbUy/kudLwVGP33jzw7jNMO+I7QNYtsvi8iOl5Ypn33UT844FS57crs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.uk; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=n4FfMuZW; arc=none smtp.client-ip=99.78.197.217 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.uk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1710858796; x=1742394796; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7chCwmjvcKwdRDMg/KUnuBlj1+hgueNS7eq72Sg7bgc=; b=n4FfMuZWUPSg6EQNL/alRBNTWIz1fcXK/bBPsgY1xTpPB8n8Cbf7JBds 0lAqhyYF3gdt8gyTtUlleDqw4kzgOLlCriKUyPZKLhketbrbKMWyhMgN8 hSAD1JSiAhTq9HQia8m1PiU+gqOecOdglS4ujej9TrrMMQATNJgD38NoT I=; X-IronPort-AV: E=Sophos;i="6.07,137,1708387200"; d="scan'208";a="281151282" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 14:33:11 +0000 Received: from EX19MTAEUB001.ant.amazon.com [10.0.43.254:57997] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.44.205:2525] with esmtp (Farcaster) id 95b839fb-0be7-4cdc-8180-c37e26cdca51; Tue, 19 Mar 2024 14:33:08 +0000 (UTC) X-Farcaster-Flow-ID: 95b839fb-0be7-4cdc-8180-c37e26cdca51 Received: from EX19D036EUC002.ant.amazon.com (10.252.61.191) by EX19MTAEUB001.ant.amazon.com (10.252.51.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 19 Mar 2024 14:33:08 +0000 Received: from bcd074994f7f.amazon.com (10.106.83.11) by EX19D036EUC002.ant.amazon.com (10.252.61.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 19 Mar 2024 14:33:03 +0000 From: Sudan Landge To: , , , , , , , , , , CC: , , , Subject: [PATCH v1 0/4] virt: vmgenid: Add devicetree bindings support Date: Tue, 19 Mar 2024 14:32:49 +0000 Message-ID: <20240319143253.22317-1-sudanl@amazon.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EX19D046UWA004.ant.amazon.com (10.13.139.76) To EX19D036EUC002.ant.amazon.com (10.252.61.191) This small series of patches aims to add devicetree bindings support for the Virtual Machine Generation ID (vmgenid) driver. Virtual Machine Generation ID driver was introduced in commit af6b54e2b5ba ("virt: vmgenid: notify RNG of VM fork and supply generation ID") as an ACPI only device. We would like to extend vmgenid to support devicetree bindings because: 1. A device should not be defined as an ACPI or DT only device. 2. Technically there's no issue with adding devicetree support to vmgenid. 3. This would allow Hypervisors to use vmgenid without the need to enable ACPI. This is important for hypervisors that want to keep things minimalistic and enable ACPI only when they have no other alternative. While adding the devicetree support we considered re-using existing structures/code to avoid duplication code and reduce maintenance; so, we used the same driver to be configured either by ACPI or by DT. This also meant reimplementing the existing vmgenid ACPI bus driver as a platform driver and making it discoverable using `driver.of_match_table` and `driver.acpi_match_table`. There is no user impact or change in vmgenid functionality when used with ACPI. We verified ACPI support of these patches on X86 and DT support on ARM using Firecracker hypervisor https://github.com/firecracker-microvm/firecracker. To check schema and syntax errors, the bindings file is verified with: ``` make dt_binding_check \ DT_SCHEMA_FILES=Documentation/devicetree/bindings/vmgenid/vmgenid.yaml ``` and the patches were verified with: `scripts/checkpatch.pl --strict v1-000*`. Sudan Landge (4): virt: vmgenid: rearrange code to make review easier virt: vmgenid: change implementation to use a platform driver dt-bindings: Add bindings for vmgenid virt: vmgenid: add support for devicetree bindings .../devicetree/bindings/vmgenid/vmgenid.yaml | 57 +++++ MAINTAINERS | 1 + drivers/virt/Kconfig | 2 +- drivers/virt/vmgenid.c | 197 ++++++++++++++---- 4 files changed, 221 insertions(+), 36 deletions(-) create mode 100644 Documentation/devicetree/bindings/vmgenid/vmgenid.yaml -- 2.40.1