Page MenuHomeFreeBSD

lib/libc/x86/sys/__vdso_gettc.c: Conditionalize hyperv support based on MK_HYPERV
ClosedPublic

Authored by ngie on Jan 19 2017, 8:08 AM.

Details

Summary

This conditionalizes hyperv support in gettimeofday based on MK_HYPERV, so systems where the administrator has made a conscious decision not to build hyperv support in the system will not be hit by the hyperv path.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ngie updated this revision to Diff 24188.Jan 19 2017, 8:08 AM
ngie retitled this revision from to lib/libc/x86/sys/__vdso_gettc.c: Conditionalize hyperv support based on MK_HYPERV.
ngie updated this object.
ngie edited the test plan for this revision. (Show Details)
ngie added a reviewer: sepherosa_gmail.com.
ngie set the repository for this revision to rS FreeBSD src repository.
ngie added a subscriber: kib.
ngie updated this revision to Diff 24189.Jan 19 2017, 8:09 AM

Tweak a comment marking the end of the WANT_HYPERV #endif .

I don't see why it is needed. If hyperv is not in kernel or the ref rdtsc is not the current timecounter, this path will never be hit. Or do you have other concerns?

ngie added a comment.Jan 19 2017, 8:20 AM

I don't see why it is needed. If hyperv is not in kernel or the ref rdtsc is not the current timecounter, this path will never be hit. Or do you have other concerns?

I just saw that it only hits this case if the time counter is enabled, and after that only hits it if opening the character device succeeds.

It's not an issue today because MK_HYPERV != no doesn't control hyperv header installation, but if that ever changes (and I would kind of like that to be honest), then this would be an issue.

So, the reasoning I claimed here originally might be a bit misleading, but this unfortunately stands in the way of removing the hyperv headers from the system when MK_HYPERV == no.

sepherosa_gmail.com edited edge metadata.

OK, I see. Please fix the commit message when committing then. BTW, in addition to include/dev/hyperv, there are usr.sbin/hyperv and several manpages that you probably want to manage w/ MK_HYPERV.

This revision is now accepted and ready to land.Jan 19 2017, 8:26 AM
lib/libc/x86/sys/__vdso_gettc.c
220 ↗(On Diff #24189)

WANT_HYPERV, i.e. no __ prefix.

ngie marked an inline comment as done.Jan 19 2017, 5:00 PM
ngie added inline comments.
lib/libc/x86/sys/__vdso_gettc.c
220 ↗(On Diff #24189)

Thanks :)!

This revision was automatically updated to reflect the committed changes.
ngie marked an inline comment as done.