qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: David Hildenbrand <david@redhat.com>,
	qemu-devel@nongnu.org,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-s390x@nongnu.org
Subject: Re: [Qemu-devel] [qemu-s390x] [PULL 06/15] s390x/tod: factor out TOD into separate device
Date: Thu, 11 Oct 2018 14:32:29 +0200	[thread overview]
Message-ID: <20181011143229.55b34fc3.cohuck@redhat.com> (raw)
In-Reply-To: <fffba8cf-cc67-b9ba-f2cc-16b6738c1f15@redhat.com>

On Thu, 11 Oct 2018 14:15:41 +0200
Thomas Huth <thuth@redhat.com> wrote:

> On 2018-07-02 13:17, Cornelia Huck wrote:
> > From: David Hildenbrand <david@redhat.com>
> > 
> > Let's treat this like a separate device. TCG will have to store the
> > actual state/time later on.
> > 
> > Include cpu-qom.h in kvm_s390x.h (due to S390CPU) to compile tod-kvm.c.  
> 
> This patch breaks "make check" when QEMU has been compiled with
> --disable-tcg on s390x:
> 
> $ gdb --args s390x-softmmu/qemu-system-s390x -nographic -accel qtest
> [...]
> ERROR:qom/object.c:549:object_new_with_type: assertion failed: (type != NULL)
> 
> Program received signal SIGABRT, Aborted.
> [...]
> (gdb) bt
> #0  0x000003fffcac1220 in raise () from /lib64/libc.so.6
> #1  0x000003fffcac2aa8 in abort () from /lib64/libc.so.6
> #2  0x000003fffd0fdd5e in g_assertion_message () from /lib64/libglib-2.0.so.0
> #3  0x000003fffd0fddc6 in g_assertion_message_expr () from /lib64/libglib-2.0.so.0
> #4  0x00000001002d4bf2 in object_new_with_type (type=0x0)
>     qom/object.c:549
> #5  0x00000001002d4d6e in object_new (typename=typename@entry=0x100490ce8 "s390-tod-qemu")
>     at qom/object.c:563
> #6  0x00000001001c04ee in s390_init_tod () at hw/s390x/tod.c:25
> #7  0x0000000100233d00 in machine_run_board_init (machine=0x1008f5510)
>     at hw/core/machine.c:834
> #8  0x000000010012cb08 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
>     at vl.c:4489
> 
> > diff --git a/hw/s390x/Makefile.objs b/hw/s390x/Makefile.objs
> > index dc704b57d6..93282f7c59 100644
> > --- a/hw/s390x/Makefile.objs
> > +++ b/hw/s390x/Makefile.objs
> > @@ -14,6 +14,9 @@ obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o
> >  obj-$(call lnot,$(CONFIG_PCI)) += s390-pci-stub.o
> >  obj-y += s390-skeys.o
> >  obj-y += s390-stattrib.o
> > +obj-y += tod.o
> > +obj-$(CONFIG_KVM) += tod-kvm.o
> > +obj-$(CONFIG_TCG) += tod-qemu.o  
> 
> With --disable-tcg, tod-qemu.o is not included in the build.
> 
> [...]
> > diff --git a/hw/s390x/tod.c b/hw/s390x/tod.c
> > new file mode 100644
> > index 0000000000..0501affa7f
> > --- /dev/null
> > +++ b/hw/s390x/tod.c
> > @@ -0,0 +1,119 @@
> > +/*
> > + * TOD (Time Of Day) clock
> > + *
> > + * Copyright 2018 Red Hat, Inc.
> > + * Author(s): David Hildenbrand <david@redhat.com>
> > + *
> > + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> > + * See the COPYING file in the top-level directory.
> > + */
> > +
> > +#include "qemu/osdep.h"
> > +#include "hw/s390x/tod.h"
> > +#include "qapi/error.h"
> > +#include "qemu/error-report.h"
> > +#include "sysemu/kvm.h"
> > +#include "migration/register.h"
> > +
> > +void s390_init_tod(void)
> > +{
> > +    Object *obj;
> > +
> > +    if (kvm_enabled()) {
> > +        obj = object_new(TYPE_KVM_S390_TOD);
> > +    } else {
> > +        obj = object_new(TYPE_QEMU_S390_TOD);
> > +    }  
> 
> ... but with "-accel qtest", QEMU tries to instantiate the object here.
> 
> I think we should maybe simply inclue tod-qemu.o unconditionally? Opinions?

If tod-qemu does not depend on tcg stuff, that sounds like the easiest
solution.

  reply	other threads:[~2018-10-11 12:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 11:17 [Qemu-devel] [PULL 00/15] s390x patches for 3.0 Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 01/15] s390/ipl: fix ipl with -no-reboot Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 02/15] loader: Check access size when calling rom_ptr() to avoid crashes Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 03/15] s390x/cpumodel: default enable bpb and ppa15 for z196 and later Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 04/15] s390x/tcg: avoid overflows in time2tod/tod2time Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 05/15] s390x/kvm: pass values instead of pointers to kvm_s390_set_clock_*() Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 06/15] s390x/tod: factor out TOD into separate device Cornelia Huck
2018-10-11 12:15   ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2018-10-11 12:32     ` Cornelia Huck [this message]
2018-10-11 12:35       ` David Hildenbrand
2018-07-02 11:17 ` [Qemu-devel] [PULL 07/15] s390x/tcg: drop tod_basetime Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 08/15] s390x/tcg: properly implement the TOD Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 09/15] s390x/tcg: SET CLOCK COMPARATOR can clear CKC interrupts Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 10/15] s390x/tcg: implement SET CLOCK Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 11/15] s390x/tcg: rearm the CKC timer during migration Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 12/15] s390x/tcg: fix CPU hotplug with single-threaded TCG Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 13/15] s390x/kvm: legacy_s390_alloc() only supports one allocation Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 14/15] s390x/kvm: indicate alignment in legacy_s390_alloc() Cornelia Huck
2018-07-02 11:17 ` [Qemu-devel] [PULL 15/15] s390x/tcg: fix locking problem with tcg_s390_tod_updated Cornelia Huck
2018-07-02 15:07 ` [Qemu-devel] [PULL 00/15] s390x patches for 3.0 Peter Maydell

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=20181011143229.55b34fc3.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --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).