From patchwork Fri Mar 28 14:07:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 27291 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5E40620062 for ; Fri, 28 Mar 2014 14:09:56 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id fb1sf12274842pad.0 for ; Fri, 28 Mar 2014 07:09:55 -0700 (PDT) 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=ugrw6gSaJjmF3hyv8KeVjuP5OkWQeYW5Hwh7fSQKj3I=; b=HDLawxvIPZz/uaeq0gA1swSzTgDKaS/Yn7ImYbHYBTFvm2CKywYxPXRkX45jP5RS8x UH2PtZs7jgwJKHZIbNN8JNnr6Dm1EIbAouL2D/fLnEsVrJHKDPAwyrf/P5bpUOOQwzSN EqUcbnMUlYby7Xexx9kShs/WUFJouvF70IZP6H92Xf5B2PLzuLRbZ/tlqIMmvxdnmTem TXsh4PY1hiX/v6l2A6hydY5VNAlTUURU31AXCFEJjVS7jnfftORUeIY3Y86LUbuc5OVH TPxyB7r6HzLysbl72XEKg8++wvKlPIY8+Az6WRarRAScMu3VWQO7gIFdwbSBBXFYah/k zg+g== X-Gm-Message-State: ALoCoQkxoBuDZ1j/XdK9yVfkIrfkw3arQEnMZgrcxdWlVlt0uKgA902yk1pKLEEro01zbf8/DfZ/ X-Received: by 10.66.140.8 with SMTP id rc8mr2022325pab.41.1396015795605; Fri, 28 Mar 2014 07:09:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.234 with SMTP id 97ls1548218qgp.68.gmail; Fri, 28 Mar 2014 07:09:55 -0700 (PDT) X-Received: by 10.52.90.37 with SMTP id bt5mr6253798vdb.7.1396015795467; Fri, 28 Mar 2014 07:09:55 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id cn1si282323ved.157.2014.03.28.07.09.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 07:09:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so5841559veb.11 for ; Fri, 28 Mar 2014 07:09:55 -0700 (PDT) X-Received: by 10.52.119.197 with SMTP id kw5mr6128694vdb.5.1396015795384; Fri, 28 Mar 2014 07:09:55 -0700 (PDT) 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.220.12.8 with SMTP id v8csp11808vcv; Fri, 28 Mar 2014 07:09:55 -0700 (PDT) X-Received: by 10.58.122.164 with SMTP id lt4mr7390796veb.2.1396015795077; Fri, 28 Mar 2014 07:09:55 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id w10si1158751vck.104.2014.03.28.07.09.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 07:09:55 -0700 (PDT) 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 1WTXS6-0005VC-AS; Fri, 28 Mar 2014 14:08:10 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WTXS4-0005V5-EJ for xen-devel@lists.xen.org; Fri, 28 Mar 2014 14:08:08 +0000 Received: from [85.158.137.68:24230] by server-7.bemta-3.messagelabs.com id 9B/CE-04151-74285335; Fri, 28 Mar 2014 14:08:07 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1396015684!3596327!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.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16952 invoked from network); 28 Mar 2014 14:08:06 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 28 Mar 2014 14:08:06 -0000 X-IronPort-AV: E=Sophos;i="4.97,751,1389744000"; d="scan'208";a="115955026" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 28 Mar 2014 14:07:30 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Fri, 28 Mar 2014 10:07:30 -0400 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WTXRS-0004yI-3I; Fri, 28 Mar 2014 14:07:30 +0000 From: Ian Campbell To: Date: Fri, 28 Mar 2014 14:07:29 +0000 Message-ID: <1396015649-5886-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: keir@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com, George Dunlap , julien.grall@linaro.org, tim@xen.org, jbeulich@suse.com Subject: [Xen-devel] [PATCH] xen: arm: fully implement multicall interface. 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.128.180 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: I'm not sure what I was smoking at the time of 5d74ad1a082e "xen: arm: implement do_multicall_call for both 32 and 64-bit" but it is obviously insufficient since it doesn't actually wire up the hypercall. Before doing so we need to make the usual adjustments for ARM and turn the unsigned longs into xen_ulong_t. There is no difference in the resulting structure for x86. There are knock on changes to the trace interface, but again they are nops on x86. In the interests of clarity and always using explicitly sized types change the unsigned int in the hypercall arguments to a uint32_t. There is no actual change here on any platform. We should consider backporting this to 4.4.1 in case a guest decides they want to use a multicall in common code e.g. I suggested such a thing while reviewing a netback change recently. Signed-off-by: Ian Campbell Cc: keir@xen.org Cc: jbeulich@suse.com Cc: George Dunlap --- xen/arch/arm/traps.c | 1 + xen/common/multicall.c | 4 ++-- xen/common/trace.c | 2 +- xen/include/public/xen.h | 6 +++--- xen/include/xen/trace.h | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index ec43e65..ca315af 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -1011,6 +1011,7 @@ static arm_hypercall_t arm_hypercall_table[] = { HYPERCALL(sysctl, 2), HYPERCALL(hvm_op, 2), HYPERCALL(grant_table_op, 3), + HYPERCALL(multicall, 2), HYPERCALL_ARM(vcpu_op, 3), }; diff --git a/xen/common/multicall.c b/xen/common/multicall.c index e66c798..fa9d910 100644 --- a/xen/common/multicall.c +++ b/xen/common/multicall.c @@ -35,10 +35,10 @@ static void trace_multicall_call(multicall_entry_t *call) ret_t do_multicall( - XEN_GUEST_HANDLE_PARAM(multicall_entry_t) call_list, unsigned int nr_calls) + XEN_GUEST_HANDLE_PARAM(multicall_entry_t) call_list, uint32_t nr_calls) { struct mc_state *mcs = ¤t->mc_state; - unsigned int i; + uint32_t i; int rc = 0; if ( unlikely(__test_and_set_bit(_MCSF_in_multicall, &mcs->flags)) ) diff --git a/xen/common/trace.c b/xen/common/trace.c index 1814165..f651cf3 100644 --- a/xen/common/trace.c +++ b/xen/common/trace.c @@ -817,7 +817,7 @@ unlock: } void __trace_hypercall(uint32_t event, unsigned long op, - const unsigned long *args) + const xen_ulong_t *args) { struct __packed { uint32_t op; diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 8c5697e..5bba3af 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -541,13 +541,13 @@ DEFINE_XEN_GUEST_HANDLE(mmu_update_t); /* * ` enum neg_errnoval * ` HYPERVISOR_multicall(multicall_entry_t call_list[], - * ` unsigned int nr_calls); + * ` uint32_t nr_calls); * * NB. The fields are natural register size for this architecture. */ struct multicall_entry { - unsigned long op, result; - unsigned long args[6]; + xen_ulong_t op, result; + xen_ulong_t args[6]; }; typedef struct multicall_entry multicall_entry_t; DEFINE_XEN_GUEST_HANDLE(multicall_entry_t); diff --git a/xen/include/xen/trace.h b/xen/include/xen/trace.h index 3b8a7b3..12966ea 100644 --- a/xen/include/xen/trace.h +++ b/xen/include/xen/trace.h @@ -45,7 +45,7 @@ static inline void trace_var(u32 event, int cycles, int extra, } void __trace_hypercall(uint32_t event, unsigned long op, - const unsigned long *args); + const xen_ulong_t *args); /* Convenience macros for calling the trace function. */ #define TRACE_0D(_e) \