From patchwork Thu Sep 29 01:19:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 77113 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp79914qgf; Wed, 28 Sep 2016 18:22:20 -0700 (PDT) X-Received: by 10.107.168.195 with SMTP id e64mr140711ioj.205.1475112140856; Wed, 28 Sep 2016 18:22:20 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id k2si22991126ith.19.2016.09.28.18.22.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Sep 2016 18:22:20 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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; dmarc=fail (p=NONE dis=NONE) header.from=linaro.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 1bpQ10-0001jI-65; Thu, 29 Sep 2016 01:19:58 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpQ0y-0001gi-MQ for xen-devel@lists.xen.org; Thu, 29 Sep 2016 01:19:56 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 10/72-01957-C3C6CE75; Thu, 29 Sep 2016 01:19:56 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsVyMfTABl3rnDf hBu29khZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aWXy3sBTf5K9oPrmZvYHzO3cXIxSEkMJFR ovvQC8YuRk4OFoF5zBKb/8aCJCQE+lklnr85zAySkBCIkfj1ahcThF0lsW7fVbAGIQE1iWWHF zJD2E1MEt1nNEBsNgEdiReTdrKB2CIC0hLXPl9mBBnKLHCEUeLW/JNgDcICwRJTrp+H2qwq8e POXLAFvAI2Ep1PTzJCLNOUmD7rNVg9J1D8Q8svqGXWEsu+bWaZwCiwgJFhFaNGcWpRWWqRrpG hXlJRZnpGSW5iZo6uoYGpXm5qcXFiempOYlKxXnJ+7iZGYGjVMzAw7mC8O9nvEKMkB5OSKC+n z5twIb6k/JTKjMTijPii0pzU4kOMMhwcShK8V7KAcoJFqempFWmZOcAgh0lLcPAoifC+AknzF hck5hZnpkOkTjEac2z5fW0tE8e2qffWMgmx5OXnpUqJ814FKRUAKc0ozYMbBIu+S4yyUsK8jA wMDEI8BalFuZklqPKvGMU5GJWEeV+DTOHJzCuB2/cK6BQmoFOWnngBckpJIkJKqoGx/N1vsy0 JdknFLzRfP7MXW7n3NdPzaY9XHxJ223jXRYZh8eu/jX5rxfZPufTALcK0IS/peKTk8ge6Dm7T H8YKOQndUDbpUhNdHx6yw+7ImklJokdvCX9tCfea4C54+3PWg+hj1+02p/FuuJz+7q+ur7Wn8 r/9z+dvvDTt+INvXvu/zeXLvMN/QImlOCPRUIu5qDgRAB6gKIy5AgAA X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-9.tower-206.messagelabs.com!1475111994!62227900!1 X-Originating-IP: [209.85.192.176] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 52909 invoked from network); 29 Sep 2016 01:19:55 -0000 Received: from mail-pf0-f176.google.com (HELO mail-pf0-f176.google.com) (209.85.192.176) by server-9.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 29 Sep 2016 01:19:55 -0000 Received: by mail-pf0-f176.google.com with SMTP id q2so22844716pfj.3 for ; Wed, 28 Sep 2016 18:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MTwmgoIqINo3FeB94tMlnHtt6dDkA2tdljkNQ9vm8SY=; b=Gm1oyK250nD7kzuObwgZAr52P5wB4T2IdJqNcJPWbsc8OAfYQvk9Pvc4K/3ggplcJa GQs9n23YGVntOGtnfd4zwunUAYjTsfGvHBzJlfat1cTS5+p/UYmx77v79N97c0qOT9qz f3mhfvhTwrJ0mT/IwBGb//aouMrHfS/rrSzyM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MTwmgoIqINo3FeB94tMlnHtt6dDkA2tdljkNQ9vm8SY=; b=WNr75IwR3adXcbqYVIvDpV3mkRsbDG8HaEFK8uX+dxmGH9w3I3rNwXl9sGoYU9RPDa p12QNgBOIzpY85nYYTMiEhJ7/DkJueniwnQTq2mN47Qhq962eKMw/30JoftljoB7OXYO PbpZX5youGZ4v1UzKKeb4iEfcH+NusjUupxNdtOU7uZ1ff/d6lga7mQsEUpPrXYvDk3O yC5uJRKqbkcwCEa5bCKBRlfXOWc7kdf6ef0256LFWz4y1UxhJr1VZYRWn1PErVKudKPP dhOzjWXZcK3t41Q7Fptjc6jomuZmgsZ+8qKncjyjt/TUytVkwfTZswNl7dWJa+BsW5eW Zcqg== X-Gm-Message-State: AE9vXwMRWS77EFnb5OU5nn9v4UxyMv/un9Me8UYn42RvjNvnrHUOV8XFweNan5/wT48xw9CI X-Received: by 10.98.158.90 with SMTP id s87mr61182867pfd.117.1475111993540; Wed, 28 Sep 2016 18:19:53 -0700 (PDT) Received: from HZA160860128-A.china.huawei.com ([67.238.99.186]) by smtp.gmail.com with ESMTPSA id wd7sm15228744pab.2.2016.09.28.18.19.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Sep 2016 18:19:52 -0700 (PDT) From: Shannon Zhao To: xen-devel@lists.xen.org Date: Wed, 28 Sep 2016 18:19:01 -0700 Message-Id: <20160929011902.7784-16-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.10.0.windows.1 In-Reply-To: <20160929011902.7784-1-shannon.zhao@linaro.org> References: <20160929011902.7784-1-shannon.zhao@linaro.org> Cc: sstabellini@kernel.org, wei.liu2@citrix.com, ian.jackson@eu.citrix.com, julien.grall@arm.com, Shannon Zhao , zhaoshenglong@huawei.com, boris.ostrovsky@oracle.com Subject: [Xen-devel] [PATCH v8 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" 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 Acked-by: Wei Liu --- 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 376307e..5f5ff03 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); \