All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Glauber Costa <glommer@gmail.com>
Cc: Jan Kiszka <jan.kiszka@web.de>,
	Glauber Costa <glommer@redhat.com>,
	kvm@vger.kernel.org, avi@redhat.com, aliguori@us.ibm.com,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] return default values for apic probe functions.
Date: Fri, 17 Apr 2009 16:15:00 +0200	[thread overview]
Message-ID: <49E88EE4.6040307@siemens.com> (raw)
In-Reply-To: <5d6222a80904170640p7c50950fla5ebb65e0b1db138@mail.gmail.com>

Glauber Costa wrote:
> On Fri, Apr 17, 2009 at 10:22 AM, Glauber Costa <glommer@gmail.com> wrote:
>>> Even on sunny days, this collides with QEMU commit #7048. :)
>>>
>>> Does Intel specify what non-existent MSRs should return, ie. is your
>>> version still correct if !s->apicbase means that there is actually no
>>> APIC? And does kvm depend on the default base? If so, I would say:
>>> provide a patch against upstream.
>> hummm, I missed this one going in.
>> But sadly, your patch also breaks cpu hotplug. Not a segfault anymore, but the
>> VM will freeze instead of shutting down, if we ask too. It does not even respond
>> to ^C anymore.
>>
>> By leaving your patch as is, and changing the apic base return to
>>
>>   return s ? s->apicbase : (0xfee00000 | MSR_IA32_APICBASE_ENABLE);
>>
>> fixes the issue.
>>
> After reading the manual, my understanding is that only the flag must
> be set. I tried,
> and in fact:
> 
>    return s ? s->apicbase :  MSR_IA32_APICBASE_ENABLE;
> 
> still fixes it.
> If it works for you, I believe this is a good solution, and will send
> a descriptive patch.
> If we ever read the apic as disabled, we will have problems enabling
> it again. So for
> my test case, kvm should never see a disabled apic.
> 
> For yours, you'll still see the apic base address as zero.
> 
> what do you think?
> 

My use case (you can try it yourself: -M isapc) will likely already be
fine if there is no segv on accidentally reading that msr. I was more
concerned about the correct value according to the spec - if that case
isn't simply "undefined".

On the other hand, I didn't get the precise race yet, and my feeling
about this patch as a fix for something else than an inexistent apic is
not that good. But it's just a feeling.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Glauber Costa <glommer@gmail.com>
Cc: aliguori@us.ibm.com, kvm@vger.kernel.org,
	Glauber Costa <glommer@redhat.com>,
	qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@web.de>,
	avi@redhat.com
Subject: [Qemu-devel] Re: [PATCH] return default values for apic probe functions.
Date: Fri, 17 Apr 2009 16:15:00 +0200	[thread overview]
Message-ID: <49E88EE4.6040307@siemens.com> (raw)
In-Reply-To: <5d6222a80904170640p7c50950fla5ebb65e0b1db138@mail.gmail.com>

Glauber Costa wrote:
> On Fri, Apr 17, 2009 at 10:22 AM, Glauber Costa <glommer@gmail.com> wrote:
>>> Even on sunny days, this collides with QEMU commit #7048. :)
>>>
>>> Does Intel specify what non-existent MSRs should return, ie. is your
>>> version still correct if !s->apicbase means that there is actually no
>>> APIC? And does kvm depend on the default base? If so, I would say:
>>> provide a patch against upstream.
>> hummm, I missed this one going in.
>> But sadly, your patch also breaks cpu hotplug. Not a segfault anymore, but the
>> VM will freeze instead of shutting down, if we ask too. It does not even respond
>> to ^C anymore.
>>
>> By leaving your patch as is, and changing the apic base return to
>>
>>   return s ? s->apicbase : (0xfee00000 | MSR_IA32_APICBASE_ENABLE);
>>
>> fixes the issue.
>>
> After reading the manual, my understanding is that only the flag must
> be set. I tried,
> and in fact:
> 
>    return s ? s->apicbase :  MSR_IA32_APICBASE_ENABLE;
> 
> still fixes it.
> If it works for you, I believe this is a good solution, and will send
> a descriptive patch.
> If we ever read the apic as disabled, we will have problems enabling
> it again. So for
> my test case, kvm should never see a disabled apic.
> 
> For yours, you'll still see the apic base address as zero.
> 
> what do you think?
> 

My use case (you can try it yourself: -M isapc) will likely already be
fine if there is no segv on accidentally reading that msr. I was more
concerned about the correct value according to the spec - if that case
isn't simply "undefined".

On the other hand, I didn't get the precise race yet, and my feeling
about this patch as a fix for something else than an inexistent apic is
not that good. But it's just a feeling.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

  reply	other threads:[~2009-04-17 14:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17  5:15 [PATCH] return default values for apic probe functions Glauber Costa
2009-04-17  5:15 ` [Qemu-devel] " Glauber Costa
2009-04-17  6:56 ` Jan Kiszka
2009-04-17  6:56   ` [Qemu-devel] " Jan Kiszka
2009-04-17 13:22   ` Glauber Costa
2009-04-17 13:22     ` [Qemu-devel] " Glauber Costa
2009-04-17 13:40     ` Glauber Costa
2009-04-17 13:40       ` [Qemu-devel] " Glauber Costa
2009-04-17 14:15       ` Jan Kiszka [this message]
2009-04-17 14:15         ` Jan Kiszka
2009-04-17 13:53 ` Marcelo Tosatti
2009-04-17 13:53   ` [Qemu-devel] " Marcelo Tosatti
2009-04-17 13:59   ` Glauber Costa
2009-04-17 13:59     ` [Qemu-devel] " Glauber Costa
2009-04-17 14:18     ` Marcelo Tosatti
2009-04-17 14:18       ` [Qemu-devel] " Marcelo Tosatti
2009-04-19  8:45 ` Avi Kivity
2009-04-19  8:45   ` [Qemu-devel] " Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49E88EE4.6040307@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=glommer@gmail.com \
    --cc=glommer@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.