diff mbox

[PATCHv1,5/5] x86/domctl: Add XEN_DOMCTL_PARAM_ARCH_X86_FIP_WIDTH parameter

Message ID 1455821530-4263-6-git-send-email-david.vrabel@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Vrabel Feb. 18, 2016, 6:52 p.m. UTC
Add a parameter to allow the toolstack to set the x87 FIP width in case
the hypervisor's heuristics do the wrong thing.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/arch/x86/domctl.c       | 10 ++++++++++
 xen/include/public/domctl.h |  1 +
 2 files changed, 11 insertions(+)

Comments

David Vrabel Feb. 19, 2016, 10:05 a.m. UTC | #1
On 18/02/16 18:52, David Vrabel wrote:
> Add a parameter to allow the toolstack to set the x87 FIP width in case
> the hypervisor's heuristics do the wrong thing.

I think this would be better as a HVM param since: a) it only needs to
be changed for HVM guests; b) it would allow the guest agent or OS
(which may be able to make a better decision) to set it; and c) it can
be saved/restored across a migrate.

David

> 
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
>  xen/arch/x86/domctl.c       | 10 ++++++++++
>  xen/include/public/domctl.h |  1 +
>  2 files changed, 11 insertions(+)
> 
> diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
> index 3a3ebbf..f75cd69 100644
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -1415,6 +1415,16 @@ int arch_domctl_param(struct domain *d, uint32_t param, bool_t set,
>  
>      switch ( param )
>      {
> +    case XEN_DOMCTL_PARAM_ARCH_X86_FIP_WIDTH:
> +        *value = d->arch.x87_fip_width;
> +        if ( set )
> +        {
> +            if ( new_value != 0 && new_value != 4 && new_value != 8 )
> +                return -EINVAL;
> +            d->arch.x87_fip_width = new_value;
> +        }
> +        break;
> +
>      default:
>          return -EINVAL;
>      }
> diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
> index 330b3e7..26d4096 100644
> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -1100,6 +1100,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cat_op_t);
>   *
>   * Not all parameters are valid for all architectures or domain types.
>   */
> +#define XEN_DOMCTL_PARAM_ARCH_X86_FIP_WIDTH 0
>  #define XEN_DOMCTL_PARAM_SET (1u << 31)
>  
>  struct xen_domctl_param {
>
Jan Beulich Feb. 19, 2016, 2:13 p.m. UTC | #2
>>> On 19.02.16 at 11:05, <david.vrabel@citrix.com> wrote:
> On 18/02/16 18:52, David Vrabel wrote:
>> Add a parameter to allow the toolstack to set the x87 FIP width in case
>> the hypervisor's heuristics do the wrong thing.
> 
> I think this would be better as a HVM param since: a) it only needs to
> be changed for HVM guests; b) it would allow the guest agent or OS
> (which may be able to make a better decision) to set it; and c) it can
> be saved/restored across a migrate.

I had wondered namely about a) when seeing patch 1, and I agree
with all of the points made (thus eliminating patches 1 and 2).

Jan
diff mbox

Patch

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 3a3ebbf..f75cd69 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1415,6 +1415,16 @@  int arch_domctl_param(struct domain *d, uint32_t param, bool_t set,
 
     switch ( param )
     {
+    case XEN_DOMCTL_PARAM_ARCH_X86_FIP_WIDTH:
+        *value = d->arch.x87_fip_width;
+        if ( set )
+        {
+            if ( new_value != 0 && new_value != 4 && new_value != 8 )
+                return -EINVAL;
+            d->arch.x87_fip_width = new_value;
+        }
+        break;
+
     default:
         return -EINVAL;
     }
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 330b3e7..26d4096 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1100,6 +1100,7 @@  DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cat_op_t);
  *
  * Not all parameters are valid for all architectures or domain types.
  */
+#define XEN_DOMCTL_PARAM_ARCH_X86_FIP_WIDTH 0
 #define XEN_DOMCTL_PARAM_SET (1u << 31)
 
 struct xen_domctl_param {