All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Meng Xu <xumengpanda@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: Question about the tools/misc/xen-hptool
Date: Fri, 17 Apr 2015 20:21:54 +0100	[thread overview]
Message-ID: <55315D52.90602@citrix.com> (raw)
In-Reply-To: <CAENZ-+kEZg_rD273pw+D1_C+dZUzWYM7Xgs3gnvXMsvDmP2R-Q@mail.gmail.com>

On 17/04/15 19:48, Meng Xu wrote:
> Hi,
>
> I'm trying to use the xen-hptool to make one memory page offline. I
> tried to search around to see how to use this tool but didn't find any
> manual/tutorial about it.

First off, let me say that I have never used this interface before, so
the rest of this email is somewhat guesswork.

>
> I had a look at the code of xen-hptool.c and tried the command
> 'xen-hptool mem-offline' but it does not work (probably because of
> incorrect system configuration IMO).  I really appreciate if anyone
> could guide me a little bit on how to use this tool. (Maybe a wiki
> page about how to use this tool will be beneficial?)
>
> I used the latest Xen code in staging branch of xen repository. I
> created a guest PV domain vm1 on Xen with credit scheduler.
>
> I first find on page of dom1 which is mfn=0x16c47a by using xen-mfndump tool.
> # xen-mfndump dump-p2m 1
>
>  --- Dumping P2M for domain 1 ---
>
>  Guest Width: 8, PT Levels: 4 P2M size: = 262144
>
> ...(omit the output of other pfn entries)
>
>   pfn=0x1a ==> mfn=0x16c47a (type 0x0)
>
> ...(omit the output of other pfn entries)
>
>
> I want to make mfn 0x16c47a offline, so I issue this following command:
>
> # xen-hptool mem-offline 0x16c47a
>
> Prepare to offline MEMORY mfn 16c47a
>
> DOM1: No suspend port, try live migration
>
> Failed to suspend guest 1 for mfn 16c47a
>
>
> I checked the output of 'xenstore-ls', and found that  dom1 does not
> set up the suspend channel.
>
> This is the part of output of xenstore-ls for dom1
>
> device = ""
>
>     suspend = ""
>
>      event-channel = ""
>
> I'm guessing this is the reason why xen-hptool mem-offline does not work.
>
>
> ===My question are:===
> 1) How should I set up the dom1 so that the xen-hptool mem-offline
> could work and solve this above issue? In other words, how should I
> configure the suspend event-channel for dom1?
> (I'm not so familiar with the event channel mechanism in Xen. Any
> advice/help on how to make this work is really appreciated.)

It is suspend/resume mechanism, and is strictly optional, according to
docs/misc/xenstore-paths.markdown.

>
> 2) Can I use the libxl_domain_suspend(ctx, domid, fd, 0, NULL) to
> suspend the domain instead of using the event channel?
>
> 3) Do I have to suspend the guest domain before making one page of the
> domain offline? Can I just pause the domain and make the page offline?

It would appear that the idea is to simulate a suspend without actually
doing a full suspend, so that when the guest resumes and rescans its
p2m, it notices the broken page.

This a) can only work for PV guests, and b) seems very silly.  A better
alternative would surely be to deliver a RAM MCE to the guest, which
would then also work for HVM guests.

~Andrew

      reply	other threads:[~2015-04-17 19:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 18:48 Question about the tools/misc/xen-hptool Meng Xu
2015-04-17 19:21 ` Andrew Cooper [this message]

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=55315D52.90602@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    --cc=xumengpanda@gmail.com \
    /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.