All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Musta <tommusta@gmail.com>
To: qemu-devel@nongnu.org
Cc: tommusta@gmail.com, qemu-ppc@nongnu.org
Subject: [Qemu-devel] [PATCH 1/4] linux-user: Correct AUXV Cache Line Sizes for PowerPC
Date: Mon, 16 Jun 2014 11:03:19 -0500	[thread overview]
Message-ID: <1402934602-29002-2-git-send-email-tommusta@gmail.com> (raw)
In-Reply-To: <1402934602-29002-1-git-send-email-tommusta@gmail.com>

Set the AT_ICACHEBSIZE and AT_DCACHEBSIZE entries of the AUXV to match the
CPU model's cache line sizes.  This fixes memory clobbering problems on more
recent Book 3s implementations; memset(p, 0, N) will use the dcbz instruction
when N is sufficiently large and many of the newer server CPUs have cache lines
sizes of 128 bytes.

Signed-off-by: Tom Musta <tommusta@gmail.com>
---
 linux-user/elfload.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 127c565..9a32899 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -767,8 +767,9 @@ static uint32_t get_elf_hwcap(void)
 #define DLINFO_ARCH_ITEMS       5
 #define ARCH_DLINFO                                     \
     do {                                                \
-        NEW_AUX_ENT(AT_DCACHEBSIZE, 0x20);              \
-        NEW_AUX_ENT(AT_ICACHEBSIZE, 0x20);              \
+        PowerPCCPU *cpu = POWERPC_CPU(thread_cpu);              \
+        NEW_AUX_ENT(AT_DCACHEBSIZE, cpu->env.dcache_line_size); \
+        NEW_AUX_ENT(AT_ICACHEBSIZE, cpu->env.icache_line_size); \
         NEW_AUX_ENT(AT_UCACHEBSIZE, 0);                 \
         /*                                              \
          * Now handle glibc compatibility.              \
-- 
1.7.1

  reply	other threads:[~2014-06-16 16:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 16:03 [Qemu-devel] [PATCH 0/4] AUXV Fixes for PowerPC Linux User Mode Tom Musta
2014-06-16 16:03 ` Tom Musta [this message]
2014-06-16 16:03 ` [Qemu-devel] [PATCH 2/4] target-ppc: Add DFP to Emulated Instructions Flag Tom Musta
2014-06-16 16:03 ` [Qemu-devel] [PATCH 3/4] linux-user: Identify Addition Hardware Capabilities for PowerPC Tom Musta
2014-06-16 16:03 ` [Qemu-devel] [PATCH 4/4] linux-user: Support HWCAP2 in PowerPC Tom Musta
2014-06-16 22:39 ` [Qemu-devel] [Qemu-ppc] [PATCH 0/4] AUXV Fixes for PowerPC Linux User Mode Alexander Graf

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=1402934602-29002-2-git-send-email-tommusta@gmail.com \
    --to=tommusta@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.