qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Fontana <cfontana@suse.de>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Claudio Fontana" <cfontana@centriq4.arch.suse.de>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, "Roman Bolshakov" <r.bolshakov@yadro.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [RFC v1 04/38] target/arm: move psci.c into tcg/softmmu/
Date: Tue, 23 Feb 2021 09:44:24 +0100	[thread overview]
Message-ID: <f6aafba9-600f-59a1-9dac-d3b88e82fc82@suse.de> (raw)
In-Reply-To: <87eeh857xf.fsf@linaro.org>

On 2/22/21 6:22 PM, Alex Bennée wrote:
> 
> Claudio Fontana <cfontana@suse.de> writes:
> 
>> From: Claudio Fontana <cfontana@centriq4.arch.suse.de>
>>
>> Signed-off-by: Claudio Fontana <cfontana@suse.de>
>> ---
>>  target/arm/internals.h              | 23 ++++++++++-------------
>>  target/arm/tcg/helper.c             |  2 ++
>>  target/arm/{ => tcg/softmmu}/psci.c |  0
>>  target/arm/tcg/user/psci.c          | 26 ++++++++++++++++++++++++++
>>  target/arm/meson.build              |  1 -
>>  target/arm/tcg/meson.build          |  3 +++
>>  target/arm/tcg/softmmu/meson.build  |  4 ++++
>>  target/arm/tcg/user/meson.build     |  4 ++++
>>  8 files changed, 49 insertions(+), 14 deletions(-)
>>  rename target/arm/{ => tcg/softmmu}/psci.c (100%)
>>  create mode 100644 target/arm/tcg/user/psci.c
>>  create mode 100644 target/arm/tcg/softmmu/meson.build
>>  create mode 100644 target/arm/tcg/user/meson.build
>>
>> diff --git a/target/arm/internals.h b/target/arm/internals.h
>> index 05cebc8597..6384461177 100644
>> --- a/target/arm/internals.h
>> +++ b/target/arm/internals.h
>> @@ -292,21 +292,18 @@ vaddr arm_adjust_watchpoint_address(CPUState *cs, vaddr addr, int len);
>>  /* Callback function for when a watchpoint or breakpoint triggers. */
>>  void arm_debug_excp_handler(CPUState *cs);
>>  
>> -#if defined(CONFIG_USER_ONLY) || !defined(CONFIG_TCG)
>> -static inline bool arm_is_psci_call(ARMCPU *cpu, int excp_type)
>> -{
>> -    return false;
>> -}
>> -static inline void arm_handle_psci_call(ARMCPU *cpu)
>> -{
>> -    g_assert_not_reached();
>> -}
>> -#else
> 
> I'm not sure I'm a fan of pushing these #ifdef tweaks down into the main
> code when the compiler is good an eliding them away. I guess we need
> this because the helper.o wants to be a shared object between both user
> and softmmu/sysemu mode?


Hi Alex,

yes, but will try to clean this up, I agree that this is too much preprocessor stuff.

Ciao,

CLaudio

> 
>> -/* Return true if the r0/x0 value indicates that this SMC/HVC is a PSCI call. */
>> +#ifdef CONFIG_TCG
>> +/*
>> + * Return true only for softmmu, if the r0/x0 value indicates that this
>> + * SMC/HVC is a PSCI call.
>> + */
>>  bool arm_is_psci_call(ARMCPU *cpu, int excp_type);
>> -/* Actually handle a PSCI call */
>> +
>> +#ifndef CONFIG_USER_ONLY
>>  void arm_handle_psci_call(ARMCPU *cpu);
>> -#endif
>> +#endif /* !CONFIG_USER_ONLY */
>> +
>> +#endif /* CONFIG_TCG */
>>  
>>  /**
>>   * arm_clear_exclusive: clear the exclusive monitor
>> diff --git a/target/arm/tcg/helper.c b/target/arm/tcg/helper.c
>> index 0e1a3b9421..beb8a5deed 100644
>> --- a/target/arm/tcg/helper.c
>> +++ b/target/arm/tcg/helper.c
>> @@ -10040,11 +10040,13 @@ void arm_cpu_do_interrupt(CPUState *cs)
>>                        env->exception.syndrome);
>>      }
>>  
>> +#ifndef CONFIG_USER_ONLY
>>      if (arm_is_psci_call(cpu, cs->exception_index)) {
>>          arm_handle_psci_call(cpu);
>>          qemu_log_mask(CPU_LOG_INT, "...handled as PSCI call\n");
>>          return;
>>      }
>> +#endif /* CONFIG_USER_ONLY */
>>  
>>      /*
>>       * Semihosting semantics depend on the register width of the code
>> diff --git a/target/arm/psci.c b/target/arm/tcg/softmmu/psci.c
>> similarity index 100%
>> rename from target/arm/psci.c
>> rename to target/arm/tcg/softmmu/psci.c
>> diff --git a/target/arm/tcg/user/psci.c b/target/arm/tcg/user/psci.c
>> new file mode 100644
>> index 0000000000..f3e293c516
>> --- /dev/null
>> +++ b/target/arm/tcg/user/psci.c
>> @@ -0,0 +1,26 @@
>> +/*
>> + * Copyright (C) 2014 - Linaro
>> + * Author: Rob Herring <rob.herring@linaro.org>
>> + *
>> + *  This program is free software; you can redistribute it and/or modify
>> + *  it under the terms of the GNU General Public License as published by
>> + *  the Free Software Foundation; either version 2 of the License, or
>> + *  (at your option) any later version.
>> + *
>> + *  This program is distributed in the hope that it will be useful,
>> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + *  GNU General Public License for more details.
>> + *
>> + *  You should have received a copy of the GNU General Public License
>> + *  along with this program; if not, see <http://www.gnu.org/licenses/>.
>> + */
>> +
>> +#include "qemu/osdep.h"
>> +#include "cpu.h"
>> +#include "internals.h"
>> +
>> +bool arm_is_psci_call(ARMCPU *cpu, int excp_type)
>> +{
>> +    return false;
>> +}
>> diff --git a/target/arm/meson.build b/target/arm/meson.build
>> index 0172937b40..3d23a6c687 100644
>> --- a/target/arm/meson.build
>> +++ b/target/arm/meson.build
>> @@ -19,7 +19,6 @@ arm_softmmu_ss.add(files(
>>    'arm-powerctl.c',
>>    'machine.c',
>>    'monitor.c',
>> -  'psci.c',
>>  ))
>>  arm_user_ss = ss.source_set()
>>  
>> diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build
>> index 3b4146d079..4d9ed4b9cf 100644
>> --- a/target/arm/tcg/meson.build
>> +++ b/target/arm/tcg/meson.build
>> @@ -36,3 +36,6 @@ arm_ss.add(when: ['TARGET_AARCH64','CONFIG_TCG'], if_true: files(
>>    'pauth_helper.c',
>>    'sve_helper.c',
>>  ))
>> +
>> +subdir('user')
>> +subdir('softmmu')
>> diff --git a/target/arm/tcg/softmmu/meson.build b/target/arm/tcg/softmmu/meson.build
>> new file mode 100644
>> index 0000000000..f136c8bb8b
>> --- /dev/null
>> +++ b/target/arm/tcg/softmmu/meson.build
>> @@ -0,0 +1,4 @@
>> +
>> +arm_softmmu_ss.add(when: ['CONFIG_TCG','CONFIG_SOFTMMU'], if_true: files(
>> +  'psci.c',
>> +))
>> diff --git a/target/arm/tcg/user/meson.build b/target/arm/tcg/user/meson.build
>> new file mode 100644
>> index 0000000000..f18d08c52c
>> --- /dev/null
>> +++ b/target/arm/tcg/user/meson.build
>> @@ -0,0 +1,4 @@
>> +
>> +arm_user_ss.add(when: ['CONFIG_TCG','CONFIG_USER_ONLY'], if_true: files(
>> +  'psci.c',
>> +))
> 
> 



  parent reply	other threads:[~2021-02-23  8:46 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210221092449.7545-1-cfontana@suse.de>
     [not found] ` <20210221092449.7545-33-cfontana@suse.de>
2021-02-21  9:53   ` [RFC v1 32/38] target/arm: cpu: do not initialize TCG PMU for KVM Philippe Mathieu-Daudé
2021-02-21 13:59     ` Claudio Fontana
2021-02-22  6:11     ` Richard Henderson
     [not found] ` <20210221092449.7545-35-cfontana@suse.de>
2021-02-21  9:55   ` [RFC v1 34/38] target/arm: cpu: only initialize TCG gt timers under CONFIG_TCG Philippe Mathieu-Daudé
2021-02-21 13:59     ` Claudio Fontana
2021-02-22  8:35       ` Claudio Fontana
2021-03-01 18:19       ` Olaf Hering
     [not found]   ` <87v9ak5cz0.fsf@linaro.org>
2021-02-23  9:12     ` Claudio Fontana
2021-02-23 11:01       ` Alex Bennée
2021-02-23 11:36         ` Claudio Fontana
2021-02-23 12:38           ` Claudio Fontana
2021-02-23 14:47         ` Paolo Bonzini
2021-02-22  5:35 ` [RFC v1 00/38] arm cleanup experiment for kvm-only build Richard Henderson
2021-02-22  8:43   ` Claudio Fontana
2021-02-22 11:56     ` Philippe Mathieu-Daudé
2021-02-22 16:08     ` Richard Henderson
2021-02-22 16:57       ` Alex Bennée
2021-02-23  9:17       ` Claudio Fontana
     [not found] ` <20210221092449.7545-21-cfontana@suse.de>
2021-02-22  5:48   ` [RFC v1 20/38] target/arm: move arm_hcr_el2_eff to common_cpu Richard Henderson
     [not found] ` <20210221092449.7545-24-cfontana@suse.de>
2021-02-22  5:52   ` [RFC v1 23/38] target/arm: move arm_mmu_idx_el to common-cpu Richard Henderson
     [not found] ` <20210221092449.7545-25-cfontana@suse.de>
2021-02-22  6:02   ` [RFC v1 24/38] target/arm: move aa64_va_parameter_tbi,tbid,tcma and arm_rebuild_hflags Richard Henderson
2021-02-23 10:07     ` Claudio Fontana
2021-02-23 16:30       ` Richard Henderson
     [not found] ` <20210221092449.7545-26-cfontana@suse.de>
2021-02-22  6:04   ` [RFC v1 25/38] target/arm: move fp_exception_el outside of tcg helpers Richard Henderson
     [not found] ` <20210221092449.7545-27-cfontana@suse.de>
2021-02-22  6:05   ` [RFC v1 26/38] target/arm: move sve_exception_el to cpu Richard Henderson
     [not found] ` <20210221092449.7545-28-cfontana@suse.de>
2021-02-22  6:06   ` [RFC v1 27/38] target/arm: move sve_zcr_len_for_el to common_cpu Richard Henderson
2021-02-25 17:28     ` Claudio Fontana
2021-02-25 20:13       ` Claudio Fontana
2021-02-26  4:01         ` Richard Henderson
     [not found] ` <20210221092449.7545-29-cfontana@suse.de>
2021-02-22  6:09   ` [RFC v1 28/38] target/arm: make arm_pmu_timer_cb TCG-only, starting tcg-stub Richard Henderson
     [not found] ` <20210221092449.7545-2-cfontana@suse.de>
2021-02-22  6:14   ` [RFC v1 01/38] target/arm: move translate modules to tcg/ Richard Henderson
     [not found] ` <20210221092449.7545-4-cfontana@suse.de>
2021-02-22  6:16   ` [RFC v1 03/38] arm: tcg: only build under CONFIG_TCG Richard Henderson
     [not found] ` <20210221092449.7545-6-cfontana@suse.de>
2021-02-22  6:21   ` [RFC v1 05/38] target/arm: wrap arm_cpu_exec_interrupt in CONFIG_TCG Richard Henderson
2021-02-22  8:31     ` Claudio Fontana
2021-02-22 15:54       ` Richard Henderson
2021-02-23  8:46         ` Claudio Fontana
     [not found] ` <20210221092449.7545-9-cfontana@suse.de>
2021-02-22  6:29   ` [RFC v1 08/38] target/arm/tcg: split softmmu parts of v8_cp_reginfo and el2_cp_reginfo Richard Henderson
     [not found] ` <20210221092449.7545-3-cfontana@suse.de>
2021-02-22  6:16   ` [RFC v1 02/38] target/arm: move helpers to tcg/ Richard Henderson
2021-02-22 17:20   ` Philippe Mathieu-Daudé
     [not found] ` <20210221092449.7545-5-cfontana@suse.de>
     [not found]   ` <87eeh857xf.fsf@linaro.org>
2021-02-23  8:44     ` Claudio Fontana [this message]
     [not found] ` <20210221092449.7545-7-cfontana@suse.de>
     [not found]   ` <87blcc57rj.fsf@linaro.org>
2021-02-23  8:55     ` [RFC v1 06/38] target/arm: split off cpu-softmmu.c Claudio Fontana
2021-02-23  9:16       ` Philippe Mathieu-Daudé
2021-02-23  9:35         ` Claudio Fontana
2021-02-23 18:18           ` softmmu vs sysemu [Was: Re: [RFC v1 06/38] target/arm: split off cpu-softmmu.c] Claudio Fontana
2021-02-23 18:51             ` Richard Henderson
2021-02-23 23:43               ` Philippe Mathieu-Daudé
2021-02-24  0:06                 ` Richard Henderson
2021-02-24  9:20                   ` Paolo Bonzini
2021-02-24  9:30                     ` Claudio Fontana
2021-02-24 10:00                       ` Paolo Bonzini
     [not found] ` <875z2k53mn.fsf@linaro.org>
2021-02-23  9:18   ` [RFC v1 00/38] arm cleanup experiment for kvm-only build Philippe Mathieu-Daudé
2021-03-01 11:52     ` Claudio Fontana
2021-03-01 16:23       ` Alex Bennée
2021-03-03 17:57         ` Claudio Fontana
2021-03-03 18:09           ` Peter Maydell
2021-03-03 18:17             ` Claudio Fontana
2021-03-03 18:20               ` Claudio Fontana
2021-03-03 18:30                 ` Philippe Mathieu-Daudé
2021-03-03 18:39                 ` Richard Henderson
2021-03-03 18:45                   ` Claudio Fontana
2021-03-03 18:54                     ` Richard Henderson
2021-03-04 16:39                       ` Philippe Mathieu-Daudé
2021-03-04 17:19                         ` Claudio Fontana
2021-03-04 17:47                           ` Philippe Mathieu-Daudé
2021-03-04 19:24                         ` Peter Maydell
2021-03-05  9:04                           ` Claudio Fontana
2021-03-03 18:34           ` Philippe Mathieu-Daudé
2021-03-03 18:38             ` Claudio Fontana
2021-02-23  9:18   ` Claudio Fontana

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=f6aafba9-600f-59a1-9dac-d3b88e82fc82@suse.de \
    --to=cfontana@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=cfontana@centriq4.arch.suse.de \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=r.bolshakov@yadro.com \
    --cc=richard.henderson@linaro.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).