Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

2017-04-03 Thread Daniel Kiper
ast basic commands like dmesg, bt, ps, etc.)? If yes for both you can add: Reviewed-by: Daniel Kiper Daniel ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH] kexec: clear kexec_image slot when unloading kexec image

2017-04-03 Thread Daniel Kiper
End thread. > }); > } > > for my $i (0..99) > { > threaded_task(); > } > -snip- > > --- > When kexec_do_unload calls kexec_swap_images to get the old kexec_image to > free, it passes NULL for the new kexec_image pointer. The new slot wasn't > being

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

2017-04-04 Thread Daniel Kiper
> On 03/04/17 14:42, Daniel Kiper wrote: > > On Fri, Mar 31, 2017 at 12:14:38PM +0200, Juergen Gross wrote: > >> For kdump to work correctly it needs the physical address of > >> vmcoreinfo_note. When running as dom0 this means the virtual address > >> has to

Re: [Xen-devel] [PATCH] arm64: xen: Implement EFI reset_system callback

2017-04-06 Thread Daniel Kiper
On Thu, Apr 06, 2017 at 09:32:32AM +0100, Julien Grall wrote: > Hi Juergen, > > On 06/04/17 07:23, Juergen Gross wrote: > >On 05/04/17 21:49, Boris Ostrovsky wrote: > >>On 04/05/2017 02:14 PM, Julien Grall wrote: > >>>The x86 code has theoritically a similar issue, altought EFI does not > >>>seem t

Re: [Xen-devel] [PATCH] arm64: xen: Implement EFI reset_system callback

2017-04-06 Thread Daniel Kiper
On Thu, Apr 06, 2017 at 04:38:24PM +0200, Juergen Gross wrote: > On 06/04/17 16:27, Daniel Kiper wrote: > > On Thu, Apr 06, 2017 at 09:32:32AM +0100, Julien Grall wrote: > >> Hi Juergen, > >> > >> On 06/04/17 07:23, Juergen Gross wrote: > >>> On 05/

Re: [Xen-devel] [PATCH] arm64: xen: Implement EFI reset_system callback

2017-04-06 Thread Daniel Kiper
Hi Julien, On Thu, Apr 06, 2017 at 04:39:13PM +0100, Julien Grall wrote: > Hi Daniel, > > On 06/04/17 16:20, Daniel Kiper wrote: > >On Thu, Apr 06, 2017 at 04:38:24PM +0200, Juergen Gross wrote: > >>On 06/04/17 16:27, Daniel Kiper wrote: > >>>On Thu, Apr 06, 20

Re: [Xen-devel] [PATCH] arm64: xen: Implement EFI reset_system callback

2017-04-06 Thread Daniel Kiper
On Thu, Apr 06, 2017 at 06:22:44PM +0200, Juergen Gross wrote: > On 06/04/17 18:06, Daniel Kiper wrote: > > Hi Julien, > > > > On Thu, Apr 06, 2017 at 04:39:13PM +0100, Julien Grall wrote: > >> Hi Daniel, > >> > >> On 06/04/17 16:20, Daniel Kiper

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

2017-04-10 Thread Daniel Kiper
On Fri, Apr 07, 2017 at 11:16:22AM +0200, Petr Tesarik wrote: > On Wed, 5 Apr 2017 13:13:00 +0200 > Petr Tesarik wrote: > > > On Tue, 4 Apr 2017 12:42:53 -0700 (PDT) > > Daniel Kiper wrote: > > > >[...] > > > So, if Petr did relevant tests that is nice.

Re: [Xen-devel] [PATCH] kexec: Add spinlock for the whole hypercall

2017-04-11 Thread Daniel Kiper
On Tue, Apr 11, 2017 at 01:46:37AM -0600, Jan Beulich wrote: > >>> On 10.04.17 at 21:44, wrote: > > Please don't forget Cc-ing the maintainer(s) of the code being modified. > > > @@ -1187,12 +1182,22 @@ static int do_kexec_op_internal(unsigned long op, > > XEN_GUES

Re: [Xen-devel] [PATCH] kexec: Add spinlock for the whole hypercall

2017-04-11 Thread Daniel Kiper
On Tue, Apr 11, 2017 at 06:31:36AM -0600, Jan Beulich wrote: > >>> On 11.04.17 at 13:24, wrote: > > On Tue, Apr 11, 2017 at 01:46:37AM -0600, Jan Beulich wrote: > >> >>> On 10.04.17 at 21:44, wrote: > >> wouldn't it be better to handle this with a static state variable, > >> which gets checked/se

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

2017-04-11 Thread Daniel Kiper
On Tue, Apr 11, 2017 at 02:45:43PM +0200, Juergen Gross wrote: > On 03/04/17 14:42, Daniel Kiper wrote: > > On Fri, Mar 31, 2017 at 12:14:38PM +0200, Juergen Gross wrote: > >> For kdump to work correctly it needs the physical address of > >> vmcoreinfo_note. When run

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

2017-04-11 Thread Daniel Kiper
On Tue, Apr 11, 2017 at 04:59:16PM +0200, Petr Tesarik wrote: > On Tue, 11 Apr 2017 15:00:58 +0200 > Daniel Kiper wrote: > > > On Tue, Apr 11, 2017 at 02:45:43PM +0200, Juergen Gross wrote: > > > On 03/04/17 14:42, Daniel Kiper wrote: > > > > On Fri, Mar 3

Re: [Xen-devel] [PATCH v16 7/9] x86: make Xen early boot code relocatable

2017-04-13 Thread Daniel Kiper
s is used as base for Xen data relative addressing in 32-bit code > > if it is possible; %esi is used for that thing during error printing > > because it is not always possible to properly and efficiently > > initialize %fs. > > > > Signed-off-by: Daniel Kiper >

Re: [Xen-devel] [PATCH v5 00/16] x86: multiboot2 protocol support

2016-08-30 Thread Daniel Kiper
On Mon, Aug 22, 2016 at 04:10:04AM -0600, Jan Beulich wrote: > >>> On 20.08.16 at 00:43, wrote: > > The final goal is xen.efi binary file which could be loaded by EFI > > loader, multiboot (v1) protocol (only on legacy BIOS platforms) and > > multiboot2 protocol. This way we will have: > > - sma

Re: [Xen-devel] [PATCH v5 02/16] x86/boot: remove multiboot1_header_end from symbol table

2016-08-30 Thread Daniel Kiper
On Thu, Aug 25, 2016 at 05:21:24AM -0600, Jan Beulich wrote: > >>> On 20.08.16 at 00:43, wrote: > > Its visibility is not needed and just pollute symbol table. > > > > Suggested-by: Jan Beulich > > Signed-off-by: Daniel Kiper > > With Andrew effective

Re: [Xen-devel] [PATCH v5 06/16] x86/boot/reloc: create generic alloc and copy functions

2016-08-30 Thread Daniel Kiper
On Thu, Aug 25, 2016 at 05:34:31AM -0600, Jan Beulich wrote: > >>> On 20.08.16 at 00:43, wrote: > > Create generic alloc and copy functions. We need > > separate tools for memory allocation and copy to > > provide multiboot2 protocol support. > > > > Sign

Re: [Xen-devel] [PATCH v5 09/16] x86: add multiboot2 protocol support

2016-08-30 Thread Daniel Kiper
On Thu, Aug 25, 2016 at 05:50:04AM -0600, Jan Beulich wrote: > >>> On 20.08.16 at 00:43, wrote: > > +case MULTIBOOT2_TAG_TYPE_MMAP: > > +if ( get_mb2_data(tag, mmap, entry_size) < sizeof(*mmap_src) ) > > +break; > > + > > +mbi_out->flags |= MBI_MEMMA

Re: [Xen-devel] [PATCH v5 10/16] efi: create efi_enabled()

2016-08-30 Thread Daniel Kiper
On Thu, Aug 25, 2016 at 06:16:35AM -0600, Jan Beulich wrote: > >>> On 20.08.16 at 00:43, wrote: > > --- a/xen/arch/x86/efi/stub.c > > +++ b/xen/arch/x86/efi/stub.c > > @@ -4,9 +4,10 @@ > > #include > > #include > > > > -#ifndef efi_enabled > > -const bool_t efi_enabled = 0; > > -#endif > > +bo

Re: [Xen-devel] [PATCH v5 13/16] x86: add multiboot2 protocol support for EFI platforms

2016-08-30 Thread Daniel Kiper
On Thu, Aug 25, 2016 at 06:59:54AM -0600, Jan Beulich wrote: > >>> On 20.08.16 at 00:43, wrote: > > @@ -100,19 +107,45 @@ multiboot2_header_start: > > gdt_boot_descr: > > .word 6*8-1 > > .long sym_phys(trampoline_gdt) > > +.long 0 /* Needed for 64-bit lgdt */ > > +

Re: [Xen-devel] [PATCH v5 14/16] x86/boot: implement early command line parser in C

2016-08-30 Thread Daniel Kiper
On Thu, Aug 25, 2016 at 07:27:21AM -0600, Jan Beulich wrote: > >>> On 20.08.16 at 00:43, wrote: > > +#define NULL ((void *)0) > > + > > +#define __packed __attribute__((__packed__)) > > +#define __stdcall __attribute__((__stdcall__)) > > + > > +#define max(x,y) ({ \ > > +const typ

Re: [Xen-devel] [PATCH v5 15/16] x86: make Xen early boot code relocatable

2016-08-31 Thread Daniel Kiper
On Thu, Aug 25, 2016 at 08:41:39AM -0600, Jan Beulich wrote: > >>> On 20.08.16 at 00:43, wrote: > > Every multiboot protocol (regardless of version) compatible image must > > specify its load address (in ELF or multiboot header). Multiboot protocol > > compatible loader have to load image at speci

Re: [Xen-devel] [PATCH v5 00/16] x86: multiboot2 protocol support

2016-08-31 Thread Daniel Kiper
On Tue, Aug 30, 2016 at 09:09:50AM -0600, Jan Beulich wrote: > >>> On 30.08.16 at 16:15, wrote: > > On Mon, Aug 22, 2016 at 04:10:04AM -0600, Jan Beulich wrote: > >> >>> On 20.08.16 at 00:43, wrote: > >> > The final goal is xen.efi binary file which could be loaded by EFI > >> > loader, multiboot

Re: [Xen-devel] [PATCH v5 06/16] x86/boot/reloc: create generic alloc and copy functions

2016-08-31 Thread Daniel Kiper
ctions. We need > >> > separate tools for memory allocation and copy to > >> > provide multiboot2 protocol support. > >> > > >> > Signed-off-by: Daniel Kiper > >> > >> The amount of casting in this patch alone looks very reasonable now. >

Re: [Xen-devel] [PATCH v5 09/16] x86: add multiboot2 protocol support

2016-08-31 Thread Daniel Kiper
On Tue, Aug 30, 2016 at 09:14:28AM -0600, Jan Beulich wrote: > >>> On 30.08.16 at 16:41, wrote: > > On Thu, Aug 25, 2016 at 05:50:04AM -0600, Jan Beulich wrote: > >> >>> On 20.08.16 at 00:43, wrote: > >> > +case MULTIBOOT2_TAG_TYPE_MMAP: > >> > +if ( get_mb2_data(tag, mmap, en

Re: [Xen-devel] [PATCH v5 13/16] x86: add multiboot2 protocol support for EFI platforms

2016-08-31 Thread Daniel Kiper
On Wed, Aug 31, 2016 at 06:49:51AM -0600, Jan Beulich wrote: > >>> On 30.08.16 at 21:32, wrote: > > On Thu, Aug 25, 2016 at 06:59:54AM -0600, Jan Beulich wrote: > >> >>> On 20.08.16 at 00:43, wrote: [...] > >> > +paddr_t __init efi_multiboot2(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE > >> > *Sy

Re: [Xen-devel] [PATCH v5 14/16] x86/boot: implement early command line parser in C

2016-08-31 Thread Daniel Kiper
On Wed, Aug 31, 2016 at 07:01:10AM -0600, Jan Beulich wrote: > >>> On 30.08.16 at 21:58, wrote: > > On Thu, Aug 25, 2016 at 07:27:21AM -0600, Jan Beulich wrote: > >> >>> On 20.08.16 at 00:43, wrote: [...] > >> > +static unsigned int strtoui(const char *s, const char *stop, const char > >> > **

Re: [Xen-devel] [PATCH v5 06/16] x86/boot/reloc: create generic alloc and copy functions

2016-08-31 Thread Daniel Kiper
Jan Beulich wrote: > >> >> >>> On 20.08.16 at 00:43, wrote: > >> >> > Create generic alloc and copy functions. We need > >> >> > separate tools for memory allocation and copy to > >> >> > provide multiboot2 protocol

Re: [Xen-devel] [PATCH v5 15/16] x86: make Xen early boot code relocatable

2016-08-31 Thread Daniel Kiper
On Wed, Aug 31, 2016 at 09:46:31AM -0600, Jan Beulich wrote: > >>> On 31.08.16 at 16:59, wrote: > > On Thu, Aug 25, 2016 at 08:41:39AM -0600, Jan Beulich wrote: > >> >>> On 20.08.16 at 00:43, wrote: [...] > >> > --- a/xen/arch/x86/boot/head.S > >> > +++ b/xen/arch/x86/boot/head.S > >> > @@ -12,

Re: [Xen-devel] [PATCH v5 09/16] x86: add multiboot2 protocol support

2016-08-31 Thread Daniel Kiper
On Wed, Aug 31, 2016 at 09:18:39PM +0100, Andrew Cooper wrote: > On 19/08/2016 23:43, Daniel Kiper wrote: > > @@ -106,3 +121,122 @@ multiboot_info_t __stdcall *reloc(u32 mbi_in, u32 > > trampoline) > > > > return mbi_out; > > } > > + > >

Re: [Xen-devel] [PATCH v5 13/16] x86: add multiboot2 protocol support for EFI platforms

2016-09-01 Thread Daniel Kiper
On Thu, Sep 01, 2016 at 01:40:11AM -0600, Jan Beulich wrote: > >>> On 31.08.16 at 19:07, wrote: > > On Wed, Aug 31, 2016 at 06:49:51AM -0600, Jan Beulich wrote: > >> >>> On 30.08.16 at 21:32, wrote: > >> > On Thu, Aug 25, 2016 at 06:59:54AM -0600, Jan Beulich wrote: > >> >> >>> On 20.08.16 at 00:

Re: [Xen-devel] [PATCH v5 14/16] x86/boot: implement early command line parser in C

2016-09-01 Thread Daniel Kiper
On Thu, Sep 01, 2016 at 01:41:26AM -0600, Jan Beulich wrote: > >>> On 31.08.16 at 21:31, wrote: > > On Wed, Aug 31, 2016 at 07:01:10AM -0600, Jan Beulich wrote: > >> >>> On 30.08.16 at 21:58, wrote: > >> > On Thu, Aug 25, 2016 at 07:27:21AM -0600, Jan Beulich wrote: > >> >> >>> On 20.08.16 at 00:

Re: [Xen-devel] [PATCH v5 15/16] x86: make Xen early boot code relocatable

2016-09-01 Thread Daniel Kiper
On Thu, Sep 01, 2016 at 01:46:24AM -0600, Jan Beulich wrote: > >>> On 31.08.16 at 22:50, wrote: > > On Wed, Aug 31, 2016 at 09:46:31AM -0600, Jan Beulich wrote: > >> >>> On 31.08.16 at 16:59, wrote: > >> > On Thu, Aug 25, 2016 at 08:41:39AM -0600, Jan Beulich wrote: > >> >> >>> On 20.08.16 at 00:

Re: [Xen-devel] [PATCH v6 0/4] arm64, xen: add xen_boot support into grup-mkconfig

2016-09-01 Thread Daniel Kiper
Hey Julien, On Thu, Sep 01, 2016 at 01:47:05PM +0100, Julien Grall wrote: > Hi Daniel, > > I have heard you became co-maintainer of GRUB. Congratulations for that :). Thanks a lot! > We have a couple series (this series and [1]) to allow grub booting > Xen on ARM that have been waiting on the GR

Re: [Xen-devel] [PATCH v5 15/16] x86: make Xen early boot code relocatable

2016-09-02 Thread Daniel Kiper
On Fri, Sep 02, 2016 at 12:58:14AM -0600, Jan Beulich wrote: > >>> On 01.09.16 at 23:19, wrote: > > On Thu, Sep 01, 2016 at 01:46:24AM -0600, Jan Beulich wrote: > >> >>> On 31.08.16 at 22:50, wrote: > >> > On Wed, Aug 31, 2016 at 09:46:31AM -0600, Jan Beulich wrote: > >> >> >>> On 31.08.16 at 16:

Re: [Xen-devel] [PATCH v5 12/16] x86/efi: create new early memory allocator

2016-09-07 Thread Daniel Kiper
On Mon, Sep 05, 2016 at 06:33:57AM -0600, Jan Beulich wrote: > >>> On 20.08.16 at 00:43, wrote: [...] > > +static char __initdata *ebmalloc_free = NULL; > > + > > +/* EFI boot allocator. */ > > +static void __init *ebmalloc(size_t size) > > +{ > > +void *ptr; > > + > > +/* > > + * In

Re: [Xen-devel] [PATCH v5 12/16] x86/efi: create new early memory allocator

2016-09-08 Thread Daniel Kiper
On Wed, Sep 07, 2016 at 08:01:31AM -0600, Jan Beulich wrote: > >>> On 07.09.16 at 14:05, wrote: > > On Mon, Sep 05, 2016 at 06:33:57AM -0600, Jan Beulich wrote: > >> >>> On 20.08.16 at 00:43, wrote: > >> > +static char __initdata *ebmalloc_free = NULL; > >> > + > >> > +/* EFI boot allocator. */ >

[Xen-devel] [PATCH v6 01/15] x86: properly calculate ELF end of image address

2016-09-12 Thread Daniel Kiper
e, it have to be changed to something more reliable. So, let's take ELF end of image address by reading _end symbol address from nm output. Signed-off-by: Daniel Kiper --- xen/arch/x86/Makefile |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/Makefile

[Xen-devel] [PATCH v6 00/15] x86: multiboot2 protocol support

2016-09-12 Thread Daniel Kiper
insertions(+), 568 deletions(-) Daniel Kiper (15): x86: properly calculate ELF end of image address x86/boot/reloc: create generic alloc and copy functions x86/boot/reloc: rename some variables and rearrange code a bit x86: add multiboot2 protocol support efi: create

[Xen-devel] [PATCH v6 05/15] efi: create efi_enabled()

2016-09-12 Thread Daniel Kiper
EFI_BOOT, EFI_LOADER and EFI_RS features. EFI_BOOT is equal to old efi_enabled == 1. EFI_RS ease control on runtime services usage. EFI_LOADER tells that Xen was loaded directly from EFI as PE executable. Suggested-by: Jan Beulich Signed-off-by: Daniel Kiper --- v6 - suggestions/fixes: - define

[Xen-devel] [PATCH v6 02/15] x86/boot/reloc: create generic alloc and copy functions

2016-09-12 Thread Daniel Kiper
Create generic alloc and copy functions. We need separate tools for memory allocation and copy to provide multiboot2 protocol support. Signed-off-by: Daniel Kiper --- v6 - suggestions/fixes: - reduce number of casts (suggested by Andrew Cooper and Jan Beulich). v4 - suggestions/fixes

[Xen-devel] [PATCH v6 03/15] x86/boot/reloc: rename some variables and rearrange code a bit

2016-09-12 Thread Daniel Kiper
Replace mbi with mbi_out and mbi_old with mbi_in and rearrange code a bit to make it more readable. Additionally, this way multiboot (v1) protocol implementation and future multiboot2 protocol implementation will use the same variable naming convention. Signed-off-by: Daniel Kiper Acked-by: Jan

[Xen-devel] [PATCH v6 07/15] efi: build xen.gz with EFI code

2016-09-12 Thread Daniel Kiper
This way we will have one Xen binary which can be loaded by three boot protocols: EFI native loader, multiboot (v1) and multiboot2. Signed-off-by: Daniel Kiper Acked-by: Jan Beulich --- v6 - suggestions/fixes: - improve efi_enabled() checks in efi_runtime_call() (suggested by Jan Beu

[Xen-devel] [PATCH v6 06/15] x86: allow EFI reboot method neither on EFI platforms...

2016-09-12 Thread Daniel Kiper
..nor EFI platforms with runtime services enabled. Suggested-by: Jan Beulich Signed-off-by: Daniel Kiper --- v6 - suggestions/fixes: - move this commit behind "efi: create efi_enabled()" commit (suggested by Jan Beulich). v5 - suggestions/fixes: - fix build error (su

[Xen-devel] [PATCH v6 04/15] x86: add multiboot2 protocol support

2016-09-12 Thread Daniel Kiper
Add multiboot2 protocol support. Alter min memory limit handling as we now may not find it from either multiboot (v1) or multiboot2. This way we are laying the foundation for EFI + GRUB2 + Xen development. Signed-off-by: Daniel Kiper --- v6 - suggestions/fixes: - properly index

[Xen-devel] [PATCH v6 10/15] x86/boot: implement early command line parser in C

2016-09-12 Thread Daniel Kiper
: Andrew Cooper Signed-off-by: Daniel Kiper --- v6 - suggestions/fixes: - put common cmdline.c and reloc.c definitions into defs.h header (suggested by Jan Beulich), - use xen/include/xen/stdbool.h and bool type from it instead of own defined bool_t (suggested by Jan

[Xen-devel] [PATCH v6 11/15] x86: change default load address from 1 MiB to 2 MiB

2016-09-12 Thread Daniel Kiper
fault load address from 1 MiB to 2 MiB. This way page table code will be nice and easy. Hence, there is a chance that it will be less error prone too... :-))) Signed-off-by: Daniel Kiper --- xen/arch/x86/Makefile |2 +- xen/arch/x86/Rules.mk |4 xen/arch/x86/setup.c |3 ++- xen

[Xen-devel] [PATCH v6 09/15] x86: add multiboot2 protocol support for EFI platforms

2016-09-12 Thread Daniel Kiper
This way Xen can be loaded on EFI platforms using GRUB2 and other boot loaders which support multiboot2 protocol. Signed-off-by: Daniel Kiper --- v6 - suggestions/fixes: - improve label names in assembly error printing code (suggested by Jan Beulich), - improve comments

[Xen-devel] [PATCH v6 15/15] x86: add multiboot2 protocol support for relocatable images

2016-09-12 Thread Daniel Kiper
Add multiboot2 protocol support for relocatable images. Only GRUB2 with "multiboot2: Add support for relocatable images" patch understands that feature. Older multiboot protocol (regardless of version) compatible loaders ignore it and everything works as usual. Signed-off-by: Daniel Kip

[Xen-devel] [PATCH v6 13/15] x86: make Xen early boot code relocatable

2016-09-12 Thread Daniel Kiper
not always possible to properly and efficiently initialize %fs. Signed-off-by: Daniel Kiper --- v6 - suggestions/fixes: - leave static mapping of first 16 MiB in l2_identmap as is (suggested by Jan Beulich), - use xen_phys_start instead of xen_img_load_base_addr (suggested

[Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-12 Thread Daniel Kiper
ented because it is quite simple and requires limited number of changes, especially in __start_xen(). Signed-off-by: Daniel Kiper --- v6 - suggestions/fixes: - optimize ebmalloc allocator, - move ebmalloc machinery to xen/common/efi/boot.c (suggested by Jan Beulich), - enforce PAGE

[Xen-devel] [PATCH v6 12/15] x86/setup: use XEN_IMG_OFFSET instead of...

2016-09-12 Thread Daniel Kiper
..calculating its value during runtime. Signed-off-by: Daniel Kiper --- xen/arch/x86/setup.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index f19af6e..ca1a97a 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c

[Xen-devel] [PATCH v6 14/15] x86/boot: rename sym_phys() to sym_offs()

2016-09-12 Thread Daniel Kiper
This way macro name better describes its function. There is no functional change. Suggested-by: Jan Beulich Signed-off-by: Daniel Kiper --- xen/arch/x86/boot/head.S | 40 xen/arch/x86/boot/trampoline.S |2 +- xen/arch/x86/boot/wakeup.S

Re: [Xen-devel] Xen 4.8 Development Update

2016-09-12 Thread Daniel Kiper
On Wed, Aug 31, 2016 at 09:30:46AM +0100, Wei Liu wrote: [...] > * Boot Xen on EFI platforms using GRUB2 (multiboot2 protocol) > - Daniel Kiper I have just sent v6. Daniel ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.x

[Xen-devel] Fixes for low memory allocation machinery in early boot code

2016-09-14 Thread Daniel Kiper
Hey, So, as I promised in other thread I am sending more info about my investigation related to low memory allocation for trampoline and other early boot data. Starting from the beginning it looks that there are "soft" limits enforced in BIOS early boot code looking for usable low memory region.

Re: [Xen-devel] [PATCH v6 01/15] x86: properly calculate ELF end of image address

2016-09-19 Thread Daniel Kiper
On Fri, Sep 16, 2016 at 04:43:21PM -0400, Konrad Rzeszutek Wilk wrote: > On Mon, Sep 12, 2016 at 10:18:16PM +0200, Daniel Kiper wrote: > > Currently ELF end of image address is calculated using first line from > > "nm -nr xen/xen-syms" output. However, today usually it c

Re: [Xen-devel] [PATCH v6 01/15] x86: properly calculate ELF end of image address

2016-09-19 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 05:14:07AM -0600, Jan Beulich wrote: > >>> On 16.09.16 at 22:43, wrote: > > On Mon, Sep 12, 2016 at 10:18:16PM +0200, Daniel Kiper wrote: > >> Currently ELF end of image address is calculated using first line from > >> "nm -nr xen

Re: [Xen-devel] [PATCH v6 05/15] efi: create efi_enabled()

2016-09-19 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 05:58:46AM -0600, Jan Beulich wrote: > >>> On 12.09.16 at 22:18, wrote: > > --- a/xen/arch/x86/domain_page.c > > +++ b/xen/arch/x86/domain_page.c > > @@ -36,7 +36,7 @@ static inline struct vcpu *mapcache_current_vcpu(void) > > * domain's page tables but current may po

Re: [Xen-devel] [PATCH v6 09/15] x86: add multiboot2 protocol support for EFI platforms

2016-09-19 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 06:29:55AM -0600, Jan Beulich wrote: > >>> On 12.09.16 at 22:18, wrote: > > --- a/xen/arch/x86/efi/stub.c > > +++ b/xen/arch/x86/efi/stub.c > > @@ -3,6 +3,43 @@ > > #include > > #include > > #include > > +#include > > +#include > > +#include > > +#include > > +#in

Re: [Xen-devel] [PATCH v6 10/15] x86/boot: implement early command line parser in C

2016-09-19 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 06:47:50AM -0600, Jan Beulich wrote: > >>> On 12.09.16 at 22:18, wrote: [...] > > --- a/xen/arch/x86/boot/trampoline.S > > +++ b/xen/arch/x86/boot/trampoline.S > > @@ -220,8 +220,22 @@ trampoline_boot_cpu_entry: > > /* Jump to the common bootstrap entry point. */

Re: [Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-19 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 06:12:35AM -0600, Jan Beulich wrote: > >>> On 12.09.16 at 22:18, wrote: > > --- a/xen/arch/x86/setup.c > > +++ b/xen/arch/x86/setup.c > > @@ -520,6 +520,8 @@ static void noinline init_done(void) > > > > system_state = SYS_STATE_active; > > > > +free_ebmalloc_unused

Re: [Xen-devel] [PATCH v6 05/15] efi: create efi_enabled()

2016-09-19 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 08:57:02AM -0600, Jan Beulich wrote: > >>> On 19.09.16 at 16:27, wrote: > > On Mon, Sep 19, 2016 at 05:58:46AM -0600, Jan Beulich wrote: > >> >>> On 12.09.16 at 22:18, wrote: > >> > --- a/xen/arch/x86/domain_page.c > >> > +++ b/xen/arch/x86/domain_page.c > >> > @@ -36,7 +3

Re: [Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-20 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 09:17:50AM -0600, Jan Beulich wrote: > >>> On 19.09.16 at 17:04, wrote: > > On Mon, Sep 19, 2016 at 06:12:35AM -0600, Jan Beulich wrote: > >> >>> On 12.09.16 at 22:18, wrote: > >> > --- a/xen/arch/x86/setup.c > >> > +++ b/xen/arch/x86/setup.c > >> > @@ -520,6 +520,8 @@ sta

Re: [Xen-devel] [PATCH v6 10/15] x86/boot: implement early command line parser in C

2016-09-20 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 10:03:08AM -0600, Jan Beulich wrote: > >>> On 19.09.16 at 17:27, wrote: > > On Mon, Sep 19, 2016 at 06:47:50AM -0600, Jan Beulich wrote: > >> >>> On 12.09.16 at 22:18, wrote: > > > > [...] > > > >> > --- a/xen/arch/x86/boot/trampoline.S > >> > +++ b/xen/arch/x86/boot/tramp

Re: [Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-20 Thread Daniel Kiper
On Tue, Sep 20, 2016 at 03:57:19AM -0600, Jan Beulich wrote: > >>> On 20.09.16 at 11:45, wrote: > > On Mon, Sep 19, 2016 at 09:17:50AM -0600, Jan Beulich wrote: > >> >>> On 19.09.16 at 17:04, wrote: > >> > On Mon, Sep 19, 2016 at 06:12:35AM -0600, Jan Beulich wrote: > >> >> >>> On 12.09.16 at 22:

Re: [Xen-devel] [PATCH v6 10/15] x86/boot: implement early command line parser in C

2016-09-20 Thread Daniel Kiper
On Tue, Sep 20, 2016 at 04:05:12AM -0600, Jan Beulich wrote: > >>> On 20.09.16 at 11:49, wrote: > > Out of curiosity, could you outline in a few words your idea? > > Well, one approach would be something along the lines of > the public headers errno.h and cpufeatureset.h: Have a helper > header in

Re: [Xen-devel] [PATCH v6 01/15] x86: properly calculate ELF end of image address

2016-09-20 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 08:52:02AM -0600, Jan Beulich wrote: > >>> On 19.09.16 at 15:56, wrote: > > On Mon, Sep 19, 2016 at 05:14:07AM -0600, Jan Beulich wrote: > >> >>> On 16.09.16 at 22:43, wrote: > >> > On Mon, Sep 12, 2016 at 10:18:16PM +0200,

Re: [Xen-devel] Fixes for low memory allocation machinery in early boot code

2016-09-20 Thread Daniel Kiper
On Fri, Sep 16, 2016 at 06:15:10AM -0600, Jan Beulich wrote: > >>> On 14.09.16 at 10:23, wrote: > > Starting from the beginning it looks that there are "soft" limits enforced > > in BIOS early boot code looking for usable low memory region. Hight limit > > is set at 640 KiB and low at 256 KiB. Thi

Re: [Xen-devel] [PATCH v6 01/15] x86: properly calculate ELF end of image address

2016-09-20 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 08:52:02AM -0600, Jan Beulich wrote: > >>> On 19.09.16 at 15:56, wrote: > > On Mon, Sep 19, 2016 at 05:14:07AM -0600, Jan Beulich wrote: [...] > >> So before taking this patch I'd really like to see proof that what gets > >> done currently does actually go wrong in at lea

Re: [Xen-devel] Fixes for low memory allocation machinery in early boot code

2016-09-20 Thread Daniel Kiper
On Tue, Sep 20, 2016 at 07:23:06AM -0600, Jan Beulich wrote: > >>> On 20.09.16 at 14:11, wrote: > > On Fri, Sep 16, 2016 at 06:15:10AM -0600, Jan Beulich wrote: > >> >>> On 14.09.16 at 10:23, wrote: > >> > Additionally, my investigation has shown that there are no bound checks > >> > in > >> > l

Re: [Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-20 Thread Daniel Kiper
On Tue, Sep 20, 2016 at 07:46:56AM -0600, Jan Beulich wrote: > >>> On 20.09.16 at 12:52, wrote: > > On Tue, Sep 20, 2016 at 03:57:19AM -0600, Jan Beulich wrote: > >> >>> On 20.09.16 at 11:45, wrote: > >> > On Mon, Sep 19, 2016 at 09:17:50AM -0600, Jan Beulich wrote: > >> >> >>> On 19.09.16 at 17:

Re: [Xen-devel] [PATCH v6 04/15] x86: add multiboot2 protocol support

2016-09-21 Thread Daniel Kiper
On Mon, Sep 19, 2016 at 05:42:36AM -0600, Jan Beulich wrote: > >>> On 12.09.16 at 22:18, wrote: [...] > > +case MULTIBOOT2_TAG_TYPE_MODULE: > > +if ( mod_idx >= mbi_out->mods_count ) > > +break; > > + > > +mbi_out_mods[mod_idx].mod_start = get_mb2_

Re: [Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-22 Thread Daniel Kiper
On Wed, Sep 21, 2016 at 03:42:09AM -0600, Jan Beulich wrote: > >>> On 20.09.16 at 20:45, wrote: > > On Tue, Sep 20, 2016 at 07:46:56AM -0600, Jan Beulich wrote: > >> >>> On 20.09.16 at 12:52, wrote: [...] > >> > Do you suggest that I should move out of #ifndef CONFIG_ARM all ebmalloc > >> > st

Re: [Xen-devel] [PATCH v6 01/15] x86: properly calculate ELF end of image address

2016-09-22 Thread Daniel Kiper
On Wed, Sep 21, 2016 at 03:37:52AM -0600, Jan Beulich wrote: > >>> On 20.09.16 at 20:00, wrote: > > OK, I did some more tests and found out that after patch "efi: build > > xen.gz with EFI code" we have following xen ELF file: > > > > Program Headers: > > Type Offset VirtAddr PhysA

Re: [Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-22 Thread Daniel Kiper
On Thu, Sep 22, 2016 at 05:25:46AM -0600, Jan Beulich wrote: > >>> On 22.09.16 at 12:52, wrote: > > On Wed, Sep 21, 2016 at 03:42:09AM -0600, Jan Beulich wrote: > >> >>> On 20.09.16 at 20:45, wrote: > >> > On Tue, Sep 20, 2016 at 07:46:56AM -0600, Jan Beulich wrote: > >> >> >>> On 20.09.16 at 12:

Re: [Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-23 Thread Daniel Kiper
Hi Julien, On Thu, Sep 22, 2016 at 06:07:26PM +0100, Julien Grall wrote: [...] > >#ifndef CONFIG_ARM > >/* Whole x86 ebmalloc stuff. */ > >... > >#else > >void __init free_ebmalloc_unused_mem(void) > >{ > >} > >#endif > > > >and then call free_ebmalloc_unused_mem() from e.g. > >xen/arch/arm/setu

Re: [Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-23 Thread Daniel Kiper
On Fri, Sep 23, 2016 at 12:07:14PM +0100, Julien Grall wrote: > On 23/09/16 11:50, Daniel Kiper wrote: > >Hi Julien, > > Hi Daniel, > > > > >On Thu, Sep 22, 2016 at 06:07:26PM +0100, Julien Grall wrote: > > > >[...] > > > >

Re: [Xen-devel] [PATCH v6 08/15] x86/efi: create new early memory allocator

2016-09-23 Thread Daniel Kiper
On Fri, Sep 23, 2016 at 12:42:10PM +0100, Julien Grall wrote: > > > On 23/09/16 12:35, Daniel Kiper wrote: > >On Fri, Sep 23, 2016 at 12:07:14PM +0100, Julien Grall wrote: > >>On 23/09/16 11:50, Daniel Kiper wrote: > >>>Hi Julien, > >> > >>Hi

[Xen-devel] [PATCH v7 04/14] efi: create efi_enabled()

2016-09-23 Thread Daniel Kiper
EFI_BOOT, EFI_LOADER and EFI_RS features. EFI_BOOT is equal to old efi_enabled == 1. EFI_RS ease control on runtime services usage. EFI_LOADER tells that Xen was loaded directly from EFI as PE executable. Suggested-by: Jan Beulich Signed-off-by: Daniel Kiper Reviewed-by: Jan Beulich --- v7

[Xen-devel] [PATCH v7 05/14] x86: allow EFI reboot method neither on EFI platforms...

2016-09-23 Thread Daniel Kiper
..nor EFI platforms with runtime services enabled. Suggested-by: Jan Beulich Signed-off-by: Daniel Kiper Acked-by: Jan Beulich --- v6 - suggestions/fixes: - move this commit behind "efi: create efi_enabled()" commit (suggested by Jan Beulich). v5 - suggestions/fixes: -

[Xen-devel] [PATCH v7 13/14] x86/boot: rename sym_phys() to sym_offs()

2016-09-23 Thread Daniel Kiper
This way macro name better describes its function. There is no functional change. Suggested-by: Jan Beulich Signed-off-by: Daniel Kiper --- xen/arch/x86/boot/head.S | 40 xen/arch/x86/boot/trampoline.S |2 +- xen/arch/x86/boot/wakeup.S

[Xen-devel] [PATCH v7 02/14] x86: properly calculate xen ELF end of image address

2016-09-23 Thread Daniel Kiper
ecause there is no check which symbol address is used to calculate end of image address. So, let's fix it and take ELF end of image address by reading __end_of_image__ symbol address from nm output. This way xen ELF image build process is not prone to changes in order of nm output. Signed-off-by:

[Xen-devel] [PATCH v7 10/14] x86: change default load address from 1 MiB to 2 MiB

2016-09-23 Thread Daniel Kiper
fault load address from 1 MiB to 2 MiB. This way page table code will be nice and easy. Hence, there is a chance that it will be less error prone too... :-))) Signed-off-by: Daniel Kiper Acked-by: Jan Beulich --- v7 - suggestions/fixes: - minor cleanups (suggested by Jan Beulich). --- xen

[Xen-devel] [PATCH v7 01/14] x86: move xen ELF end of image to 16 MiB

2016-09-23 Thread Daniel Kiper
e. Then it (bootloader) would not be able to put in this place anything else because from its POV simply this memory region will be allocated and used. This patch does not change xen ELF file size. It changes memory size which should be allocated for the image during load. Signed-off-by: Daniel Kiper

[Xen-devel] [PATCH v7 08/14] x86: add multiboot2 protocol support for EFI platforms

2016-09-23 Thread Daniel Kiper
This way Xen can be loaded on EFI platforms using GRUB2 and other boot loaders which support multiboot2 protocol. Signed-off-by: Daniel Kiper Acked-by: Jan Beulich --- v7 - suggestions/fixes: - do not allocate twice memory for trampoline if we were loaded via multiboot2 protocol on EFI

[Xen-devel] [PATCH v7 11/14] x86/setup: use XEN_IMG_OFFSET instead of...

2016-09-23 Thread Daniel Kiper
..calculating its value during runtime. Signed-off-by: Daniel Kiper Acked-by: Jan Beulich --- xen/arch/x86/setup.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index f19af6e..ca1a97a 100644 --- a/xen/arch/x86/setup.c

[Xen-devel] [PATCH RFC v7 07/14] efi: create new early memory allocator

2016-09-23 Thread Daniel Kiper
ented because it is quite simple and requires limited number of changes, especially in __start_xen(). New allocator is quite generic and can be used on ARM platforms too. So, let's enable most of its machinery on them. Signed-off-by: Daniel Kiper --- v7 - suggestions/fixes: - enable most o

[Xen-devel] [PATCH v7 06/14] efi: build xen.gz with EFI code

2016-09-23 Thread Daniel Kiper
This way we will have one Xen binary which can be loaded by three boot protocols: EFI native loader, multiboot (v1) and multiboot2. Signed-off-by: Daniel Kiper Acked-by: Jan Beulich --- v6 - suggestions/fixes: - improve efi_enabled() checks in efi_runtime_call() (suggested by Jan Beu

[Xen-devel] [PATCH v7 12/14] x86: make Xen early boot code relocatable

2016-09-23 Thread Daniel Kiper
not always possible to properly and efficiently initialize %fs. Signed-off-by: Daniel Kiper --- v6 - suggestions/fixes: - leave static mapping of first 16 MiB in l2_identmap as is (suggested by Jan Beulich), - use xen_phys_start instead of xen_img_load_base_addr (suggested

[Xen-devel] [PATCH v7 09/14] x86/boot: implement early command line parser in C

2016-09-23 Thread Daniel Kiper
: Andrew Cooper Signed-off-by: Daniel Kiper --- v7 - suggestions/fixes: - add min() macro (suggested by Jan Beulich), - add padding to early_boot_opts_t in more standard way (suggested by Jan Beulich), - simplify defs.h dependencies (suggested by Jan Beulich). v6

[Xen-devel] [PATCH v7 00/14] x86: multiboot2 protocol support

2016-09-23 Thread Daniel Kiper
|2 +- xen/include/xen/efi.h |9 +- xen/include/xen/multiboot2.h | 182 34 files changed, 1522 insertions(+), 540 deletions(-) Daniel Kiper (14): x86: move xen ELF end of image to 16 MiB x86: properly calculate xen ELF end of

[Xen-devel] [PATCH v7 03/14] x86: add multiboot2 protocol support

2016-09-23 Thread Daniel Kiper
Add multiboot2 protocol support. Alter min memory limit handling as we now may not find it from either multiboot (v1) or multiboot2. This way we are laying the foundation for EFI + GRUB2 + Xen development. Signed-off-by: Daniel Kiper --- v7 - suggestions/fixes: - rename mbi_mbi/mbi2_mbi to

[Xen-devel] [PATCH v7 14/14] x86: add multiboot2 protocol support for relocatable images

2016-09-23 Thread Daniel Kiper
Add multiboot2 protocol support for relocatable images. Only GRUB2 with "multiboot2: Add support for relocatable images" patch understands that feature. Older multiboot protocol (regardless of version) compatible loaders ignore it and everything works as usual. Signed-off-by: Daniel Kip

Re: [Xen-devel] [PATCH v7 01/14] x86: move xen ELF end of image to 16 MiB

2016-09-26 Thread Daniel Kiper
On Mon, Sep 26, 2016 at 04:39:37AM -0600, Jan Beulich wrote: > >>> On 23.09.16 at 23:47, wrote: > > It seems that from xen ELF image POV _end symbol properly determine > > image end. However, taking into account that initial Xen image mapping > > covers 16 MiB it looks that it is not sufficient. C

Re: [Xen-devel] [PATCH v7 02/14] x86: properly calculate xen ELF end of image address

2016-09-26 Thread Daniel Kiper
On Mon, Sep 26, 2016 at 04:45:25AM -0600, Jan Beulich wrote: > >>> On 23.09.16 at 23:47, wrote: > > Currently xen ELF end of image address is calculated using first line from > > "nm -nr xen/xen-syms" output. However, sometimes it may contain random > > symbol address not related to the end of ima

Re: [Xen-devel] [PATCH v14 4/9] x86: add multiboot2 protocol support for EFI platforms

2017-02-08 Thread Daniel Kiper
On Mon, Feb 06, 2017 at 03:18:53AM -0700, Jan Beulich wrote: > >>> On 02.02.17 at 23:01, wrote: > > This way Xen can be loaded on EFI platforms using GRUB2 and > > other boot loaders which support multiboot2 protocol. > > > > Signed-off-by: Daniel Kiper

[Xen-devel] [PATCH v15 00/10] x86: multiboot2 protocol support

2017-02-14 Thread Daniel Kiper
+- xen/include/xen/config.h |1 + xen/include/xen/multiboot2.h | 182 ++ 20 files changed, 1103 insertions(+), 124 deletions(-) Daniel Kiper (10): x86: add "w" flag to .init.data section definition x86: add multiboot2 protocol support

[Xen-devel] [PATCH v15 04/10] efi: create new early memory allocator

2017-02-14 Thread Daniel Kiper
ented because it is quite simple and requires limited number of changes, especially in __start_xen(). New allocator is quite generic and can be used on ARM platforms too. Though it is not enabled on ARM yet due to lack of some prereq. List of them is placed before ebmalloc code. Signed-off-by: D

[Xen-devel] [PATCH v15 03/10] efi: build xen.gz with EFI code

2017-02-14 Thread Daniel Kiper
This way we will have one Xen binary which can be loaded by three boot protocols: EFI native loader, multiboot (v1) and multiboot2. Signed-off-by: Daniel Kiper Acked-by: Jan Beulich Reviewed-by: Doug Goldstein --- v14 - suggestions/fixes: - at least GNU Make 4.1 does not build efi/buildid.o

[Xen-devel] [PATCH v15 06/10] x86: change default load address from 1 MiB to 2 MiB

2017-02-14 Thread Daniel Kiper
fault load address from 1 MiB to 2 MiB. This way page table code will be nice and easy. Hence, there is a chance that it will be less error prone too... :-))) Additionally, drop first 2 MiB mapping from Xen image mapping. It is no longer needed. Signed-off-by: Daniel Kiper Reviewed-by: Jan Be

[Xen-devel] [PATCH v15 02/10] x86: add multiboot2 protocol support

2017-02-14 Thread Daniel Kiper
Add multiboot2 protocol support. Alter min memory limit handling as we now may not find it from either multiboot (v1) or multiboot2. This way we are laying the foundation for EFI + GRUB2 + Xen development. Signed-off-by: Daniel Kiper Reviewed-by: Jan Beulich Reviewed-by: Doug Goldstein

<    1   2   3   4   5   6   7   8   9   >