From: "Andreas Färber" <afaerber@suse.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Alexander Graf <agraf@suse.de>,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
Paul Mackerras <paulus@samba.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH 6/6] xics-kvm: Support for in-kernel XICS interrupt controller
Date: Wed, 07 Aug 2013 09:08:17 +0200 [thread overview]
Message-ID: <5201F261.7080800@suse.de> (raw)
In-Reply-To: <5201F12B.6050101@ozlabs.ru>
Am 07.08.2013 09:03, schrieb Alexey Kardashevskiy:
> On 08/06/2013 08:12 PM, Andreas Färber wrote:
>>> + /* Call emulated XICS implementation for consistency */
>>> + assert(xics_info && xics_info->cpu_setup);
>>> + xics_info->cpu_setup(icp, cpu);
>>> +}
>>> +
>>> +void xics_kvm_set_nr_irqs(XICSState *icp, uint32_t nr_irqs)
>>> +{
>>> + icp->ics = ICS(object_new(TYPE_ICS_KVM));
>>> + object_property_add_child(OBJECT(icp), "ics", OBJECT(icp->ics), NULL);
>>> + icp->ics->icp = icp;
>>
>> instance_init + object_initialize()?
>
> Create ICS_KVM in instance_init of XICS_KVM and initialize it here? Why split?
Answered on 5/6 (mail bounced at first due to kernel.crashing.org).
>>> + icp->nr_irqs = icp->ics->nr_irqs = nr_irqs;
>>> +}
>>> +
>>> +void xics_kvm_set_nr_servers(XICSState *icp, uint32_t nr_servers)
>>> +{
>>> + int i;
>>> +
>>> + icp->nr_servers = nr_servers;
>>> +
>>> + icp->ss = g_malloc0(icp->nr_servers*sizeof(ICPState));
>>> + for (i = 0; i < icp->nr_servers; i++) {
>>> + char buffer[32];
>>> + object_initialize(&icp->ss[i], TYPE_ICP_KVM);
>>> + snprintf(buffer, sizeof(buffer), "icp[%d]", i);
>>> + object_property_add_child(OBJECT(icp), buffer, OBJECT(&icp->ss[i]), NULL);
>>> + }
>>> +}
[...]
>>> +static void xics_kvm_realize(DeviceState *dev, Error **errp)
>>> +{
>>> + KVMXICSState *icpkvm = KVM_XICS(dev);
>>> + XICSState *icp = XICS_COMMON(dev);
>>> + int i, rc;
>>> + Error *error = NULL;
>>> + struct kvm_create_device xics_create_device = {
>>> + .type = KVM_DEV_TYPE_XICS,
>>> + .flags = 0,
>>> + };
>>> +
>>> + assert(kvm_enabled());
>>> + assert(kvm_check_extension(kvm_state, KVM_CAP_IRQ_XICS));
>>
>> error_setg() - if device can be created without accel=kvm (which it
>> looks as if it can) then you should just error out the nice way here.
>
>
> I check kvm_enabled() (I thought I check both but was wrong, will fix it)
> where I try to create XICS_KVM so we should not be here if that check failed.
-device, -object and patch Anthony's patch QMP are other ways to
instantiate the same type. :)
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-08-07 7:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-06 8:27 [Qemu-devel] [PATCH 0/6 v2] xics: reworks and in-kernel support Alexey Kardashevskiy
2013-08-06 8:27 ` [Qemu-devel] [PATCH 1/6] target-ppc: Add helper for KVM_PPC_RTAS_DEFINE_TOKEN Alexey Kardashevskiy
2013-08-06 9:11 ` Andreas Färber
2013-08-06 8:27 ` [Qemu-devel] [PATCH 2/6] xics: add pre_save/post_load/cpu_setup dispatchers Alexey Kardashevskiy
2013-08-06 9:19 ` Andreas Färber
2013-08-06 8:27 ` [Qemu-devel] [PATCH 3/6] xics: move registration of global state to realize() Alexey Kardashevskiy
2013-08-06 9:06 ` Andreas Färber
2013-08-06 8:27 ` [Qemu-devel] [PATCH 4/6] xics: minor changes and cleanups Alexey Kardashevskiy
2013-08-06 9:26 ` Andreas Färber
2013-08-06 8:27 ` [Qemu-devel] [PATCH 5/6] xics: split to xics and xics-common Alexey Kardashevskiy
2013-08-06 9:53 ` Andreas Färber
2013-08-07 6:06 ` Alexey Kardashevskiy
2013-08-07 7:03 ` Andreas Färber
2013-08-07 7:26 ` Alexey Kardashevskiy
2013-08-07 14:22 ` Andreas Färber
2013-08-08 3:10 ` Alexey Kardashevskiy
2013-08-08 11:33 ` Andreas Färber
2013-08-06 8:27 ` [Qemu-devel] [PATCH 6/6] xics-kvm: Support for in-kernel XICS interrupt controller Alexey Kardashevskiy
2013-08-06 10:12 ` Andreas Färber
2013-08-06 12:06 ` Alexey Kardashevskiy
2013-08-06 15:10 ` Andreas Färber
2013-08-07 7:03 ` Alexey Kardashevskiy
2013-08-07 7:08 ` Andreas Färber [this message]
2013-08-07 7:31 ` Alexey Kardashevskiy
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=5201F261.7080800@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=aliguori@us.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=paulus@samba.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).