From e5a6d12ff80aef5a34c3081f153b958dca2ea841 Mon Sep 17 00:00:00 2001 From: Pankaj Raghav Date: Thu, 27 Jan 2022 16:25:39 +0530 Subject: [PATCH] Kernel: Add nvme_poll command line parameters As we don't currently support MSI(X) interrupts, it could be an issue to boot on some newer hardware. NVMe devices support polling mode where the driver actively polls for completion instead of waiting for an interrupt. --- Base/usr/share/man/man7/boot_parameters.md | 4 +++- Kernel/CommandLine.cpp | 5 +++++ Kernel/CommandLine.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Base/usr/share/man/man7/boot_parameters.md b/Base/usr/share/man/man7/boot_parameters.md index 517adafb949..2338a746755 100644 --- a/Base/usr/share/man/man7/boot_parameters.md +++ b/Base/usr/share/man/man7/boot_parameters.md @@ -66,7 +66,9 @@ List of options: enable available APs (application processors) and use them with the BSP (Bootstrap processor) to schedule and run threads. This parameter defaults to **`off`**. This parameter requires **`enable_ioapic`** to be enabled - and and a `MADT` (APIC) table to be available. + and a `MADT` (APIC) table to be available. + +* **`nvme_poll`** - This parameter configures the NVMe drive to use polling instead of interrupt driven completion. * **`system_mode`** - This parameter is not interpreted by the Kernel, and is made available at `/proc/system_mode`. SystemServer uses it to select the set of services that should be started. Common values are: - **`graphical`** (default) - Boots the system in the normal graphical mode. diff --git a/Kernel/CommandLine.cpp b/Kernel/CommandLine.cpp index 00d74292b8e..13e315d5576 100644 --- a/Kernel/CommandLine.cpp +++ b/Kernel/CommandLine.cpp @@ -175,6 +175,11 @@ UNMAP_AFTER_INIT StringView CommandLine::root_device() const return lookup("root"sv).value_or("/dev/hda"sv); } +bool CommandLine::is_nvme_polling_enabled() const +{ + return contains("nvme_poll"sv); +} + UNMAP_AFTER_INIT AcpiFeatureLevel CommandLine::acpi_feature_level() const { auto value = kernel_command_line().lookup("acpi"sv).value_or("limited"sv); diff --git a/Kernel/CommandLine.h b/Kernel/CommandLine.h index 492650e7816..ad94755222a 100644 --- a/Kernel/CommandLine.h +++ b/Kernel/CommandLine.h @@ -87,6 +87,7 @@ public: [[nodiscard]] StringView userspace_init() const; [[nodiscard]] NonnullOwnPtrVector userspace_init_args() const; [[nodiscard]] StringView root_device() const; + [[nodiscard]] bool is_nvme_polling_enabled() const; [[nodiscard]] size_t switch_to_tty() const; private: