[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 11/17] target-s390x: Add KVM VM attribute int
From: |
Michael Mueller |
Subject: |
Re: [Qemu-devel] [PATCH v5 11/17] target-s390x: Add KVM VM attribute interface for S390 CPU models |
Date: |
Mon, 27 Apr 2015 13:07:58 +0200 |
On Mon, 27 Apr 2015 12:52:54 +0200
Christian Borntraeger <address@hidden> wrote:
> Am 27.04.2015 um 11:43 schrieb Michael Mueller:
> > On Mon, 27 Apr 2015 10:15:47 +0200
> > Christian Borntraeger <address@hidden> wrote:
> >
> >> Am 13.04.2015 um 15:56 schrieb Michael Mueller:
> >> [...]
> >>> +static int cpu_model_get(KVMState *s, uint64_t attr, uint64_t addr)
> >>> +{
> >>> + int rc = -ENOSYS;
> >>> + struct kvm_device_attr dev_attr = {
> >>> + .group = KVM_S390_VM_CPU_MODEL,
> >>> + .attr = attr,
> >>> + .addr = addr,
> >>
> >> Would it make sense to do the cast here....
> >
> > cpu_model_get/set() is used to handle both attributes,
> > KVM_S390_VM_CPU_MACHINE and KVM_S390_VM_CPU_PROCESSOR.
> > Both require a different type in the signature, (S390ProcessorProps*)
> > and (S390MachineProps*). Adding both as parameters seems to be odd
> > and would require additionally logic in the function.
> > Thus I think doing the cast outside is just the right thing to do.
>
> So what about a void pointer then as parameter?
> I prefer a pointer for qemu process memory over uint64_t as part of the
> function interface. This makes it somewhat clearer that this is an
> address within QEMU. Both ways will certainly work, though.
The interface calls are:
int kvm_s390_get_machine_props(KVMState *s, S390MachineProps *prop)
int kvm_s390_get_processor_props(S390ProcessorProps *prop)
cpu_model_get/set() are just static helpers.
>
> Conny, I guess you will pick up the patches. Any preference?
>
> Christian
- Re: [Qemu-devel] [PATCH v5 06/17] target-s390x: Introduce S390 CPU facilities, (continued)
[Qemu-devel] [PATCH v5 01/17] Introduce stub routine cpu_desc_avail, Michael Mueller, 2015/04/13
[Qemu-devel] [PATCH v5 16/17] target-s390x: Introduce S390 CPU facility test routine, Michael Mueller, 2015/04/13
[Qemu-devel] [PATCH v5 14/17] target-s390x: Initialize S390 CPU model name in CPUState, Michael Mueller, 2015/04/13
[Qemu-devel] [PATCH v5 11/17] target-s390x: Add KVM VM attribute interface for S390 CPU models, Michael Mueller, 2015/04/13
[Qemu-devel] [PATCH v5 08/17] target-s390x: Introduce S390 CPU models, Michael Mueller, 2015/04/13
[Qemu-devel] [PATCH v5 10/17] target-s390x: Add S390 CPU model alias definition routines, Michael Mueller, 2015/04/13
[Qemu-devel] [PATCH v5 17/17] target-s390x: Enable S390 CPU model usage, Michael Mueller, 2015/04/13
[Qemu-devel] [PATCH v5 09/17] target-s390x: Define S390 CPU model specific facility lists, Michael Mueller, 2015/04/13
[Qemu-devel] [PATCH v5 15/17] target-s390x: Extend arch specific QMP command query-cpu-definitions, Michael Mueller, 2015/04/13