diff mbox

[v6,19/22] hvm/params: Add a new delivery type for event-channel in HVM_PARAM_CALLBACK_IRQ

Message ID 1458207668-12012-20-git-send-email-zhaoshenglong@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shannon Zhao March 17, 2016, 9:41 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

This new delivery type which is for ARM shares the same value with
HVM_PARAM_CALLBACK_TYPE_VECTOR which is for x86.

val[15:8] is flag: val[7:0] is a PPI.
To the flag, bit 8 stands the interrupt mode is edge(1) or level(0) and
bit 9 stands the interrupt polarity is active low(1) or high(0).

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
v6: share the value with HVM_PARAM_CALLBACK_TYPE_VECTOR
---
 xen/include/public/hvm/params.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Jan Beulich March 17, 2016, 10:42 a.m. UTC | #1
>>> On 17.03.16 at 10:41, <zhaoshenglong@huawei.com> 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/).

Jan
Shannon Zhao March 17, 2016, 11:04 a.m. UTC | #2
On 2016/3/17 18:42, Jan Beulich wrote:
>>>> On 17.03.16 at 10:41, <zhaoshenglong@huawei.com> 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__)

Thanks,
Jan Beulich March 17, 2016, 11:29 a.m. UTC | #3
>>> On 17.03.16 at 12:04, <zhaoshenglong@huawei.com> wrote:
> On 2016/3/17 18:42, Jan Beulich wrote:
>>>>> On 17.03.16 at 10:41, <zhaoshenglong@huawei.com> 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.

Jan
diff mbox

Patch

diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 73d4718..50f5a2f 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]
  */
 
+#ifndef CONFIG_ARM
 #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.
  */
+#else
+#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
 
 /*
  * These are not used by Xen. They are here for convenience of HVM-guest