All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xenpaging: add error code to indicate iommem passthrough
@ 2012-03-30 15:10 Olaf Hering
  2012-03-30 15:51 ` Tim Deegan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Olaf Hering @ 2012-03-30 15:10 UTC (permalink / raw)
  To: xen-devel; +Cc: Tim Deegan

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1333120147 -7200
# Node ID 34d9828185501f6e7ea2c3c2a397176a8e54ef0a
# Parent  80653c8ea1d19dfe6130396bbc77f766eb9f9fab
xenpaging: add error code to indicate iommem passthrough

Similar to the existing ENODEV and EXDEV error codes, add EMDEV to
indicate that iommu passthrough is not compatible with paging.
All error codes are just made-up return codes to give proper error
messages in the pager.

Also update the HAP related error message now that paging is enabled
also on AMD hosts.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r 80653c8ea1d1 -r 34d982818550 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -378,7 +378,10 @@ static struct xenpaging *xenpaging_init(
                 ERROR("xenpaging is (or was) active on this domain");
                 break;
             case ENODEV:
-                ERROR("EPT not supported for this guest");
+                ERROR("xenpaging requires Hardware Assisted Paging");
+                break;
+            case EMLINK:
+                ERROR("xenpaging not supported while iommu passthrough is enabled");
                 break;
             case EXDEV:
                 ERROR("xenpaging not supported in a PoD guest");
diff -r 80653c8ea1d1 -r 34d982818550 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -564,10 +564,11 @@ int mem_event_domctl(struct domain *d, x
                 break;
 
             /* No paging if iommu is used */
-            rc = -EXDEV;
+            rc = -EMLINK;
             if ( unlikely(need_iommu(d)) )
                 break;
 
+            rc = -EXDEV;
             /* Disallow paging in a PoD guest */
             if ( p2m->pod.entry_count )
                 break;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xenpaging: add error code to indicate iommem passthrough
  2012-03-30 15:10 [PATCH] xenpaging: add error code to indicate iommem passthrough Olaf Hering
@ 2012-03-30 15:51 ` Tim Deegan
  2012-04-02 15:02 ` Ian Jackson
  2012-04-05 10:08 ` Tim Deegan
  2 siblings, 0 replies; 4+ messages in thread
From: Tim Deegan @ 2012-03-30 15:51 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel

At 17:10 +0200 on 30 Mar (1333127445), Olaf Hering wrote:
> # HG changeset patch
> # User Olaf Hering <olaf@aepfle.de>
> # Date 1333120147 -7200
> # Node ID 34d9828185501f6e7ea2c3c2a397176a8e54ef0a
> # Parent  80653c8ea1d19dfe6130396bbc77f766eb9f9fab
> xenpaging: add error code to indicate iommem passthrough
> 
> Similar to the existing ENODEV and EXDEV error codes, add EMDEV to
> indicate that iommu passthrough is not compatible with paging.
> All error codes are just made-up return codes to give proper error
> messages in the pager.
> 
> Also update the HAP related error message now that paging is enabled
> also on AMD hosts.

I believe what I said was: 

] I'll take a patch to change the return code if it also documents it in
] the hypercall interface. :)

This adds another funny errno and doesn't document anything!

Just to be clear: if you want to use these ERRNO values with something
other than their usual meaning, then please add some comments in
xen/include/public/domctl.h to describe what's going on.

Cheers,

Tim.

> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> diff -r 80653c8ea1d1 -r 34d982818550 tools/xenpaging/xenpaging.c
> --- a/tools/xenpaging/xenpaging.c
> +++ b/tools/xenpaging/xenpaging.c
> @@ -378,7 +378,10 @@ static struct xenpaging *xenpaging_init(
>                  ERROR("xenpaging is (or was) active on this domain");
>                  break;
>              case ENODEV:
> -                ERROR("EPT not supported for this guest");
> +                ERROR("xenpaging requires Hardware Assisted Paging");
> +                break;
> +            case EMLINK:
> +                ERROR("xenpaging not supported while iommu passthrough is enabled");
>                  break;
>              case EXDEV:
>                  ERROR("xenpaging not supported in a PoD guest");
> diff -r 80653c8ea1d1 -r 34d982818550 xen/arch/x86/mm/mem_event.c
> --- a/xen/arch/x86/mm/mem_event.c
> +++ b/xen/arch/x86/mm/mem_event.c
> @@ -564,10 +564,11 @@ int mem_event_domctl(struct domain *d, x
>                  break;
>  
>              /* No paging if iommu is used */
> -            rc = -EXDEV;
> +            rc = -EMLINK;
>              if ( unlikely(need_iommu(d)) )
>                  break;
>  
> +            rc = -EXDEV;
>              /* Disallow paging in a PoD guest */
>              if ( p2m->pod.entry_count )
>                  break;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xenpaging: add error code to indicate iommem passthrough
  2012-03-30 15:10 [PATCH] xenpaging: add error code to indicate iommem passthrough Olaf Hering
  2012-03-30 15:51 ` Tim Deegan
@ 2012-04-02 15:02 ` Ian Jackson
  2012-04-05 10:08 ` Tim Deegan
  2 siblings, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2012-04-02 15:02 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel, Tim Deegan

Olaf Hering writes ("[Xen-devel] [PATCH] xenpaging: add error code to indicate iommem passthrough"):
> xenpaging: add error code to indicate iommem passthrough
> 
> Similar to the existing ENODEV and EXDEV error codes, add EMDEV to
> indicate that iommu passthrough is not compatible with paging.
> All error codes are just made-up return codes to give proper error
> messages in the pager.
> 
> Also update the HAP related error message now that paging is enabled
> also on AMD hosts.

The tools parts of this are fine.

Ian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xenpaging: add error code to indicate iommem passthrough
  2012-03-30 15:10 [PATCH] xenpaging: add error code to indicate iommem passthrough Olaf Hering
  2012-03-30 15:51 ` Tim Deegan
  2012-04-02 15:02 ` Ian Jackson
@ 2012-04-05 10:08 ` Tim Deegan
  2 siblings, 0 replies; 4+ messages in thread
From: Tim Deegan @ 2012-04-05 10:08 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel

At 17:10 +0200 on 30 Mar (1333127445), Olaf Hering wrote:
> xenpaging: add error code to indicate iommem passthrough
> 
> Similar to the existing ENODEV and EXDEV error codes, add EMDEV to
> indicate that iommu passthrough is not compatible with paging.
> All error codes are just made-up return codes to give proper error
> messages in the pager.
> 
> Also update the HAP related error message now that paging is enabled
> also on AMD hosts.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Applied, thanks.

Tim.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-05 10:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-30 15:10 [PATCH] xenpaging: add error code to indicate iommem passthrough Olaf Hering
2012-03-30 15:51 ` Tim Deegan
2012-04-02 15:02 ` Ian Jackson
2012-04-05 10:08 ` Tim Deegan

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.