From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [BUG][PATCH?] kvm: unhandled wrmsr: 0xc0000083 Date: Mon, 13 Aug 2007 12:09:46 +0300 Message-ID: <46C01FDA.9000302@qumranet.com> References: <20070811212520.GA26794@dreamland.darkstar.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-TtF/mJH4Jtrk1uMJSBkQmQ@public.gmane.org, Uri Lublin To: Luca Tettamanti Return-path: In-Reply-To: <20070811212520.GA26794-sTXFmx6KbOnUXq0IF5SVAZ4oGUkBHcCu@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Luca Tettamanti wrote: > which enabled the compilation of code depending on TARGET_X86_64. > Problems arise when the host is in 32 bit mode; Avi fixed part of the > issue with d9ff68d1 (masking the LM bit when the host is 32 bit). > > The MSR issue is caused by load_regs (qemu/qemu-kvm.c); at line 304 (git > current) you can see: > > #ifdef TARGET_X86_64 > set_msr_entry(&msrs[n++], MSR_CSTAR, env->cstar); > set_msr_entry(&msrs[n++], MSR_KERNELGSBASE, env->kernelgsbase); > set_msr_entry(&msrs[n++], MSR_FMASK, env->fmask); > set_msr_entry(&msrs[n++], MSR_LSTAR , env->lstar); > #endif > > But the kernel side part (vmx.c) cannot handle those MSRs when using a > 32 bit kernel (hence the "unhandled wrmsr"). > > As a side note: MSC_CSTAR (syscall target for compat mode) is supported > *only* on AMD processors (there's no syscall on Intel in 32 bit mode); > is it safe to use it unconditionally? (AFAICS vmx.c would do wrmsrl, > maybe it's not documented but supported?). > > In order to fix this bug I hijacked "lm_capable_kernel" (introduced by > Avi) so that {load,save}_regs don't touch 64bit-only MSRs while the host > is in 32bit mode: > > Good catch -- patch applied, thanks. > get_msr_entry should be fine, cpu_save/cpu_load (used by savevm - > qemu/vl.c) may need a similar fix. > > The patch stops the "unhandled wrmsr", but reboot is still not working > (guest is stuck using 100% of the CPU). The last working userspace is > KVM-28, and I tested it with recent kernel modules. Any idea on this > one? > That's around the time kvm moved to its own main loop (for smp), so it's not surprising there's breakage there. I tested erboot at the time, but not with all guests. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/