All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>,
	the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Xen-devel <xen-devel@lists.xensource.com>,
	Greg KH <gregkh@suse.de>, Jens Axboe <jens.axboe@oracle.com>,
	Chris Wright <chrisw@redhat.com>,
	kurt.hackel@oracle.com, Andrew Morton <akpm@linux-foundation.org>,
	Ky Srinivasan <ksrinivasan@novell.com>,
	Beulich <jbeulich@novell.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Avi Kivity <avi@redhat.com>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Subject: Re: [PATCH 01/17] xen/dom0: handle acpi lapic parsing in Xen dom0
Date: Wed, 03 Jun 2009 16:38:42 +1000	[thread overview]
Message-ID: <4A261A72.5040700@goop.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0906021826430.3419@localhost.localdomain>

Thomas Gleixner wrote:
> On Wed, 27 May 2009, Jeremy Fitzhardinge wrote:
>
>   
>> When running in Xen dom0, we still want to parse the ACPI tables to
>> find out about local and IO apics, but we don't want to actually use
>> the lapics.
>>     
>
> Hmm, we parse the tables and discard the information. What's the point
> of this exercise ? Some nice dmesg lines ?
>   

No, it was to make some highly convoluted logic work.  I'm planning on 
revisting all this to make it so that clearing the APIC cpuid feature 
flag works (ie, the local apics are skipped, but IO-APIC discovery still 
works).

I don't remember the specific problems I encountered, but it was 
something to do with the fact that CPU discovery is tied up with local 
APIC discovery and some entanglement with how ACPI table parsing works, 
all coupled through some global variables with unclear semantics.

> I hate these "if (xen_...)" extra cases even more than the paravirt
> misery. They stick Xen dependencies into random places and enforce the
> people who want to modify that code to find out why the heck this
> needs to be there.
>   

I agree.  The if (xen) stuff was there to avoid sugar-coating the 
situation.  I could have prettily hidden things in abstraction layers, 
but if there were no current or even likely non-Xen users, I thought it 
was more honest and direct to just make the situation obvious to the reader.

> That's the fundamental design problem with the Dom0 model that you
> want just certain parts of Linux and those parts which are in your way
> are just hacked out. But this is designed to be a nightmare for
> maintainence and development. Are you going to stick more and more of
> those "if (xen..)" constructs into places which provide functionality
> which is only partially useful to Xen ?
>   

No.

My current plan for this apic stuff is to 1) clean up the local apic 
discovery so we can just clear the APIC cpuid flag and have the right 
thing happen (since that's the truth of the situation: there are no 
local apics available to the kernel), and 2) implement the ioapic driver 
layer so that we can just plug our Xen stuff into that.  That should 
avoid all the explicit if (xen) bits in this part of the code.

    J

WARNING: multiple messages have this Message-ID (diff)
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Chris Wright <chrisw@redhat.com>,
	Xen-devel <xen-devel@lists.xensource.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ky Srinivasan <ksrinivasan@novell.com>,
	kurt.hackel@oracle.com, the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>,
	Avi Kivity <avi@redhat.com>, Jens Axboe <jens.axboe@oracle.com>,
	Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Greg KH <gregkh@suse.de>
Subject: Re: [PATCH 01/17] xen/dom0: handle acpi lapic parsing in Xen dom0
Date: Wed, 03 Jun 2009 16:38:42 +1000	[thread overview]
Message-ID: <4A261A72.5040700@goop.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0906021826430.3419@localhost.localdomain>

Thomas Gleixner wrote:
> On Wed, 27 May 2009, Jeremy Fitzhardinge wrote:
>
>   
>> When running in Xen dom0, we still want to parse the ACPI tables to
>> find out about local and IO apics, but we don't want to actually use
>> the lapics.
>>     
>
> Hmm, we parse the tables and discard the information. What's the point
> of this exercise ? Some nice dmesg lines ?
>   

No, it was to make some highly convoluted logic work.  I'm planning on 
revisting all this to make it so that clearing the APIC cpuid feature 
flag works (ie, the local apics are skipped, but IO-APIC discovery still 
works).

I don't remember the specific problems I encountered, but it was 
something to do with the fact that CPU discovery is tied up with local 
APIC discovery and some entanglement with how ACPI table parsing works, 
all coupled through some global variables with unclear semantics.

> I hate these "if (xen_...)" extra cases even more than the paravirt
> misery. They stick Xen dependencies into random places and enforce the
> people who want to modify that code to find out why the heck this
> needs to be there.
>   

I agree.  The if (xen) stuff was there to avoid sugar-coating the 
situation.  I could have prettily hidden things in abstraction layers, 
but if there were no current or even likely non-Xen users, I thought it 
was more honest and direct to just make the situation obvious to the reader.

> That's the fundamental design problem with the Dom0 model that you
> want just certain parts of Linux and those parts which are in your way
> are just hacked out. But this is designed to be a nightmare for
> maintainence and development. Are you going to stick more and more of
> those "if (xen..)" constructs into places which provide functionality
> which is only partially useful to Xen ?
>   

No.

My current plan for this apic stuff is to 1) clean up the local apic 
discovery so we can just clear the APIC cpuid flag and have the right 
thing happen (since that's the truth of the situation: there are no 
local apics available to the kernel), and 2) implement the ioapic driver 
layer so that we can just plug our Xen stuff into that.  That should 
avoid all the explicit if (xen) bits in this part of the code.

    J

  reply	other threads:[~2009-06-03  6:38 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27  7:37 [GIT PULL REPOST] xen/dom0/apic-ops: Xen dom0 APIC changes Jeremy Fitzhardinge
2009-05-27  7:37 ` Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 01/17] xen/dom0: handle acpi lapic parsing in Xen dom0 Jeremy Fitzhardinge
2009-05-27  7:37   ` Jeremy Fitzhardinge
2009-06-02 16:58   ` Thomas Gleixner
2009-06-03  6:38     ` Jeremy Fitzhardinge [this message]
2009-06-03  6:38       ` Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 02/17] x86: add io_apic_ops to allow interception Jeremy Fitzhardinge
2009-05-27  7:37   ` Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 03/17] xen: implement io_apic_ops Jeremy Fitzhardinge
2009-05-27  7:37   ` Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 04/17] xen: create dummy ioapic mapping Jeremy Fitzhardinge
2009-05-27  7:37   ` Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 05/17] xen: implement pirq type event channels Jeremy Fitzhardinge
2009-05-27  7:37   ` Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 06/17] x86/io_apic: add get_nr_irqs_gsi() Jeremy Fitzhardinge
2009-05-27  7:37   ` Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 07/17] xen/apic: identity map gsi->irqs Jeremy Fitzhardinge
2009-05-27  7:37   ` Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 08/17] xen: direct irq registration to pirq event channels Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 09/17] xen: bind pirq to vector and event channel Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 10/17] xen: pre-initialize legacy irqs early Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 11/17] xen: don't setup acpi interrupt unless there is one Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 12/17] xen: use acpi_get_override_irq() to get triggering for legacy irqs Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 13/17] xen: initialize irq 0 too Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 14/17] xen: dynamically allocate irq & event structures Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 15/17] xen: set pirq name to something useful Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 16/17] xen: fix legacy irq setup, make ioapic-less machines work Jeremy Fitzhardinge
2009-05-27  7:37 ` [PATCH 17/17] xen: disable MSI Jeremy Fitzhardinge
2009-05-27 15:34   ` Linus Torvalds
2009-05-27 20:40     ` David Miller
2009-05-27 22:25       ` Ingo Molnar
2009-05-27 22:25         ` Ingo Molnar
2009-05-27 21:18     ` Ingo Molnar
2009-05-27 21:18       ` Ingo Molnar
2009-05-27 21:46       ` Linus Torvalds
2009-05-27 22:01         ` Ingo Molnar
2009-05-27 22:01           ` Ingo Molnar
2009-05-27 22:03         ` Roland Dreier
2009-05-27 22:13           ` Linus Torvalds
2009-05-27 22:20             ` Roland Dreier
2009-05-27 22:26               ` Ingo Molnar
2009-05-27 22:26                 ` Ingo Molnar
2009-05-28  6:28           ` Alan Cox
2009-05-28  6:28             ` Alan Cox
2009-05-28  6:38             ` Andrew Morton
2009-05-28 22:21               ` Roland Dreier
2009-05-28 22:21                 ` Roland Dreier
2009-06-01  2:09                 ` Jon Masters
2009-05-28 19:51         ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2009-05-12 23:25 [GIT PULL] Xen APIC hooks (with io_apic_ops) Jeremy Fitzhardinge
2009-05-12 23:25 ` [PATCH 01/17] xen/dom0: handle acpi lapic parsing in Xen dom0 Jeremy Fitzhardinge
2009-03-13 16:42 [GIT PULL] Xen dom0 apic changes Jeremy Fitzhardinge
2009-03-13 16:42 ` [PATCH 01/17] xen/dom0: handle acpi lapic parsing in Xen dom0 Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A261A72.5040700@goop.org \
    --to=jeremy@goop.org \
    --cc=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=chrisw@redhat.com \
    --cc=gregkh@suse.de \
    --cc=jbeulich@novell.com \
    --cc=jens.axboe@oracle.com \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=ksrinivasan@novell.com \
    --cc=kurt.hackel@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.