All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2 5/7] x86: relocate pvh_info
Date: Fri, 19 Jan 2018 16:29:31 +0000	[thread overview]
Message-ID: <20180119162931.3mcwyzqya6wb2r7h@MacBook-Pro-de-Roger.local> (raw)
In-Reply-To: <20180119153458.22535-6-wei.liu2@citrix.com>

On Fri, Jan 19, 2018 at 03:34:56PM +0000, Wei Liu wrote:
> diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
> index 48c7407c00..028ac19b96 100644
> --- a/xen/arch/x86/boot/build32.mk
> +++ b/xen/arch/x86/boot/build32.mk
> @@ -36,5 +36,8 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
>  cmdline.o: cmdline.c $(CMDLINE_DEPS)
>  
>  reloc.o: reloc.c $(RELOC_DEPS)
> +ifeq ($(CONFIG_PVH_GUEST),y)
> +reloc.o: CFLAGS += -DCONFIG_PVH_GUEST
> +endif

I would maybe do this above, where the rest of the CFLAGS are set.
Certainly setting -DCONFIG_PVH_GUEST shouldn't cause issues elsewhere.

CFLAGS-$(CONFIG_PVH_GUEST) += -DCONFIG_PVH_GUEST
CFLAGS += $(CFLAGS-y)

>  .PRECIOUS: %.bin %.lnk
> diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
> index 6abdc15446..05921a64a3 100644
> --- a/xen/arch/x86/boot/defs.h
> +++ b/xen/arch/x86/boot/defs.h
> @@ -51,6 +51,9 @@ typedef unsigned short u16;
>  typedef unsigned int u32;
>  typedef unsigned long long u64;
>  typedef unsigned int size_t;
> +typedef u8 uint8_t;
> +typedef u32 uint32_t;
> +typedef u64 uint64_t;

This this seems to be always expanding, maybe better to simply replace
the stdbool.h include above with types.h?

>  #define U16_MAX		((u16)(~0U))
>  #define UINT_MAX	(~0U)
> diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
> index 0f652cea11..614e53081e 100644
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -414,6 +414,7 @@ __pvh_start:
>  
>          /* Set trampoline_phys to use mfn 1 to avoid having a mapping at VA 0 */
>          movw    $0x1000, sym_esi(trampoline_phys)
> +        movl    $0x336ec578, %eax /* mov $XEN_HVM_START_MAGIC_VALUE, %eax */

Hm, if XEN_HVM_START_MAGIC_VALUE cannot be used I would rather prefer
to use (%ebx).

> -multiboot_info_t __stdcall *reloc(u32 mb_magic, u32 mbi_in, u32 trampoline)
> +void __stdcall *reloc(u32 magic, u32 in, u32 trampoline)
>  {
>      alloc = trampoline;
>  
> -    if ( mb_magic == MULTIBOOT2_BOOTLOADER_MAGIC )
> -        return mbi2_reloc(mbi_in);
> -    else
> -        return mbi_reloc(mbi_in);
> +    switch ( magic )
> +    {
> +    case MULTIBOOT_BOOTLOADER_MAGIC:
> +        return mbi_reloc(in);
> +    case MULTIBOOT2_BOOTLOADER_MAGIC:
> +        return mbi2_reloc(in);

Newline between non-fallthrough cases.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-01-19 16:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 15:34 [PATCH v2 0/7] Fixes and improvements to pvshim Wei Liu
2018-01-19 15:34 ` [PATCH v2 1/7] Update shim.config Wei Liu
2018-01-19 15:34 ` [PATCH v2 2/7] libxl: remove whitespaces introduced in 62982da926 Wei Liu
2018-01-19 15:34 ` [PATCH v2 3/7] x86/guest: clean up guest/xen.h Wei Liu
2018-01-19 15:55   ` Roger Pau Monné
2018-01-19 16:01   ` Jan Beulich
2018-01-19 15:34 ` [PATCH v2 4/7] x86/shim: use credit scheduler Wei Liu
2018-01-19 16:00   ` Roger Pau Monné
2018-01-22 15:30     ` Ian Jackson
2018-01-19 15:34 ` [PATCH v2 5/7] x86: relocate pvh_info Wei Liu
2018-01-19 16:29   ` Roger Pau Monné [this message]
2018-01-19 16:39     ` Wei Liu
2018-01-22 10:31       ` Jan Beulich
2018-01-22 12:35         ` Wei Liu
2018-01-22 12:44           ` Roger Pau Monné
2018-01-22 12:46             ` Wei Liu
2018-01-22 12:54           ` Jan Beulich
2018-01-22 12:10     ` Wei Liu
2018-01-19 15:34 ` [PATCH v2 6/7] Revert "x86/boot: Map more than the first 16MB" Wei Liu
2018-01-19 15:34 ` [PATCH v2 7/7] libxl: lower shim related message to level DEBUG Wei Liu

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=20180119162931.3mcwyzqya6wb2r7h@MacBook-Pro-de-Roger.local \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.