ppc-7.0 queue:

* Coverity fixes
 * Fix for a memory leak issue
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmJKsD8ACgkQUaNDx8/7
 7KHPLw//VwXltsrxSUA1ND8gIIoKloWBwMv966Rdy5zCHf+s3JwUnW8Kb9y0WzTT
 WY7DDnZjojMWgcIegFO25rB/T+8dKTLlmDmz2V0o80NOKwXjZm5LpIqk3U0g2vHA
 6S+rnMPK+5jfBgV5x38bSOELri8mhv05MQeFC3JlIzKo7+tV7AJ3bExQ53N042tC
 8mpNCayqR3JhEaOql2sGg1SbC6Sz/gf5tPJo+LD2miMUg54jdcO2E9gdun1qSdKk
 +HwMzjzTv3FnuwpIPs50c/DzFqrYzsva+k1+6mrTcEkB4JTBqXNlUNIuTZaaEAkB
 tgjKPw7AR3KVzj//YnoY6J2emfyAUqYcQwxU8y8lBAgEQmvG95TK1K10XDlPbtlg
 8Q4v9IgsaFAZEQhC5+pAJYBHJpKIXtGylFz0z6TooZroIhkbr6HlZSdhs7OUZdbf
 MyIgr12uTT9uwK2wtlt4hsQ8rLNSM/FpudWWmLf7Hog6UC0xsjSbgwpHSVQvNDzK
 ahdYTySqXGisbUzzeze1e3f57xb3EiT2cBKo1teM+oVndvPLFbGXMrKvUA7chEMn
 lX2i7RTyZSSXB9khPFGiCbN01tJER7w1DGCWNYrSowqzvOOx1OoqWzAQg9jwmlok
 pleWiazF+WYxBagSpaFw7oicYu3ZbuoAtNpXCt+Orb+TVIH8qtU=
 =8JCW
 -----END PGP SIGNATURE-----

Merge tag 'pull-ppc-20220404' of https://github.com/legoater/qemu into staging

ppc-7.0 queue:

* Coverity fixes
* Fix for a memory leak issue

# gpg: Signature made Mon 04 Apr 2022 09:45:51 BST
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@kaod.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1

* tag 'pull-ppc-20220404' of https://github.com/legoater/qemu:
  linux-user/ppc: Narrow type of ccr in save_user_regs
  ppc/pnv: Fix number of registers in the PCIe controller on POWER9
  hw/ppc: free env->tb_env in spapr_unrealize_vcpu()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2022-04-04 15:48:55 +01:00
commit 20661b75ea
5 changed files with 13 additions and 2 deletions

View File

@ -1083,6 +1083,13 @@ clk_setup_cb cpu_ppc_tb_init (CPUPPCState *env, uint32_t freq)
return &cpu_ppc_set_tb_clk;
}
void cpu_ppc_tb_free(CPUPPCState *env)
{
timer_free(env->tb_env->decr_timer);
timer_free(env->tb_env->hdecr_timer);
g_free(env->tb_env);
}
/* cpu_ppc_hdecr_init may be used if the timer is not used by HDEC emulation */
void cpu_ppc_hdecr_init(CPUPPCState *env)
{

View File

@ -189,10 +189,13 @@ static const VMStateDescription vmstate_spapr_cpu_state = {
static void spapr_unrealize_vcpu(PowerPCCPU *cpu, SpaprCpuCore *sc)
{
CPUPPCState *env = &cpu->env;
if (!sc->pre_3_0_migration) {
vmstate_unregister(NULL, &vmstate_spapr_cpu_state, cpu->machine_data);
}
spapr_irq_cpu_intc_destroy(SPAPR_MACHINE(qdev_get_machine()), cpu);
cpu_ppc_tb_free(env);
qdev_unrealize(DEVICE(cpu));
}

View File

@ -180,7 +180,7 @@ struct PnvPhb4PecState {
MemoryRegion nest_regs_mr;
/* PCI registers, excluding per-stack */
#define PHB4_PEC_PCI_REGS_COUNT 0x2
#define PHB4_PEC_PCI_REGS_COUNT 0x3
uint64_t pci_regs[PHB4_PEC_PCI_REGS_COUNT];
MemoryRegion pci_regs_mr;

View File

@ -54,6 +54,7 @@ struct ppc_tb_t {
uint64_t cpu_ppc_get_tb(ppc_tb_t *tb_env, uint64_t vmclk, int64_t tb_offset);
clk_setup_cb cpu_ppc_tb_init (CPUPPCState *env, uint32_t freq);
void cpu_ppc_tb_free(CPUPPCState *env);
void cpu_ppc_hdecr_init(CPUPPCState *env);
void cpu_ppc_hdecr_exit(CPUPPCState *env);

View File

@ -229,7 +229,7 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame)
{
target_ulong msr = env->msr;
int i;
target_ulong ccr = 0;
uint32_t ccr = 0;
/* In general, the kernel attempts to be intelligent about what it
needs to save for Altivec/FP/SPE registers. We don't care that