Fix gcc warnings
- KASSERTs are optimized out in !INVARIANTS cases, so don't test those variables in those cases to fix -Wunused-but-set-variable warnings.
- Similarly, *CTR* are optimized out in the !KTR cases, so don't test those variables in those cases to fix -Wunused-but-set-variable warnings.
- vintr_intercept_enabled(..) is only usable in the INVARIANTS case; only define/call it in that case.
- Remove -Wunused-but-set-variable, func, in vmx_handle_cpuid(..).
- alloc_memseg(..):
- Explicitly save off the value of VM_MEMSEG_NAME(mseg) to namep and test for it being non-NULL to avoid a false positive error from gcc with passing the value in to copystr(..).
- get_gla(..):
- explicitly test error after KASSERTs to ensure less "bad things" happen if/when the code is run with !INVARIANTS kernels.
- return error when setting fault to 1; both cases are tested in the calling function, so there's no adverse affect for doing that.
- x86_emulate_cpuid(..):
- Explicitly set logical_cpus/x2apic_id to sane values to fix -Wmaybe-uninitialized warnings.
- Move width definition to CPUID_0000_000B case and initialize it to a sane value to fix a -Wmaybe-uninitialized warning.
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division