From patchwork Tue Jan 17 19:00:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9521783 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D6385601C3 for ; Tue, 17 Jan 2017 19:02:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE76328599 for ; Tue, 17 Jan 2017 19:02:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0262285A2; Tue, 17 Jan 2017 19:02:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C1B428599 for ; Tue, 17 Jan 2017 19:02:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTYzb-00009J-9b; Tue, 17 Jan 2017 19:00:27 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTYza-00009D-9b for xen-devel@lists.xen.org; Tue, 17 Jan 2017 19:00:26 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id A4/D4-12625-9C96E785; Tue, 17 Jan 2017 19:00:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLIsWRWlGSWpSXmKPExsXSO6nOVfdkZl2 EwaejLBZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa0bP7gtsBbfEKj58eMbUwLhEqIuRi0NIYCKT xK8XzewQzl9Gia/XtjBDOBsYJSY92cwI4XQzSuzauIG1i5ETyCmS+PfyKEsXIwcHi4CqxP5Zr iAmm4CJxJtVjiAVIgK6Es8WPGMDaWUWWMUo8bK/hwkkISyQKrG65SszSD2vgLlEzztGiInXGC Xeb1IGsXkFBCVOznzCAmIzC2hJ3Pj3kgmknFlAWmL5Pw6QMKeAhcTTmbfAWkUFlCX+Hr4HVi4 hYCjxeeNS5gmMQrOQTJqFZNIshEkLGJlXMWoUpxaVpRbpGhrrJRVlpmeU5CZm5ugaGhjr5aYW Fyemp+YkJhXrJefnbmIEBjMDEOxg3Lbd8xCjJAeTkihvx+PaCCG+pPyUyozE4oz4otKc1OJDj DIcHEoSvE0ZdRFCgkWp6akVaZk5wLiCSUtw8CiJ8KaApHmLCxJzizPTIVKnGBWlxHmFQBICII mM0jy4NlgsX2KUlRLmZQQ6RIinILUoN7MEVf4VozgHo5IwbzrIFJ7MvBK46a+AFjMBLb6uUw2 yuCQRISXVwOg0ZeKXXUbrti29/K3p5c4YyYb77yT6pApuNaXMzW56xBPtLfZm9kQlhkT/O1ty eIP+/Tgm7bxf7bK2vvL9fbMu+kxJjGmce1ZsRo3Kwoxyj+JPehfyqn2zxVT3XThR3CpyfPff2 LqJypr5svH794u+i4uQ6pjjea8+fH7f4yOTbuw7EcvJKa3EUpyRaKjFXFScCABwqJf24AIAAA == X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-10.tower-31.messagelabs.com!1484679623!80364702!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64246 invoked from network); 17 Jan 2017 19:00:24 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-10.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 17 Jan 2017 19:00:24 -0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v0HJ0CIh006116 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Jan 2017 19:00:12 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v0HJ0BjB022739 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Jan 2017 19:00:11 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v0HJ0AR8020464; Tue, 17 Jan 2017 19:00:10 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Jan 2017 11:00:10 -0800 Received: by char.us.oracle.com (Postfix, from userid 1000) id B7F646A0140; Tue, 17 Jan 2017 14:00:09 -0500 (EST) Date: Tue, 17 Jan 2017 14:00:09 -0500 From: Konrad Rzeszutek Wilk To: Andrew Cooper Message-ID: <20170117190009.GA16720@char.us.oracle.com> References: <1484571849-15298-1-git-send-email-andrew.cooper3@citrix.com> <20170117180543.GE12951@char.us.oracle.com> <32515ecc-270e-0b5c-490e-ad57e0f8f704@citrix.com> <20170117184254.GU12951@char.us.oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170117184254.GU12951@char.us.oracle.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Source-IP: userv0022.oracle.com [156.151.31.74] Cc: Julien Grall , Stefano Stabellini , Jan Beulich , Xen-devel Subject: Re: [Xen-devel] [PATCH] xen/common: Drop function calls for Xen compile/version information X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Jan 17, 2017 at 01:42:54PM -0500, Konrad Rzeszutek Wilk wrote: > On Tue, Jan 17, 2017 at 06:16:36PM +0000, Andrew Cooper wrote: > > On 17/01/17 18:05, Konrad Rzeszutek Wilk wrote: > > > On Mon, Jan 16, 2017 at 01:04:09PM +0000, Andrew Cooper wrote: > > >> The chageset/version/compile information is currently exported as a set of > > >> function calls into a separate translation unit, which is inefficient for all > > >> callers. > > >> > > >> Replace the function calls with externs pointing appropriately into .rodata, > > >> which allows all users to generate code referencing the data directly. > > >> > > >> No functional change, but causes smaller and more efficient compiled code. > > >> > > >> Signed-off-by: Andrew Cooper > > > Ah crud. That breaks the livepatch test-cases (they patch the xen_extra_version > > > function). > > > > Lucky I haven't pushed it then, (although the livepatch build seems to > > still work fine for me, despite this change.) > > make tests should fail. (which is not by built by default as requested by Jan - but the OSSTest test cases I am working would do this). > > > > > > Are there some other code that can be modified that is reported > > > by 'xl info' on which the test-cases can run (and reported easily?). > > > > Patch do_version() itself to return the same difference of information? > > Ugh. That is going to make the building of test-cases quite complex. > > I guess it can just do it and .. return only one value :-) As in something like this (not compile tested): That will make three of the test-patches work but not for the last one - the NOP one (which needs to patch the _whole_ function). Argh. Is this patch of yours that neccessary? Could at least some of the functions still exist? Like xen_minor_version() and xen_extra_verison() ? diff --git a/xen/arch/x86/test/xen_hello_world_func.c b/xen/arch/x86/test/xen_hello_world_func.c index 2e4af9c..3572600 100644 --- a/xen/arch/x86/test/xen_hello_world_func.c +++ b/xen/arch/x86/test/xen_hello_world_func.c @@ -10,7 +10,7 @@ static unsigned long *non_canonical_addr = (unsigned long *)0xdead000000000000ULL; /* Our replacement function for xen_extra_version. */ -const char *xen_hello_world(void) +const char *xen_version_hello_world(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) { unsigned long tmp; int rc; @@ -21,7 +21,19 @@ const char *xen_hello_world(void) rc = __get_user(tmp, non_canonical_addr); BUG_ON(rc != -EFAULT); - return "Hello World"; + if ( cmd == XENVER_extraversion ) + { + xen_extraversion_t extraversion = "Hello World"; + + if ( copy_to_guest(arg, extraversion, ARRAY_SIZE(extraversion)) ) + return -EFAULT; + return 0; + } + /* + * Can't return -EPERM as certain subversions can't deal with negative + * values. + */ + return 0; }