From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Jan Beulich <jbeulich@suse.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v2 for-4.6 1/3] xen/x86/libxl: replace non-POSIX error codes used by PSR code
Date: Wed, 22 Jul 2015 13:07:50 +0200 [thread overview]
Message-ID: <1437563272-14168-2-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1437563272-14168-1-git-send-email-roger.pau@citrix.com>
PSR was using EBADSLT and EUSERS which are not POSIX error codes, replace
them with ENOTSOCK and EOVERFLOW respectively.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes since v1:
- Use ENOTSOCK to replace EBADSLT instead of EINVAL.
---
tools/libxl/libxl_psr.c | 6 +++---
xen/arch/x86/psr.c | 8 ++++----
xen/include/public/errno.h | 1 +
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 2a07777..3378239 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -31,7 +31,7 @@ static void libxl__psr_log_err_msg(libxl__gc *gc, int err)
case ESRCH:
msg = "invalid domain ID";
break;
- case EBADSLT:
+ case ENOTSOCK:
msg = "socket is not supported";
break;
case EFAULT:
@@ -59,7 +59,7 @@ static void libxl__psr_cmt_log_err_msg(libxl__gc *gc, int err)
case ENOENT:
msg = "CMT is not attached to this domain";
break;
- case EUSERS:
+ case EOVERFLOW:
msg = "no free RMID available";
break;
default:
@@ -81,7 +81,7 @@ static void libxl__psr_cat_log_err_msg(libxl__gc *gc, int err)
case ENOENT:
msg = "CAT is not enabled on the socket";
break;
- case EUSERS:
+ case EOVERFLOW:
msg = "no free COS available";
break;
case EEXIST:
diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
index 861683f..19f714b 100644
--- a/xen/arch/x86/psr.c
+++ b/xen/arch/x86/psr.c
@@ -176,7 +176,7 @@ int psr_alloc_rmid(struct domain *d)
if ( rmid > psr_cmt->rmid_max )
{
d->arch.psr_rmid = 0;
- return -EUSERS;
+ return -EOVERFLOW;
}
d->arch.psr_rmid = rmid;
@@ -251,7 +251,7 @@ static struct psr_cat_socket_info *get_cat_socket_info(unsigned int socket)
return ERR_PTR(-ENODEV);
if ( socket >= nr_sockets )
- return ERR_PTR(-EBADSLT);
+ return ERR_PTR(-ENOTSOCK);
if ( !test_bit(socket, cat_socket_enable) )
return ERR_PTR(-ENOENT);
@@ -332,7 +332,7 @@ static int write_l3_cbm(unsigned int socket, unsigned int cos, uint64_t cbm)
unsigned int cpu = get_socket_cpu(socket);
if ( cpu >= nr_cpu_ids )
- return -EBADSLT;
+ return -ENOTSOCK;
on_selected_cpus(cpumask_of(cpu), do_write_l3_cbm, &info, 1);
}
@@ -381,7 +381,7 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm)
if ( !found )
{
spin_unlock(&info->cbm_lock);
- return -EUSERS;
+ return -EOVERFLOW;
}
cos = found - map;
diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h
index 9a7e411..50adcb9 100644
--- a/xen/include/public/errno.h
+++ b/xen/include/public/errno.h
@@ -65,6 +65,7 @@ XEN_ERRNO(EILSEQ, 84) /* Illegal byte sequence */
XEN_ERRNO(ERESTART, 85) /* Interrupted system call should be restarted */
#endif
XEN_ERRNO(EUSERS, 87) /* Too many users */
+XEN_ERRNO(ENOTSOCK, 88) /* Socket operation on non-socket */
XEN_ERRNO(EOPNOTSUPP, 95) /* Operation not supported on transport endpoint */
XEN_ERRNO(EADDRINUSE, 98) /* Address already in use */
XEN_ERRNO(EADDRNOTAVAIL, 99) /* Cannot assign requested address */
--
1.9.5 (Apple Git-50.3)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-07-22 11:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 11:07 [PATCH v2 for-4.6 0/3] Get rid of non-POSIX error codes Roger Pau Monne
2015-07-22 11:07 ` Roger Pau Monne [this message]
2015-07-22 12:40 ` [PATCH v2 for-4.6 1/3] xen/x86/libxl: replace non-POSIX error codes used by PSR code Wei Liu
2015-07-22 11:07 ` [PATCH v2 for-4.6 2/3] xen: replace non-POSIX error codes Roger Pau Monne
2015-07-22 11:12 ` George Dunlap
2015-07-22 12:00 ` Jan Beulich
2015-07-22 11:07 ` [PATCH v2 for-4.6 3/3] xen: remove " Roger Pau Monne
2015-07-22 14:16 ` Ian Campbell
2015-07-22 14:55 ` Jan Beulich
2015-07-22 12:02 ` [PATCH v2 for-4.6 0/3] Get rid of " Jan Beulich
2015-07-22 12:26 ` 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=1437563272-14168-2-git-send-email-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=stefano.stabellini@eu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).