Page MenuHomeFreeBSD

hyperv/hv: use MSR to hint hypervisor on entering idle.
AbandonedPublic

Authored by howard0su_gmail.com on Apr 11 2016, 12:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 8, 8:52 PM
Unknown Object (File)
Mon, Apr 8, 5:10 PM
Unknown Object (File)
Mar 18 2024, 4:16 AM
Unknown Object (File)
Feb 22 2024, 7:19 PM
Unknown Object (File)
Feb 8 2024, 10:04 PM
Unknown Object (File)
Dec 20 2023, 1:48 AM
Unknown Object (File)
Dec 7 2023, 6:29 PM
Unknown Object (File)
Nov 13 2023, 12:24 PM

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3212
Build 3245: arc lint + arc unit

Event Timeline

howard0su_gmail.com retitled this revision from to hyperv/hv: use MSR to hint hypervisor on entering idle..
howard0su_gmail.com updated this object.
howard0su_gmail.com edited the test plan for this revision. (Show Details)
sys/dev/hyperv/vmbus/hv_hv.c
521

Hmm, we should make the test more stringent:

if ((hyperv_features & HV_FEATURE_MSR_GUEST_IDLE) &&
    (hyperv_features3 & HV_FEATURE3_GUEST_IDLE))
522

Well, does it really work for you? acpi_cpu will override cpu_idle_hook unconditionally later.

sys/dev/hyperv/vmbus/hv_hv.c
522

I set the breakpoint in DDB to make sure it works. I believe acpi_cpu is earlier.

sys/dev/hyperv/vmbus/hv_hv.c
522

I added a log in hyperv_init() and acpi_cpu_startup(), see the last line in the two log chunks.

...
Apr 18 09:57:02 perf01-sephe kernel: FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
Apr 18 09:57:02 perf01-sephe kernel: Hyper-V Version: 6.3.9600 [SP18]
Apr 18 09:57:02 perf01-sephe kernel: Features=0xe7f<VPRUNTIME,TMREFCNT,SYNIC,SYNTM,APIC,HYPERCALL,VPINDEX,REFTSC,IDLE,TMFREQ>
Apr 18 09:57:02 perf01-sephe kernel: PM Features=max C2, 0x0
Apr 18 09:57:02 perf01-sephe kernel: Features3=0x17b2<DEBUG,XMMHC,IDLE,NUMA,TMFREQ,SYNCMC,CRASH,NPIEP>
Apr 18 09:57:02 perf01-sephe kernel: Timecounter "Hyper-V" frequency 10000000 Hz quality 10000000
Apr 18 09:57:02 perf01-sephe kernel: hyperv init
...
...
...
Apr 18 09:57:02 perf01-sephe kernel: sc0: VGA <16 virtual consoles, flags=0x300>
Apr 18 09:57:02 perf01-sephe kernel: vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Apr 18 09:57:02 perf01-sephe kernel: Timecounters tick every 1.000 msec
Apr 18 09:57:02 perf01-sephe kernel: acpi_cpu override idle hook
...

I think you were adding the ddb brkptr to the MSR idle routing; the MSR version would be triggered before the ACPI cpu overrides, but it does not mean ACPI cpu takes over the idle hook earlier.

This need more testing and some change in my private tree is dependency for this change.