All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 00/23] Add KVM support for PPC64 (970) hosts
Date: Wed, 08 Jul 2009 08:01:26 +0000	[thread overview]
Message-ID: <1247040086.6066.171.camel@pasglop> (raw)
In-Reply-To: <1246976262-4826-1-git-send-email-agraf@suse.de>


> > The cache line sizes vary between processors, that is, the problem is
> > not only classic 32 "32 bytes" vs. classic 64 "128 bytes", some CPUs
> > have 64 bytes cache line size for example too.
> 
> Which non-booke CPUs have 64 byte cache line size? I thought all BookS  
> PPC64 ones are on 128 bytes.

PA-Semi, maybe rs64 (not sure, I have some vague memories here though
the later is only supported on some legacy iSeries which we may not care
about... the kernel cputable still says 128 though, but maybe the
device-tree says otherwise).

Also, for 32-bit, there's some e500's that have 64 byte cache line size
and I know of at least one thing not released yet that will be 32-bits
and will have 128 d-side and 32 i-side :-) (so it can be tricked into
making look like i side is 128 too).

> Well, we only need to tell our guest firmware what the host cache line  
> size is, which qemu knows already, as it's passed to userspace.

Right. As long as the guest OS does the right thing, which afaik only
linux 64-bit does at the moment, though we plan to fix linux 32-bit.

> MacOS always sets the HID5 dcbz32 bit and assumes 128 bytes for dcbzl.

Which will be a problem on processor that don't support that bit.. your
patching technique is interesting though. It should probably remain an
option in case it causes trouble.

For MacOS X, it's reasonably easy to fix things up with paravirt
extensions to a certain extent. For MOL, we have some optional add-ons
you can install inside OS X that patch its kernel in various ways to
make it work better/faster in MOL by avoiding some nasty constructs,
such as abuse of split MMU mode (IR clear DR set or the other way
around) (thanks for Apple publishing their source code here :-)

> It'd be really nice to have 32-bit Linux be a bit more clever about  
> this. Right now I have a dcbz hack in that makes all dcbz basically be  
> dcbz32 when running in book3s_32 mode or HID5.dcbz32 = 1 for book3s_64.
>
> That hack is either achieved by setting HID5.dcbz32 = 1 on the host  
> (if possible) or by runtime binary patching of the guest.

Yup, I saw.

> > The patching technique Alexander does on executable pages is fun :-)
> > Though it's also both a bit slow and potentially dangerous (you don't
> > know for sure that what you are patching is actually an instruction).
> 
> Yeah, we also lose nx capabilites in the guest atm. We're rather safe  
> on not patching data by only patching on execution, but you're right -  
> there could still be data in executed pages.

Well, most 32-bit "S" processors don't support NX at the PTE level
anyway, only at the segment level.

> > Maybe it should be a configuration option to only be enabled when
> > needed.
> 
> It _is_ needed for every possible configuration atm :-). PPC32 Linux  
> doesn't boot without. PPC64 Linux doesn't set dcbz32.

Right. We do need to fix ppc32 linux :-) dcbz32 only exists on 970, not
on other processors so we can't really make that more generic.

Cheers,
Ben.


  parent reply	other threads:[~2009-07-08  8:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07 14:17 [PATCH 00/23] Add KVM support for PPC64 (970) hosts Alexander Graf
2009-07-07 15:44 ` Arnd Bergmann
2009-07-07 15:49 ` Alexander Graf
2009-07-07 15:54 ` Avi Kivity
2009-07-07 15:56 ` Alexander Graf
2009-07-07 16:08 ` Avi Kivity
2009-07-08  6:17 ` Benjamin Herrenschmidt
2009-07-08  6:22 ` Benjamin Herrenschmidt
2009-07-08  6:42 ` Benjamin Herrenschmidt
2009-07-08  7:35 ` Alexander Graf
2009-07-08  8:01 ` Benjamin Herrenschmidt [this message]
2009-07-08  8:06 ` Avi Kivity
2009-07-08  8:19 ` [PATCH 00/23] Add KVM support for PPC64 (970) host Benjamin Herrenschmidt
2009-07-08  8:28 ` [PATCH 00/23] Add KVM support for PPC64 (970) hosts Alexander Graf
2009-07-08  8:43 ` [PATCH 00/23] Add KVM support for PPC64 (970) host Avi Kivity
2009-07-08  9:51 ` Benjamin Herrenschmidt
2009-07-08 10:04 ` Avi Kivity
2009-07-08 10:24 ` Benjamin Herrenschmidt
2009-07-08 11:10 ` [PATCH 00/23] Add KVM support for PPC64 (970) hosts Benjamin Herrenschmidt
2009-07-08 12:29 ` Alexander Graf
2009-07-08 21:40 ` Benjamin Herrenschmidt
2009-07-22 22:58 ` Olof Johansson
2009-07-22 23:02 ` Olof Johansson

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=1247040086.6066.171.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=kvm-ppc@vger.kernel.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 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.