devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoffer Dall <christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Peter Maydell <peter.maydell-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org"
	<kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org>,
	Grant Likely
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: device tree cpu node 'compatible' string when using KVM_ARM_PREFERRED_TARGET vcpu
Date: Mon, 18 Nov 2013 12:14:47 -0800	[thread overview]
Message-ID: <20131118201447.GC9314@cbox> (raw)
In-Reply-To: <CAFEAcA9nmruvf52A4whSTbZFRBhtcCAxvdn5PCJjRGF0ouUWWw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Mon, Nov 18, 2013 at 07:40:22PM +0000, Peter Maydell wrote:
> The KVM API has an ioctl KVM_ARM_PREFERRED_TARGET which we can use
> to create virtual CPUs of whatever the host CPU's "preferred" type
> is (typically "same as host"). This allows userspace to create a
> VCPU for best performance without having to have specific knowledge
> about that CPU.
> 
> However there's a slight wrinkle when userspace comes to create the
> device tree to pass to the guest kernel. The device tree binding
> for v7 says that the cpu nodes in the device tree must have a
> "compatible" string, and the only valid values it lists all nail
> things down to an exact CPU model. Requiring userspace to have
> an explicit mapping table of target values to dtb compat strings
> defeats the point of userspace not having to have hardcoded knowledge
> of all CPU types.
> 
> This problem doesn't exist for v8, because there the compat
> string is always "arm,arm-v8", indicating that the kernel
> doesn't care beyond "this is a v8 CPU of some kind".
> 
> In fact I'm told that for v7 the kernel doesn't care either (both
> because it needs to know about the CPU type much earlier than it
> has access to information in the dtb and also because this is
> all probeable via ID registers anyhow). So the obvious solution
> would be for userspace to pass a 'compatible' string "arm,arm-v7"
> (which the kernel will ignore anyway).
> 
> Does anybody see a problem with this approach? If it seems like a
> good plan, how do we go about getting it put into the official
> device tree binding docs?

I think it sounds like the only viable approach.

I guess we simply add it as an option to
Documentation/devicetree/bindings/arm/cpus.txt as a patch and send it to
lakml?  Am I missing some more difficult aspect here?  (assuming this
doesn't have to go through any DT stable tree thingy or anything like
that - it's a one-liner after all).

-Christoffer
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2013-11-18 20:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 19:40 device tree cpu node 'compatible' string when using KVM_ARM_PREFERRED_TARGET vcpu Peter Maydell
     [not found] ` <CAFEAcA9nmruvf52A4whSTbZFRBhtcCAxvdn5PCJjRGF0ouUWWw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-18 20:14   ` Christoffer Dall [this message]

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=20131118201447.GC9314@cbox \
    --to=christoffer.dall-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org \
    --cc=peter.maydell-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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).