linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zachary Amsden <zamsden@redhat.com>
To: Glauber Costa <glommer@redhat.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	Avi Kivity <avi@redhat.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	kvm@vger.kernel.org, linux-next@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: Tree for November 22 (kvm)
Date: Tue, 30 Nov 2010 08:09:54 -1000	[thread overview]
Message-ID: <4CF53DF2.2040803@redhat.com> (raw)
In-Reply-To: <1291119448.17261.4.camel@mothafucka.localdomain>

On 11/30/2010 02:17 AM, Glauber Costa wrote:
> On Mon, 2010-11-29 at 08:08 -1000, Zachary Amsden wrote:
>    
>> On 11/29/2010 07:52 AM, Randy Dunlap wrote:
>>      
>>> On 11/29/10 09:47, Zachary Amsden wrote:
>>>
>>>        
>>>> On 11/29/2010 06:35 AM, Avi Kivity wrote:
>>>>
>>>>          
>>>>> On 11/29/2010 06:33 PM, Randy Dunlap wrote:
>>>>>
>>>>>            
>>>>>> On Mon, 22 Nov 2010 13:26:27 -0800 Randy Dunlap wrote:
>>>>>>
>>>>>>
>>>>>>              
>>>>>>>    On Mon, 22 Nov 2010 13:49:11 +1100 Stephen Rothwell wrote:
>>>>>>>
>>>>>>>
>>>>>>>                
>>>>>>>>    Hi all,
>>>>>>>>
>>>>>>>>    Changes since 20101119:
>>>>>>>>
>>>>>>>>                  
>>>>>>>    kvm.c:(.init.text+0x11f49): undefined reference to
>>>>>>>
>>>>>>>                
>>>>>> `kvm_register_clock'
>>>>>>
>>>>>>              
>>>>>>>    when CONFIG_KVM_CLOCK is not enabled.
>>>>>>>
>>>>>>>                
>>>>>> BUild error still present in linux-next-2010-NOV-29.
>>>>>>
>>>>>>
>>>>>>              
>>>>> Glauber, Zach?
>>>>>
>>>>>
>>>>>            
>>>> I can only speculate this reference is being called from smpboot without
>>>> CONFIG guarding?
>>>>
>>>>          
>>> Sorry, looks like I dropped the first line of the error messages:
>>>
>>> arch/x86/built-in.o: In function `kvm_smp_prepare_boot_cpu':
>>> kvm.c:(.init.text+0xad38): undefined reference to `kvm_register_clock'
>>>
>>> from arch/x86/kernel/kvm.c:
>>>
>>> #ifdef CONFIG_SMP
>>> static void __init kvm_smp_prepare_boot_cpu(void)
>>> {
>>> 	WARN_ON(kvm_register_clock("primary cpu clock"));
>>> 	kvm_guest_cpu_init();
>>> 	native_smp_prepare_boot_cpu();
>>> }
>>>
>>> so it looks like you are correct...
>>>
>>>        
>> Looks like this is the appropriate fix:
>>
>> #ifdef CONFIG_SMP
>> static void __init kvm_smp_prepare_boot_cpu(void)
>> {
>> #ifdef CONFIG_KVM_CLOCK
>> 	WARN_ON(kvm_register_clock("primary cpu clock"));
>> #endif
>> 	kvm_guest_cpu_init();
>> 	native_smp_prepare_boot_cpu();
>> }
>>
>>
>> The SMP code is still buggy as well, wrt printk timing, in that it
>> doesn't get called early enough, correct?  Has anyone thought of a good
>> solution to that problem?
>>
>> Basically the problem is CPU-1 will get CPU-0's per-cpu areas copied
>> over, and these are not valid for CPU-1.  If the clocksource is used on
>> CPU-1 before kvm clock gets setup, it can go backwards, wreaking havoc,
>> causing panic, etc.
>>
>> What is the best test to guard against this?  Perhaps we should keep the
>> CPU number in the per-cpu data and test against it?
>>      
> Can we identify precisely when it happens? If we can, we can try to
> force a hypervisor exit or re-register right after the data is copied
> over. This will force the per-cpu structure to get updated with good
> values.
>    

It's as if we need a new type of per-cpu data, per_cpu_zeroed, which is 
always cleared prior to starting on the AP.

I imagine other code paths may need this as well.

Zach

  reply	other threads:[~2010-11-30 18:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22  2:49 linux-next: Tree for November 22 Stephen Rothwell
2010-11-22 12:47 ` Zimny Lech
     [not found] ` <20101122134911.b7e106f9.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2010-11-22 15:37   ` Zimny Lech
2010-11-22 19:46     ` Greg KH
     [not found]       ` <20101122194643.GB21985-l3A5Bk7waGM@public.gmane.org>
2010-11-22 20:08         ` Arend Van Spriel
2010-11-22 21:31           ` Greg KH
2010-11-22 19:55 ` Zimny Lech
2010-11-22 21:26 ` linux-next: Tree for November 22 (kvm) Randy Dunlap
2010-11-29 16:33   ` Randy Dunlap
2010-11-29 16:35     ` Avi Kivity
2010-11-29 17:47       ` Zachary Amsden
2010-11-29 17:52         ` Randy Dunlap
2010-11-29 18:08           ` Zachary Amsden
2010-11-29 19:05             ` Randy Dunlap
2010-11-30 12:17             ` Glauber Costa
2010-11-30 18:09               ` Zachary Amsden [this message]
2010-12-10 17:18             ` Randy Dunlap
2010-12-12  9:23               ` Avi Kivity
2010-12-16  9:37                 ` 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=4CF53DF2.2040803@redhat.com \
    --to=zamsden@redhat.com \
    --cc=avi@redhat.com \
    --cc=glommer@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=sfr@canb.auug.org.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).