临时修改
临时修改可以方便地测试和验证内核参数是否有效地解决问题,而这只需要在系统启动时,选中条目,e 键即可进入编辑模式,将参数追加到 linux 所在行。
永久修改
经过临时修改验证后,是时候将其修改永久保存,将内核参数追加到 /etc/default/grub 文件中的 GRUB_CMDLINE_LINUX_DEFAULT,每个参数以空格隔开。比如开启OS串口重定向:
console= [KNL] Output console device and options.
tty<n> Use the virtual console device <n>.
ttyS<n>[,options]
ttyUSB0[,options]
Use the specified serial port. The options are of
the form "bbbbpnf", where "bbbb" is the baud rate,
"p" is parity ("n", "o", or "e"), "n" is number of
bits, and "f" is flow control ("r" for RTS or
omit it). Default is "9600n8".
See Documentation/serial-console.txt for more
information. See
Documentation/networking/netconsole.txt for an
alternative.
uart[8250],io,<addr>[,options]
uart[8250],mmio,<addr>[,options]
Start an early, polled-mode console on the 8250/16550
UART at the specified I/O port or MMIO address,
switching to the matching ttyS device later. The
options are the same as for ttyS, above.
hvc<n> Use the hypervisor console device <n>. This is for
both Xen and PowerPC hypervisors.
If the device connected to the port is not a TTY but a braille
device, prepend "brl," before the device type, for instance
console=brl,ttyS0
For now, only VisioBraille is supported.
找到 GRUB_CMDLINE_LINUX 修改为
GRUB_CMDLINE_LINUX="console=ttyS0,115200n8"
例如IOMMU 功能开关
amd_iommu= [HW,X86-64]
Pass parameters to the AMD IOMMU driver in the system.
Possible values are:
fullflush - enable flushing of IO/TLB entries when
they are unmapped. Otherwise they are
flushed before they will be reused, which
is a lot of faster
off - do not initialize any AMD IOMMU found in
the system
force_isolation - Force device isolation for all
devices. The IOMMU driver is not
allowed anymore to lift isolation
requirements as needed. This option
does not override iommu=pt
amd_iommu_dump= [HW,X86-64]
Enable AMD IOMMU driver option to dump the ACPI table
for AMD IOMMU. With this option enabled, AMD IOMMU
driver will print ACPI tables for AMD IOMMU during
IOMMU initialization.
amd_iommu_intr= [HW,X86-64]
Specifies one of the following AMD IOMMU interrupt
remapping modes:
legacy - Use legacy interrupt remapping mode.
vapic - Use virtual APIC mode, which allows IOMMU
to inject interrupts directly into guest.
This mode requires kvm-amd.avic=1.
(Default when IOMMU HW support is present.)
找到 GRUB_CMDLINE_LINUX 修改为
GRUB_CMDLINE_LINUX="amd_iommu=on iommu=pt”
然后执行
sudo grub-mkconfig -o /boot/grub/grub.cfg
详细的OS kernel grub参数设置入附件 Kernel Parameters