Re: [PATCH 6.8 271/273] x86/sme: Move early SME kernel encryption handling into .head.text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[2024-04-10 07:34] Borislav Petkov:
On Tue, Apr 09, 2024 at 06:38:53PM +0200, Pascal Ernster wrote:
Just to make sure this doesn't get lost: This patch causes the kernel to not
boot on several x86_64 VMs of mine (I haven't tested it on a bare metal
machine). For details and a kernel config to reproduce the issue, see https://lore.kernel.org/stable/fd186a2b-0c62-4942-bed3-a27d72930310@xxxxxxxxxxxxxx/

I see your .config there. How are you booting the VMs? qemu cmdline?

I've seen the issue on both a Hetzner VM (UEFI mode, classical video screen, no access to a serial terminal) and on libvirt VMs (passthrough of the host systems Kaby Lake CPU, libvirt devices whereever possible, no GPU, serial console, kernel, initrd and boot cmdline configured directly in libvirt, without using a bootloader). I can't easily switch between BIOS and UEFI on my Hetzner VM, but at least on my libvirt VMs, the issue occurs regardless of whether I configure the libvirt VMs to start in UEFI or in BIOS mode.

I haven't tried manually calling qemu, and I haven't tried the broken kernel on bare metal, but I suspect that the issue occur there as well if I tested it.

One important aspect I should have mentioned: The config that I've posted is a localmodconfig from a libvirt VM that I used for bisecting this, so it is possible that a kernel built with that exact it might not be able to boot on a Hetzner VM, and it probably wouldn't be able to boot on a bare metal machine. It is sufficient to reproduce the issue on a libvirt VM, though.

I've attached a simplified but sufficient version of my original libvirt VM definition that you can use to reproduce the issue. With this VM defintion, the "working" kernel (from the 0.2 PKGBUILD that reverts your patch) will complain about a missing rootfs, but besides from not finding a rootfs, it will boot, show messages and eventually settle on a low CPU load. With the broken kernel (from the 0.1 PKGBUILD that includes your patch), it won't output even a single message, and it will remain at 100% CPU from the moment you boot the VM to the moment you kill the VM.


Regards
Pascal
<domain type="kvm">
  <name>kernel_issue</name>
  <uuid>3ef94585-9ed2-464c-97ca-546fe9b42e2d</uuid>
  <memory unit="KiB">2097152</memory>
  <currentMemory unit="KiB">2097152</currentMemory>
  <vcpu placement="static">1</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch="x86_64" machine="pc-q35-8.2">hvm</type>
    <kernel>/var/lib/libvirt/boot/vmlinuz-linux-hardened</kernel>
    <initrd>/var/lib/libvirt/boot/initramfs-linux-hardened.img</initrd>
    <cmdline>console=ttyS0,115200 intel_iommu=on lockdown=confidentiality ia32_emulation=0 usbcore.nousb loglevel=7 earlyprintk=serial,ttyS0,115200</cmdline>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <smm state="on"/>
  </features>
  <cpu mode="host-passthrough" check="none" migratable="on"/>
  <clock offset="utc">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <controller type="usb" index="0" model="none"/>
    <controller type="pci" index="0" model="pcie-root"/>
    <controller type="pci" index="1" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="1" port="0x8"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="2" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="2" port="0x9"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
    </controller>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="3" port="0xa"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x2"/>
    </controller>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="4" port="0xb"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x3"/>
    </controller>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="5" port="0xc"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x4"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0xd"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x5"/>
    </controller>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <serial type="pty">
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
      </target>
    </serial>
    <console type="pty">
      <target type="serial" port="0"/>
    </console>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <audio id="1" type="none"/>
    <watchdog model="itco" action="reset"/>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </memballoon>
  </devices>
  <seclabel type="dynamic" model="dac" relabel="yes"/>
</domain>

[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux