From patchwork Thu Sep 22 12:52:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 76788 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp16165qgf; Thu, 22 Sep 2016 05:58:49 -0700 (PDT) X-Received: by 10.36.155.213 with SMTP id o204mr2501085itd.96.1474549129325; Thu, 22 Sep 2016 05:58:49 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id d74si1955015iod.26.2016.09.22.05.58.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Sep 2016 05:58:49 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bn3Yh-0005hn-9j; Thu, 22 Sep 2016 12:56:59 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bn3Yg-0005gy-2b for xen-devel@lists.xen.org; Thu, 22 Sep 2016 12:56:58 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id FB/AE-06162-915D3E75; Thu, 22 Sep 2016 12:56:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRWlGSWpSXmKPExsVi9XuGg67E1cf hBvdeq1os+biYxYHR4+ju30wBjFGsmXlJ+RUJrBkLzx5gK7jKX7Fu/XXmBsaH3F2MXBxCAqcY JbbtP8oC4exhlGhatpy1i5GTg01AS+L89B/sILaIgKzE6q457CBFzALXGSXuvN8GViQsECzx/ s08oAQHB4uAqsSrrSEgJq+Ap8SOv/ogFRICGhIreyewgNicQOEJR9aDdQoJeEisvLIQzOYVEJ Q4OfMJWA2zgITEwRcvmCF6FSXa1p9kg7AlJQ6uuAF2pwTI0St3LmGBSJhKLGrfwDSBUXAWklm zkMxawMi0ilGjOLWoLLVI18hIL6koMz2jJDcxM0fX0MBYLze1uDgxPTUnMalYLzk/dxMjMEDr GRgYdzBOPeF3iFGSg0lJlPdC/+NwIb6k/JTKjMTijPii0pzU4kOMMhwcShK8dy8D5QSLUtNTK 9Iyc4CxApOW4OBREuHVugKU5i0uSMwtzkyHSJ1iVJQS560D6RMASWSU5sG1weLzEqOslDAvIw MDgxBPQWpRbmYJqvwrRnEORiVh3mMgU3gy80rgpr8CWswEtHjLzwcgi0sSEVJSDYxz7pyN2d6 9KH1jheISpy2flM7InHszdfJJSUPGmK0f1n78PjPPe19JrdTdDftTL2Wa5cvbLrV6N///C58Z ZzZfdubuUDwjMyvBtfP+5MZPTIoJZ+4s5nf4usTol4X/tuX1/6J5Z9jNnJF+bq7Q7r0zq68+/ Bmy+vbhDWl7y46WrdB5fvSbSCDvPyWW4oxEQy3mouJEAFHsdHjKAgAA X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1474549010!54583748!1 X-Originating-IP: [58.251.152.64] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12657 invoked from network); 22 Sep 2016 12:56:55 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 22 Sep 2016 12:56:55 -0000 Received: from 172.24.1.36 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.36]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DRK49281; Thu, 22 Sep 2016 20:53:11 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.235.1; Thu, 22 Sep 2016 20:53:01 +0800 From: z00226004 To: Date: Thu, 22 Sep 2016 20:52:32 +0800 Message-ID: <1474548753-12596-16-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1474548753-12596-1-git-send-email-zhaoshenglong@huawei.com> References: <1474548753-12596-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.57E3D439.00CE, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: aeaac1e3b26b214c57d972f78f60714a Cc: sstabellini@kernel.org, wei.liu2@citrix.com, ian.jackson@eu.citrix.com, peter.huangpeng@huawei.com, julien.grall@arm.com, shannon.zhao@linaro.org, boris.ostrovsky@oracle.com Subject: [Xen-devel] [PATCH v6 15/16] libxl/arm: Initialize domain param HVM_PARAM_CALLBACK_IRQ 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" From: Shannon Zhao The guest kernel will get the event channel interrupt information via domain param HVM_PARAM_CALLBACK_IRQ. Initialize it here. Signed-off-by: Shannon Zhao Acked-by: Julien Grall --- tools/libxl/libxl_arm.c | 14 ++++++++++++++ tools/libxl/libxl_internal.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index 6f0bc70..913f401 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -900,8 +900,22 @@ int libxl__arch_domain_init_hw_description(libxl__gc *gc, struct xc_dom_image *dom) { int rc; + uint64_t val; assert(info->type == LIBXL_DOMAIN_TYPE_PV); + + /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ. */ + val = MASK_INSR(HVM_PARAM_CALLBACK_TYPE_PPI, + HVM_PARAM_CALLBACK_IRQ_TYPE_MASK); + /* Active-low level-sensitive */ + val |= MASK_INSR(HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_LOW_LEVEL, + HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_MASK); + val |= GUEST_EVTCHN_PPI; + rc = xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_CALLBACK_IRQ, + val); + if (rc) + return rc; + rc = libxl__prepare_dtb(gc, info, state, dom); if (rc) goto out; diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index f1ba473..cb6d9e0 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -128,6 +128,9 @@ #define ROUNDUP(_val, _order) \ (((unsigned long)(_val)+(1UL<<(_order))-1) & ~((1UL<<(_order))-1)) +#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m))) +#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m)) + #define min(X, Y) ({ \ const typeof (X) _x = (X); \ const typeof (Y) _y = (Y); \