From: Tony Krowiak <akrowiak@linux.ibm.com>
To: Halil Pasic <pasic@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>
Cc: mjrosato@linux.vnet.ibm.com,
Tony Krowiak <akrowiak@linux.vnet.ibm.com>,
fiuczy@linux.ibm.com, eskultet@redhat.com, qemu-s390x@nongnu.org,
heiko.carstens@de.ibm.com, david@redhat.com,
pmorel@linux.vnet.ibm.com, qemu-devel@nongnu.org, agraf@suse.de,
borntraeger@de.ibm.com, alex.williamson@redhat.com,
pasic@linux.vnet.ibm.com, jjherne@linux.vnet.ibm.com,
schwidefsky@de.ibm.com, mimu@linux.ibm.com,
bjsdjshi@linux.vnet.ibm.com, alifm@linux.vnet.ibm.com,
eric.auger@redhat.com, rth@twiddle.net
Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH v9 4/6] s390x/ap: base Adjunct Processor (AP) object model
Date: Tue, 2 Oct 2018 11:18:01 -0400 [thread overview]
Message-ID: <9afe3867-3a0e-8fe4-aa23-9b49a8e547fe@linux.ibm.com> (raw)
In-Reply-To: <8a1b11b2-2145-d4fa-7415-8dc57402bdbe@linux.ibm.com>
On 09/28/2018 08:51 AM, Halil Pasic wrote:
>
>
> On 09/27/2018 02:52 PM, Cornelia Huck wrote:
>> On Thu, 27 Sep 2018 14:29:01 +0200
>> Thomas Huth <thuth@redhat.com> wrote:
>>
>>> On 2018-09-27 00:54, Tony Krowiak wrote:
>>>> From: Tony Krowiak <akrowiak@linux.ibm.com>
>>>>
>>>> Introduces the base object model for virtualizing AP devices.
>>>>
>>>> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
>>>> ---
>>
>>>> +typedef struct APBridge {
>>>> + SysBusDevice sysbus_dev;
>>>> + bool css_dev_path;
>>>
>>> What is this css_dev_path variable good for? I don't see it used in any
>>> of the other patches?
>>> If you don't need it, I think you could get rid of this struct completely?
>>
>> Huh, now I remember complaining about it before. Looks like a
>> copy-and-paste from the css bridge; that variable is used for compat
>> handling there (and should be ditched here).
>>
>
> Yes, we definitively discussed this before. And yes, it is a copy-paste
> error.
>
>
>>>
>>>> +} APBridge;
>>>> +
>>>> +#define TYPE_AP_BRIDGE "ap-bridge"
>>>> +#define AP_BRIDGE(obj) \
>>>> + OBJECT_CHECK(APBridge, (obj), TYPE_AP_BRIDGE)
>>>> +
>>>> +typedef struct APBus {
>>>> + BusState parent_obj;
>>>> +} APBus;
>>>> +
>>>> +#define TYPE_AP_BUS "ap-bus"
>>>> +#define AP_BUS(obj) \
>>>> + OBJECT_CHECK(APBus, (obj), TYPE_AP_BUS)
>>>
>>> I think you could also get rid of AP_BRIDGE(), AP_BUS() and maybe even
>>> struct APBus.
>>
>> If there's nothing interesting to put in these inherited structures,
>> probably yes.
>>
>
> I was under impression that this is how inheritance/subtyping is done in
> QEMU. Was probably added for the sake of interface completeness.
>
>>>
>>>> +void s390_init_ap(void);
>>>> +
>>>> +#endif
>>>> diff --git a/include/hw/s390x/ap-device.h b/include/hw/s390x/ap-device.h
>>>> new file mode 100644
>>>> index 000000000000..693df90cc041
>>>> --- /dev/null
>>>> +++ b/include/hw/s390x/ap-device.h
>>>> @@ -0,0 +1,38 @@
>>>> +/*
>>>> + * Adjunct Processor (AP) matrix device interfaces
>>>> + *
>>>> + * Copyright 2018 IBM Corp.
>>>> + * Author(s): Tony Krowiak <akrowiak@linux.vnet.ibm.com>
>>>> + *
>>>> + * This work is licensed under the terms of the GNU GPL, version 2 or (at
>>>> + * your option) any later version. See the COPYING file in the top-level
>>>> + * directory.
>>>> + */
>>>> +#ifndef HW_S390X_AP_DEVICE_H
>>>> +#define HW_S390X_AP_DEVICE_H
>>>> +
>>>> +#define AP_DEVICE_TYPE "ap-device"
>>>> +
>>>> +typedef struct APDevice {
>>>> + DeviceState parent_obj;
>>>> +} APDevice;
>>>> +
>>>> +typedef struct APDeviceClass {
>>>> + DeviceClass parent_class;
>>>> +} APDeviceClass;
>>>> +
>>>> +static inline APDevice *to_ap_dev(DeviceState *dev)
>>>> +{
>>>> + return container_of(dev, APDevice, parent_obj);
>>>> +}
>>>> +
>>>> +#define AP_DEVICE(obj) \
>>>> + OBJECT_CHECK(APDevice, (obj), AP_DEVICE_TYPE)
>>>> +
>>>> +#define AP_DEVICE_GET_CLASS(obj) \
>>>> + OBJECT_GET_CLASS(APDeviceClass, (obj), AP_DEVICE_TYPE)
>>>> +
>>>> +#define AP_DEVICE_CLASS(klass) \
>>>> + OBJECT_CLASS_CHECK(APDeviceClass, (klass), AP_DEVICE_TYPE)
>>>
>>> Do you really need any of these definitions except AP_DEVICE_TYPE ?
>>
>> Same here, I think.
>>
>
> I don't think the qom utility/casting macros will ever be used. I'm
> fine with removing what is not needed.
>
> Regards,
> Halil
Per Thomas's suggestions and Connie's concurrence, I am going to remove
the macros as well as the structures they reference. The ap_bridge.h
will be relegated to defining the bridge and bus types and serve as a
container for AP bridge and bus definitions that might be needed in the
future.
>
>
>
next prev parent reply other threads:[~2018-10-02 15:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180926225440.6204-1-akrowiak@linux.vnet.ibm.com>
[not found] ` <20180927112852.71782355.cohuck@redhat.com>
2018-10-02 14:05 ` [Qemu-devel] [PATCH v9 0/6] s390x: vfio-ap: guest dedicated crypto adapters Tony Krowiak
[not found] ` <20180926225440.6204-4-akrowiak@linux.vnet.ibm.com>
[not found] ` <1bb4b47c-5dda-cbea-ee4e-c6b8645ee288@redhat.com>
2018-10-02 15:36 ` [Qemu-devel] [PATCH v9 3/6] s390x/kvm: enable AP instruction interpretation for guest Pierre Morel
[not found] ` <20180926225440.6204-3-akrowiak@linux.vnet.ibm.com>
2018-10-02 14:56 ` [Qemu-devel] [PATCH v9 2/6] s390x/cpumodel: Set up CPU model for AP device support Pierre Morel
2018-10-04 8:45 ` Pierre Morel
2018-10-04 8:53 ` Pierre Morel
[not found] ` <20180926225440.6204-5-akrowiak@linux.vnet.ibm.com>
2018-10-04 8:57 ` [Qemu-devel] [PATCH v9 4/6] s390x/ap: base Adjunct Processor (AP) object model Pierre Morel
[not found] ` <6ae10841-43af-f37f-450e-7dcb4cc75747@redhat.com>
[not found] ` <20180927145240.7f8aba31.cohuck@redhat.com>
[not found] ` <8a1b11b2-2145-d4fa-7415-8dc57402bdbe@linux.ibm.com>
2018-10-02 15:18 ` Tony Krowiak [this message]
2018-10-08 14:20 ` [Qemu-devel] [qemu-s390x] " Tony Krowiak
2018-10-08 14:22 ` David Hildenbrand
2018-10-08 14:35 ` Cornelia Huck
2018-10-08 14:48 ` Tony Krowiak
2018-10-08 14:44 ` Thomas Huth
2018-10-08 16:31 ` Tony Krowiak
[not found] ` <20180926225440.6204-6-akrowiak@linux.vnet.ibm.com>
[not found] ` <2291104a-4cbf-e4fd-3496-fa0910beb96a@redhat.com>
2018-10-02 15:05 ` [Qemu-devel] [qemu-s390x] [PATCH v9 5/6] s390x/vfio: ap: Introduce VFIO AP device Tony Krowiak
2018-10-04 8:27 ` [Qemu-devel] " Pierre Morel
2018-10-04 9:07 ` Pierre Morel
[not found] ` <20180926225440.6204-7-akrowiak@linux.vnet.ibm.com>
2018-10-04 10:38 ` [Qemu-devel] [PATCH v9 6/6] s390: doc: detailed specifications for AP virtualization Pierre Morel
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=9afe3867-3a0e-8fe4-aa23-9b49a8e547fe@linux.ibm.com \
--to=akrowiak@linux.ibm.com \
--cc=agraf@suse.de \
--cc=akrowiak@linux.vnet.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=alifm@linux.vnet.ibm.com \
--cc=bjsdjshi@linux.vnet.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=eric.auger@redhat.com \
--cc=eskultet@redhat.com \
--cc=fiuczy@linux.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jjherne@linux.vnet.ibm.com \
--cc=mimu@linux.ibm.com \
--cc=mjrosato@linux.vnet.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=pasic@linux.vnet.ibm.com \
--cc=pmorel@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
--cc=schwidefsky@de.ibm.com \
--cc=thuth@redhat.com \
/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).