|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-devel
[Xen-devel] Re: [PATCH 02/17] x86: add io_apic_ops to allow	interception
 
* Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
> 
> Xen dom0 needs to paravirtualize IO operations to the IO APIC, so add
> a io_apic_ops for it to intercept.  Do this as ops structure because
> there's at least some chance that another paravirtualized environment
> may want to intercept these.
> 
> [Impact: indirect IO APIC access via io_apic_ops]
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
> ---
>  arch/x86/include/asm/io_apic.h |    9 +++++++
>  arch/x86/kernel/apic/io_apic.c |   50 +++++++++++++++++++++++++++++++++++++--
>  2 files changed, 56 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
> index 9d826e4..8cbfe73 100644
> --- a/arch/x86/include/asm/io_apic.h
> +++ b/arch/x86/include/asm/io_apic.h
> @@ -21,6 +21,15 @@
>  #define IO_APIC_REDIR_LEVEL_TRIGGER  (1 << 15)
>  #define IO_APIC_REDIR_MASKED         (1 << 16)
>  
> +struct io_apic_ops {
> +     void (*init)(void);
> +     unsigned int (*read)(unsigned int apic, unsigned int reg);
> +     void (*write)(unsigned int apic, unsigned int reg, unsigned int value);
> +     void (*modify)(unsigned int apic, unsigned int reg, unsigned int value);
> +};
> +
> +void __init set_io_apic_ops(const struct io_apic_ops *);
ok, could you please turn the whole IO-APIC code into a driver 
framework? I.e. all IO-APIC calls outside of 
arch/x86/kernel/apic/io_apic.c should be to some io_apic-> method.
The advantage will be a proper abstraction for all IO-APIC details - 
not just a minimalistic one for Xen's need.
Also, please name it 'struct io_apic' - similar to the 'struct apic' 
naming we have for the local APIC driver structure.
Thanks,
        Ingo
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 |   
 
| <Prev in Thread] | 
Current Thread | 
[Next in Thread>
 |  
- [Xen-devel] [GIT PULL] Xen APIC hooks (with io_apic_ops), Jeremy Fitzhardinge
- [Xen-devel] [PATCH 01/17] xen/dom0: handle acpi lapic parsing in	Xen dom0, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 02/17] x86: add io_apic_ops to allow interception, Jeremy Fitzhardinge
- [Xen-devel] Re: [PATCH 02/17] x86: add io_apic_ops to allow	interception,
Ingo Molnar <=
 
 
 
- [Xen-devel] [PATCH 03/17] xen: implement io_apic_ops, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 04/17] xen: create dummy ioapic mapping, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 06/17] x86/io_apic: add get_nr_irqs_gsi(), Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 07/17] xen/apic: identity map gsi->irqs, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 12/17] xen: use acpi_get_override_irq() to get	triggering for legacy irqs, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 09/17] xen: bind pirq to vector and event channel, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 08/17] xen: direct irq registration to pirq	event channels, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 05/17] xen: implement pirq type event channels, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 11/17] xen: don't setup acpi interrupt unless	there is one, Jeremy Fitzhardinge
 
 
 
 
 |  
  
 | 
    | 
  
  
    |   | 
    |