Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2121228lqe; Tue, 9 Apr 2024 10:03:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVeRtgGFLSybbXtpqhfaE90r+BR8YaFWqPX6vqRvzyHCO4xBggt1NYaMdKSulaGIp+MsK/m6T/BhgKKIIq5dGzaE6TH9Lad9izLgilXxA== X-Google-Smtp-Source: AGHT+IGmyVAsmjDe0JKXNbEq3jW0URX19Mwxe6HUZp88rTxychDBMlM6a2Jlf1GrhDhPMssorG73 X-Received: by 2002:a05:6300:8082:b0:1a7:528b:33bd with SMTP id ap2-20020a056300808200b001a7528b33bdmr437097pzc.15.1712682201261; Tue, 09 Apr 2024 10:03:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712682201; cv=pass; d=google.com; s=arc-20160816; b=aJOJJOVzf0dXWgAt1ep2QX8vBol7dDVCmGMJGLvZNy9WNxQysXz5ogHBdETrD7UlLg F5aC7kOGFnEwHXi3MD3qwaQDg7k+jUoU3q9dJYBWEGvwHQUoODDq438m/qHO2NC3mWl/ m696Za6JVgerGdmZKforlzt/m8xcc5iIicpR7nst+8TPjodXm4Wd/BayNri3U492n5Za 83FskaUVT12O+vNlufcFkZuwR+Sx/4PcwzpzvHn2yZXU6PGtLeTSwmBqfPrkl9pA5v/v cclaWB6hKFv3E2A9h4ouoMZ91FJ3UOXNy3mp1kwkP9CAV/2c13v0m3Mcly2ICdxK0zFS jIeQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JxlOcBDU6r908oKknpBe0s7bQqLQWVDeva8VVC0aQbE=; fh=eulCrYuY4zK7Gxr6B+4yAHyThWGi9/x0Te9WMho9aNk=; b=P0yrnBh8SXR8buh9p6yOAvgRezAwrYXVsWbO/BGEH+js7MQd/TbCKtblZ5/qmSENNX 5zThj3RdOlrRsSBUcEuiw1PG1gnDqFOzNAJaCvauIDTozpS5mfzJYCSog1Kv6muvdLWb J2Ee4gWeFXE2CK46zjMY/e4D33FdlDz9JOyeiPF78/r0gQqODNcsPiQDSzecF2RDqhuG asd/2xPAajWGb1DNKFqn6yifhmgTvH8lVvdEIl02BxsKiWhyy/lSy/0F5Ol3zpdt4noo yPXymAAxsmmL7sf/4vDNgwF+D/If0aMfBp/bNz7BlwOwUh4ey1zvmNSZtuJPCtUe0mws 0sJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=nJrWZZas; 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-137356-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137356-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x18-20020aa784d2000000b006eaccc36ce2si8692614pfn.156.2024.04.09.10.03.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 10:03:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137356-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=nJrWZZas; 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-137356-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137356-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E8AA02838F2 for ; Tue, 9 Apr 2024 17:03:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1276B156239; Tue, 9 Apr 2024 17:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="nJrWZZas" Received: from smtp-fw-52005.amazon.com (smtp-fw-52005.amazon.com [52.119.213.156]) (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 87521155A33; Tue, 9 Apr 2024 17:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.119.213.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712682134; cv=none; b=TDJrdjy0eQ1GlcBGbKJBDl1O/B8w855WjKLEfoVudof850Ki/ro6Mxbf7graEgVlcB4Rax6Q5MvgLdp4+cF0sck603OOpX47XwQuOZk4Kuv5WRDxmvkbBSEo4RrZ50xjtXmOAp/hrkygahX+j+yEJl0FfBkUpbt1+dzyPMhPEO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712682134; c=relaxed/simple; bh=EcZlkq4mhkJTecvlYLJiT9xew1ftS1oIMx4P6vr0rwc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GnhVLiC72Z2uwfjicKeHEupnTgFT0LAVyEQHorf3zD9WsWvt4LNFsAQOt/3vZSh55vIeGu/R1Zv5rQIY/4hzVNyN8oP4fx2zsWysJbwv6P8we5XX2J5GxkHU8VSVJYgknIvs5fs8bIvUxbr4ctnwLdL2iOLUYxSSGbl/Mvp6ePs= 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=nJrWZZas; arc=none smtp.client-ip=52.119.213.156 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=1712682133; x=1744218133; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JxlOcBDU6r908oKknpBe0s7bQqLQWVDeva8VVC0aQbE=; b=nJrWZZasF1NWhKz6tX8Ybk4a37fTW2Q0pIaYaoLwB6nT0NGe/Wvwd8fw qp9ZHo14eVYDRQZ8Be2CgH+D/jtnsr+njMXIjzaqfvJQ9iS0rNG88Imfz qeGfXqlPLFGdA9BgNz9ErKkHjaknk+Ephy921MgmjQQiJwGUwz7xsbHgk U=; X-IronPort-AV: E=Sophos;i="6.07,190,1708387200"; d="scan'208";a="646642541" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.43.8.6]) by smtp-border-fw-52005.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2024 17:02:12 +0000 Received: from EX19MTAEUA002.ant.amazon.com [10.0.17.79:2366] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.47.234:2525] with esmtp (Farcaster) id 80dc4823-351c-441e-ad33-11ab3022cf0f; Tue, 9 Apr 2024 17:02:11 +0000 (UTC) X-Farcaster-Flow-ID: 80dc4823-351c-441e-ad33-11ab3022cf0f Received: from EX19D036EUC002.ant.amazon.com (10.252.61.191) by EX19MTAEUA002.ant.amazon.com (10.252.50.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 9 Apr 2024 17:02:10 +0000 Received: from bcd074994f7f.amazon.com (10.95.97.144) 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, 9 Apr 2024 17:02:06 +0000 From: Sudan Landge To: , , , , , , , , , , CC: , , , Subject: [PATCH v4 3/5] virt: vmgenid: enable driver regardless of ACPI config Date: Tue, 9 Apr 2024 18:01:35 +0100 Message-ID: <20240409170137.79197-4-sudanl@amazon.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20240409170137.79197-1-sudanl@amazon.com> References: <20240409170137.79197-1-sudanl@amazon.com> 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: EX19D044UWA001.ant.amazon.com (10.13.139.100) To EX19D036EUC002.ant.amazon.com (10.252.61.191) Since with next commits vmgenid driver will support both ACPI and devicetree, and since either one of CONFIG_ACPI or CONFIG_OF will always be enabled, there is no need for the driver compilation to depend on ACPI/OF. So, remove ACPI dependency for compiling the driver. Signed-off-by: Sudan Landge --- drivers/virt/Kconfig | 1 - drivers/virt/vmgenid.c | 16 +++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/virt/Kconfig b/drivers/virt/Kconfig index 40129b6f0eca..d8c848cf09a6 100644 --- a/drivers/virt/Kconfig +++ b/drivers/virt/Kconfig @@ -16,7 +16,6 @@ if VIRT_DRIVERS config VMGENID tristate "Virtual Machine Generation ID driver" default y - depends on ACPI help Say Y here to use the hypervisor-provided Virtual Machine Generation ID to reseed the RNG when the VM is cloned. This is highly recommended if diff --git a/drivers/virt/vmgenid.c b/drivers/virt/vmgenid.c index c028e2064fdd..3d93e3fb94c4 100644 --- a/drivers/virt/vmgenid.c +++ b/drivers/virt/vmgenid.c @@ -36,13 +36,15 @@ static void vmgenid_notify(struct device *device) kobject_uevent_env(&device->kobj, KOBJ_CHANGE, envp); } -static void vmgenid_acpi_handler(acpi_handle __always_unused handle, - u32 __always_unused event, void *dev) +static void __maybe_unused +vmgenid_acpi_handler(acpi_handle __always_unused handle, + u32 __always_unused event, void *dev) { vmgenid_notify(dev); } -static int setup_vmgenid_state(struct vmgenid_state *state, u8 *next_id) +static int __maybe_unused +setup_vmgenid_state(struct vmgenid_state *state, u8 *next_id) { if (IS_ERR(next_id)) return PTR_ERR(next_id); @@ -53,9 +55,10 @@ static int setup_vmgenid_state(struct vmgenid_state *state, u8 *next_id) return 0; } -static int vmgenid_add_acpi(struct device *dev, - struct vmgenid_state *state) +static int vmgenid_add_acpi(struct device __maybe_unused *dev, + struct vmgenid_state __maybe_unused *state) { +#if IS_ENABLED(CONFIG_ACPI) struct acpi_device *device = ACPI_COMPANION(dev); struct acpi_buffer parsed = { ACPI_ALLOCATE_BUFFER }; union acpi_object *obj; @@ -98,6 +101,9 @@ static int vmgenid_add_acpi(struct device *dev, out: ACPI_FREE(parsed.pointer); return ret; +#else + return -EINVAL; +#endif } static int vmgenid_add(struct platform_device *pdev) -- 2.34.1