Patchwork [6/6] kvm: Add documentation comment for kvm_irqchip_in_kernel()

login
register
mail settings
Submitter Peter Maydell
Date July 25, 2012, 1:24 p.m.
Message ID <1343222672-25312-7-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/173166/
State New
Headers show

Comments

Peter Maydell - July 25, 2012, 1:24 p.m.
Now we've cleared out the architecture-independent uses of
kvm_irqchip_in_kernel(), we can add a doc comment describing
what it means.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 kvm.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
Andreas Färber - July 25, 2012, 3:40 p.m.
Am 25.07.2012 15:24, schrieb Peter Maydell:
> Now we've cleared out the architecture-independent uses of
> kvm_irqchip_in_kernel(), we can add a doc comment describing
> what it means.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  kvm.h |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)

If you've cleared the arch-independent uses, can't it be moved out of
the generic kvm.h? Otherwise if just the commit message is confusing me:

> 
> diff --git a/kvm.h b/kvm.h
> index 1449795..ae9df2d 100644
> --- a/kvm.h
> +++ b/kvm.h
> @@ -30,6 +30,17 @@ extern bool kvm_msi_via_irqfd_allowed;
>  
>  #if defined CONFIG_KVM || !defined NEED_CPU_H
>  #define kvm_enabled()           (kvm_allowed)

Could we add a white line here...

> +/**
> + * kvm_irqchip_in_kernel:
> + *
> + * Returns: true if the user asked us to create an in-kernel
> + * irqchip via the "kernel_irqchip=on" machine option.
> + * What this actually means is architecture and machine model
> + * specific: on PC, for instance, it means that the LAPIC,
> + * IOAPIC and PIT are all in kernel. This function should never
> + * be used from generic target-independent code: use one of the
> + * following functions or some other specific check instead.
> + */
>  #define kvm_irqchip_in_kernel() (kvm_kernel_irqchip)

...and here, to better group the macros and their documentation?

Andreas

>  /**
>   * kvm_async_interrupt_injection:
>
Jan Kiszka - July 25, 2012, 4:47 p.m.
On 2012-07-25 17:40, Andreas Färber wrote:
> Am 25.07.2012 15:24, schrieb Peter Maydell:
>> Now we've cleared out the architecture-independent uses of
>> kvm_irqchip_in_kernel(), we can add a doc comment describing
>> what it means.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>>  kvm.h |   11 +++++++++++
>>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> If you've cleared the arch-independent uses, can't it be moved out of
> the generic kvm.h? Otherwise if just the commit message is confusing me:

kvm_irqchip_in_kernel is still a generic service as it probes a generic
property - that just has arch-dependent detail semantics.

Jan

Patch

diff --git a/kvm.h b/kvm.h
index 1449795..ae9df2d 100644
--- a/kvm.h
+++ b/kvm.h
@@ -30,6 +30,17 @@  extern bool kvm_msi_via_irqfd_allowed;
 
 #if defined CONFIG_KVM || !defined NEED_CPU_H
 #define kvm_enabled()           (kvm_allowed)
+/**
+ * kvm_irqchip_in_kernel:
+ *
+ * Returns: true if the user asked us to create an in-kernel
+ * irqchip via the "kernel_irqchip=on" machine option.
+ * What this actually means is architecture and machine model
+ * specific: on PC, for instance, it means that the LAPIC,
+ * IOAPIC and PIT are all in kernel. This function should never
+ * be used from generic target-independent code: use one of the
+ * following functions or some other specific check instead.
+ */
 #define kvm_irqchip_in_kernel() (kvm_kernel_irqchip)
 /**
  * kvm_async_interrupt_injection: