From: Auger Eric <eric.auger@redhat.com>
To: David Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Stefan Weil <sw@weilnetz.de>,
Xiao Guangrong <xiaoguangrong.eric@gmail.com>,
Alexander Graf <agraf@suse.de>,
qemu-ppc@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v3 3/4] pc: drop memory region alignment check for 0
Date: Tue, 3 Jul 2018 10:10:54 +0200 [thread overview]
Message-ID: <edd967e7-28f9-4d7f-564c-5343f69a663d@redhat.com> (raw)
In-Reply-To: <20180702093755.7384-4-david@redhat.com>
Hi David,
On 07/02/2018 11:37 AM, David Hildenbrand wrote:
> All applicable memory regions always have an alignment > 0. All memory
> backends result in file_ram_alloc() or qemu_anon_ram_alloc() getting
> called, setting the alignment to > 0.
>
> So a PCDIMM memory region always has an alignment > 0. NVDIMM copy the
> alignment of the original memory memory region into the handcrafted memory
> region that will be used at this place.
>
> So the check for 0 can be dropped and we can reduce the special
> handling.
>
> Dropping this check makes factoring out of alignment handling easier as
> compat handling only has to look at pcmc->enforce_aligned_dimm and not
> care about the alignment of the memory region.
>
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> hw/i386/pc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index bf986baf91..934b7155b1 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1712,7 +1712,7 @@ static void pc_memory_plug(HotplugHandler *hotplug_dev,
> uint64_t align = TARGET_PAGE_SIZE;
> bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
>
> - if (memory_region_get_alignment(mr) && pcmc->enforce_aligned_dimm) {
> + if (pcmc->enforce_aligned_dimm) {
> align = memory_region_get_alignment(mr);
> }
>
>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Thanks
Eric
next prev parent reply other threads:[~2018-07-03 8:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 9:37 [Qemu-devel] [PATCH v3 0/4] pc-dimm: pre_plug "slot" and "addr" assignment David Hildenbrand
2018-07-02 9:37 ` [Qemu-devel] [PATCH v3 1/4] pc-dimm: assign and verify the "slot" property during pre_plug David Hildenbrand
2018-07-03 8:10 ` Auger Eric
2018-07-02 9:37 ` [Qemu-devel] [PATCH v3 2/4] util/oslib-win32: indicate alignment for qemu_anon_ram_alloc() David Hildenbrand
2018-07-02 10:16 ` Igor Mammedov
2018-07-03 8:10 ` Auger Eric
2018-07-02 9:37 ` [Qemu-devel] [PATCH v3 3/4] pc: drop memory region alignment check for 0 David Hildenbrand
2018-07-03 8:10 ` Auger Eric [this message]
2018-07-02 9:37 ` [Qemu-devel] [PATCH v3 4/4] pc-dimm: assign and verify the "addr" property during pre_plug David Hildenbrand
2018-07-02 10:31 ` Igor Mammedov
2018-07-02 10:39 ` David Hildenbrand
2018-07-02 12:44 ` Igor Mammedov
2018-07-02 12:47 ` David Hildenbrand
2018-07-03 8:20 ` Auger Eric
2018-07-03 8:22 ` Auger Eric
2018-07-03 0:19 ` David Gibson
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=edd967e7-28f9-4d7f-564c-5343f69a663d@redhat.com \
--to=eric.auger@redhat.com \
--cc=agraf@suse.de \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
--cc=sw@weilnetz.de \
--cc=xiaoguangrong.eric@gmail.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).