Re: [RFC PATCH 1/2] spapr: Report correct GTSE support via ov5

2022-03-10 Thread Fabiano Rosas
Fabiano Rosas writes: > QEMU reports MMU support to the guest via the ibm,architecture-vec-5 > property of the /chosen node. Byte number 26 specifies Radix Table > Expansions, currently only GTSE (Guest Translation Shootdown > Enable). This feature determines whether the tlbie

[PATCH] analyze-migration.py: Fix instance_id signedness

2022-02-21 Thread Fabiano Rosas
rgs.memory) File "./scripts/analyze-migration.py", line 539, in read classdesc = self.section_classes[section_key] KeyError: ('spapr_iommu', -2147483648) Signed-off-by: Fabiano Rosas --- scripts/analyze-migration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --g

[RFC PATCH 1/4] target/ppc: TCG: Migrate tb_offset and decr

2022-02-24 Thread Fabiano Rosas
These two were not migrated so the remote end was starting with the decrementer expired. I am seeing less frequent crashes with this patch (tested with -smp 4 and -smp 32). It certainly doesn't fix all issues but it looks like it helps. Signed-off-by: Fabiano Rosas --- target/ppc/machine.c

[RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG)

2022-02-24 Thread Fabiano Rosas
if anyone spots something right away. I haven't made much progress in debugging the general TCG migration case so if anyone has any input there as well I'd appreciate it. Thanks Fabiano Rosas (4): target/ppc: TCG: Migrate tb_offset and decr spapr: TCG: Migrate spapr_cpu->prod hw/ppc: T

[RFC PATCH 2/4] spapr: TCG: Migrate spapr_cpu->prod

2022-02-24 Thread Fabiano Rosas
I'm seeing some stack traces in the migrated guest going through cede and some hangs at the plpar_hcall_norets so let's make sure everything related to cede/prod is being migrated just in case. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_cpu_core.c | 1 + include/hw/ppc

[RFC PATCH 4/4] spapr: Add KVM-on-TCG migration support

2022-02-24 Thread Fabiano Rosas
This adds migration support for TCG pseries machines running a KVM-HV guest. The state that needs to be migrated is: - the nested PTCR value; - the in_nested flag; - the nested_tb_offset. - the saved host CPUPPCState structure; Signed-off-by: Fabiano Rosas --- (this migrates just fine with L2

[RFC PATCH 3/4] hw/ppc: Take nested guest into account when saving timebase

2022-02-24 Thread Fabiano Rosas
When saving the guest "timebase" we look to the first_cpu for its tb_offset. If that CPU happens to be running a nested guest at this time, the tb_offset will have the nested guest value. This was caught by code inspection. Signed-off-by: Fabiano Rosas --- hw/ppc/

[PATCH v2 23/27] target/ppc: Rename spr_tcg.h to spr_common.h

2022-02-16 Thread Fabiano Rosas
ing to decouple SPR creation and TCG callback registration any time soon, so let's rename the header to spr_common to accomodate the register_*_sprs functions that will be moved out of cpu_init.c in the following patches. Signed-off-by: Fabiano Rosas --- target/ppc/cpu_init.c

[PATCH v2 14/27] target/ppc: cpu_init: Deduplicate 7xx SPR registration

2022-02-16 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 68 +++ 1 file changed, 11 insertions(+), 57 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 131c2da4c2..ea4ed19bde 100644 --- a/target/ppc

[PATCH v2 17/27] target/ppc: cpu_init: Move 604e SPR registration into a function

2022-02-16 Thread Fabiano Rosas
This is done to improve init_proc readability and to make subsequent patches that touch this code a bit cleaner. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 43 --- 1 file changed, 24 insertions(+), 19 deletions

[PATCH v2 06/27] target/ppc: cpu_init: Move 405 SPRs into register_405_sprs

2022-02-16 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 1eef006a04..330b765ba9 100644 --- a/target/ppc/cpu_init.c +++ b

[PATCH v2 01/27] target/ppc: cpu_init: Remove not implemented comments

2022-02-16 Thread Fabiano Rosas
to take in the future to implement these? Are they only informative? Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 582 ++ 1 file changed, 253 insertions(+), 329 deletions(-) diff --git a/target/ppc/cpu_init.c b/target

[PATCH v2 07/27] target/ppc: cpu_init: Move G2 SPRs into register_G2_sprs

2022-02-16 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 41 ++--- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 330b765ba9..29f25e093f 100644 --- a/target/ppc

[PATCH v2 04/27] target/ppc: cpu_init: Move Timebase registration into the common function

2022-02-16 Thread Fabiano Rosas
Now that the 601 was removed, all of our CPUs have a timebase, so that can be moved into the common function. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 98 --- 1 file changed, 18 insertions(+), 80 deletions

[PATCH v2 03/27] target/ppc: cpu_init: Group registration of generic SPRs

2022-02-16 Thread Fabiano Rosas
The top level init_proc calls register_generic_sprs but also registers some other SPRs outside of that function. Let's group everything into a single place. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 58 --- 1 file

[PATCH v2 15/27] target/ppc: cpu_init: Move 755 L2 cache SPRs into a function

2022-02-16 Thread Fabiano Rosas
This is just to have 755-specific registers contained into a function, intead of leaving them open-coded in init_proc_755. It makes init_proc easier to read and keeps later patches that touch this code a bit cleaner. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc

[PATCH v2 22/27] target/ppc: cpu_init: Remove register_usprg3_sprs

2022-02-16 Thread Fabiano Rosas
This function registers just one SPR and has only two callers, so open code it. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc

[PATCH v2 13/27] target/ppc: cpu_init: Deduplicate 745/755 SPR registration

2022-02-16 Thread Fabiano Rosas
-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 50 --- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index c54f10cb48..131c2da4c2 100644 --- a/target/ppc/cpu_init.c +++ b

[PATCH v2 19/27] target/ppc: cpu_init: Reuse init_proc_604 for the 604e

2022-02-16 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 975257c19b..638e16c583 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc

[PATCH v2 21/27] target/ppc: cpu_init: Rename register_ne_601_sprs

2022-02-16 Thread Fabiano Rosas
The important part of this function is that it applies to non-embedded CPUs, not that it also applies to the 601. We removed support for the 601 anyway, so rename this function. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 41

[PATCH v2 24/27] target/ppc: cpu_init: Expose some SPR registration helpers

2022-02-16 Thread Fabiano Rosas
register_thrm_sprs | 8 callers register_usprgh_sprs | 6 callers register_6xx_7xx_soft_tlb | only 3 callers, but it helps to keep the soft TLB code consistent. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 14

Re: [PATCH 26/27] target/ppc: cpu_init: Move check_pow and QOM macros to a header

2022-02-16 Thread Fabiano Rosas
David Gibson writes: > On Tue, Feb 15, 2022 at 06:41:47PM -0300, Fabiano Rosas wrote: >> These will need to be accessed from other files once we move the CPUs >> code to separate files. >> >> Signed-off-by: Fabiano Rosas >> -

Re: [PATCH 22/27] target/ppc: cpu_init: Rename register_ne_601_sprs

2022-02-16 Thread Fabiano Rosas
David Gibson writes: > On Tue, Feb 15, 2022 at 06:41:43PM -0300, Fabiano Rosas wrote: >> The important part of this function is that it applies to non-embedded >> CPUs, not that it also applies to the 601. We removed support for the >> 601 anyway, so rename this functi

[PATCH v2 27/27] target/ppc: Move common SPR functions out of cpu_init

2022-02-16 Thread Fabiano Rosas
Let's leave cpu_init with just generic CPU initialization and QOM-related functions. The rest of the SPR registration functions will be moved in the following patches along with the code that uses them. These are only the commonly used ones. Signed-off-by: Fabiano Rosas Reviewed-by: David

[PATCH v2 25/27] target/ppc: cpu_init: Move SPR registration macros to a header

2022-02-16 Thread Fabiano Rosas
Put the SPR registration macros in a header that is accessible outside of cpu_init.c. The following patches will move CPU-specific code to separate files and will need to access it. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 65

[PATCH v2 20/27] target/ppc: cpu_init: Reuse init_proc_745 for the 755

2022-02-16 Thread Fabiano Rosas
The init_proc_755 function is identical to the 745 one except for the 755-specific registers. I think it is worth it to make them share code. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions

[PATCH v2 11/27] target/ppc: cpu_init: Deduplicate 603 SPR registration

2022-02-16 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 28 +--- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 711834a4c1..cae4ab69fe 100644 --- a/target/ppc/cpu_init.c +++ b

[PATCH v2 09/27] target/ppc: cpu_init: Decouple 74xx SPR registration from 7xx

2022-02-16 Thread Fabiano Rosas
We're considering these two to be from different CPU families, so duplicate some code to keep them separate. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 107 +++--- 1 file changed, 91 insertions(+), 16 deletions

[PATCH v2 26/27] target/ppc: cpu_init: Move check_pow and QOM macros to a header

2022-02-16 Thread Fabiano Rosas
These will need to be accessed from other files once we move the CPUs code to separate files. The check_pow_hid0 and check_pow_hid0_74xx are too specific to be moved to a header so I'll deal with them later when splitting this code between the multiple CPU families. Signed-off-by: Fabiano Rosas

[PATCH v2 12/27] target/ppc: cpu_init: Deduplicate 604 SPR registration

2022-02-16 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index cae4ab69fe..c54f10cb48 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc

[PATCH v2 18/27] target/ppc: cpu_init: Reuse init_proc_603 for the e300

2022-02-16 Thread Fabiano Rosas
init_proc_603 is defined after init_proc_e300, so I had to move some code around to make it work. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 104 +++--- 1 file changed, 46 insertions(+), 58 deletions(-) diff --git

[PATCH v2 00/27] target/ppc: SPR registration cleanups

2022-02-16 Thread Fabiano Rosas
with in the next series; - Added a new patch to rename spr_tcg to spr_common. Patches 23 and 26 still need review. This series is based on legoater/ppc7.0. v1: https://lists.nongnu.org/archive/html/qemu-ppc/2022-02/msg00313.html Fabiano Rosas (27): target/ppc: cpu_init: Remove not implemented comments

[PATCH v2 08/27] target/ppc: cpu_init: Decouple G2 SPR registration from 755

2022-02-16 Thread Fabiano Rosas
We're considering these two to be in different CPU families (6xx and 7xx), so keep their SPR registration separate. The code was copied into register_G2_sprs and the common function was renamed to apply only to the 755. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc

[PATCH v2 10/27] target/ppc: cpu_init: Deduplicate 440 SPR registration

2022-02-16 Thread Fabiano Rosas
Move some of the 440 registers that are being repeated in the 440* CPUs to register_440_sprs. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 100 +++--- 1 file changed, 26 insertions(+), 74 deletions(-) diff --git

[PATCH v2 16/27] target/ppc: cpu_init: Move e300 SPR registration into a function

2022-02-16 Thread Fabiano Rosas
This is done to improve init_proc readability and to make subsequent patches that touch this code a bit cleaner. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 64 +++ 1 file changed, 35 insertions(+), 29 deletions

[PATCH v2 02/27] target/ppc: cpu_init: Remove G2LE init code

2022-02-16 Thread Fabiano Rosas
The G2LE CPU initialization code is the same as the G2. Use the latter for both. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson --- target/ppc/cpu_init.c | 42 +- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/target/ppc/cpu_init.c

[PATCH v2 05/27] target/ppc: cpu_init: Avoid nested SPR register functions

2022-02-16 Thread Fabiano Rosas
Make sure that every register_*_sprs function only has calls to spr_register* to register individual SPRs. Do not allow nesting. This makes the code easier to follow and a look at init_proc_* should suffice to know what SPRs a CPU has. Signed-off-by: Fabiano Rosas Reviewed-by: David Gibson

Re: [RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG)

2022-02-25 Thread Fabiano Rosas
Mark Cave-Ayland writes: > On 24/02/2022 18:58, Fabiano Rosas wrote: > >> This series implements the migration for a TCG pseries guest running a >> nested KVM guest. This is just like migrating a pseries TCG guest, but >> with some extra state to allow a nested

Re: [RFC PATCH 2/4] spapr: TCG: Migrate spapr_cpu->prod

2022-02-25 Thread Fabiano Rosas
David Gibson writes: > On Thu, Feb 24, 2022 at 03:58:15PM -0300, Fabiano Rosas wrote: >> I'm seeing some stack traces in the migrated guest going through cede >> and some hangs at the plpar_hcall_norets so let's make sure everything >> related to cede/prod is being

Re: [RFC PATCH 3/4] hw/ppc: Take nested guest into account when saving timebase

2022-02-25 Thread Fabiano Rosas
David Gibson writes: > On Thu, Feb 24, 2022 at 03:58:16PM -0300, Fabiano Rosas wrote: >> When saving the guest "timebase" we look to the first_cpu for its >> tb_offset. If that CPU happens to be running a nested guest at this >> time, the tb_offset w

Re: [RFC PATCH 1/4] target/ppc: TCG: Migrate tb_offset and decr

2022-02-25 Thread Fabiano Rosas
David Gibson writes: > On Thu, Feb 24, 2022 at 03:58:14PM -0300, Fabiano Rosas wrote: >> These two were not migrated so the remote end was starting with the >> decrementer expired. >> >> I am seeing less frequent crashes with this patch (tested with -smp 4 >> a

Re: [PATCH 0/9] ppc: nested KVM HV for spapr virtual hypervisor

2022-02-15 Thread Fabiano Rosas
Daniel Henrique Barboza writes: > On 2/15/22 15:33, Cédric Le Goater wrote: >> On 2/15/22 04:16, Nicholas Piggin wrote: >>> Here is the rollup of patches in much better shape since the RFC. >>> I include the 2 first ones unchanged from independent submission >>> just to be clear that this series

[PATCH 16/17] target/ppc: Move powerpc_excp_books into cpu_books.c

2022-03-01 Thread Fabiano Rosas
Take powerpc_reset_wakeup and ppc_excp_apply_ail along because these are specific to BookS as well. Signed-off-by: Fabiano Rosas --- target/ppc/cpu.h | 1 + target/ppc/cpu_books.c | 525 +- target/ppc/excp_helper.c | 531

[PATCH 15/17] target/ppc: Move powerpc_excp_booke into cpu_booke.c

2022-03-01 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas --- target/ppc/cpu.h | 1 + target/ppc/cpu_booke.c | 216 ++- target/ppc/excp_helper.c | 204 3 files changed, 216 insertions(+), 205 deletions(-) diff --git a/target/ppc/cpu.h b

[PATCH 13/17] target/ppc: Move powerpc_excp_7xx into cpu_7xx.c

2022-03-01 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas --- target/ppc/cpu.h | 1 + target/ppc/cpu_7xx.c | 193 ++- target/ppc/excp_helper.c | 181 3 files changed, 193 insertions(+), 182 deletions(-) diff --git a/target/ppc/cpu.h b

[PATCH 12/17] target/ppc: Move powerpc_excp_6xx into cpu_6xx.c

2022-03-01 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas --- target/ppc/cpu.h | 2 + target/ppc/cpu_6xx.c | 188 ++- target/ppc/excp_helper.c | 177 +--- 3 files changed, 190 insertions(+), 177 deletions(-) diff --git a/target/ppc/cpu.h b

[PATCH 02/17] target/ppc: Use trace-events instead of CPU_LOG_INT

2022-03-01 Thread Fabiano Rosas
Part of our exception logging is using qemu_log_mask and part is using trace-events. Move the remaining users of '-d int' to the trace-events infrastructure. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 9 ++--- target/ppc/misc_helper.c | 4 ++-- target/ppc/trace-events | 2

Re: [PATCH 03/17] target/ppc: Move 40x CPUs code to their own file

2022-03-02 Thread Fabiano Rosas
BALATON Zoltan writes: > On Tue, 1 Mar 2022, Fabiano Rosas wrote: >> Affects the 405 CPU. >> >> This moves init_proc, init_excp and register_*sprs functions that are >> related to the 40x CPUs (currently only 405) into a separate file. >> >> Signed-off-

[PATCH 01/17] target/ppc: Add a tracepoint for System Calls

2022-03-01 Thread Fabiano Rosas
This replaces the old dump_syscall qemu_log print with a tracepoint. One immediate effect of this is that we can now avoid flooding the console with syscall prints when debugging. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 53 ++-- target/ppc

[PATCH 03/17] target/ppc: Move 40x CPUs code to their own file

2022-03-01 Thread Fabiano Rosas
Affects the 405 CPU. This moves init_proc, init_excp and register_*sprs functions that are related to the 40x CPUs (currently only 405) into a separate file. Signed-off-by: Fabiano Rosas --- target/ppc/cpu_40x.c | 263 + target/ppc/cpu_init.c | 250

[PATCH 00/17] target/ppc: CPU families split

2022-03-01 Thread Fabiano Rosas
but we're close to having only TCG-specific code in it, as the file name implies. I left this for the next series. Based on legoater/ppc-7.0 Fabiano Rosas (17): target/ppc: Add a tracepoint for System Calls target/ppc: Use trace-events instead of CPU_LOG_INT target/ppc: Move 40x CPUs code

[PATCH 06/17] target/ppc: Move 74xx CPUs code to their own file

2022-03-01 Thread Fabiano Rosas
copying check_pow_hid0 instead of moving it to avoid having to keep it exposed in a header file; - I'm also copying vscr_init to avoid having to include fpu/softfloat.h (due to set_float_rounding_mode) from elsewhere. Signed-off-by: Fabiano Rosas --- target/ppc/cpu_74xx.c | 1167

[PATCH 05/17] target/ppc: Move 7xx CPUs code to their own file

2022-03-01 Thread Fabiano Rosas
that comes from linux-headers kvm.h; - I'm copying check_pow_hid0 instead of moving it to avoid having to keep it exposed in a header file. Signed-off-by: Fabiano Rosas --- target/ppc/cpu_7xx.c | 896 + target/ppc/cpu_init.c | 873

[PATCH 07/17] target/ppc: Move BookE CPUs code to their own file

2022-03-01 Thread Fabiano Rosas
in a header file; - Differently from the previous files, this one contains both 32-bit and 64-bit code. Signed-off-by: Fabiano Rosas --- target/ppc/cpu_booke.c | 1422 target/ppc/cpu_init.c | 1410 --- target/ppc

[PATCH 04/17] target/ppc: Move 6xx CPUs code to their own file

2022-03-01 Thread Fabiano Rosas
-headers kvm.h; - I'm copying check_pow_hid0 instead of moving it to avoid having to keep it exposed in a header file. Signed-off-by: Fabiano Rosas --- target/ppc/cpu_6xx.c | 1146 target/ppc/cpu_init.c | 1129

[PATCH 10/17] target/ppc: Expose some excp_helper functions

2022-03-01 Thread Fabiano Rosas
The next patches will move the powerpc_excp_foo functions into the proper cpu_foo.c files. This patch makes visible some functions that are common to all of them. Signed-off-by: Fabiano Rosas --- target/ppc/cpu.h | 5 + target/ppc/excp_helper.c | 8 2 files changed, 9

[PATCH 08/17] target/ppc: Move BookS CPUs to their own file

2022-03-01 Thread Fabiano Rosas
intialization. These are all specific to BookS. The BookS CPUs are all 64-bits so this new file goes under the TARGET_PPC64 config. Signed-off-by: Fabiano Rosas --- target/ppc/cpu_books.c | 1770 target/ppc/cpu_init.c | 1761

[PATCH 11/17] target/ppc: Move powerpc_excp_40x into cpu_40x.c

2022-03-01 Thread Fabiano Rosas
of simplifying the init_excp/powerpc_excp relationship since both users of the POWERPC_EXCP vector addresses are now in the same place. Signed-off-by: Fabiano Rosas --- target/ppc/cpu.h | 1 + target/ppc/cpu_40x.c | 150 ++- target/ppc/excp_helper.c

[PATCH 09/17] target/ppc: Remove leftover comments from cpu_init

2022-03-01 Thread Fabiano Rosas
The defines are not in use and the comment seems to have lost its purpose, whatever it was. Signed-off-by: Fabiano Rosas --- target/ppc/cpu_init.c | 34 -- 1 file changed, 34 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index

[PATCH 17/17] target/ppc: Move powerpc_excp* to the PowerPCCPU Class

2022-03-01 Thread Fabiano Rosas
Now that all the powerpc_excp* functions are in their appropriate C files, we can drop the excp_model switch and just use a QOM class method. This will allow us to remove the excp_model enum once we've figured out the last two remaining usages outside of excp_helper.c Signed-off-by: Fabiano

[PATCH 14/17] target/ppc: Move powerpc_excp_74xx into cpu_74xx.c

2022-03-01 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas --- target/ppc/cpu.h | 1 + target/ppc/cpu_74xx.c| 185 ++- target/ppc/excp_helper.c | 173 3 files changed, 185 insertions(+), 174 deletions(-) diff --git a/target/ppc/cpu.h b

Re: Issue with qemu-system-ppc running OSX guests

2022-03-02 Thread Fabiano Rosas
Howard Spoelstra writes: > On Wed, Mar 2, 2022 at 9:11 PM BALATON Zoltan wrote: > >> On Wed, 2 Mar 2022, Howard Spoelstra wrote: >> > Hi all, >> > >> > I noticed qemu-system-ppc running OSX guests does not get to the desktop >> or >> > does not display the menu bars. >> >> Cc-ing the relevant

Re: [PATCH 2/2] target/ppc/kvm: Use KVM_CAP_PPC_AIL_MODE_3 to determine cap-ail-mode-3 support

2022-02-14 Thread Fabiano Rosas
Nicholas Piggin writes: > Use KVM_CAP_PPC_AIL_MODE_3 to determine cap-ail-mode-3 support for KVM > guests. Keep the fallback heuristic for KVM hosts that pre-date this > CAP. > > This is only proposed the KVM CAP has not yet been allocated. I will > ask to merge the new KVM cap when there are no

Re: [PATCH] spapr: prevent hdec timer being set up under virtual hypervisor

2022-02-14 Thread Fabiano Rosas
Nicholas Piggin writes: > The spapr virtual hypervisor does not require the hdecr timer. Why is that? Is this not needed for an emulated powernv running KVM guests? > Remove it. > > Signed-off-by: Nicholas Piggin > --- > hw/ppc/ppc.c| 2 +- > hw/ppc/spapr_cpu_core.c | 6 +++--- >

Re: [RFC PATCH 3/3] spapr: implement nested-hv support for the TCG virtual hypervisor

2022-02-14 Thread Fabiano Rosas
Nicholas Piggin writes: > This implements the nested-hv hcall API for spapr under TCG. > It's still a bit rough around the edges, concept seems to work. > > Some HV exceptions can be raised now in the TCG spapr machine when > running a nested guest. The main ones are the lev==1 syscall, the >

Re: [PATCH] target/ppc: raise HV interrupts for partition table entry problems

2022-02-14 Thread Fabiano Rosas
Nicholas Piggin writes: > Invalid or missing partition table entry exceptions should cause HV > interrupts. HDSISR is set to bad MMU config, which is consistent with > the ISA and experimentally matches what POWER9 generates. > > Signed-off-by: Nicholas Piggin Reviewed-by

Re: [RFC PATCH 1/6] target/ppc: Add support for the Processor Attention instruction

2022-03-25 Thread Fabiano Rosas
Leandro Lupori writes: > From: Cédric Le Goater > > Check the HID0 bit to send signal, currently modeled as a checkstop. > The QEMU implementation adds an exit using the GPR[3] value (that's a > hack for tests) > > Signed-off-by: Cédric Le Goater > Signed-off-by: Leandro Lupori > --- >

[PATCH v2 2/2] spapr: Move nested KVM hypercalls under a TCG only config.

2022-03-25 Thread Fabiano Rosas
These are the spapr virtual hypervisor implementation of the nested KVM API. They only make sense when running with TCG. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_hcall.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b

[PATCH v2 0/2] spapr: Make the nested code TCG only

2022-03-25 Thread Fabiano Rosas
the hypercall_register_* functions closer; - Dropped the more paranoid patch that checked for KVM at every call. I couldn't convince myself anymore that it was necessary. v1: https://lists.nongnu.org/archive/html/qemu-ppc/2022-03/msg00412.html Fabiano Rosas (2): spapr: Move

[PATCH v2 1/2] spapr: Move hypercall_register_softmmu

2022-03-25 Thread Fabiano Rosas
I'm moving this because next patch will add more code under the ifdef and it will be cleaner if we keep them together. Also switch the ifdef branches to make it more convenient to add code under CONFIG_TCG in the next patch. Signed-off-by: Fabiano Rosas --- hw/ppc/spapr_hcall.c | 50

[PATCH] target/ppc: Improve KVM hypercall trace

2022-03-25 Thread Fabiano Rosas
: kvm_handle_papr_hcall 0x3a8 kvm_handle_papr_hcall 0x3ac kvm_handle_papr_hcall 0x108 kvm_handle_papr_hcall 0x104 kvm_handle_papr_hcall 0x104 kvm_handle_papr_hcall 0x108 Signed-off-by: Fabiano Rosas --- target/ppc/kvm.c| 2 +- target/ppc/trace-events | 2 +- 2 files changed, 2

Re: [RFC PATCH 0/6] Port PPC64/PowerNV MMU tests to QEMU

2022-03-28 Thread Fabiano Rosas
Richard Henderson writes: > On 3/24/22 13:08, Leandro Lupori wrote: >> To be able to finish the test and return an exit code to the >> calling process, the Processor Attention instruction is used. >> As its behavior is implementation dependent, in QEMU PowerNV >> it just calls exit with GPR[3]

Re: [RFC PATCH 1/2] spapr: Report correct GTSE support via ov5

2022-04-01 Thread Fabiano Rosas
"Aneesh Kumar K.V" writes: > David Gibson writes: > >> On Mon, Mar 14, 2022 at 07:10:10PM -0300, Fabiano Rosas wrote: >>> David Gibson writes: >>> >>> > On Tue, Mar 08, 2022 at 10:23:59PM -0300, Fabiano Rosas wrote: >>>

Re: [RFC PATCH v3 3/3] target/ppc: Fix gen_priv_exception error value in mfspr/mtspr

2022-02-02 Thread Fabiano Rosas
s://gitlab.com/qemu-project/qemu/-/issues/588 > > Signed-off-by: Matheus Ferst This patch seems to do the right thing. So: Reviewed-by: Fabiano Rosas Now, I'm not sure if the code around it does the right thing. =) Specifically the else blocks (read_cb == NULL) and (write_cb =

[PATCH 11/11] target/ppc: 6xx: Set SRRs directly in exception code

2022-02-03 Thread Fabiano Rosas
The 6xx CPUs don't have alternate/hypervisor Save and Restore Registers, so we can set SRR0 and SRR1 directly. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc

[PATCH 05/11] target/ppc: 6xx: Machine Check exception cleanup

2022-02-03 Thread Fabiano Rosas
There's no MSR_HV in the 6xx CPUs. Also remove the 40x and BookE code. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 24 1 file changed, 24 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index e27e1c3c70..734170d4c2 100644

[PATCH 06/11] target/ppc: 6xx: External interrupt cleanup

2022-02-03 Thread Fabiano Rosas
There's no Hypervisor mode in the 6xx, so remove all LPES0 logic. Also remove BookE IRQ code. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 37 - 1 file changed, 37 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c

[PATCH 10/11] target/ppc: 6xx: Software TLB exceptions cleanup

2022-02-03 Thread Fabiano Rosas
This code applies only to the 6xx CPUs, so we can remove the switch statement. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 31 +++ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c

[PATCH 00/11] target/ppc: powerpc_excp improvements [6xx] (7/n)

2022-02-03 Thread Fabiano Rosas
worried because these 32 bit CPUs are quite similar to one another. Fabiano Rosas (11): target/ppc: Merge exception model IDs for 6xx CPUs target/ppc: Introduce powerpc_excp_6xx target/ppc: Simplify powerpc_excp_6xx target/ppc: 6xx: Critical exception cleanup target/ppc: 6xx: Machine

[PATCH 07/11] target/ppc: 6xx: Program exception cleanup

2022-02-03 Thread Fabiano Rosas
There's no ESR in the 6xx CPUs. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 4 1 file changed, 4 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index a008115e5f..a195288dda 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c

[PATCH 04/11] target/ppc: 6xx: Critical exception cleanup

2022-02-03 Thread Fabiano Rosas
This only applies to the G2s, the other 6xx CPUs will not have this vector registered. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index d855a275ca..e27e1c3c70

[PATCH 03/11] target/ppc: Simplify powerpc_excp_6xx

2022-02-03 Thread Fabiano Rosas
POWERPC_EXCP_MEXTBR POWERPC_EXCP_NMEXTBR POWERPC_EXCP_PROGRAM POWERPC_EXCP_RESET POWERPC_EXCP_SMI POWERPC_EXCP_SYSCALL POWERPC_EXCP_TRACE Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 163 +++ 1 file changed, 9 insertions(+), 154 deletions(-) diff --git

Re: [PATCH] target/ppc: Remove PowerPC 601 CPUs

2022-02-03 Thread Fabiano Rosas
u" > Cc: Laurent Vivier > Signed-off-by: Cédric Le Goater Reviewed-by: Fabiano Rosas

[PATCH 02/11] target/ppc: Introduce powerpc_excp_6xx

2022-02-03 Thread Fabiano Rosas
Introduce a new powerpc_excp function specific for PowerPC 6xx CPUs (603, 604, G2, MPC5xx, MCP8xx). This commit copies powerpc_excp_legacy verbatim so the next one has a clean diff. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 469 +++ 1 file

[PATCH 05/10] target/ppc: 7xx: External interrupt cleanup

2022-02-03 Thread Fabiano Rosas
There is no MSR_HV in the 7xx so remove the LPES0 handling. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 37 - 1 file changed, 37 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 4996b96616..5e2c2aa544 100644

[PATCH 04/10] target/ppc: 7xx: Machine Check exception cleanup

2022-02-03 Thread Fabiano Rosas
There's no MSR_HV in the 7xx. Also remove 40x and BookE code. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 24 1 file changed, 24 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 358c3f6206..4996b96616 100644

[PATCH 08/11] target/ppc: 6xx: System Call exception cleanup

2022-02-03 Thread Fabiano Rosas
There is no Hypervisor mode in the 6xx CPUs. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 21 ++--- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index a195288dda..28d9a9a887 100644 --- a/target

[PATCH 10/10] target/ppc: 7xx: Set SRRs directly in exception code

2022-02-03 Thread Fabiano Rosas
The 7xx CPUs don't have alternate/hypervisor Save and Restore Registers, so we can set SRR0 and SRR1 directly. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc

[PATCH 01/11] target/ppc: Merge exception model IDs for 6xx CPUs

2022-02-03 Thread Fabiano Rosas
We don't need three separate exception model IDs for the 603, 604 and G2. Signed-off-by: Fabiano Rosas --- target/ppc/cpu-qom.h | 8 ++-- target/ppc/cpu_init.c| 18 +- target/ppc/excp_helper.c | 5 ++--- 3 files changed, 13 insertions(+), 18 deletions(-) diff

[PATCH 01/10] target/ppc: Merge 7x5 and 7x0 exception model IDs

2022-02-03 Thread Fabiano Rosas
Since we've split the exception code by exception model, the exception model IDs are becoming less useful. These two can be merged. Signed-off-by: Fabiano Rosas --- target/ppc/cpu-qom.h | 6 ++ target/ppc/cpu_init.c| 16 target/ppc/excp_helper.c | 2 +- 3 files

[PATCH 06/10] target/ppc: 7xx: Program exception cleanup

2022-02-03 Thread Fabiano Rosas
There's no ESR in the 7xx. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 4 1 file changed, 4 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 5e2c2aa544..8f810f7de5 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c

[PATCH 02/10] target/ppc: Introduce powerpc_excp_7xx

2022-02-03 Thread Fabiano Rosas
Introduce a new powerpc_excp function specific for PowerPC 7xx CPUs (740, 745, 750, 750cl, 750cx, 750fx, 750gx, 755). This commit copies powerpc_excp_legacy verbatim so the next one has a clean diff. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 469

[PATCH 08/10] target/ppc: 7xx: System Reset cleanup

2022-02-03 Thread Fabiano Rosas
Thre is no HV support in the 7xx. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 0bb577b75d..f29f2ecefb 100644 --- a/target/ppc

[PATCH 03/10] target/ppc: Simplify powerpc_excp_7xx

2022-02-03 Thread Fabiano Rosas
POWERPC_EXCP_THERM POWERPC_EXCP_TRACE Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 185 ++- 1 file changed, 9 insertions(+), 176 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index df96f620b2..358c3f6206 100644

[PATCH 09/11] target/ppc: 6xx: System Reset interrupt cleanup

2022-02-03 Thread Fabiano Rosas
There is no HV support in the 6xx. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 28d9a9a887..538905c4dd 100644 --- a/target/ppc

[PATCH 09/10] target/ppc: 7xx: Software TLB cleanup

2022-02-03 Thread Fabiano Rosas
This code applies only to the 7xx CPUs, so we can remove the switch statement. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index

[PATCH 07/10] target/ppc: 7xx: System Call exception cleanup

2022-02-03 Thread Fabiano Rosas
There is no Hypervisor mode in the 7xx, so no hypercalls. Signed-off-by: Fabiano Rosas --- target/ppc/excp_helper.c | 21 ++--- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 8f810f7de5..0bb577b75d 100644

[PATCH 00/10] target/ppc: powerpc_excp improvements [7xx] (8/n)

2022-02-03 Thread Fabiano Rosas
This series handles the 7xx family: 740, 745, 750, 750cl, 750cx, 750fx, 750gx and 755. Fabiano Rosas (10): target/ppc: Merge 7x5 and 7x0 exception model IDs target/ppc: Introduce powerpc_excp_7xx target/ppc: Simplify powerpc_excp_7xx target/ppc: 7xx: Machine Check exception cleanup

Re: [PATCH 10/11] target/ppc: 6xx: Software TLB exceptions cleanup

2022-02-04 Thread Fabiano Rosas
BALATON Zoltan writes: > On Thu, 3 Feb 2022, Fabiano Rosas wrote: >> This code applies only to the 6xx CPUs, so we can remove the switch >> statement. >> >> Signed-off-by: Fabiano Rosas >> --- >> target/ppc/excp_helper.c | 31 +++--

Re: [PATCH 00/11] target/ppc: powerpc_excp improvements [6xx] (7/n)

2022-02-04 Thread Fabiano Rosas
Cédric Le Goater writes: > On 2/3/22 21:09, Fabiano Rosas wrote: > >> This series handles the 6xx family: 603, 604, G2, G2LE, > > What about the e300 ? I guess it's only a 603 variant for QEMU. I forgot to mention. >> MPC5xx and MPC8xx. > > These are linux-use

<    1   2   3   4   5   6   7   8   9   10   >