View Issue Details

IDProjectCategoryView StatusLast Update
0015698CentOS-6kernelpublic2019-01-11 13:28
Reporterjonathan.davies 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version6.10 
Target VersionFixed in Version 
Summary0015698: USB device DMA region outside addressable region
DescriptionIn a CentOS 6.10 x86_64 VM that has a virtual USB tablet device and memory regions at both 0GB--2GB and 4GB--5GB, the USB tablet device is not functional from boot time.

A memory layout like this is plausible if the VM starts with 2 GB and has a further 1 GB DIMM hot-plugged at 4GB.

lsusb does not report the existence of the device:

  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Instead, we would expect lsusb would show the USB tablet device (0627:0001) like this:

  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd

I see the following in dmesg on boot, which explains why the device is broken:
  usb 1-1: new high speed USB device number 2 using ehci_hcd
  nommu_map_single: overflow 13f9d3d00+8 of device mask ffffffff
  nommu_map_single: overflow 13f430c40+64 of device mask ffffffff
  nommu_map_single: overflow 13f9d3d00+8 of device mask ffffffff
  nommu_map_single: overflow 13f430c40+64 of device mask ffffffff
  nommu_map_single: overflow 13f9d3d00+8 of device mask ffffffff
  nommu_map_single: overflow 13f430c40+64 of device mask ffffffff

It looks like the kernel's USB subsystem has allocated the transfer_buffer for the initialisation packets for the USB tablet device in the upper region.

It should be able to recognise that the 3rd gigabyte of memory is at physical address > 4GB and therefore not use it for DMA to a device that it believes only supports 32-bit addressing.

The VM kernel's USB stack should not be allocating memory above 4GB when it believes the device can only address 4GB.

This is probably something that has been fixed since 2.6.32-754 because I can't reproduce it with CentOS 7. A quick guess is that Linux commit ff9c895f07 may be where this was fixed on later kernels.
Steps To ReproduceRun CentOS 6.10 x86_64 in a VM with 2 GB + 1 GB DIMM plugged at 4GB. This memory layout can be recreated using qemu with the following options:

  -object memory-backend-file,id=ram-node0,size=2147483648
  -object memory-backend-file,id=memdimm0,size=1073741824
  -device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296

A USB tablet device can be emulated with qemu using:

  -device usb-tablet,id=input0,bus=usb.0,port=1

When the VM is booted, the USB tablet device is not enumerated by lsusb, and the "nommu_map_single" errors above can be seen in dmesg.
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-01-11 13:28 jonathan.davies New Issue