From patchwork Thu Jan 16 15:27:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 23273 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4EFEF203C4 for ; Thu, 16 Jan 2014 15:40:02 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id l109sf5617082yhq.5 for ; Thu, 16 Jan 2014 07:40:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id :mime-version:cc:subject:precedence:list-id:list-unsubscribe :list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=lVpzkNOcYZ8IeUn8clB0DjujOUmkZBKWOOB7eaX90mg=; b=gzIJ7hT1GXTwwBNqZ9phowjkpHPgX8gZOFR9dkM8XG1kPHSdgIDV6HBWhPhNeSNYKI iHwPmsAR6SRrBIwMf/wcmMZUIAryWMRtxrJfohFpyEXhEaElJFArkVOeipUaqT7+KJFc xjng31wnHFjPQt8yqTs2JZxWVq0/gQNUK7FObp3YhZ3T+bxeECQ+LBBPUsQ0OIjtYyqn tJN2cKIwxIuZOnMH2D3KyGYdGPuywDzBw72v+Lqq9yTQkLjuHip+dJzU/cBfVrUUgemx CUauyOSOUfpFFiSbwnDS9//y2RGjk2W32BQjOlgZ06vWs11Ouv4E6MYXJvMM4EhaWlCe Odag== X-Gm-Message-State: ALoCoQnrlP8sMFsmLZJnbL+WpkoF2dy3quULoDIcNoXNldE7iwZJ/+9IkKMVoOtUh3x/bIHDHlxm X-Received: by 10.236.41.234 with SMTP id h70mr2861821yhb.42.1389886801341; Thu, 16 Jan 2014 07:40:01 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.88.68 with SMTP id be4ls932783qeb.46.gmail; Thu, 16 Jan 2014 07:40:01 -0800 (PST) X-Received: by 10.53.11.198 with SMTP id ek6mr2496178vdd.24.1389886801257; Thu, 16 Jan 2014 07:40:01 -0800 (PST) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id qi8si3523000vec.31.2014.01.16.07.40.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jan 2014 07:40:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.53; Received: by mail-vb0-f53.google.com with SMTP id p17so1045903vbe.12 for ; Thu, 16 Jan 2014 07:40:01 -0800 (PST) X-Received: by 10.220.29.200 with SMTP id r8mr7181252vcc.9.1389886801152; Thu, 16 Jan 2014 07:40:01 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp356933ved; Thu, 16 Jan 2014 07:40:00 -0800 (PST) X-Received: by 10.221.30.14 with SMTP id sa14mr142599vcb.44.1389886800531; Thu, 16 Jan 2014 07:40:00 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id df13si3524076vec.34.2014.01.16.07.40.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 16 Jan 2014 07:40:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W3ora-0007up-9f; Thu, 16 Jan 2014 15:28:10 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W3orY-0007uk-UA for xen-devel@lists.xen.org; Thu, 16 Jan 2014 15:28:09 +0000 Received: from [85.158.137.68:57530] by server-10.bemta-3.messagelabs.com id 22/D5-23989-48AF7D25; Thu, 16 Jan 2014 15:28:04 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-16.tower-31.messagelabs.com!1389886082!8761771!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26178 invoked from network); 16 Jan 2014 15:28:03 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-16.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 16 Jan 2014 15:28:03 -0000 X-IronPort-AV: E=Sophos;i="4.95,668,1384300800"; d="scan'208";a="93511761" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 16 Jan 2014 15:28:01 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.2.342.4; Thu, 16 Jan 2014 10:28:01 -0500 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=marilith-n13.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1W3orQ-0005I0-4d; Thu, 16 Jan 2014 15:28:00 +0000 From: Ian Campbell To: Date: Thu, 16 Jan 2014 15:27:59 +0000 Message-ID: <1389886079-6855-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell , stefano.stabellini@eu.citrix.com, tim@xen.org, julien.grall@linaro.org, ian.jackson@eu.citrix.com, george.dunlap@citrix.com Subject: [Xen-devel] [PATCH] tools: libxl: do not set the PoD target on ARM X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: ARM does not implemented PoD and so returns ENOSYS from XENMEM_set_pod_target. The correct solution here would be to check for ENOSYS in libxl, unfortunately xc_domain_set_pod_target suffers from the same broken error reporting as the rest of libxc and throws away the errno. So for now conditionally define xc_domain_set_pod_target to return success (which is what PoD does if nothing needs doing). xc_domain_get_pod_target sets errno==-1 and returns -1, which matches the broken error reporting of the existing function. It appears to have no in tree callers in any case. The conditional should be removed once libxc has been fixed. This makes ballooning (xl mem-set) work for ARM domains. Signed-off-by: Ian Campbell Cc: george.dunlap@citrix.com --- I'd be generally wary of modifying the error handling in a piecemeal way, but certainly doing so for 4.4 now would be inapropriate. IIRC Ian J was planning a thorough sweep of the libxc error paths in 4.5 time frame, at which point this conditional stuff could be dropped. In terms of the 4.4 release, obviously ballooning would be very nice to have for ARM guests, on the other hand I'm aware that while the patch is fairly small/contained and safe it is also pretty skanky and likely wouldn't be accepted outside of the rc period. --- tools/libxc/xc_domain.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index c2fdd74..e1d1bec 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -986,6 +986,12 @@ out: return rc; } +/* Currently only implemented on x86. This cannot be handled in the + * caller, e.g. by looking for errno==ENOSYS because of the broken + * error reporting style. Once this is fixed then this condition can + * be removed. + */ +#if defined(__i386__)||defined(__x86_64__) static int xc_domain_pod_target(xc_interface *xch, int op, uint32_t domid, @@ -1055,6 +1061,28 @@ int xc_domain_get_pod_target(xc_interface *xch, pod_cache_pages, pod_entries); } +#else +int xc_domain_set_pod_target(xc_interface *xch, + uint32_t domid, + uint64_t target_pages, + uint64_t *tot_pages, + uint64_t *pod_cache_pages, + uint64_t *pod_entries) +{ + return 0; +} +int xc_domain_get_pod_target(xc_interface *xch, + uint32_t domid, + uint64_t *tot_pages, + uint64_t *pod_cache_pages, + uint64_t *pod_entries) +{ + /* On x86 (above) xc_domain_pod_target will incorrectly return -1 + * with errno==-1 on error. Do the same for least surprise. */ + errno = -1; + return -1; +} +#endif int xc_domain_max_vcpus(xc_interface *xch, uint32_t domid, unsigned int max) {