| Summary: | 8-STABLE amd64 past r233799 is unable to boot in certain KVM environments [regression] | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Jimmy Olgeni <olgeni> |
| Component: | amd64 | Assignee: | Konstantin Belousov <kib> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | jkim |
| Priority: | Normal | ||
| Version: | 8.3-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Jimmy Olgeni
2012-08-05 10:40:02 UTC
Try this. Comment should give enough explanation what happens there, my guess anyway. diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index 3890551..dbeaec6 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -91,11 +91,17 @@ init_amd(void) * * http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf * http://support.amd.com/us/Processor_TechDocs/44739_12h_Rev_Gd.pdf + * + * Hypervisors do not provide access to the errata MSR, + * causing #GP exception on attempt to apply the errata. The + * MSR write shall be done on host and persist globally + * anyway, so do not try to do it when under virtualization. */ switch (CPUID_TO_FAMILY(cpu_id)) { case 0x10: case 0x12: - wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); + if ((cpu_feature2 & CPUID2_HV) == 0) + wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } } On Sun, 5 Aug 2012, Konstantin Belousov wrote:
> Try this. Comment should give enough explanation what happens there, my
> guess anyway.
Works great: I just booted into 8-STABLE.
I'll try with 9-STABLE too - rebuilding right now.
Thanks!
On Sun, 5 Aug 2012, Konstantin Belousov wrote:
> Try this. Comment should give enough explanation what happens there, my
> guess anyway.
Works great on 9-STABLE too (tested on r239079).
Looks like a *great* candidate for 9.1.
--
jimmy
Responsible Changed From-To: freebsd-amd64->kib kib has a patch and submitter notes it fixes the problem. Author: kib Date: Tue Aug 7 08:36:10 2012 New Revision: 239125 URL: http://svn.freebsd.org/changeset/base/239125 Log: Do not apply errata 721 workaround when under hypervisor, since typical hypervisor does not implement access to the required MSR, causing #GP on boot. Reported and tested by: olgeni PR: amd64/170388 MFC after: 3 days Modified: head/sys/amd64/amd64/initcpu.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Tue Aug 7 07:52:25 2012 (r239124) +++ head/sys/amd64/amd64/initcpu.c Tue Aug 7 08:36:10 2012 (r239125) @@ -91,11 +91,17 @@ init_amd(void) * * http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf * http://support.amd.com/us/Processor_TechDocs/44739_12h_Rev_Gd.pdf + * + * Hypervisors do not provide access to the errata MSR, + * causing #GP exception on attempt to apply the errata. The + * MSR write shall be done on host and persist globally + * anyway, so do not try to do it when under virtualization. */ switch (CPUID_TO_FAMILY(cpu_id)) { case 0x10: case 0x12: - wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); + if ((cpu_feature2 & CPUID2_HV) == 0) + wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" Hello, Just a quick reminder about the MFC of r239125 :) Thanks! -- jimmy Author: kib Date: Sat Sep 8 16:47:52 2012 New Revision: 240240 URL: http://svn.freebsd.org/changeset/base/240240 Log: MFC r239125: Do not apply errata 721 workaround when under hypervisor, since typical hypervisor does not implement access to the required MSR, causing #GP on boot. PR: amd64/170388 Approved by: re (kensmith) Modified: releng/9.1/sys/amd64/amd64/initcpu.c Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/amd64/amd64/initcpu.c ============================================================================== --- releng/9.1/sys/amd64/amd64/initcpu.c Sat Sep 8 16:45:48 2012 (r240239) +++ releng/9.1/sys/amd64/amd64/initcpu.c Sat Sep 8 16:47:52 2012 (r240240) @@ -91,11 +91,17 @@ init_amd(void) * * http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf * http://support.amd.com/us/Processor_TechDocs/44739_12h_Rev_Gd.pdf + * + * Hypervisors do not provide access to the errata MSR, + * causing #GP exception on attempt to apply the errata. The + * MSR write shall be done on host and persist globally + * anyway, so do not try to do it when under virtualization. */ switch (CPUID_TO_FAMILY(cpu_id)) { case 0x10: case 0x12: - wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); + if ((cpu_feature2 & CPUID2_HV) == 0) + wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State Changed From-To: open->closed Merged. |