From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EF40126C0D for ; Sun, 5 Jan 2025 17:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736097462; cv=none; b=VVff9Itg+Y+nEA8xmwYT+BnZc4SlWQsoiy+bjNXyIx8HDhKgeUL945MppxOaLbBdsNVXPHxnnB3Nk7bG9SBgHXsKwhgf+qog8DlXyRzN5rFxrMcuH8vAxusJp0vFW5HtuzgCbuBYqkj70TOKzGR5moryYnjrdvmoJtZS9s1ZSZ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736097462; c=relaxed/simple; bh=5k8ycTRaWzR61UJvHO40HQsKr26i4RCmw6iVaBJ1p5w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Wu/QobtjuNescgYznBnr2bpAnlbezMc3bq1pM1EIZnwI65OJLQorydAiaMK7NdhPlzhX/15+XacgHnoqlCK22iflr3k3eNqAiDd9/Ijl37n0zsznswm+600lEb2lTHxWglfnV4M3ik2EvClUMvxEOBHl+rUHNLOmAytdFqWprQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=fvRCFaMm; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fvRCFaMm" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso97709505e9.1 for ; Sun, 05 Jan 2025 09:17:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1736097459; x=1736702259; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=28ukOJT+BC5Hb4IDeNu8OIpCDoYlDgcQuEEIPI9KYoI=; b=fvRCFaMm3iSp6k3o6ah86JkBAa7qoaqeJ8kI0dUvpBoOoqDNDa28kiY7tiusIcw7ek XgCQppccELMRdVWo7Aqedqhg154+1l++LwjH7bqOcB7q1yPobMPX0gE31bW0RiOSn/Y8 W/w51YXg4lkYZRvC8UY4W0tKdOTKY92LrYKH8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736097459; x=1736702259; 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=28ukOJT+BC5Hb4IDeNu8OIpCDoYlDgcQuEEIPI9KYoI=; b=RUbUmzrYyWoL5sYA0dhDiYjJSovK9z0uKd9KN5nkkKZ+ZZENBiQVSDLSKDX77itZvf Qtssz9rNH4MWaviolCfWt6c6mCUFikwQ6r90nC9V97slptTKEsnesP8g6NeVekO32cic fBFFtDV9fWZjg4JGdXvhRY62pv0lKTjuthNZBeI6dx/0yQSn0GrLgmbJzWTBEM37IqrV wlmgAYF+bUvwfcHlyogsvEbGUv27WurToe8T8DtKiRvGzlGLfTa5d5RuaWfj12W0IsnC 6HOK3GdmSZI8UD4lkKscivbFsqve8ykH2f2B8ocqsns5GBN7zbjWNT77y6M1kLwAetpq mTNA== X-Forwarded-Encrypted: i=1; AJvYcCW+jP2rtMbnas3D6Ht4DOFSlDwLbadugje3hS1gIZkKJyRmNkKEq13508/FI3anfGQtUkpyq2xSf7ECiVI=@vger.kernel.org X-Gm-Message-State: AOJu0YxFzyQ27GSCalQ/IoBo7EDJdMzdFckD184N7gs3jdRX2EHV5AkU ZEhQHnGOZoPB0T65JwSAiZG+QDOaFKvzAyULcQm/Trfd/5ae/C4W/bIh1SyM5g== X-Gm-Gg: ASbGncuds5RmM79vDhGvL7mjhaq2IsC9kMqiOQlyXfR1EJIwU1yTugGjVIB8XPaXO2/ 3gBzHP/c4h6+4h4wc7sIXZEVRppK1x2cq+lKqz8VFeDRrvvJ1Uki6L8xaGIGwLJ0C465CgHqnZ7 cH9xgdH03WpL/pOLX2eyLUrBxKed2SMbZzTk05wZEQNZAAdzSXUfnxHKcb7/pkrXu7zX6dJykhp NKKeU8iA2yiRxZrj7QPiF0gwg8fRW1Bzxx/IUtCp5c0sWvfSSKZ+erY2ejF706PVwFuN8+13Kc9 TKzKp94nKtCBj6Rozj8IP9sAxxRr/cqF9PHb X-Google-Smtp-Source: AGHT+IFuJF16gyCsGs4Et67YtR7rCbdYRxOtCkpAuEKYuEZF3nGCOZgmij9h5QndKxy+u1vp6J6uFQ== X-Received: by 2002:a05:600c:4688:b0:435:b064:7dce with SMTP id 5b1f17b1804b1-4366864618emr504125065e9.18.1736097459372; Sun, 05 Jan 2025 09:17:39 -0800 (PST) Received: from dmaluka.c.googlers.com.com (19.50.76.34.bc.googleusercontent.com. [34.76.50.19]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436604e9c2csm543987345e9.43.2025.01.05.09.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2025 09:17:38 -0800 (PST) From: Dmytro Maluka To: Thomas Gleixner , Rob Herring Cc: Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter Anvin" , Saravana Kannan , Saurabh Sengar , Usama Arif , Stephen Boyd , Frank Rowand , linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE), =?UTF-8?q?Pierre-Cl=C3=A9ment=20Tosi?= , Shikha Panwar , Will Deacon , Keir Fraser , Michal Mazurek , =?UTF-8?q?Bart=C5=82omiej=20Grzesik?= , Tomasz Nowicki , Grzegorz Jaszczyk , Dmytro Maluka Subject: [PATCH 0/2] of, x86: Restore possibility to use both ACPI and FDT from bootloader Date: Sun, 5 Jan 2025 17:16:41 +0000 Message-ID: <20250105171643.3473702-1-dmaluka@chromium.org> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit There are cases when the bootloader provides information to the kernel in both ACPI and DTB, not interchangeably. One such use case is virtual machines in Android. When running on x86, the Android Virtualization Framework (AVF) boots VMs with ACPI like it is usually done on x86 (i.e. the virtual LAPIC, IOAPIC, HPET, PCI MMCONFIG etc are described in ACPI) but also passes various AVF-specific boot parameters in DTB. This allows reusing the same implementations of various AVF components on both arm64 and x86. (Note that on arm64 AVF uses DT only, no ACPI.) Commit 7b937cc243e5 ("of: Create of_root if no dtb provided by firmware") removed the possibility to do that, since among other things it introduced forcing emptying the bootloader-provided DTB if ACPI is enabled (probably assuming that if ACPI is available, a DTB can only be useful for applying overlays to it afterwards, for testing purposes). So restore this possibility. At the same time, since on x86 the aforementioned recently introduced restriction is actually useful for preventing conflicts between ACPI and DT for LAPIC/IOAPIC/HPET setup, don't remove this restriction completely but relax it: unflatten the bootloader supplied DTB but don't try to use it for SMP setup. Note that on arm64 currently ACPI and DT are not used together in any case (setup_arch() enforces that), and this series doesn't change that. v1 -> v2: Split the patch into two, to separate the x86 part from the common part. Dmytro Maluka (2): x86/of: Don't use DTB for SMP setup if ACPI is enabled of/fdt: Restore possibility to use both ACPI and FDT from bootloader arch/x86/kernel/devicetree.c | 3 ++- drivers/of/fdt.c | 10 +--------- 2 files changed, 3 insertions(+), 10 deletions(-) -- 2.47.1.613.gc27f4b7a9f-goog