qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Julian Brown <julian@codesourcery.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 1/6] Add cfgend parameter for ARM CPU selection.
Date: Wed, 11 Jan 2017 12:35:52 +0000	[thread overview]
Message-ID: <20170111123552.1873cb3b@squid.athome> (raw)
In-Reply-To: <CAFEAcA-EQ-e39uv1rnTUb5SwDZzPrHUfhydY5hzc8CrP4NhX_w@mail.gmail.com>

On Thu, 5 Jan 2017 17:17:13 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:

> > +    qdev_property_add_static(DEVICE(obj), &arm_cpu_cfgend_property,
> > +                             &error_abort);
> > +
> > +    qdev_prop_set_globals(DEVICE(obj));
> > +
> > +    if (object_property_get_bool(obj, "cfgend", NULL)) {
> > +        if (arm_feature(&cpu->env, ARM_FEATURE_V7)) {
> > +            cpu->reset_sctlr |= SCTLR_EE;
> > +        } else {
> > +            cpu->reset_sctlr |= SCTLR_B;
> > +        }
> > +    }  
> 
> Can we just implement this property the same way we do all
> our existing ones, ie just call qdev_property_add_static()
> here, and then look at the property value in arm_cpu_realizefn() ?
> I'm not clear what the call to qdev_prop_set_globals() is
> needed for.

...

> > @@ -765,15 +782,20 @@ static ObjectClass
> > *arm_cpu_class_by_name(const char *cpu_model) return NULL;
> >      }
> >
> > -    cpuname = g_strsplit(cpu_model, ",", 1);
> > +    cpuname = g_strsplit(cpu_model, ",", 2);
> >      typename = g_strdup_printf("%s-" TYPE_ARM_CPU, cpuname[0]);
> >      oc = object_class_by_name(typename);
> > -    g_strfreev(cpuname);
> > -    g_free(typename);
> >      if (!oc || !object_class_dynamic_cast(oc, TYPE_ARM_CPU) ||
> >          object_class_is_abstract(oc)) {
> > +        g_strfreev(cpuname);
> > +        g_free(typename);
> >          return NULL;
> >      }
> > +
> > +    cc = CPU_CLASS(oc);
> > +    cc->parse_features(typename, cpuname[1], &error_fatal);
> > +    g_strfreev(cpuname);
> > +  
> 
> I'm also not clear why this needs to change -- the existing code works
> for all of our current properties.

I'm a little confused, I think -- these changes seemed to be necessary
to allow the parsing of the command-line syntax you suggested earlier
(-mcpu=foo,cfgend=bar):

http://lists.nongnu.org/archive/html/qemu-devel/2016-11/msg00660.html

The qdev_prop_set_globals function calls back into arm/cpu.c to do the
actual parsing, IIRC.

Can the existing properties be set like that via the command line?
AFAICT they're only used to communicate settings from the machine
models (integratorcp, and so on) to the CPU initialisation code, and
are never exposed to the user.

Did I miss something? (I think the g_strsplit call with 1 as its third
argument is a no-op. Actually maybe that was supposed to be -1?)

Thanks,

Julian

  reply	other threads:[~2017-01-11 12:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 14:48 [Qemu-devel] [PATCH v2 0/6] ARM BE8/BE32 big-endian system-mode fixes (semihosting, gdbstub) Julian Brown
2016-12-07 14:48 ` [Qemu-devel] [PATCH v2 1/6] Add cfgend parameter for ARM CPU selection Julian Brown
2017-01-05 17:17   ` Peter Maydell
2017-01-11 12:35     ` Julian Brown [this message]
2017-01-12 14:28       ` Julian Brown
2017-01-17 11:52         ` Peter Maydell
2017-01-18 16:52           ` Eduardo Habkost
2017-01-19 15:12             ` Peter Maydell
2017-01-19 18:02               ` Julian Brown
2017-01-19 18:25                 ` Peter Maydell
2016-12-07 14:48 ` [Qemu-devel] [PATCH v2 2/6] Infer endianness from SCTLR reset value Julian Brown
2017-01-05 17:29   ` Peter Maydell
2016-12-07 14:48 ` [Qemu-devel] [PATCH v2 3/6] ARM big-endian system-mode semihosting support Julian Brown
2017-01-05 17:49   ` Peter Maydell
2016-12-07 14:49 ` [Qemu-devel] [PATCH v2 4/6] ARM big-endian system-mode gdbstub support Julian Brown
2017-01-05 17:53   ` Peter Maydell
2016-12-07 14:49 ` [Qemu-devel] [PATCH v2 5/6] Fix Thumb-1 BE32 execution and disassembly Julian Brown
2017-01-05 18:18   ` Peter Maydell
2016-12-07 14:49 ` [Qemu-devel] [PATCH v2 6/6] ARM BE32 watchpoint fix Julian Brown
2017-01-05 18:25   ` Peter Maydell
2016-12-07 15:09 ` [Qemu-devel] [PATCH v2 0/6] ARM BE8/BE32 big-endian system-mode fixes (semihosting, gdbstub) no-reply
2016-12-07 15:28 ` no-reply

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=20170111123552.1873cb3b@squid.athome \
    --to=julian@codesourcery.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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).