All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 1/2] guest/pvh: fix handling of multiboot info and module list
Date: Mon, 12 Nov 2018 05:40:21 -0700	[thread overview]
Message-ID: <5BE974B502000078001FAF6F@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <20181112114909.rovrjxp2ynrlgx2n@mac.citrite.net>

>>> On 12.11.18 at 12:49, <roger.pau@citrix.com> wrote:
> On Mon, Nov 12, 2018 at 03:28:37AM -0700, Jan Beulich wrote:
>> >>> On 09.11.18 at 18:22, <roger.pau@citrix.com> wrote:
>> >      for ( i = 0; i < pvh_info->nr_modules; i++ )
>> >      {
>> >          BUG_ON(entry[i].paddr >> 32);
>> >          BUG_ON(entry[i].cmdline_paddr >> 32);
>> >  
>> > -        mod[i].mod_start = entry[i].paddr;
>> > -        mod[i].mod_end   = entry[i].paddr + entry[i].size;
>> > -        mod[i].string    = entry[i].cmdline_paddr;
>> > +        pvh_mbi_mods[i].mod_start = entry[i].paddr;
>> > +        pvh_mbi_mods[i].mod_end   = entry[i].paddr + entry[i].size;
>> > +        pvh_mbi_mods[i].string    = entry[i].cmdline_paddr;
>> >      }
>> >  
>> >      BUG_ON(!pvh_info->rsdp_paddr);
>> >      rsdp_hint = pvh_info->rsdp_paddr;
>> > +
>> > +    *mbi = &pvh_mbi;
>> > +    *mod = pvh_mbi_mods;
>> 
>> And there are no __va() uses or alike getting added here (not that
>> it would make any sense for static variables, i.e. things sitting inside
>> the Xen image).
> 
> No, __va was currently used by __start_xen in order to get the virtual
> address of the module list (__va(mbi->mods_addr)), which becomes stale
> after relocating Xen itself because in the PVH case the mods_addrs
> points to a physical address in the .init section of the Xen image.

So aiui you refer to this hunk:

--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -719,12 +719,13 @@ void __init noreturn __start_xen(unsigned long mbi_p)
          */
         opt_console_xen = -1;
         ASSERT(mbi_p == 0);
-        mbi = pvh_init();
+        pvh_init(&mbi, &mod);
     }
     else
+    {
         mbi = __va(mbi_p);
-
-    mod = __va(mbi->mods_addr);
+        mod = __va(mbi->mods_addr);
+    }
 
     loader = (mbi->flags & MBI_LOADERNAME)
         ? (char *)__va(mbi->boot_loader_name) : "unknown";

Which indeed bypasses the passing through __va() for mods_addr,
but the last paragraph of the description suggests that you also
alter how mbi gets handled, which is perhaps part of my confusion.

>> > --- a/xen/include/asm-x86/guest/pvh-boot.h
>> > +++ b/xen/include/asm-x86/guest/pvh-boot.h
>> > @@ -25,17 +25,16 @@
>> >  
>> >  extern bool pvh_boot;
>> >  
>> > -multiboot_info_t *pvh_init(void);
>> > +void pvh_init(multiboot_info_t **mbi, module_t **mod);
>> >  void pvh_print_info(void);
>> >  
>> >  #else
>> >  
>> >  #define pvh_boot 0
>> >  
>> > -static inline multiboot_info_t *pvh_init(void)
>> > +static inline void *pvh_init(multiboot_info_t **mbi, module_t **mod)
>> >  {
>> >      ASSERT_UNREACHABLE();
>> > -    return NULL;
>> >  }
>> 
>> Please don't remove the return statement. Or wait - don't you
>> mean the function to return "void" rather than "void *"?
> 
> Yes, this is a mistake, please see v2 of this patch which is already
> on the list.

Oh, I see. I didn't even notice the v2 in the title - it being a standalone
1/2 patch, I thought this was a mailing artifact.  The more that it also
doesn't list what has changed in v2.

Jan



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

  reply	other threads:[~2018-11-12 12:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09 17:22 [PATCH 0/2] guest/pvh: fixes for idle memory scrubbing Roger Pau Monne
2018-11-09 17:22 ` [PATCH 1/2] guest/pvh: fix handling of multiboot info and module list Roger Pau Monne
2018-11-09 17:54   ` [PATCH v2 " Roger Pau Monne
2018-11-12 10:28   ` [PATCH " Jan Beulich
2018-11-12 11:49     ` Roger Pau Monné
2018-11-12 12:40       ` Jan Beulich [this message]
2018-11-12 15:00         ` Roger Pau Monné
2018-11-12 15:12           ` Jan Beulich
2018-11-12 15:17             ` Roger Pau Monné
2018-11-12 15:54           ` Wei Liu
2018-11-09 17:22 ` [PATCH 2/2] guest/pvh: special case the low 1MB Roger Pau Monne
2018-11-12 10:31   ` Jan Beulich
2018-11-12 15:54   ` 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=5BE974B502000078001FAF6F@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.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.