virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Zachary Amsden <zach@vmware.com>
To: Andi Kleen <ak@suse.de>
Cc: tglx@linutronix.de, Ingo Molnar <mingo@elte.hu>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	john stultz <johnstul@us.ibm.com>,
	akpm@linux-foundation.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Pratap Subrahmanyam <pratap@vmware.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Daniel Hecht <dhecht@vmware.com>, Daniel Arai <arai@vmware.com>,
	Chris Wright <chrisw@sous-sol.org>,
	Virtualization Mailing List <virtualization@lists.osdl.org>
Subject: Re: hardwired VMI crap
Date: Thu, 08 Mar 2007 14:58:41 -0800	[thread overview]
Message-ID: <45F09521.1060308@vmware.com> (raw)
In-Reply-To: <200703082239.44585.ak@suse.de>

Andi Kleen wrote:

> At least in Linux we don't really work with deadlines; if there 
> are issues they need to be fixed even if it takes longer. I don't 
> expect the version in .21 to be really usable anyways; it is clearly
> still in development.
>   

It was working, and I expect to have it working again.  It is not in 
development, but we urgently need to find a way to fix the problems 
created when Ingo hobbled it by removing NO_IDLE_HZ code from 2.6.21..

>   
>> we re-used the APIC and IO-APIC, this is  
>> uber rocket science.  We've been doing things this way, with public 
>> patches for over a year, and you've even been CC'd on some of the 
>> discussions.  So it is a little late to tell us - "redesign your 
>> hypervisor, or else.."
>>     
>
> It shouldn't touch the hypervisor, just the paravirt VMI backend shouldn't it?
> I assume you could do a very minimal APIC layer that is just enough to 
> talk to your softapic and a genapic backend for IPIs.
>
> At least I would welcome anything that shrinks the number of 
> paravirt hooks.
>
> I'm just not sure it would be less hooks: you would probably need
> functions to start other CPUs at least.
>   
 
Anything that attempts to create this uber multi-virtual interrupt / 
timer / IPI / clock management beast is going to add a huge number of 
paravirt hooks, because the vendor backends will be different for all of 
these.

>  
> I must admit I also didn't quite get what was the big problem with
> hooking apic_read/apic_write.
>   

You mean why we need them?  They make APIC writes faster, since 
otherwise they would trap and emulate, which is slow, and APIC is on 
critical paths.  Or why people object to them?  I don't get the latter 
either.

> For the timer you just need to use a own exclusive 
> clocksource that never touches PIT.
>   

We have that working fine.  It is getting the clock event to work 
independently from the lapic timer that is difficult because of the i386 
backend.

>   
>> We faithfully emulate lapic, io_apic, the pit, pic, and a normal 
>> interrupt subsystem. We can't magically stop using these things because  
>> we have to support traditional full virtualization.  Which means any 
>> version of Linux, virtual interrupt controller or not, is going to boot 
>> up, find these things, and try to use them.  So for a paravirt kernel, 
>> either we have to disable each of these things in the Linux code or just 
>> re-use them.
>>     
>
> If you don't enable them they should be already disabled as default 
> state, shouldn't they? 
>
> With an own custom clocksource and possible own APIC layer nobody
> would ever enable the APICs.
>   

But we enable and use them, in both full-virt, and paravirt mode.  So we 
really would need to duplicate the code, almost exactly for our "virtual 
interrupt controller", which would really just be a wrapper on top of a 
nearly identical APIC or IO-APIC implementation.

>> 1) Rewrite the interrupt subsystem of our hypervisor, making it 
>> incompatible with full virtualization, so that we can support an 
>> abstract interrupt controller with a "clean" interface
>>     
>
> What do you mean with rewrite? It's quite easy to add a new
> backend to the generic IRQ code. They aren't a lot of code.
>   

Yes, but we would then need to duplicate the APIC or IO-APIC 
implementation, because that is the hardware we emulate and use.  We 
just want a different way to fire local timers, that is all.

> You could probably do a much simpler version, couldn't you? A lot of 
> the stuff in apic.c/io_apic.c shouldn't be needed for a clean virtual
> interface. But yes it would probably be still a lot of code.
>   

Yes, we could do a cleaner simpler version.  But then we need to write 
this new interrupt controller code for both the hypervisor and for 
Linux.  And the fact that it is cleaner doesn't make it any nicer or 
perform any better - it is just another dependency between the kernel 
and hypervisor that then becomes hard to change.  So we would rather 
stay as close to the hardware design as possible.

> Still (2) is probably best for now, but the other alternatives
> are not as ridiculous as you paint them.
>   

We have (2) working.  But Thomas apparently hated it.  The idea I have 
about a single-IRQ source interrupt controller for timers seems pretty 
nice, and does almost exactly encapsulate the one difference we have 
from standard APIC / IO-APIC hardware - a different way to drive local 
timers.

Thanks for your feedback,

Zach

  reply	other threads:[~2007-03-08 22:58 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200703060654.l266sVxr014860@shell0.pdx.osdl.net>
     [not found] ` <45ED16D2.3000202@vmware.com>
     [not found]   ` <20070306084258.GA15745@elte.hu>
     [not found]     ` <20070306084647.GA16280@elte.hu>
2007-03-06  8:55       ` + stupid-hack-to-make-mainline-build.patch added to -mm tree Zachary Amsden
2007-03-06 10:59         ` Thomas Gleixner
2007-03-06 21:07           ` Dan Hecht
2007-03-06 22:21             ` Andi Kleen
2007-03-06 21:32               ` Dan Hecht
2007-03-06 23:53             ` Thomas Gleixner
2007-03-07  0:24               ` Jeremy Fitzhardinge
2007-03-07  0:35                 ` Dan Hecht
2007-03-07  0:49                   ` Thomas Gleixner
2007-03-07  0:53                     ` Dan Hecht
2007-03-07  1:18                       ` Thomas Gleixner
2007-03-07  2:08                         ` Dan Hecht
2007-03-07  8:37                           ` Thomas Gleixner
2007-03-07 17:41                             ` Jeremy Fitzhardinge
2007-03-07 17:49                               ` Ingo Molnar
2007-03-07 18:03                                 ` James Morris
2007-03-07 18:35                                 ` Jeremy Fitzhardinge
2007-03-08  0:45                                   ` Alan Cox
2007-03-07 17:52                               ` Ingo Molnar
2007-03-07 18:28                                 ` Jeremy Fitzhardinge
2007-03-07 18:53                                   ` Thomas Gleixner
2007-03-07 18:11                               ` James Morris
2007-03-07 18:56                                 ` Thomas Gleixner
2007-03-07 19:05                                 ` Jeremy Fitzhardinge
2007-03-07 19:49                                   ` Dan Hecht
2007-03-07 20:11                                     ` Jeremy Fitzhardinge
2007-03-07 20:49                                       ` Dan Hecht
2007-03-07 21:14                                         ` Thomas Gleixner
2007-03-07 20:57                                       ` Thomas Gleixner
2007-03-07 21:02                                         ` Dan Hecht
2007-03-07 21:08                                           ` Jeremy Fitzhardinge
2007-03-07 21:19                                           ` Thomas Gleixner
2007-03-07 21:14                                             ` Dan Hecht
2007-03-07 21:21                                     ` Thomas Gleixner
2007-03-07 21:33                                       ` Dan Hecht
2007-03-07 22:05                                       ` Jeremy Fitzhardinge
2007-03-07 23:05                                         ` Thomas Gleixner
2007-03-07 23:25                                           ` Zachary Amsden
2007-03-07 23:36                                             ` Jeremy Fitzhardinge
2007-03-07 23:40                                               ` Zachary Amsden
2007-03-08 18:30                                                 ` Chris Wright
2007-03-08  0:22                                             ` Thomas Gleixner
2007-03-08  1:01                                               ` Daniel Arai
2007-03-08  1:23                                                 ` Jeremy Fitzhardinge
2007-03-08  7:02                                                   ` Thomas Gleixner
2007-03-08  7:28                                                 ` Thomas Gleixner
2007-03-08  8:01                                                   ` Zachary Amsden
2007-03-08 18:24                                                 ` Chris Wright
2007-03-08 18:44                                                   ` Daniel Arai
2007-03-08 19:14                                                     ` Chris Wright
2007-03-08 19:17                                                       ` Ingo Molnar
2007-03-08 19:42                                                   ` Jeremy Fitzhardinge
2007-03-08 19:47                                                     ` Chris Wright
2007-03-08 19:52                                                       ` Jeremy Fitzhardinge
2007-03-08 20:10                                                         ` Chris Wright
2007-03-08 20:18                                                           ` Jeremy Fitzhardinge
2007-03-08 20:23                                                             ` Chris Wright
2007-03-08 20:33                                                               ` Jeremy Fitzhardinge
2007-03-08 20:42                                                                 ` Chris Wright
2007-03-08 20:42                                                                   ` Jeremy Fitzhardinge
2007-03-08 21:45                                                                 ` Andi Kleen
2007-03-08 19:54                                                     ` Ingo Molnar
     [not found]                                             ` <20070308091019.GA19460@elte.hu>
2007-03-08 10:06                                               ` hardwired VMI crap Zachary Amsden
2007-03-08 11:09                                                 ` Thomas Gleixner
2007-03-08 20:46                                                   ` Zachary Amsden
2007-03-08 21:15                                                     ` Jeremy Fitzhardinge
2007-03-08 21:34                                                       ` Ingo Molnar
2007-03-08 21:43                                                         ` Andi Kleen
2007-03-08 23:39                                                         ` Jeremy Fitzhardinge
2007-03-08 23:55                                                           ` Zachary Amsden
2007-03-09  0:10                                                             ` Jeremy Fitzhardinge
2007-03-09  0:29                                                               ` Linus Torvalds
2007-03-09  0:22                                                             ` Daniel Walker
2007-03-09  0:28                                                             ` Thomas Gleixner
2007-03-09  0:04                                                           ` Thomas Gleixner
2007-03-09  0:44                                                             ` Jeremy Fitzhardinge
2007-03-08 22:31                                                       ` Zachary Amsden
2007-03-08 21:39                                                     ` Andi Kleen
2007-03-08 22:58                                                       ` Zachary Amsden [this message]
2007-03-08 18:35                                                 ` Chris Wright
2007-03-07 23:33                                           ` + stupid-hack-to-make-mainline-build.patch added to -mm tree Jeremy Fitzhardinge
2007-03-07 23:52                                             ` Dan Hecht
2007-03-08  0:19                                               ` Jeremy Fitzhardinge
2007-03-08  0:35                                             ` Thomas Gleixner
2007-03-08  0:38                                               ` Jeremy Fitzhardinge
2007-03-07 20:40                               ` Thomas Gleixner
2007-03-07 21:07                                 ` Jeremy Fitzhardinge
2007-03-07 21:40                                   ` Thomas Gleixner
2007-03-07 21:34                                     ` Dan Hecht
2007-03-07 22:14                                       ` Thomas Gleixner
2007-03-07 22:17                                         ` Zachary Amsden
2007-03-07 22:31                                           ` Thomas Gleixner
2007-03-07 22:28                                             ` Dan Hecht
2007-03-08  8:01                                   ` Ingo Molnar
2007-03-08  8:15                                     ` Keir Fraser
2007-03-08  8:41                                     ` Jeremy Fitzhardinge
2007-03-08 10:26                                     ` Rusty Russell
2007-03-07 21:42                                 ` Dan Hecht
2007-03-07 22:07                                   ` Thomas Gleixner
2007-03-07  5:10                     ` Jeremy Fitzhardinge
2007-03-07  0:40                 ` Thomas Gleixner
2007-03-07  0:42               ` Dan Hecht
2007-03-07  1:22                 ` Thomas Gleixner
2007-03-07  1:44                   ` Dan Hecht
2007-03-07  7:48                     ` Thomas Gleixner

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=45F09521.1060308@vmware.com \
    --to=zach@vmware.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=arai@vmware.com \
    --cc=chrisw@sous-sol.org \
    --cc=dhecht@vmware.com \
    --cc=jeremy@goop.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pratap@vmware.com \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=virtualization@lists.osdl.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 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).