qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Baumann <Andrew.Baumann@microsoft.com>
To: qemu-devel@nongnu.org, qemu-arm@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Andrew Baumann <Andrew.Baumann@microsoft.com>
Subject: [Qemu-devel] [PATCH 2/2] target/arm: lie more convincingly about memory attributes in PAR_EL1
Date: Tue, 28 Feb 2017 13:58:01 -0800	[thread overview]
Message-ID: <20170228215801.10472-3-Andrew.Baumann@microsoft.com> (raw)
In-Reply-To: <20170228215801.10472-1-Andrew.Baumann@microsoft.com>

On a successful long-descriptor translation, PAR_EL1 bits 56:63 are
expected to report the memory attributes of the page. However, the
page table walker (get_phys_addr()) does not currently retrieve these
attributes. Rather than leaving these bits clear (which implies
uncacheable device memory), this change sets them to 0xff, which
corresponds to write-back cached normal memory.

Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com>
---
In my (biased!) opinion, this is a better lie to tell for an emulated
environment. It also happens to un-break the Windows boot process, and
enable an NT kernel optimisation (DC ZVA for page zeroing).

 target/arm/helper.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 760092a..b858d6d 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -2159,7 +2159,13 @@ static uint64_t do_ats_write(CPUARMState *env, uint64_t value,
             if (!attrs.secure) {
                 par64 |= (1 << 9); /* NS */
             }
-            /* We don't set the ATTR or SH fields in the PAR. */
+            /* ATTR bits are all set, which implies:
+             *   normal memory
+             *   outer write-back non-transient, read/write-allocate
+             *   inner write-back non-transient, read/write-allocate
+             */
+            par64 |= ((uint64_t)0xff << 56); /* ATTR */
+            /* We don't set the SH field in the PAR. */
         } else {
             par64 |= 1; /* F */
             par64 |= (fsr & 0x3f) << 1; /* FS */
-- 
2.8.3

  parent reply	other threads:[~2017-02-28 21:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 21:57 [Qemu-devel] [PATCH 0/2] misc aarch64 fixes for Windows Andrew Baumann
2017-02-28 21:58 ` [Qemu-devel] [PATCH 1/2] target/arm: implement armv8 PMUSERENR (user-mode enable bits) Andrew Baumann
2017-03-02 15:58   ` Peter Maydell
2017-02-28 21:58 ` Andrew Baumann [this message]
2017-02-28 22:52   ` [Qemu-devel] [PATCH 2/2] target/arm: lie more convincingly about memory attributes in PAR_EL1 Peter Maydell
2017-02-28 22:13 ` [Qemu-devel] [PATCH 0/2] misc aarch64 fixes for Windows no-reply
2017-02-28 22:22   ` Andrew Baumann
2017-03-02 16:04     ` Peter Maydell

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=20170228215801.10472-3-Andrew.Baumann@microsoft.com \
    --to=andrew.baumann@microsoft.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@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).