From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-ppc@nongnu.org, "Philippe Mathieu-Daudé" <philmd@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] spapr: Drop dead code in spapr_reallocate_hpt()
Date: Fri, 30 Oct 2020 07:11:49 +1100 [thread overview]
Message-ID: <20201029201149.GL5604@yekko.fritz.box> (raw)
In-Reply-To: <160398562892.32380.15006707861753544263.stgit@bahia.lan>
[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]
On Thu, Oct 29, 2020 at 04:33:48PM +0100, Greg Kurz wrote:
> 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>
Series applied to ppc-for-5.2.
> ---
> 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;
>
>
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2020-10-29 20:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` David Gibson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201029201149.GL5604@yekko.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).