[Bug 2072381] Re: NVMe show-regs command forcibly reboots ARM-based VM

Chengen Du 2072381 at bugs.launchpad.net
Tue Aug 20 02:56:15 UTC 2024


I have conducted tests on Focal, Jammy, and Noble. The command functions
correctly without forcibly restarting the system.

=== Focal ===
root at test-focal:~# apt policy nvme-cli
nvme-cli:
  Installed: 1.9-1ubuntu0.2
  Candidate: 1.9-1ubuntu0.2
  Version table:
 *** 1.9-1ubuntu0.2 100
        100 /var/lib/dpkg/status
     1.9-1ubuntu0.1 500
        500 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 Packages
root at test-focal:~# nvme show-regs /dev/nvme0
cap     : 200f010fff
version : 10000
cc      : 460001
csts    : 1
nssr    : 0
intms   : 0
intmc   : 0
aqa     : 1f001f
asq     : 100ded000
acq     : 100dec000
cmbloc  : 0
cmbsz   : 0
bpinfo  : 0
bprsel  : 0
bpmbl   : 0

=== Jammy ===
root at test-jammy:~# apt policy nvme-cli
nvme-cli:
  Installed: 1.16-3ubuntu0.3
  Candidate: 1.16-3ubuntu0.3
  Version table:
 *** 1.16-3ubuntu0.3 100
        100 /var/lib/dpkg/status
     1.16-3ubuntu0.2 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages
     1.16-3build1 500
        500 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages
root at test-jammy:~# nvme show-regs /dev/nvme0
cap     : 200f010fff
version : 10000
cc      : 460001
csts    : 1
nssr    : 0
intms   : 0
intmc   : 0
aqa     : 1f001f
asq     : 1010a6000
acq     : 1010a5000
cmbloc  : 0
cmbsz   : 0
bpinfo  : 0
bprsel  : 0
bpmbl   : 0
cmbmsc  : 0
cmbsts  : 0
pmrcap  : 0
pmrctl  : 0
pmrsts  : 0
pmrebs  : 0
pmrswtp : 0
pmrmscl : 0
pmrmscu : 0

=== Noble ===
root at test-noble:~# apt policy nvme-cli
nvme-cli:
  Installed: 2.8-1ubuntu0.1
  Candidate: 2.8-1ubuntu0.1
  Version table:
 *** 2.8-1ubuntu0.1 100
        100 http://ports.ubuntu.com/ubuntu-ports noble-proposed/main arm64 Packages
        100 /var/lib/dpkg/status
     2.8-1build2 500
        500 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 Packages
root at test-noble:~# nvme show-regs /dev/nvme0
cap     : 200f010fff
version : 10000
cc      : 460001
csts    : 1
nssr    : 0
crto    : 0
intms   : 0
intmc   : 0
aqa     : 1f001f
asq     : 10079e000
acq     : 10079d000
cmbloc  : 0
cmbsz   : 0
bpinfo  : 0
bprsel  : 0
bpmbl   : 0
cmbmsc  : 0
cmbsts  : 0
pmrcap  : 0
pmrctl  : 0
pmrsts  : 0
pmrebs  : 0
pmrswtp : 0
pmrmscl : 0
pmrmscu : 0

** Tags removed: verification-needed verification-needed-focal verification-needed-jammy verification-needed-noble
** Tags added: verification-done verification-done-focal verification-done-jammy verification-done-noble

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to nvme-cli in Ubuntu.
https://bugs.launchpad.net/bugs/2072381

Title:
  NVMe show-regs command forcibly reboots ARM-based VM

Status in nvme-cli package in Ubuntu:
  Fix Released
Status in nvme-cli source package in Focal:
  Fix Committed
Status in nvme-cli source package in Jammy:
  Fix Committed
Status in nvme-cli source package in Mantic:
  Won't Fix
Status in nvme-cli source package in Noble:
  Fix Committed
Status in nvme-cli source package in Oracular:
  Fix Released

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 <oliver.upton at linux.dev>
  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 <wab at google.com>
      Signed-off-by: Oliver Upton <oliver.upton at linux.dev>

  [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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nvme-cli/+bug/2072381/+subscriptions




More information about the foundations-bugs mailing list