From patchwork Fri Sep 2 02:55:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 75273 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp623857qga; Thu, 1 Sep 2016 19:59:04 -0700 (PDT) X-Received: by 10.36.198.197 with SMTP id j188mr1689865itg.78.1472785135137; Thu, 01 Sep 2016 19:58:55 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id g63si1955761ith.59.2016.09.01.19.58.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Sep 2016 19:58:55 -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 1bfefn-0007ie-Hb; Fri, 02 Sep 2016 02:57:43 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfefm-0007h5-0A for xen-devel@lists.xen.org; Fri, 02 Sep 2016 02:57:42 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 03/06-09160-5AAE8C75; Fri, 02 Sep 2016 02:57:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRWlGSWpSXmKPExsVSPpHPUXfpqxP hBudfi1os+biYxYHR4+ju30wBjFGsmXlJ+RUJrBnbdy9gLFguUvHq8z3WBsZGwS5GLg4hgTOM Eoufz2WDcHYzSnxrmsjcxcjJwSagK/Fx4xR2EFtEQFZiddccdpAiZoE1TBIbTneCFQkLREpce HaWBcRmEVCROPluOyuIzSvgKfH74D+wuISAhsTK3glgNidQ/O2qT2BDhQQ8JB6/esQEUS8ocX LmE7AaZgEJiYMvXjBD9CpKtK0/yQZhS0ocXHGDBeQICYFTjBI73n6HWmAqceDWIbYJjIKzkMy ahWTWAkamVYwaxalFZalFukZmeklFmekZJbmJmTm6hgbGermpxcWJ6ak5iUnFesn5uZsYgUFa z8DAuIOxYa/fIUZJDiYlUd78JyfChfiS8lMqMxKLM+KLSnNSiw8xynBwKEnw7ngJlBMsSk1Pr UjLzAHGC0xagoNHSYR3BUiat7ggMbc4Mx0idYpRUUqcNwckIQCSyCjNg2uDxeglRlkpYV5GBg YGIZ6C1KLczBJU+VeM4hyMSsK8rMCIF+LJzCuBm/4KaDET0OKSa8dBFpckIqSkGhhLs91jv7C 9Ks8rujBV6q9ze1mM1Pdz++f/3VCTvHX3+Sk/FZeWbr5aG20yrVPhlq3maVcu9x81PO8M+/Js FmctY0o7JPL9k4dph7+GrtPU6uj1DVU8fPel63ZeLnhhqJPPmiD0ISiDST6n9drbpv+5zpXnD pZPZf4x6wpPv/jVT6xqR3ubpZRYijMSDbWYi4oTAV/mXxLMAgAA X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1472785058!32220926!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1322 invoked from network); 2 Sep 2016 02:57:40 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-6.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 2 Sep 2016 02:57:40 -0000 Received: from 172.24.1.137 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.137]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DMN31494; Fri, 02 Sep 2016 10:56:24 +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; Fri, 2 Sep 2016 10:56:11 +0800 From: Shannon Zhao To: Date: Fri, 2 Sep 2016 10:55:37 +0800 Message-ID: <1472784939-14404-15-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1472784939-14404-1-git-send-email-zhaoshenglong@huawei.com> References: <1472784939-14404-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.0A020203.57C8EA58.01F3, 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: a21913a28928d0d5bdc9ece636d7255f Cc: sstabellini@kernel.org, wei.liu2@citrix.com, Andrew Cooper , ian.jackson@eu.citrix.com, peter.huangpeng@huawei.com, julien.grall@arm.com, shannon.zhao@linaro.org, Jan Beulich , boris.ostrovsky@oracle.com Subject: [Xen-devel] [PATCH v5 14/16] public/hvm/params.h: Add macros for HVM_PARAM_CALLBACK_TYPE_PPI 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 Add macros for HVM_PARAM_CALLBACK_TYPE_PPI operation values and update them in evtchn_fixup(). Also use HVM_PARAM_CALLBACK_IRQ_TYPE_SHIFT in hvm_set_callback_via(). Cc: Jan Beulich Cc: Andrew Cooper Signed-off-by: Shannon Zhao --- xen/arch/arm/domain_build.c | 8 +++++--- xen/arch/x86/hvm/irq.c | 2 +- xen/include/public/hvm/params.h | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 60db9e4..494115b 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -2019,9 +2019,11 @@ static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo) d->arch.evtchn_irq); /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ */ - val = (u64)HVM_PARAM_CALLBACK_TYPE_PPI << 56; - val |= (2 << 8); /* Active-low level-sensitive */ - val |= d->arch.evtchn_irq & 0xff; + val = (u64)HVM_PARAM_CALLBACK_TYPE_PPI << HVM_PARAM_CALLBACK_IRQ_TYPE_SHIFT; + /* Active-low level-sensitive */ + val |= (HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_LOW_LEVEL << + HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_SHIFT); + val |= d->arch.evtchn_irq; d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ] = val; /* diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c index 5323d7c..7c5836b 100644 --- a/xen/arch/x86/hvm/irq.c +++ b/xen/arch/x86/hvm/irq.c @@ -325,7 +325,7 @@ void hvm_set_callback_via(struct domain *d, uint64_t via) unsigned int gsi=0, pdev=0, pintx=0; uint8_t via_type; - via_type = (uint8_t)(via >> 56) + 1; + via_type = (uint8_t)(via >> HVM_PARAM_CALLBACK_IRQ_TYPE_SHIFT) + 1; if ( ((via_type == HVMIRQ_callback_gsi) && (via == 0)) || (via_type > HVMIRQ_callback_vector) ) via_type = HVMIRQ_callback_none; diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h index f7338a3..a161de1 100644 --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h @@ -30,6 +30,7 @@ */ #define HVM_PARAM_CALLBACK_IRQ 0 +#define HVM_PARAM_CALLBACK_IRQ_TYPE_SHIFT 56 /* * How should CPU0 event-channel notifications be delivered? * @@ -66,6 +67,8 @@ * This is only used by ARM/ARM64 and masking/eoi the interrupt associated to * the notification is handled by the interrupt controller. */ +#define HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_SHIFT 8 +#define HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_LOW_LEVEL 2 #endif /*