prime-xconfig can write an invalid BusID string
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nvidia-prime (Ubuntu) |
Fix Released
|
High
|
Alberto Milone | ||
Precise |
Fix Released
|
High
|
Alberto Milone |
Bug Description
SRU request:
Please accept nvidia-prime (0.5~hybrid0.0.3) into precise-proposed.
[Rationale]
The fix .
[Impact]
Without this work, X will fail to start in some cases (see the "Full Explanation" section) on systems with hybrid graphics (Intel/NVIDIA).
[Test Case]
1) Install the update on a hybrid system with Intel/NVIDIA GPUs
2) Make sure that the system can boot and that X doesn't fail.
[Regression Potential]
Low. Thanks to this fix, the xorg.conf, if anything, will have greater chances to work.
[Full Explanation]
The BusID string created by prime-xconfig could be incorrect in any of the following cases:
a) Any numeric component of the bus ID is greater than 9: prime-xconfig will write a hexadecimal value, but X will parse it as decimal.
b) The system has more than one PCI domain: `lspci -Dn` will show the PCI domain, which is normally hidden on systems with a single PCI domain. This breaks the formatting assumptions made by nv_get_id() about which fields are in which position.
Besides the potential correctness issues, the generated BusID string is missing the following recommended (but optional) information:
a) Bus type. According to xorg.conf(5) this should be "PCI:"
b) PCI domain: omission of this field could lead to problems on systems with multiple PCI domains
A patch against nvidia-prime 0.5.5 from Trusty is attached. The version on github seems to be behind that version by quite a bit.
Changed in nvidia-prime (Ubuntu): | |
assignee: | nobody → Alberto Milone (albertomilone) |
Changed in nvidia-prime (Ubuntu): | |
status: | New → Triaged |
Changed in nvidia-prime (Ubuntu Precise): | |
status: | New → Triaged |
Changed in nvidia-prime (Ubuntu): | |
importance: | Undecided → High |
Changed in nvidia-prime (Ubuntu Precise): | |
importance: | Undecided → High |
assignee: | nobody → Alberto Milone (albertomilone) |
Changed in nvidia-prime (Ubuntu): | |
status: | Triaged → In Progress |
Changed in nvidia-prime (Ubuntu Precise): | |
status: | Triaged → In Progress |
Changed in nvidia-prime (Ubuntu Precise): | |
milestone: | none → precise-updates |
tags: | added: precise |
tags: | added: verification-needed |
tags: | added: hw-specific |
Note that X can parse hexadecimal values in the BusID string if they're prepended with "0x", since xf86ParsePciBus String( ) uses atoi(3) to parse each field; however, the comment at the top of xf86ParsePciBus String( ) explicitly states that a decimal value is expected.