virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
  • * Re: [PATCH v2 01/11] kexec: introduce kexec_ops struct
           [not found] ` <1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
           [not found]   ` <1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
    @ 2012-11-20 16:40   ` Eric W. Biederman
           [not found]     ` <20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
      1 sibling, 1 reply; 23+ messages in thread
    From: Eric W. Biederman @ 2012-11-20 16:40 UTC (permalink / raw)
      To: Daniel Kiper
      Cc: xen-devel, konrad.wilk, andrew.cooper3, x86, kexec, linux-kernel,
    	virtualization, mingo, jbeulich, hpa, tglx
    
    Daniel Kiper <daniel.kiper@oracle.com> writes:
    
    > Some kexec/kdump implementations (e.g. Xen PVOPS) could not use default
    > functions or require some changes in behavior of kexec/kdump generic code.
    > To cope with that problem kexec_ops struct was introduced. It allows
    > a developer to replace all or some functions and control some
    > functionality of kexec/kdump generic code.
    >
    > Default behavior of kexec/kdump generic code is not changed.
    
    Ick.
    
    > v2 - suggestions/fixes:
    >    - add comment for kexec_ops.crash_alloc_temp_store member
    >      (suggested by Konrad Rzeszutek Wilk),
    >    - simplify kexec_ops usage
    >      (suggested by Konrad Rzeszutek Wilk).
    >
    > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    > ---
    >  include/linux/kexec.h |   26 ++++++++++
    >  kernel/kexec.c        |  131 +++++++++++++++++++++++++++++++++++++------------
    >  2 files changed, 125 insertions(+), 32 deletions(-)
    >
    > diff --git a/include/linux/kexec.h b/include/linux/kexec.h
    > index d0b8458..c8d0b35 100644
    > --- a/include/linux/kexec.h
    > +++ b/include/linux/kexec.h
    > @@ -116,7 +116,33 @@ struct kimage {
    >  #endif
    >  };
    >  
    > +struct kexec_ops {
    > +	/*
    > +	 * Some kdump implementations (e.g. Xen PVOPS dom0) could not access
    > +	 * directly crash kernel memory area. In this situation they must
    > +	 * allocate memory outside of it and later move contents from temporary
    > +	 * storage to final resting places (usualy done by relocate_kernel()).
    > +	 * Such behavior could be enforced by setting
    > +	 * crash_alloc_temp_store member to true.
    > +	 */
    
    Why in the world would Xen not be able to access crash kernel memory?
    As currently defined it is normal memory that the kernel chooses not to
    use.
    
    If relocate kernel can access that memory you definitely can access the
    memory so the comment does not make any sense.
    
    > +	bool crash_alloc_temp_store;
    > +	struct page *(*kimage_alloc_pages)(gfp_t gfp_mask,
    > +						unsigned int order,
    > +						unsigned long limit);
    > +	void (*kimage_free_pages)(struct page *page);
    > +	unsigned long (*page_to_pfn)(struct page *page);
    > +	struct page *(*pfn_to_page)(unsigned long pfn);
    > +	unsigned long (*virt_to_phys)(volatile void *address);
    > +	void *(*phys_to_virt)(unsigned long address);
    > +	int (*machine_kexec_prepare)(struct kimage *image);
    > +	int (*machine_kexec_load)(struct kimage *image);
    > +	void (*machine_kexec_cleanup)(struct kimage *image);
    > +	void (*machine_kexec_unload)(struct kimage *image);
    > +	void (*machine_kexec_shutdown)(void);
    > +	void (*machine_kexec)(struct kimage *image);
    > +};
    
    Ugh.  This is a nasty abstraction.
    
    You are mixing and matching a bunch of things together here.
    
    If you need to override machine_kexec_xxx please do that on a per
    architecture basis.
    
    Special case overrides of page_to_pfn, pfn_to_page, virt_to_phys,
    phys_to_virt, and friends seem completely inappropriate.
    
    There may be a point to all of these but you are mixing and matching
    things badly.
    
    
    Eric
    
    ^ permalink raw reply	[flat|nested] 23+ messages in thread

  • end of thread, other threads:[~2014-03-31 10:50 UTC | newest]
    
    Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <1353423893-23125-1-git-send-email-daniel.kiper@oracle.com>
         [not found] ` <1353423893-23125-2-git-send-email-daniel.kiper@oracle.com>
         [not found]   ` <1353423893-23125-3-git-send-email-daniel.kiper@oracle.com>
    2012-11-20 15:52     ` [PATCH v2 02/11] x86/kexec: Add extra pointers to transition page table PGD, PUD, PMD and PTE Jan Beulich
    2012-11-20 16:40   ` [PATCH v2 01/11] kexec: introduce kexec_ops struct Eric W. Biederman
         [not found]     ` <20121121105221.GA2925@host-192-168-1-59.local.net-space.pl>
    2012-11-22 12:15       ` Eric W. Biederman
    2012-11-22 17:37         ` H. Peter Anvin
    2012-11-23  9:56           ` Jan Beulich
    2012-11-23 10:53             ` [Xen-devel] " Ian Campbell
    2012-11-22 17:47         ` H. Peter Anvin
         [not found]         ` <50AE6542.3020302@zytor.com>
    2012-11-22 18:07           ` Andrew Cooper
         [not found]           ` <50AE69EF.4060909@citrix.com>
    2012-11-22 22:26             ` H. Peter Anvin
         [not found]             ` <09b41677-c9e7-4cd4-84a0-a1cb483d551d@email.android.com>
    2014-03-31 10:50               ` Petr Tesarik
    2012-11-23  0:12           ` Andrew Cooper
         [not found]           ` <50AEBF86.50501@citrix.com>
    2012-11-23  1:34             ` H. Peter Anvin
    2012-11-23  1:38             ` H. Peter Anvin
    2012-11-23  1:56               ` Andrew Cooper
         [not found]               ` <50AED7B8.7040902@citrix.com>
    2012-11-23  8:01                 ` Bouchard Louis
    2012-11-23  9:53                 ` Jan Beulich
         [not found]                 ` <50AF55B102000078000AABF3@nat28.tlf.novell.com>
    2012-11-23 10:37                   ` Daniel Kiper
         [not found]                   ` <20121123103726.GB2921@host-192-168-1-59.local.net-space.pl>
    2012-11-23 10:51                     ` [Xen-devel] " Ian Campbell
    2012-11-23 10:51                     ` Jan Beulich
    2012-11-23 11:08                       ` Daniel Kiper
         [not found]                     ` <1353667868.13542.218.camel@zakaz.uk.xensource.com>
    2012-11-23 11:13                       ` [Xen-devel] " Daniel Kiper
    2012-11-23  9:47         ` Daniel Kiper
         [not found]         ` <20121123094516.GA2921@host-192-168-1-59.local.net-space.pl>
    2012-11-23 20:24           ` Eric W. Biederman
    

    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).