qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] hw/mips: Restrict emulated machines to TCG
@ 2021-02-26 13:27 Philippe Mathieu-Daudé
  2021-02-26 13:27 ` [RFC PATCH 1/2] hw/mips/meson: Restrict emulated machines to TCG accelerator Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-26 13:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Philippe Mathieu-Daudé,
	Hervé Poussineau, Claudio Fontana, Paolo Bonzini,
	Aurelien Jarno

Simplify MIPS KVM builds by removing code depending
on TCG.

Philippe Mathieu-Daudé (2):
  hw/mips/meson: Restrict emulated machines to TCG accelerator
  hw/mips/jazz: Remove confusing ifdef'ry

 hw/mips/jazz.c      |  4 ----
 hw/mips/meson.build | 11 +++++++----
 2 files changed, 7 insertions(+), 8 deletions(-)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH 1/2] hw/mips/meson: Restrict emulated machines to TCG accelerator
  2021-02-26 13:27 [RFC PATCH 0/2] hw/mips: Restrict emulated machines to TCG Philippe Mathieu-Daudé
@ 2021-02-26 13:27 ` Philippe Mathieu-Daudé
  2021-02-26 13:27 ` [RFC PATCH 2/2] hw/mips/jazz: Remove confusing ifdef'ry Philippe Mathieu-Daudé
  2021-02-26 14:02 ` [RFC PATCH 0/2] hw/mips: Restrict emulated machines to TCG Claudio Fontana
  2 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-26 13:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Philippe Mathieu-Daudé,
	Hervé Poussineau, Claudio Fontana, Paolo Bonzini,
	Aurelien Jarno

Ideally this should solved by Kconfig "depends on TCG", but we
are not there yet:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg777710.html
https://www.mail-archive.com/qemu-devel@nongnu.org/msg777632.html

As a kludge, use meson to only include emulated machines
when TCG accelerator is selected.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/mips/meson.build | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/hw/mips/meson.build b/hw/mips/meson.build
index 1195716dc73..d172eee6e7d 100644
--- a/hw/mips/meson.build
+++ b/hw/mips/meson.build
@@ -1,12 +1,15 @@
 mips_ss = ss.source_set()
 mips_ss.add(files('bootloader.c', 'mips_int.c'))
 mips_ss.add(when: 'CONFIG_FW_CFG_MIPS', if_true: files('fw_cfg.c'))
-mips_ss.add(when: 'CONFIG_FULOONG', if_true: files('fuloong2e.c'))
 mips_ss.add(when: 'CONFIG_LOONGSON3V', if_true: files('loongson3_bootp.c', 'loongson3_virt.c'))
-mips_ss.add(when: 'CONFIG_JAZZ', if_true: files('jazz.c'))
 mips_ss.add(when: 'CONFIG_MALTA', if_true: files('gt64xxx_pci.c', 'malta.c'))
-mips_ss.add(when: 'CONFIG_MIPSSIM', if_true: files('mipssim.c'))
-mips_ss.add(when: 'CONFIG_MIPS_BOSTON', if_true: [files('boston.c'), fdt])
 mips_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('cps.c'))
 
+if 'CONFIG_TCG' in config_all
+mips_ss.add(when: 'CONFIG_FULOONG', if_true: files('fuloong2e.c'))
+mips_ss.add(when: 'CONFIG_JAZZ', if_true: files('jazz.c'))
+mips_ss.add(when: 'CONFIG_MIPSSIM', if_true: files('mipssim.c'))
+mips_ss.add(when: 'CONFIG_MIPS_BOSTON', if_true: [files('boston.c'), fdt])
+endif
+
 hw_arch += {'mips': mips_ss}
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC PATCH 2/2] hw/mips/jazz: Remove confusing ifdef'ry
  2021-02-26 13:27 [RFC PATCH 0/2] hw/mips: Restrict emulated machines to TCG Philippe Mathieu-Daudé
  2021-02-26 13:27 ` [RFC PATCH 1/2] hw/mips/meson: Restrict emulated machines to TCG accelerator Philippe Mathieu-Daudé
@ 2021-02-26 13:27 ` Philippe Mathieu-Daudé
  2021-02-26 22:21   ` Richard Henderson
  2021-02-26 14:02 ` [RFC PATCH 0/2] hw/mips: Restrict emulated machines to TCG Claudio Fontana
  2 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-26 13:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Rikalo, Philippe Mathieu-Daudé,
	Hervé Poussineau, Claudio Fontana, Paolo Bonzini,
	Aurelien Jarno

The jazz machine is not used under user emulation and
does not support KVM. Simplify the ifdef'ry.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/mips/jazz.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index 83c80860626..cd24e8778b1 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -120,7 +120,6 @@ static const MemoryRegionOps dma_dummy_ops = {
 #define MAGNUM_BIOS_SIZE                                                       \
         (BIOS_SIZE < MAGNUM_BIOS_SIZE_MAX ? BIOS_SIZE : MAGNUM_BIOS_SIZE_MAX)
 
-#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
 static void (*real_do_transaction_failed)(CPUState *cpu, hwaddr physaddr,
                                           vaddr addr, unsigned size,
                                           MMUAccessType access_type,
@@ -142,7 +141,6 @@ static void mips_jazz_do_transaction_failed(CPUState *cs, hwaddr physaddr,
     (*real_do_transaction_failed)(cs, physaddr, addr, size, access_type,
                                   mmu_idx, attrs, response, retaddr);
 }
-#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */
 
 static void mips_jazz_init(MachineState *machine,
                            enum jazz_model_e jazz_model)
@@ -211,10 +209,8 @@ static void mips_jazz_init(MachineState *machine,
      * memory region that catches all memory accesses, as we do on Malta.
      */
     cc = CPU_GET_CLASS(cpu);
-#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
     real_do_transaction_failed = cc->tcg_ops->do_transaction_failed;
     cc->tcg_ops->do_transaction_failed = mips_jazz_do_transaction_failed;
-#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */
 
     /* allocate RAM */
     memory_region_add_subregion(address_space, 0, machine->ram);
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 0/2] hw/mips: Restrict emulated machines to TCG
  2021-02-26 13:27 [RFC PATCH 0/2] hw/mips: Restrict emulated machines to TCG Philippe Mathieu-Daudé
  2021-02-26 13:27 ` [RFC PATCH 1/2] hw/mips/meson: Restrict emulated machines to TCG accelerator Philippe Mathieu-Daudé
  2021-02-26 13:27 ` [RFC PATCH 2/2] hw/mips/jazz: Remove confusing ifdef'ry Philippe Mathieu-Daudé
@ 2021-02-26 14:02 ` Claudio Fontana
  2 siblings, 0 replies; 5+ messages in thread
From: Claudio Fontana @ 2021-02-26 14:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Paolo Bonzini, Aleksandar Rikalo, Hervé Poussineau, Aurelien Jarno

On 2/26/21 2:27 PM, Philippe Mathieu-Daudé wrote:
> Simplify MIPS KVM builds by removing code depending
> on TCG.
> 
> Philippe Mathieu-Daudé (2):
>   hw/mips/meson: Restrict emulated machines to TCG accelerator
>   hw/mips/jazz: Remove confusing ifdef'ry
> 
>  hw/mips/jazz.c      |  4 ----
>  hw/mips/meson.build | 11 +++++++----
>  2 files changed, 7 insertions(+), 8 deletions(-)
> 
Reviewed-by: Claudio Fontana <cfontana@suse.de>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 2/2] hw/mips/jazz: Remove confusing ifdef'ry
  2021-02-26 13:27 ` [RFC PATCH 2/2] hw/mips/jazz: Remove confusing ifdef'ry Philippe Mathieu-Daudé
@ 2021-02-26 22:21   ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2021-02-26 22:21 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Paolo Bonzini, Aleksandar Rikalo, Hervé Poussineau,
	Claudio Fontana, Aurelien Jarno

On 2/26/21 5:27 AM, Philippe Mathieu-Daudé wrote:
> @@ -211,10 +209,8 @@ static void mips_jazz_init(MachineState *machine,
>       * memory region that catches all memory accesses, as we do on Malta.
>       */
>      cc = CPU_GET_CLASS(cpu);
> -#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
>      real_do_transaction_failed = cc->tcg_ops->do_transaction_failed;
>      cc->tcg_ops->do_transaction_failed = mips_jazz_do_transaction_failed;
> -#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */

Ah, I wondered what you were after with that first patch,
and this is it.

Series:
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-26 22:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 13:27 [RFC PATCH 0/2] hw/mips: Restrict emulated machines to TCG Philippe Mathieu-Daudé
2021-02-26 13:27 ` [RFC PATCH 1/2] hw/mips/meson: Restrict emulated machines to TCG accelerator Philippe Mathieu-Daudé
2021-02-26 13:27 ` [RFC PATCH 2/2] hw/mips/jazz: Remove confusing ifdef'ry Philippe Mathieu-Daudé
2021-02-26 22:21   ` Richard Henderson
2021-02-26 14:02 ` [RFC PATCH 0/2] hw/mips: Restrict emulated machines to TCG Claudio Fontana

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).