From: "Andreas Färber" <afaerber@suse.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-devel@nongnu.org
Cc: Alexander Graf <agraf@suse.de>,
Bharat Bhushan <bharat.bhushan@freescale.com>,
qemu-ppc@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Scott Wood <scottwood@freescale.com>,
Paul Mackerras <paulus@samba.org>
Subject: Re: [Qemu-devel] [PATCH v4] ppc: introduce CPUPPCState::cpu_dt_id and CPUState::kvm_cpu_id
Date: Fri, 15 Nov 2013 19:08:44 +0100 [thread overview]
Message-ID: <5286632C.7040900@suse.de> (raw)
In-Reply-To: <5286538E.3050807@ozlabs.ru>
Am 15.11.2013 18:02, schrieb Alexey Kardashevskiy:
> On 16.11.2013 2:11, Andreas Färber wrote:
>> Am 15.11.2013 06:14, schrieb Alexey Kardashevskiy:
>>> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
>>> index 7739e00..52fc76d 100644
>>> --- a/include/qom/cpu.h
>>> +++ b/include/qom/cpu.h
>>> @@ -197,6 +197,7 @@ struct CPUState {
>>> bool kvm_vcpu_dirty;
>>> struct KVMState *kvm_state;
>>> struct kvm_run *kvm_run;
>>> + int kvm_cpu_id;
>>>
>>> /* TODO Move common fields from CPUArchState here. */
>>> int cpu_index; /* used by alpha TCG */
>>
>> Here you are adding a field to CPUState, fine with me. (Please add a
>> documentation line above the struct then.)
>>
>>> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
>>> index bb84767..8052f6b 100644
>>> --- a/target-ppc/cpu.h
>>> +++ b/target-ppc/cpu.h
>>> @@ -1074,6 +1074,9 @@ struct CPUPPCState {
>>> */
>>> uint8_t fit_period[4];
>>> uint8_t wdt_period[4];
>>> +
>>> + /* The CPU index used in the device tree. KVM uses this index too */
>>> + int cpu_dt_id;
>>
>> But I believe I have requested a number of times not to add random
>> fields to CPUPPCState unless they are accessed by TCG. Please place the
>> new field in PowerPCCPU instead and put the description into the struct
>> documentation.
>
>
> It is accessed by xics.c which is used in TCG. Or I misinterpret the
> rule, do not I?
Yes, you do. ;)
The question is, is the field accessed using offsetof(CPUPPCState, x)
such as in target-ppc/translate.c (search for TCG_AREG0). That's what
CPUPPCState is still needed for - mainly GPRs and the TLBs that TCG ops
load from / store to using host instructions with immediate offset.
Whether it is used in a HELPER() / helper_* function called from TCG
(target-ppc/*helper.c) has become less relevant since the optimization
of ppc_env_get_cpu() macro.
Neither of that seem to be the case here, unless I missed something.
I still hope we can one day get rid of CPUPPCState by having only
numeric-offset accesses from cpu+sizeof(CPUState) and all fields
(including TLB, as Paolo recently pointed out) directly in PowerPCCPU.
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
prev parent reply other threads:[~2013-11-15 18:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 5:14 [Qemu-devel] [PATCH v4] ppc: introduce CPUPPCState::cpu_dt_id and CPUState::kvm_cpu_id Alexey Kardashevskiy
2013-11-15 10:40 ` Paolo Bonzini
2013-11-18 3:02 ` Alexey Kardashevskiy
2013-11-18 8:34 ` Paolo Bonzini
2013-11-15 15:11 ` Andreas Färber
2013-11-15 17:02 ` Alexey Kardashevskiy
2013-11-15 18:08 ` Andreas Färber [this message]
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=5286632C.7040900@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=bharat.bhushan@freescale.com \
--cc=paulus@samba.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=scottwood@freescale.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).