qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Bernhard Beschow <shentey@gmail.com>, qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>,
	qemu-trivial@nongnu.org, BALATON Zoltan <balaton@eik.bme.hu>,
	Laurent Vivier <lvivier@redhat.com>,
	Sunil Muthuswamy <sunilmut@microsoft.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>
Subject: Re: [PATCH v3 9/9] target/i386/tcg/sysemu/tcg-cpu: Avoid own opinion about smram size
Date: Sun, 5 Feb 2023 12:26:10 +0100	[thread overview]
Message-ID: <4aaafceb-848a-c4eb-2a06-0ad37899deb1@linaro.org> (raw)
In-Reply-To: <20230204151027.39007-10-shentey@gmail.com>

On 4/2/23 16:10, Bernhard Beschow wrote:
> When setting up the CPU's smram memory region alias, the code currently
> assumes that the smram size is 4 GiB. While this is true, it repeats a
> decision made elsewhere which seems redundant and prone to
> inconsistencies. Avoid this by reusing whatever size the smram region
> was set to.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   target/i386/tcg/sysemu/tcg-cpu.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/target/i386/tcg/sysemu/tcg-cpu.c b/target/i386/tcg/sysemu/tcg-cpu.c
> index c223c0fe9b..8f5ce6093c 100644
> --- a/target/i386/tcg/sysemu/tcg-cpu.c
> +++ b/target/i386/tcg/sysemu/tcg-cpu.c
> @@ -22,7 +22,6 @@
>   #include "tcg/helper-tcg.h"
>   
>   #include "sysemu/sysemu.h"
> -#include "qemu/units.h"
>   #include "exec/address-spaces.h"
>   
>   #include "tcg/tcg-cpu.h"
> @@ -36,7 +35,7 @@ static void tcg_cpu_machine_done(Notifier *n, void *unused)
>       if (smram) {
>           cpu->smram = g_new(MemoryRegion, 1);
>           memory_region_init_alias(cpu->smram, OBJECT(cpu), "smram",
> -                                 smram, 0, 4 * GiB);
> +                                 smram, 0, memory_region_size(smram));

Or define SMRAM_REGION_SIZE and use it?

(subject header can be shortened to "target/i386:").


  reply	other threads:[~2023-02-05 11:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04 15:10 [PATCH v3 0/9] PC cleanups Bernhard Beschow
2023-02-04 15:10 ` [PATCH v3 1/9] hw/pci-host/i440fx: Inline sysbus_add_io() Bernhard Beschow
2023-02-05 11:05   ` Philippe Mathieu-Daudé
2023-02-04 15:10 ` [PATCH v3 2/9] hw/pci-host/q35: " Bernhard Beschow
2023-02-05 11:12   ` Philippe Mathieu-Daudé
2023-02-06  0:15     ` Bernhard Beschow
2023-02-04 15:10 ` [PATCH v3 3/9] hw/i386/pc_q35: Reuse machine parameter Bernhard Beschow
2023-02-05 11:13   ` Philippe Mathieu-Daudé
2023-02-04 15:10 ` [PATCH v3 4/9] hw/i386/pc_{q35, piix}: Reuse MachineClass::desc as SMB product name Bernhard Beschow
2023-02-04 15:10 ` [PATCH v3 5/9] hw/i386/pc_{q35, piix}: Minimize usage of get_system_memory() Bernhard Beschow
2023-02-05 11:13   ` Philippe Mathieu-Daudé
2023-02-04 15:10 ` [PATCH v3 6/9] hw/i386/pc: Initialize ram_memory variable directly Bernhard Beschow
2023-02-04 15:26   ` BALATON Zoltan
2023-02-06  0:07     ` Bernhard Beschow
2023-02-04 15:10 ` [PATCH v3 7/9] hw/pci-host/pam: Make init_pam() usage more readable Bernhard Beschow
2023-02-05 11:16   ` Philippe Mathieu-Daudé
2023-02-04 15:10 ` [PATCH v3 8/9] hw/i386/x86: Make TYPE_X86_MACHINE the owner of smram Bernhard Beschow
2023-02-05 11:21   ` Philippe Mathieu-Daudé
2023-02-06 10:06     ` Juan Quintela
2023-02-07 15:17       ` Bernhard Beschow
2023-02-07 18:34         ` Juan Quintela
2023-02-07 22:43           ` Bernhard Beschow
2023-02-04 15:10 ` [PATCH v3 9/9] target/i386/tcg/sysemu/tcg-cpu: Avoid own opinion about smram size Bernhard Beschow
2023-02-05 11:26   ` Philippe Mathieu-Daudé [this message]
2023-02-07 22:46     ` Bernhard Beschow

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=4aaafceb-848a-c4eb-2a06-0ad37899deb1@linaro.org \
    --to=philmd@linaro.org \
    --cc=ani@anisinha.ca \
    --cc=balaton@eik.bme.hu \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shentey@gmail.com \
    --cc=sunilmut@microsoft.com \
    --cc=thuth@redhat.com \
    /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).