NVMe show-regs command forcibly reboots ARM-based VM

Bug #2072381 reported by Chengen Du
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nvme-cli (Ubuntu)
Status tracked in Oracular
Focal
In Progress
Undecided
Chengen Du
Jammy
In Progress
Undecided
Chengen Du
Mantic
In Progress
Undecided
Chengen Du
Noble
In Progress
Undecided
Chengen Du
Oracular
In Progress
Undecided
Chengen Du

Bug Description

[Impact]
The ARM-based VM will reboot after executing the 'nvme show-regs' command.

[Fix]
There is an upstream commit that fixed this issue:

commit fa5a46cc25b884a61a14f06e6693373bcefff29d
Author: Oliver Upton <email address hidden>
Date: Thu Jul 4 19:59:26 2024 +0200

    common.h: Avoid using unsupported load/store instructions in arm64 VMs

    Using nvme show-regs within a VM on arm64 can sometimes lead to VM
    termination.

    To answer why this happens: one of the deficiencies of the Arm
    architecture is that there exists a range of load/store instructions
    that have insufficient decode information for traps taken to the
    hypervisor. KVM, for example, may raise an external abort or outright
    terminate the VM depending on the configuration.

    This is a known problem on the kernel side, and is fixed by using
    assembly MMIO accessors w/ 'safe' load/store instructions. So do
    exactly that, providing arm64-specific accessors and falling back to
    plain old volatile pointer accesses for other architectures.

    Reported-by: William Butler <email address hidden>
    Signed-off-by: Oliver Upton <email address hidden>

[Test Plan]
Execute the command 'nvme show-regs /dev/nvme0' to confirm if it functions correctly.

[Where problems could occur]
The patch fixes the issue by using assembly code to access MMIO on ARM, while keeping the original approach on other platforms. If the patch encounters any issues, it will only impact the functionality of displaying register data on ARM-based platforms.

Tags: patch
Chengen Du (chengendu)
Changed in nvme-cli (Ubuntu Focal):
assignee: nobody → Chengen Du (chengendu)
Changed in nvme-cli (Ubuntu Jammy):
assignee: nobody → Chengen Du (chengendu)
Changed in nvme-cli (Ubuntu Mantic):
assignee: nobody → Chengen Du (chengendu)
Changed in nvme-cli (Ubuntu Noble):
assignee: nobody → Chengen Du (chengendu)
Changed in nvme-cli (Ubuntu Oracular):
assignee: nobody → Chengen Du (chengendu)
Revision history for this message
Chengen Du (chengendu) wrote :

Debdiff for Focal

Revision history for this message
Chengen Du (chengendu) wrote :

Debdiff for Jammy

Revision history for this message
Chengen Du (chengendu) wrote :

Debdiff for Mantic

Revision history for this message
Chengen Du (chengendu) wrote :

Debdiff for Noble

Revision history for this message
Chengen Du (chengendu) wrote :

Debdiff for Oracular

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lp2072381_nvme-cli_focal.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Chengen Du (chengendu)
Changed in nvme-cli (Ubuntu Focal):
status: New → In Progress
Changed in nvme-cli (Ubuntu Jammy):
status: New → In Progress
Changed in nvme-cli (Ubuntu Mantic):
status: New → In Progress
Changed in nvme-cli (Ubuntu Noble):
status: New → In Progress
Changed in nvme-cli (Ubuntu Oracular):
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.