Page MenuHomeFreeBSD

vt_vga: use textmode when we're running on hypervisor
ClosedPublic

Authored by decui_microsoft.com on Mar 25 2016, 1:39 PM.
Tags
None
Referenced Files
F170717894: D5739.id14667.diff
Sun, Sep 6, 4:54 AM
F170701478: D5739.id14604.diff
Sun, Sep 6, 2:38 AM
F170699804: D5739.id14667.diff
Sun, Sep 6, 2:27 AM
F170696769: D5739.id14602.diff
Sun, Sep 6, 2:05 AM
F170655740: D5739.id.diff
Sat, Sep 5, 8:30 PM
F170590296: D5739.id14602.diff
Sat, Sep 5, 1:21 PM
Unknown Object (File)
Sat, Sep 5, 9:01 AM
Unknown Object (File)
Fri, Sep 4, 5:11 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

decui_microsoft.com retitled this revision from to vt_vga: use texemode when we runnning on hypervisor.
decui_microsoft.com updated this object.
decui_microsoft.com edited the test plan for this revision. (Show Details)

The idea is correct, but implementation is arguably not. TUNABLE_XXX_FETCH() keeps the variable unchanged if the env var is not present. The correct logic would be

textmode = vm_guest != VM_GUEST_NO;
TUNABLE_INT_FETCH("hw.vga.textmode", &textmode);

This would give the desired behaviour of enabling textmode by default for guests only, but also allowing user to override it as she wants.

In D5739#122559, @kib wrote:

The idea is correct, but implementation is arguably not. TUNABLE_XXX_FETCH() keeps the variable unchanged if the env var is not present. The correct logic would be

textmode = vm_guest != VM_GUEST_NO;
TUNABLE_INT_FETCH("hw.vga.textmode", &textmode);

This would give the desired behaviour of enabling textmode by default for guests only, but also allowing user to override it as she wants.

@kib, Thanks! I'll update the patch as you suggested.

decui_microsoft.com edited edge metadata.
decui_microsoft.com removed rS FreeBSD src repository - subversion as the repository for this revision.

I improved the patch as kib suggested.

kib edited edge metadata.
kib added inline comments.
sys/dev/vt/hw/vga/vt_vga.c
1237 ↗(On Diff #14602)

You do not need braces there, and style(9) requests to not put redundand braces.

This revision is now accepted and ready to land.Mar 25 2016, 4:04 PM
decui_microsoft.com edited edge metadata.

removed the unnecessary braces as kib suggested.

This revision now requires review to proceed.Mar 25 2016, 4:15 PM
decui_microsoft.com added inline comments.
sys/dev/vt/hw/vga/vt_vga.c
1237 ↗(On Diff #14602)

OK. I updated the patch.

kib edited edge metadata.
This revision is now accepted and ready to land.Mar 25 2016, 4:23 PM
decui_microsoft.com retitled this revision from vt_vga: use texemode when we runnning on hypervisor to vt_vga: use textmode when we're running on hypervisor.Mar 25 2016, 4:52 PM
decui_microsoft.com edited edge metadata.
This revision was automatically updated to reflect the committed changes.