spapr.c (7b2c4cdd794e499883281c18770b2d16adebfaac) spapr.c (a03509cd2baf48b1e947d9eb203ccb95bd99e5fb)
1/*
2 * QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emulator
3 *
4 * Copyright (c) 2004-2007 Fabrice Bellard
5 * Copyright (c) 2007 Jocelyn Mayer
6 * Copyright (c) 2010 David Gibson, IBM Corporation.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy

--- 3640 unchanged lines hidden (view full) ---

3649 spapr_pending_dimm_unplugs_add(spapr, nr_lmbs, dimm);
3650
3651 addr = addr_start;
3652 for (i = 0; i < nr_lmbs; i++) {
3653 drc = spapr_drc_by_id(TYPE_SPAPR_DRC_LMB,
3654 addr / SPAPR_MEMORY_BLOCK_SIZE);
3655 g_assert(drc);
3656
1/*
2 * QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emulator
3 *
4 * Copyright (c) 2004-2007 Fabrice Bellard
5 * Copyright (c) 2007 Jocelyn Mayer
6 * Copyright (c) 2010 David Gibson, IBM Corporation.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy

--- 3640 unchanged lines hidden (view full) ---

3649 spapr_pending_dimm_unplugs_add(spapr, nr_lmbs, dimm);
3650
3651 addr = addr_start;
3652 for (i = 0; i < nr_lmbs; i++) {
3653 drc = spapr_drc_by_id(TYPE_SPAPR_DRC_LMB,
3654 addr / SPAPR_MEMORY_BLOCK_SIZE);
3655 g_assert(drc);
3656
3657 spapr_drc_detach(drc);
3657 spapr_drc_unplug_request(drc);
3658 addr += SPAPR_MEMORY_BLOCK_SIZE;
3659 }
3660
3661 drc = spapr_drc_by_id(TYPE_SPAPR_DRC_LMB,
3662 addr_start / SPAPR_MEMORY_BLOCK_SIZE);
3663 g_assert(drc);
3664 spapr_hotplug_req_remove_by_count_indexed(SPAPR_DR_CONNECTOR_TYPE_LMB,
3665 nr_lmbs, spapr_drc_index(drc));

--- 51 unchanged lines hidden (view full) ---

3717 return;
3718 }
3719
3720 drc = spapr_drc_by_id(TYPE_SPAPR_DRC_CPU,
3721 spapr_vcpu_id(spapr, cc->core_id));
3722 g_assert(drc);
3723
3724 if (!spapr_drc_unplug_requested(drc)) {
3658 addr += SPAPR_MEMORY_BLOCK_SIZE;
3659 }
3660
3661 drc = spapr_drc_by_id(TYPE_SPAPR_DRC_LMB,
3662 addr_start / SPAPR_MEMORY_BLOCK_SIZE);
3663 g_assert(drc);
3664 spapr_hotplug_req_remove_by_count_indexed(SPAPR_DR_CONNECTOR_TYPE_LMB,
3665 nr_lmbs, spapr_drc_index(drc));

--- 51 unchanged lines hidden (view full) ---

3717 return;
3718 }
3719
3720 drc = spapr_drc_by_id(TYPE_SPAPR_DRC_CPU,
3721 spapr_vcpu_id(spapr, cc->core_id));
3722 g_assert(drc);
3723
3724 if (!spapr_drc_unplug_requested(drc)) {
3725 spapr_drc_detach(drc);
3725 spapr_drc_unplug_request(drc);
3726 spapr_hotplug_req_remove_by_index(drc);
3727 }
3728}
3729
3730int spapr_core_dt_populate(SpaprDrc *drc, SpaprMachineState *spapr,
3731 void *fdt, int *fdt_start_offset, Error **errp)
3732{
3733 SpaprCpuCore *core = SPAPR_CPU_CORE(drc->dev);

--- 246 unchanged lines hidden (view full) ---

3980{
3981 SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(dev);
3982 SpaprDrc *drc;
3983
3984 drc = spapr_drc_by_id(TYPE_SPAPR_DRC_PHB, sphb->index);
3985 assert(drc);
3986
3987 if (!spapr_drc_unplug_requested(drc)) {
3726 spapr_hotplug_req_remove_by_index(drc);
3727 }
3728}
3729
3730int spapr_core_dt_populate(SpaprDrc *drc, SpaprMachineState *spapr,
3731 void *fdt, int *fdt_start_offset, Error **errp)
3732{
3733 SpaprCpuCore *core = SPAPR_CPU_CORE(drc->dev);

--- 246 unchanged lines hidden (view full) ---

3980{
3981 SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(dev);
3982 SpaprDrc *drc;
3983
3984 drc = spapr_drc_by_id(TYPE_SPAPR_DRC_PHB, sphb->index);
3985 assert(drc);
3986
3987 if (!spapr_drc_unplug_requested(drc)) {
3988 spapr_drc_detach(drc);
3988 spapr_drc_unplug_request(drc);
3989 spapr_hotplug_req_remove_by_index(drc);
3990 }
3991}
3992
3993static
3994bool spapr_tpm_proxy_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
3995 Error **errp)
3996{

--- 986 unchanged lines hidden ---
3989 spapr_hotplug_req_remove_by_index(drc);
3990 }
3991}
3992
3993static
3994bool spapr_tpm_proxy_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
3995 Error **errp)
3996{

--- 986 unchanged lines hidden ---