qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] spapr: Drop dead code in spapr_reallocate_hpt()
@ 2020-10-29 15:33 Greg Kurz
  2020-10-29 15:33 ` [PATCH 2/2] spapr: Convert hpt_prepare_thread() to use qemu_try_memalign() Greg Kurz
  2020-10-29 20:11 ` [PATCH 1/2] spapr: Drop dead code in spapr_reallocate_hpt() David Gibson
  0 siblings, 2 replies; 3+ messages in thread
From: Greg Kurz @ 2020-10-29 15:33 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-ppc, Philippe Mathieu-Daudé, qemu-devel

Sometimes QEMU needs to allocate the HPT in userspace, namely with TCG
or PR KVM. This is performed with qemu_memalign() because of alignment
requirements. Like glib's allocators, its behaviour is to abort on OOM
instead of returning NULL.

This could be changed to qemu_try_memalign(), but in the specific case
of spapr_reallocate_hpt(), the outcome would be to terminate QEMU anyway
since no HPT means no MMU for the guest. Drop the dead code instead.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/ppc/spapr.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 227075103e9a..12a012d9dd09 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1522,12 +1522,6 @@ int spapr_reallocate_hpt(SpaprMachineState *spapr, int shift, Error **errp)
         int i;
 
         spapr->htab = qemu_memalign(size, size);
-        if (!spapr->htab) {
-            error_setg_errno(errp, errno,
-                             "Could not allocate HPT of order %d", shift);
-            return -ENOMEM;
-        }
-
         memset(spapr->htab, 0, size);
         spapr->htab_shift = shift;
 




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

end of thread, other threads:[~2020-10-29 20:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 15:33 [PATCH 1/2] spapr: Drop dead code in spapr_reallocate_hpt() Greg Kurz
2020-10-29 15:33 ` [PATCH 2/2] spapr: Convert hpt_prepare_thread() to use qemu_try_memalign() Greg Kurz
2020-10-29 20:11 ` [PATCH 1/2] spapr: Drop dead code in spapr_reallocate_hpt() David Gibson

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