public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
  • * Re: [RFC, PATCH 1/24] i386 Vmi documentation
           [not found] <200603131759.k2DHxeep005627@zach-dev.vmware.com>
           [not found] ` <20060313224902.GD12807@sorel.sous-sol.org>
    @ 2006-03-14  4:11 ` Rik van Riel
      2006-03-22 20:05 ` Andi Kleen
      2 siblings, 0 replies; 21+ messages in thread
    From: Rik van Riel @ 2006-03-14  4:11 UTC (permalink / raw)
      To: Zachary Amsden
      Cc: Linus Torvalds, Linux Kernel Mailing List,
    	Virtualization Mailing List, Xen-devel, Andrew Morton, Dan Hecht,
    	Dan Arai, Anne Holler, Pratap Subrahmanyam, Christopher Li,
    	Joshua LeVasseur, Chris Wright, Jyothy Reddy, Jack Lo, Kip Macy,
    	Jan Beulich, Ky Srinivasan, Wim Coekaerts, Leendert van Doorn
    
    On Mon, 13 Mar 2006, Zachary Amsden wrote:
    
    > +	Zachary Amsden, Daniel Arai, Daniel Hecht, Pratap Subrahmanyam
    > +	Copyright (C) 2005, 2006, VMware, Inc.
    > +	All rights reserved
    
    Btw, this copyright claim doesn't look very GPL compatible.
    You might want to get that checked out.
    
    -- 
    All Rights Reversed
    
    ^ permalink raw reply	[flat|nested] 21+ messages in thread
  • * Re: [RFC, PATCH 1/24] i386 Vmi documentation
           [not found] <200603131759.k2DHxeep005627@zach-dev.vmware.com>
           [not found] ` <20060313224902.GD12807@sorel.sous-sol.org>
      2006-03-14  4:11 ` Rik van Riel
    @ 2006-03-22 20:05 ` Andi Kleen
      2006-03-22 21:34   ` Chris Wright
                         ` (2 more replies)
      2 siblings, 3 replies; 21+ messages in thread
    From: Andi Kleen @ 2006-03-22 20:05 UTC (permalink / raw)
      To: virtualization
      Cc: Zachary Amsden, Linus Torvalds, Linux Kernel Mailing List,
    	Xen-devel, Andrew Morton, Dan Hecht, Dan Arai, Anne Holler,
    	Pratap Subrahmanyam, Christopher Li, Joshua LeVasseur,
    	Chris Wright, Rik Van Riel, Jyothy Reddy, Jack Lo, Kip Macy,
    	Jan Beulich, Ky Srinivasan, Wim Coekaerts, Leendert van Doorn
    
    On Monday 13 March 2006 18:59, Zachary Amsden wrote:
    
    > +     The general mechanism for providing customized features and
    > +     capabilities is to provide notification of these feature through
    > +     the CPUID call, 
    
    How should that work since CPUID cannot be intercepted by 
    a Hypervisor (without VMX/SVM)?  
    
    > + Watchdog NMIs are of limited use if the OS is
    > +     already correct and running on stable hardware;
    
    So how would your Hypervisor detect a kernel hung with interrupts
    off then?
    
    >>       profiling NMIs are 
    > +     similarly of less use, since this task is accomplished with more accuracy
    > +     in the VMM itself
    
    And how does oprofile know about this?
    
    > ; and NMIs for machine check errors should be handled 
    > +     outside of the VM.  
    
    Right now yes, but if we ever implement intelligent memory ECC error handling it's questionable
    the hypervisor can do a better job. It has far less information about how memory
    is used than the kernel.
    
    > +   The net result of these choices is that most of the calls are very
    > +   easy to make from C-code, and calls that are likely to be required in
    > +   low level trap handling code are easy to call from assembler.   Most
    > +   of these calls are also very easily implemented by the hypervisor
    > +   vendor in C code, and only the performance critical calls from
    > +   assembler paths require custom assembly implementations.
    > +
    > +   CORE INTERFACE CALLS
    
    Did I miss it or do you never describe how to find these entry points? 
    
    > +    VMI_EnableInterrupts
    > +
    > +       VMICALL void VMI_EnableInterrupts(void);
    > +
    > +       Enable maskable interrupts on the processor.  Note that the
    > +       current implementation always will deliver any pending interrupts
    > +       on a call which enables interrupts, for compatibility with kernel
    > +       code which expects this behavior.  Whether this should be required
    > +       is open for debate.
    
    A subtle trap is also that it will do so on the next instruction, not the 
    followon to next like a real x86.  At some point there was code in Linux
    that dependend on this.
    
    
    > +       VMICALL VMI_UINT64 VMI_RDMSR(VMI_UINT64 dummy, VMI_UINT32 reg);
    > +
    > +       Read from a model specific register.  This functions identically to the
    > +       hardware RDMSR instruction.  Note that a hypervisor may not implement
    > +       the full set of MSRs supported by native hardware, since many of them
    > +       are not useful in the context of a virtual machine.
    
    So what happens when the kernel tries to access an unimplemented MSR?
    
    Also we have had occasionally workarounds in the past that required 
    MSR writes with magic "passwords". How would these be handled?
    +
    > +    VMI_CPUID
    > +
    > +       /* Not expressible as a C function */
    > +
    > +       The CPUID instruction provides processor feature identification in a
    > +       vendor specific manner.  The instruction itself is non-virtualizable
    > +       without hardware support, requiring a hypervisor assisted CPUID call
    > +       that emulates the effect of the native instruction, while masking any
    > +       unsupported CPU feature bits.
    
    Doesn't seem to be very useful because everybody can just call CPUID directly.
    
    > +       The RDTSC instruction provides a cycles counter which may be made
    > +       visible to userspace.  For better or worse, many applications have made
    > +       use of this feature to implement userspace timers, database indices, or
    > +       for micro-benchmarking of performance.  This instruction is extremely
    > +       problematic for virtualization, because even though it is selectively 
    > +       virtualizable using trap and emulate, it is much more expensive to
    > +       virtualize it in this fashion.  On the other hand, if this instruction
    > +       is allowed to execute without trapping, the cycle counter provided
    > +       could be wrong in any number of circumstances due to hardware drift,
    > +       migration, suspend/resume, CPU hotplug, and other unforeseen
    > +       consequences of running inside of a virtual machine.  There is no
    > +       standard specification for how this instruction operates when issued
    > +       from userspace programs, but the VMI call here provides a proper
    > +       interface for the kernel to read this cycle counter.
    
    Yes, but it will be wrong in a native kernel too so why do you want
    to be better than native? 
    
    Seems useless to me.
    
    > +    VMI_RDPMC
    > +
    > +       VMICALL VMI_UINT64 VMI_RDPMC(VMI_UINT64 dummy, VMI_UINT32 counter);
    > +
    > +       Similar to RDTSC, this call provides the functionality of reading
    > +       processor performance counters.  It also is selectively visible to
    > +       userspace, and maintaining accurate data for the performance counters
    > +       is an extremely difficult task due to the side effects introduced by
    > +       the hypervisor.
    
    Similar.
    
    Overall feeling is you have far too many calls. You seem to try to implement
    a full x86 replacement, but that makes it big and likely to be buggy. And 
    it's likely impossible to implement in any Hypervisor short of a full emulator
    like yours.
    
    I would try a diet and only implement facilities that are actually likely
    to be used by modern OS.
    
    There was one other point I wanted to make but I forgot it now @)
    
    -Andi
    
    ^ permalink raw reply	[flat|nested] 21+ messages in thread

  • end of thread, other threads:[~2006-03-23  0:12 UTC | newest]
    
    Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <200603131759.k2DHxeep005627@zach-dev.vmware.com>
         [not found] ` <20060313224902.GD12807@sorel.sous-sol.org>
    2006-03-14  0:00   ` [RFC, PATCH 1/24] i386 Vmi documentation Zachary Amsden
    2006-03-14 21:27     ` Chris Wright
         [not found]       ` <441743BD.1070108@vmware.com>
    2006-03-15  2:57         ` Chris Wright
    2006-03-15  5:44           ` Zachary Amsden
    2006-03-15 22:56           ` Daniel Arai
    2006-03-16  1:16       ` Chris Wright
    2006-03-16  3:40         ` Eli Collins
    2006-03-14  4:11 ` Rik van Riel
    2006-03-22 20:05 ` Andi Kleen
    2006-03-22 21:34   ` Chris Wright
    2006-03-22 21:13     ` Andi Kleen
    2006-03-22 21:57       ` Chris Wright
    2006-03-23  0:06       ` Zachary Amsden
    2006-03-22 21:39   ` [RFC, PATCH 1/24] i386 Vmi documentation II Andi Kleen
    2006-03-22 22:43     ` Daniel Arai
    2006-03-22 22:45     ` Zachary Amsden
    2006-03-22 22:38       ` Andi Kleen
    2006-03-22 23:54         ` Zachary Amsden
    2006-03-22 23:37           ` Andi Kleen
    2006-03-22 22:04   ` [RFC, PATCH 1/24] i386 Vmi documentation Zachary Amsden
    2006-03-22 21:58     ` Andi Kleen
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox