From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N10Oh-0004zN-Th for qemu-devel@nongnu.org; Thu, 22 Oct 2009 12:20:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N10Od-0004tg-68 for qemu-devel@nongnu.org; Thu, 22 Oct 2009 12:20:19 -0400 Received: from [199.232.76.173] (port=54452 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N10Oc-0004tZ-TV for qemu-devel@nongnu.org; Thu, 22 Oct 2009 12:20:14 -0400 Received: from mail-fx0-f211.google.com ([209.85.220.211]:61395) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N10Oc-0007hu-Ey for qemu-devel@nongnu.org; Thu, 22 Oct 2009 12:20:14 -0400 Received: by fxm7 with SMTP id 7so8859213fxm.34 for ; Thu, 22 Oct 2009 09:20:13 -0700 (PDT) Message-ID: <4AE08637.5050209@codemonkey.ws> Date: Thu, 22 Oct 2009 11:20:07 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] test for lm capable kernel. References: <1255540160-19869-1-git-send-email-glommer@redhat.com> In-Reply-To: <1255540160-19869-1-git-send-email-glommer@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: qemu-devel@nongnu.org Glauber Costa wrote: > Don't save x86_64-specific msrs if our kernel does not support them. > Code is already in qemu-kvm.git, but the test function is slightly different. > It follows what the test for msr_start does. > Repeat after me: "I will not use --target-list when submitting qemu patches. I will not use --target-list when submitting qemu patches." Fedora enables ccache by default. After one build, all future builds are extremely fast in most cases. It's really not that bad :-) > Signed-off-by: Glauber Costa > --- > target-i386/kvm.c | 37 +++++++++++++++++++++++++++---------- > 1 files changed, 27 insertions(+), 10 deletions(-) > > diff --git a/target-i386/kvm.c b/target-i386/kvm.c > index 7010999..0e69b57 100644 > --- a/target-i386/kvm.c > +++ b/target-i386/kvm.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > > #include > > @@ -266,6 +267,20 @@ static int kvm_has_msr_star(CPUState *env) > return 0; > } > > +static int lm_capable_kernel(void) > +{ > + static int lm_capable = -1; > + struct utsname utsname; > + > + if (lm_capable != -1) { > + return lm_capable; > + } > + > + uname(&utsname); > + lm_capable = (strcmp(utsname.machine, "x86_64") == 0); > + return lm_capable; > +} > + > This function is unused for qemu-system-i386. Regards, Anthony Liguori