From patchwork Thu Mar 17 11:56:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8610331 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 42DB89F44D for ; Thu, 17 Mar 2016 11:59:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 674232034B for ; Thu, 17 Mar 2016 11:59:02 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78CE420279 for ; Thu, 17 Mar 2016 11:59:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agWXb-0000KK-DR; Thu, 17 Mar 2016 11:56:35 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agWXZ-0000K7-HE for xen-devel@lists.xen.org; Thu, 17 Mar 2016 11:56:33 +0000 Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id 27/19-16885-07B9AE65; Thu, 17 Mar 2016 11:56:32 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1458215788!29672308!1 X-Originating-IP: [119.145.14.66] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NiA9PiA4NTI3\n X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 32638 invoked from network); 17 Mar 2016 11:56:31 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 17 Mar 2016 11:56:31 -0000 Received: from 172.24.1.47 (EHLO szxeml422-hub.china.huawei.com) ([172.24.1.47]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BYG67182; Thu, 17 Mar 2016 19:56:25 +0800 (CST) Received: from [127.0.0.1] (10.177.16.142) by szxeml422-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.235.1; Thu, 17 Mar 2016 19:56:18 +0800 Message-ID: <56EA9B5E.9090203@huawei.com> Date: Thu, 17 Mar 2016 19:56:14 +0800 From: Shannon Zhao User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Jan Beulich References: <1458207668-12012-1-git-send-email-zhaoshenglong@huawei.com> <1458207668-12012-20-git-send-email-zhaoshenglong@huawei.com> <56EA983C02000078000DDB4E@prv-mh.provo.novell.com> <56EA8F38.1080800@huawei.com> <56EAA33702000078000DDC6D@prv-mh.provo.novell.com> In-Reply-To: <56EAA33702000078000DDC6D@prv-mh.provo.novell.com> X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.56EA9B6A.019A, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 4491d16e076c66d39c85d25e532cad4b Cc: Keir Fraser , Tim Deegan , Ian Jackson , peter.huangpeng@huawei.com, xen-devel@lists.xen.org, julien.grall@arm.com, stefano.stabellini@citrix.com, shannon.zhao@linaro.org Subject: Re: [Xen-devel] [PATCH v6 19/22] hvm/params: Add a new delivery type for event-channel in 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" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 2016/3/17 19:29, Jan Beulich wrote: >>>> On 17.03.16 at 12:04, wrote: >> On 2016/3/17 18:42, Jan Beulich wrote: >>>>>> On 17.03.16 at 10:41, wrote: >>>>> --- a/xen/include/public/hvm/params.h >>>>> +++ b/xen/include/public/hvm/params.h >>>>> @@ -49,11 +49,24 @@ >>>>> * Domain = val[47:32], Bus = val[31:16] DevFn = val[15:8], IntX = >> val[1:0] >>>>> */ >>>>> >>>>> +#ifndef CONFIG_ARM >>> This is a public header, so you can't rely on CONFIG_* values. >>> You should check compiler defined CPU architecture manifest >>> constants instead (and there are numerous examples throughout >>> public/). >> Oh, right, thanks. Will replace it with >> #if !defined(__arm__) && !defined (__aarch64__) > > Well, not exactly. You should use only positive checks here, > i.e. the x86 one wants to be framed by a respective x86 > conditional, and the ARM one wants to be framed by the > inverse of the above. > Like below: /* * These are not used by Xen. They are here for convenience of HVM-guest diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h index 73d4718..d03c103 100644 --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h @@ -49,11 +49,24 @@ * Domain = val[47:32], Bus = val[31:16] DevFn = val[15:8], IntX = val[1:0] */ +#if defined(__i386__) || defined(__x86_64__) #define HVM_PARAM_CALLBACK_TYPE_VECTOR 2 /* * val[7:0] is a vector number. Check for XENFEAT_hvm_callback_vector to know * if this delivery method is available. */ +#elif defined(__arm__) || defined (__aarch64__) +#define HVM_PARAM_CALLBACK_TYPE_PPI 2 +/* + * val[55:16] needs to be zero. + * val[15:8] is interrupt flag of the PPI used by event-channel: + * bit 8: the PPI is edge(1) or level(0) triggered + * bit 9: the PPI is active low(1) or high(0) + * val[7:0] is a PPI number used by event-channel. + * This is only used by ARM/ARM64 and masking/eoi the interrupt associated to + * the notification is handled by the interrupt controller. + */ +#endif