All of lore.kernel.org
 help / color / mirror / Atom feed
From: konrad.wilk@oracle.com (Konrad Rzeszutek Wilk)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 05/13] xen/arm,arm64: move Xen initialization earlier
Date: Fri, 6 Sep 2013 10:23:01 -0400	[thread overview]
Message-ID: <20130906142301.GA5140@phenom.dumpdata.com> (raw)
In-Reply-To: <20130906140921.GD1946@arm.com>

On Fri, Sep 06, 2013 at 03:09:21PM +0100, Catalin Marinas wrote:
> On Fri, Sep 06, 2013 at 09:58:59AM +0100, Ian Campbell wrote:
> > On Thu, 2013-09-05 at 17:59 +0100, Stefano Stabellini wrote:
> > > On Thu, 5 Sep 2013, Catalin Marinas wrote:
> > > > On Thu, Aug 29, 2013 at 07:32:26PM +0100, Stefano Stabellini wrote:
> > > > > Move Xen initialization earlier, before any DMA requests can be made.
> > > > > 
> > > > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > > 
> > > > I guess you should cc the corresponding maintainers here.
> > > 
> > > Thanks for the reminder, I'll do that.
> > > 
> > > 
> > > > >  arch/arm/include/asm/xen/hypervisor.h |    8 ++++++++
> > > > >  arch/arm/kernel/setup.c               |    2 ++
> > > > >  arch/arm/xen/enlighten.c              |   21 ++++++++++++++-------
> > > > >  arch/arm64/kernel/setup.c             |    2 ++
> > > > >  4 files changed, 26 insertions(+), 7 deletions(-)
> > > > 
> > > > [...]
> > > > 
> > > > > --- a/arch/arm64/kernel/setup.c
> > > > > +++ b/arch/arm64/kernel/setup.c
> > > > > @@ -53,6 +53,7 @@
> > > > >  #include <asm/traps.h>
> > > > >  #include <asm/memblock.h>
> > > > >  #include <asm/psci.h>
> > > > > +#include <asm/xen/hypervisor.h>
> > > > >  
> > > > >  unsigned int processor_id;
> > > > >  EXPORT_SYMBOL(processor_id);
> > > > > @@ -267,6 +268,7 @@ void __init setup_arch(char **cmdline_p)
> > > > >  	unflatten_device_tree();
> > > > >  
> > > > >  	psci_init();
> > > > > +	xen_early_init();
> > > > 
> > > > So Xen guests don't have any hope for single Image? Basically you set
> > > > dma_ops unconditionally in xen_early_init(), even if the kernel is not
> > > > intended to run under Xen.
> > > 
> > > That should not happen: if we are not running on Xen xen_early_init
> > > returns early, before calling xen_mm_init.
> > 
> > x96 has a call to init_hypervisor_platform() at approximately this
> > location, which detects and calls the init function for any of Xen, KVM,
> > hyperv and vmware.
> 
> I would rather have a core_initcall(xen_early_init()) if possible,
> rather than hard-coded calls in setup_arch(). This early stuff is
> DT-driven, so in theory you don't need a specific xen call. The only
> thing is that you end up with swiotlb_init() and 64MB wasted if the Xen
> guest does not plan to use them.

There is a swiotlb_free mechanism in case the allocation was not
neccessary.
> 
> > I guess only Xen and KVM are currently relevant on Linux ARM(64), so
> > perhaps adding similar infrastructure on ARM would be overkill at this
> > point. I don't know if KVM needs such an early C-land hook, I suppose
> > it needs it even earlier so it can set up the hyp mode trampoline from
> > head.S?
> 
> head.S installs a Hyp stub if it starts in that mode and then forget
> about. Later when KVM is initialised it installs its own code by doing
> an HVC call.
> 
> -- 
> Catalin

WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v5 05/13] xen/arm,arm64: move Xen initialization earlier
Date: Fri, 6 Sep 2013 10:23:01 -0400	[thread overview]
Message-ID: <20130906142301.GA5140@phenom.dumpdata.com> (raw)
In-Reply-To: <20130906140921.GD1946@arm.com>

On Fri, Sep 06, 2013 at 03:09:21PM +0100, Catalin Marinas wrote:
> On Fri, Sep 06, 2013 at 09:58:59AM +0100, Ian Campbell wrote:
> > On Thu, 2013-09-05 at 17:59 +0100, Stefano Stabellini wrote:
> > > On Thu, 5 Sep 2013, Catalin Marinas wrote:
> > > > On Thu, Aug 29, 2013 at 07:32:26PM +0100, Stefano Stabellini wrote:
> > > > > Move Xen initialization earlier, before any DMA requests can be made.
> > > > > 
> > > > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > > 
> > > > I guess you should cc the corresponding maintainers here.
> > > 
> > > Thanks for the reminder, I'll do that.
> > > 
> > > 
> > > > >  arch/arm/include/asm/xen/hypervisor.h |    8 ++++++++
> > > > >  arch/arm/kernel/setup.c               |    2 ++
> > > > >  arch/arm/xen/enlighten.c              |   21 ++++++++++++++-------
> > > > >  arch/arm64/kernel/setup.c             |    2 ++
> > > > >  4 files changed, 26 insertions(+), 7 deletions(-)
> > > > 
> > > > [...]
> > > > 
> > > > > --- a/arch/arm64/kernel/setup.c
> > > > > +++ b/arch/arm64/kernel/setup.c
> > > > > @@ -53,6 +53,7 @@
> > > > >  #include <asm/traps.h>
> > > > >  #include <asm/memblock.h>
> > > > >  #include <asm/psci.h>
> > > > > +#include <asm/xen/hypervisor.h>
> > > > >  
> > > > >  unsigned int processor_id;
> > > > >  EXPORT_SYMBOL(processor_id);
> > > > > @@ -267,6 +268,7 @@ void __init setup_arch(char **cmdline_p)
> > > > >  	unflatten_device_tree();
> > > > >  
> > > > >  	psci_init();
> > > > > +	xen_early_init();
> > > > 
> > > > So Xen guests don't have any hope for single Image? Basically you set
> > > > dma_ops unconditionally in xen_early_init(), even if the kernel is not
> > > > intended to run under Xen.
> > > 
> > > That should not happen: if we are not running on Xen xen_early_init
> > > returns early, before calling xen_mm_init.
> > 
> > x96 has a call to init_hypervisor_platform() at approximately this
> > location, which detects and calls the init function for any of Xen, KVM,
> > hyperv and vmware.
> 
> I would rather have a core_initcall(xen_early_init()) if possible,
> rather than hard-coded calls in setup_arch(). This early stuff is
> DT-driven, so in theory you don't need a specific xen call. The only
> thing is that you end up with swiotlb_init() and 64MB wasted if the Xen
> guest does not plan to use them.

There is a swiotlb_free mechanism in case the allocation was not
neccessary.
> 
> > I guess only Xen and KVM are currently relevant on Linux ARM(64), so
> > perhaps adding similar infrastructure on ARM would be overkill at this
> > point. I don't know if KVM needs such an early C-land hook, I suppose
> > it needs it even earlier so it can set up the hyp mode trampoline from
> > head.S?
> 
> head.S installs a Hyp stub if it starts in that mode and then forget
> about. Later when KVM is initialised it installs its own code by doing
> an HVC call.
> 
> -- 
> Catalin

WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v5 05/13] xen/arm,arm64: move Xen initialization earlier
Date: Fri, 6 Sep 2013 10:23:01 -0400	[thread overview]
Message-ID: <20130906142301.GA5140@phenom.dumpdata.com> (raw)
In-Reply-To: <20130906140921.GD1946@arm.com>

On Fri, Sep 06, 2013 at 03:09:21PM +0100, Catalin Marinas wrote:
> On Fri, Sep 06, 2013 at 09:58:59AM +0100, Ian Campbell wrote:
> > On Thu, 2013-09-05 at 17:59 +0100, Stefano Stabellini wrote:
> > > On Thu, 5 Sep 2013, Catalin Marinas wrote:
> > > > On Thu, Aug 29, 2013 at 07:32:26PM +0100, Stefano Stabellini wrote:
> > > > > Move Xen initialization earlier, before any DMA requests can be made.
> > > > > 
> > > > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > > 
> > > > I guess you should cc the corresponding maintainers here.
> > > 
> > > Thanks for the reminder, I'll do that.
> > > 
> > > 
> > > > >  arch/arm/include/asm/xen/hypervisor.h |    8 ++++++++
> > > > >  arch/arm/kernel/setup.c               |    2 ++
> > > > >  arch/arm/xen/enlighten.c              |   21 ++++++++++++++-------
> > > > >  arch/arm64/kernel/setup.c             |    2 ++
> > > > >  4 files changed, 26 insertions(+), 7 deletions(-)
> > > > 
> > > > [...]
> > > > 
> > > > > --- a/arch/arm64/kernel/setup.c
> > > > > +++ b/arch/arm64/kernel/setup.c
> > > > > @@ -53,6 +53,7 @@
> > > > >  #include <asm/traps.h>
> > > > >  #include <asm/memblock.h>
> > > > >  #include <asm/psci.h>
> > > > > +#include <asm/xen/hypervisor.h>
> > > > >  
> > > > >  unsigned int processor_id;
> > > > >  EXPORT_SYMBOL(processor_id);
> > > > > @@ -267,6 +268,7 @@ void __init setup_arch(char **cmdline_p)
> > > > >  	unflatten_device_tree();
> > > > >  
> > > > >  	psci_init();
> > > > > +	xen_early_init();
> > > > 
> > > > So Xen guests don't have any hope for single Image? Basically you set
> > > > dma_ops unconditionally in xen_early_init(), even if the kernel is not
> > > > intended to run under Xen.
> > > 
> > > That should not happen: if we are not running on Xen xen_early_init
> > > returns early, before calling xen_mm_init.
> > 
> > x96 has a call to init_hypervisor_platform() at approximately this
> > location, which detects and calls the init function for any of Xen, KVM,
> > hyperv and vmware.
> 
> I would rather have a core_initcall(xen_early_init()) if possible,
> rather than hard-coded calls in setup_arch(). This early stuff is
> DT-driven, so in theory you don't need a specific xen call. The only
> thing is that you end up with swiotlb_init() and 64MB wasted if the Xen
> guest does not plan to use them.

There is a swiotlb_free mechanism in case the allocation was not
neccessary.
> 
> > I guess only Xen and KVM are currently relevant on Linux ARM(64), so
> > perhaps adding similar infrastructure on ARM would be overkill at this
> > point. I don't know if KVM needs such an early C-land hook, I suppose
> > it needs it even earlier so it can set up the hyp mode trampoline from
> > head.S?
> 
> head.S installs a Hyp stub if it starts in that mode and then forget
> about. Later when KVM is initialised it installs its own code by doing
> an HVC call.
> 
> -- 
> Catalin

  reply	other threads:[~2013-09-06 14:23 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 18:31 [PATCH v5 0/13] enable swiotlb-xen on arm and arm64 Stefano Stabellini
2013-08-29 18:31 ` Stefano Stabellini
2013-08-29 18:31 ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 01/13] arm: make SWIOTLB available Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 02/13] arm: introduce a global dma_ops pointer Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-09-02 14:45   ` [Xen-devel] " Julien Grall
2013-09-02 14:45     ` Julien Grall
2013-09-02 14:45     ` Julien Grall
2013-09-05 16:39     ` Stefano Stabellini
2013-09-05 16:39       ` Stefano Stabellini
2013-09-05 16:39       ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 03/13] arm64: define DMA_ERROR_CODE Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-09-05 16:05   ` Catalin Marinas
2013-09-05 16:05     ` Catalin Marinas
2013-09-05 16:05     ` Catalin Marinas
2013-09-05 16:54     ` Stefano Stabellini
2013-09-05 16:54       ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 04/13] arm64: do not initialize arm64_swiotlb if dma_ops is already set Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 05/13] xen/arm,arm64: move Xen initialization earlier Stefano Stabellini
2013-08-29 18:32   ` [PATCH v5 05/13] xen/arm, arm64: " Stefano Stabellini
2013-08-29 18:32   ` [PATCH v5 05/13] xen/arm,arm64: " Stefano Stabellini
2013-09-05 16:20   ` Catalin Marinas
2013-09-05 16:20     ` Catalin Marinas
2013-09-05 16:20     ` Catalin Marinas
2013-09-05 16:59     ` Stefano Stabellini
2013-09-05 16:59       ` Stefano Stabellini
2013-09-06  8:58       ` Ian Campbell
2013-09-06  8:58         ` Ian Campbell
2013-09-06 14:09         ` Catalin Marinas
2013-09-06 14:09           ` Catalin Marinas
2013-09-06 14:09           ` Catalin Marinas
2013-09-06 14:23           ` Konrad Rzeszutek Wilk [this message]
2013-09-06 14:23             ` Konrad Rzeszutek Wilk
2013-09-06 14:23             ` Konrad Rzeszutek Wilk
2013-09-06 14:53             ` Stefano Stabellini
2013-09-06 14:53               ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 06/13] xen: introduce XENMEM_exchange_and_pin and XENMEM_unpin Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 07/13] xen: make xen_create_contiguous_region return the dma address Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-30 13:45   ` Konrad Rzeszutek Wilk
2013-08-30 13:45     ` Konrad Rzeszutek Wilk
2013-08-29 18:32 ` [PATCH v5 08/13] swiotlb-xen: support autotranslate guests Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-30 13:46   ` Konrad Rzeszutek Wilk
2013-08-30 13:46     ` Konrad Rzeszutek Wilk
2013-08-29 18:32 ` [PATCH v5 09/13] xen/arm,arm64: enable SWIOTLB_XEN Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 10/13] swiotlb-xen: introduce xen_swiotlb_set_dma_mask Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 11/13] xen: introduce xen_alloc/free_coherent_pages Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-09-05 16:09   ` Catalin Marinas
2013-09-05 16:09     ` Catalin Marinas
2013-09-05 16:09     ` Catalin Marinas
2013-09-05 16:43     ` Stefano Stabellini
2013-09-05 16:43       ` Stefano Stabellini
2013-09-06 14:14       ` Catalin Marinas
2013-09-06 14:14         ` Catalin Marinas
2013-09-06 14:14         ` Catalin Marinas
2013-09-06 14:59         ` Stefano Stabellini
2013-09-06 14:59           ` Stefano Stabellini
2013-09-06 15:59           ` Catalin Marinas
2013-09-06 15:59             ` Catalin Marinas
2013-09-06 15:59             ` Catalin Marinas
2013-09-06 16:09             ` Stefano Stabellini
2013-09-06 16:09               ` Stefano Stabellini
2013-09-06 16:20               ` Catalin Marinas
2013-09-06 16:20                 ` Catalin Marinas
2013-09-06 16:20                 ` Catalin Marinas
2013-09-06 16:52                 ` Stefano Stabellini
2013-09-06 16:52                   ` Stefano Stabellini
2013-09-09 15:51                   ` Catalin Marinas
2013-09-09 15:51                     ` Catalin Marinas
2013-09-09 16:46                     ` Stefano Stabellini
2013-09-09 16:46                       ` Stefano Stabellini
2013-09-11  9:36                       ` Catalin Marinas
2013-09-11  9:36                         ` Catalin Marinas
2013-09-11  9:36                         ` Catalin Marinas
2013-09-11 17:34                         ` Stefano Stabellini
2013-09-11 17:34                           ` Stefano Stabellini
2013-09-12 13:53                           ` Catalin Marinas
2013-09-12 13:53                             ` Catalin Marinas
2013-09-12 13:53                             ` Catalin Marinas
2013-09-12 14:44                             ` Stefano Stabellini
2013-09-12 14:44                               ` Stefano Stabellini
2013-09-12 15:04                               ` Catalin Marinas
2013-09-12 15:04                                 ` Catalin Marinas
2013-08-29 18:32 ` [PATCH v5 12/13] swiotlb-xen: use xen_alloc/free_coherent_pages Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-30 13:53   ` Konrad Rzeszutek Wilk
2013-08-30 13:53     ` Konrad Rzeszutek Wilk
2013-09-05 16:50     ` Stefano Stabellini
2013-09-05 16:50       ` Stefano Stabellini
2013-09-05 16:50       ` Stefano Stabellini
2013-09-06 14:17       ` Konrad Rzeszutek Wilk
2013-09-06 14:17         ` Konrad Rzeszutek Wilk
2013-09-06 15:04         ` Stefano Stabellini
2013-09-06 15:04           ` Stefano Stabellini
2013-09-06 15:04           ` Stefano Stabellini
2013-08-29 18:32 ` [PATCH v5 13/13] swiotlb: don't assume that io_tlb_start-io_tlb_end is coherent Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini
2013-08-29 18:32   ` Stefano Stabellini

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=20130906142301.GA5140@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.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.