From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Roman Kagan <rkagan@virtuozzo.com>
Subject: [PATCH] hyperv: set priority for SynIC pages
Date: Thu, 9 Jan 2020 10:41:17 +0100 [thread overview]
Message-ID: <20200109094117.16237-1-pbonzini@redhat.com> (raw)
On PC systems, system memory is organized like this:
- priority -1 is the PCI BARs
- priority 0 is the RAM
- priority 1 pokes holes in RAM whenever PCI BARs should appear instead
(for example due to SMRAM or PAM configuration), plus it contains RAM
regions in RAM mode (again toggled by PAM configuration).
(SMRAM for CPUs in SMM has "infinite" priority since it is added in a
completely different address space).
SynIC memory regions are overlaid on top of memory, so they should have
the highest priority except for SMRAM. Implement this by giving them
priority 2.
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/hyperv/hyperv.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/hyperv/hyperv.c b/hw/hyperv/hyperv.c
index da8ce82725..dc8d3b31c3 100644
--- a/hw/hyperv/hyperv.c
+++ b/hw/hyperv/hyperv.c
@@ -53,8 +53,8 @@ static void synic_update(SynICState *synic, bool enable,
&synic->msg_page_mr);
}
if (msg_page_addr) {
- memory_region_add_subregion(get_system_memory(), msg_page_addr,
- &synic->msg_page_mr);
+ memory_region_add_subregion_overlap(get_system_memory(), msg_page_addr,
+ &synic->msg_page_mr, 2);
}
synic->msg_page_addr = msg_page_addr;
}
@@ -64,8 +64,8 @@ static void synic_update(SynICState *synic, bool enable,
&synic->event_page_mr);
}
if (event_page_addr) {
- memory_region_add_subregion(get_system_memory(), event_page_addr,
- &synic->event_page_mr);
+ memory_region_add_subregion_overlap(get_system_memory(), event_page_addr,
+ &synic->event_page_mr, 2);
}
synic->event_page_addr = event_page_addr;
}
--
2.21.0
reply other threads:[~2020-01-09 9:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200109094117.16237-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkagan@virtuozzo.com \
--cc=vkuznets@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).