[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [v5][PATCH 10/16] tools: introduce some new parameters to set rdm policy



On Tue, Jul 07, 2015 at 02:17:11PM +0800, Tiejun Chen wrote:
> This patch introduces user configurable parameters to specify RDM
> resource and according policies,
> 
> Global RDM parameter:
>     rdm = "type=none/host,reserve=strict/relaxed"
> Per-device RDM parameter:
>     pci = [ 'sbdf, rdm_reserve=strict/relaxed' ]
> 
> Global RDM parameter, "type", allows user to specify reserved regions
> explicitly, e.g. using 'host' to include all reserved regions reported
> on this platform which is good to handle hotplug scenario. In the future
> this parameter may be further extended to allow specifying random regions,
> e.g. even those belonging to another platform as a preparation for live
> migration with passthrough devices. Instead, 'none' means we have nothing
> to do all reserved regions and ignore all policies, so guest work as before.
> 
> 'strict/relaxed' policy decides how to handle conflict when reserving RDM
> regions in pfn space. If conflict exists, 'strict' means an immediate error
> so VM can't keep running, while 'relaxed' allows moving forward with a
> warning message thrown out.
> 
> Default per-device RDM policy is 'strict', while default global RDM policy
> is 'relaxed'. And the per-device policy would override the global policy like
> others.
> 
> CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
> CC: Wei Liu <wei.liu2@xxxxxxxxxx>
> Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>
> ---
> v5:
> 
> * Just make sure the per-device plicy always override the global policy,
>   and so cleanup some associated comments and the patch head description.
> * A little change to follow one bit, XEN_DOMCTL_DEV_RDM_RELAXED.
> * Improve all descriptions in doc.
> * Make all rdm variables specific to .hvm
> 
> v4:
> 
> * No need to define init_val for libxl_rdm_reserve_type since its just zero
> * Grab those changes to xl/libxlu to as a final patch
> 
>  docs/man/xl.cfg.pod.5        | 84 
> ++++++++++++++++++++++++++++++++++++++++++++
>  docs/misc/vtd.txt            | 24 +++++++++++++
>  tools/libxl/libxl_create.c   |  7 ++++
>  tools/libxl/libxl_internal.h |  2 ++
>  tools/libxl/libxl_pci.c      |  9 +++++
>  tools/libxl/libxl_types.idl  | 18 ++++++++++
>  6 files changed, 144 insertions(+)
> 
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index a3e0e2e..a2dc343 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -655,6 +655,83 @@ assigned slave device.
>  
>  =back
>  
> +=item B<rdm="RDM_RESERVATION_STRING">
> +
> +(HVM/x86 only) Specifies information about Reserved Device Memory (RDM),
> +which is necessary to enable robust device passthrough. One example of RDM
> +is reported through ACPI Reserved Memory Region Reporting (RMRR) structure
> +on x86 platform.
> +
> +B<RDM_RESERVE_STRING> has the form C<[KEY=VALUE,KEY=VALUE,...> where:
> +
> +=over 4
> +
> +=item B<KEY=VALUE>
> +
> +Possible B<KEY>s are:
> +
> +=over 4
> +
> +=item B<type="STRING">
> +
> +Currently there are only two valid types:
> +
> +"host" means all reserved device memory on this platform should be checked to
> +reserve regions in this VM's guest address space. This global RDM parameter
> +allows user to specify reserved regions explicitly, and using "host" includes
> +all reserved regions reported on this platform, which is useful when doing
> +hotplug.
> +
> +"none" is the default value and it means we don't check any reserved regions
> +and then all rdm policies would be ignored. Guest just works as before and
> +the conflict of RDM and guest address space wouldn't be handled, and then
> +this may result in the associated device not being able to work or even crash
> +the VM. So if you're assigning this kind of device, this option is not
> +recommended unless you can make sure any conflict doesn't exist.
> +

One issue didn't come to conclusion during last round of review. Ian was
asking what's the difference with type=none vs not specifying rdm option
at all.

You need to either convince Ian or remove "type=none" in *xl* level.
I.e. don't touch the libxl IDL. It still needs a none type.

> +For example, you're trying to set "memory = 2800" to allocate memory to one
> +given VM but the platform owns two RDM regions like,
> +
> +RMRR region: base_addr ac6d3000 end_address ac6e6fff
> +RMRR region: base_addr ad800000 end_address afffffff
> +
> +In this conflict case,
> +
> +#1. If the type options is set with "none",
> +

If B<type> is set to "none", for example,

> +rdm = "type=none,reserve=strict" or rdm = "type=none,reserve=relaxed"
> +
> +mean we don't handle any conflict just to make VM keep running as before.
> +Note this is our default behavior.
> +

It means we don't handle any conflict to make VM run as before. This is
the default behavior.

> +#2. If the type options is set with "host",
> +

If B<type> is set to "host", for example,

> +rdm = "type=host,reserve=strict" or rdm = "type=host,reserve=relaxed"
> +
> +mean all conflict would be handled according to our policies which is
> +introduced by the reserve option as described below.
> +

It means all conflicts will be handled according to the policy
introduced by B<reserve> as described below.

> +=item B<reserve="STRING">
> +
> +Specifies how to deal with conflicts discovered when reserving reserved 
> device
> +memory in the guest address space.
> +

Specifies how to deal with conflicts when reserving reserved device
memory in guest address space.

> +When that conflict is unsolved,
> +
> +"strict" means this VM can't be created successfully, or the associated 
> device
> +can't be attached in the case of hotplug;
> +

"strict" means VM can't be created, or the associated device can't be
attached in the case of hotplug.

> +"relaxed" allows a VM to be created to keep running with a warning message
> +thrown out. But this may crash this VM if this device accesses RDM. For 
> example,
> +Windows IGD GFX driver always access these regions so this lead to a blue 
> screen
> +to crash VM in such a case.
> +

"relaxed" allows VM to be created but may cause VM to crash if
pass-through device accesses RDM. For exampl,e Windows IGD GFX driver
always accessed RDM regions so it leads to VM crash.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.