From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/3] powerpc/e500: add paravirt QEMU platform
Date: Fri, 6 Jul 2012 17:04:48 -0500 [thread overview]
Message-ID: <4FF76100.1000006@freescale.com> (raw)
In-Reply-To: <0C067161-2FF3-4EF6-BC4D-B3C93828ED36@suse.de>
On 07/06/2012 11:59 AM, Alexander Graf wrote:
>
> On 06.07.2012, at 18:52, Scott Wood wrote:
>
>> On 07/06/2012 11:30 AM, Alexander Graf wrote:
>>>
>>> On 06.07.2012, at 18:25, Scott Wood wrote:
>>>
>>>> Then what would we do if we want to add an ePAPR virtual PIC
>>>> instead? Or if something replaces MPIC on future FSL chips?
>>>
>>> Then we need a different compatible anyways, because we wouldn't
>>> be backwards compatible, no?
>>
>> No, that's exactly what I'm trying to avoid. This notion of a
>> toplevel compatible that tells you everything you need to know
>> about the machine (even if Linux chooses to be device-tree-based
>> for some arbitrary subset of that information) is incompatible with
>> a flexible virtual platform.
>>
>> All this compatible is saying is "see the rest of the device
>> tree". How well Linux does so is a quality of implementation issue
>> that can be addressed as needed. The information about what sort
>> of interrupt controller you have is already in the device tree.
>> The device tree is the machine spec.
>>
>> Another assumption this patch makes is that it doesn't need
>> SWIOTLB. Is "has more than 4GiB RAM" a machine attribute that
>> would warrant a separate toplevel compatible? SWIOTLB for PCI is
>> handled due to the previous patch that provides common PCI code --
>> but in a previous version of the patch it was not handled. Is it
>> yet another incompatible machine spec if RAM must be less than 4GiB
>> minus PCICSRBAR (ignoring the QEMU bug that PCICSRBAR is not
>> implemented)?
>
> Well, the thing that I'm wary of is the following. Imagine we make
> this the default machine type for all e500 user cases. Which is
> reasonable. Now we release 3.6 which works awesome with QEMU 1.2. We
> change something in QEMU. QEMU 1.3 comes out. It can no longer boot
> your old kernel 3.6.
Do you expect your old kernel to boot when you get new hardware? QEMU
is basically hardware that is easy to change.
The only thing that using a more specific compatible would do is make
sure that the kernel wouldn't boot whenever it changes, rather than just
having a chance of certain combinations having problems.
Obviously we should make a reasonable effort to avoid gratuitous
breakage in the default config, but I just don't see how overspecifying
things is going to help.
> That's the type of situation I don't want to be in. We need to be
> backwards compatible with what we used to be able to run. We can get
> away with declaring things as experimental for now, until we settled
> on a reasonable compromise to achieve said compatibility. But it
> needs to be our goal somewhere.
>
> One idea would be to version the machine type according to what Linux
> implements. If Linux finds a machine type that is newer than what it
> implements, it spawns a warning.
What does it mean to have a version number for a platform which is
intended to eventually be arbitrarily configurable?
> If we want, we can implement
> backwards compatible machine types in QEMU, similar to how we
> implement -M pc-0.12 and friends today.
Heh, I was just about to respond by saying "how would you version a PC"? :-)
If you want a stable versioned platform that happens to not pretend to
be a real board, go ahead and add one -- that's not what this is for.
Maybe instead of documenting things like "has an MPIC", there should be
some comment mentioning that this platform is intended to be flexible
and device tree driven, not static. The device tree is the machine
spec. I could see an argument for versioning individual devices, OTOH,
rather than e.g. pretending the PCI is really equivalent to an
mpc8540-pci despite significant missing functionality.
BTW, could you point me to the documentation that explains exactly what
a pc-0.12 is? And is there any place in Linux that actually sees this
version number and does anything with it? How would a user know what
version of a PC to request? What version do you get by default? Under
what conditions are the version number bumped?
> Again, no need to do so as long as we tell users to not use it. As
> soon as we want them to actually run the machine, we need to have
> independent upgrade paths in place. New QEMU needs to be able to run
> old kernels. New kernels need to be run on old QEMU.
They will, usually. We can't guarantee this will always be true
regardless of a versioning scheme, since bugs will happen.
>>>> Better to change the Linux implementation as needed than to
>>>> change a spec.
>>>
>>> Why not keep the 2 in sync in the same patch? Just throw a file
>>> with a rough outline of the machine in Documentation/.
>>
>> Because that would give people the wrong impression about what
>> this machine is, and be unlikely to stay in sync or be a complete
>> listing of current assumptions. You're basically suggesting to use
>> Documentation/ as a bug tracker.
>
> I'm just saying that every time we hardcode assumptions, we need to
> make sure we document it somewhere. And currently we do hardcode
> assumptions, even though only a few.
If you want a bug tracker, use a bug tracker. Linux already has plenty
of assumptions regarding the real hardware it runs on, how firmware
configures it, etc. Most of these assumptions are not documented, and
things get changed when new hardware comes along that breaks an
assumption. Most of the assumptions this platform would be making come
from outside the platform file itself. If I tried to document it, it
would be incomplete and quickly become out of date.
-Scott
next prev parent reply other threads:[~2012-07-06 22:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-27 23:48 [PATCH 0/3] powerpc/fsl: PCI refactoring and QEMU paravirt platform Scott Wood
2012-06-27 23:50 ` [PATCH 1/3] powerpc/fsl-pci: provide common PCI init Scott Wood
2012-06-27 23:50 ` [PATCH 2/3] powerpc/e500: add paravirt QEMU platform Scott Wood
2012-07-06 12:29 ` Alexander Graf
2012-07-06 16:25 ` Scott Wood
2012-07-06 16:30 ` Alexander Graf
2012-07-06 16:52 ` Scott Wood
2012-07-06 16:59 ` Alexander Graf
2012-07-06 22:04 ` Scott Wood [this message]
2012-06-27 23:50 ` [PATCH 3/3] powerpc/mpc85xx_ds: convert to unified PCI init Scott Wood
2012-07-10 18:31 ` Kumar Gala
2012-06-28 4:06 ` [PATCH 0/3] powerpc/fsl: PCI refactoring and QEMU paravirt platform Jia Hongtao-B38951
2012-06-28 16:31 ` Scott Wood
2012-06-29 2:36 ` Jia Hongtao-B38951
2012-06-29 15:57 ` Kumar Gala
2012-06-29 16:01 ` Scott Wood
2012-06-29 16:04 ` Kumar Gala
2012-06-29 16:18 ` Li Yang-R58472
2012-06-29 16:59 ` Scott Wood
2012-06-29 16:06 ` Zang Roy-R61911
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=4FF76100.1000006@freescale.com \
--to=scottwood@freescale.com \
--cc=agraf@suse.de \
--cc=linuxppc-dev@lists.ozlabs.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).