All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <tony.nguyen.git@gmail.com>
To: qemu-devel@nongnu.org
Cc: Tony Nguyen <tony.nguyen.git@gmail.com>,
	Tony Nguyen <tony.nguyen@bt.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Richard Henderson <richard.henderson@linaro.org>,
	Artyom Tarasenko <atar4qemu@gmail.com>
Subject: [Qemu-devel] [PATCH v8 20/21] target/sparc: Add TLB entry with attributes
Date: Thu, 22 Aug 2019 01:09:14 +1000	[thread overview]
Message-ID: <9ba4b3413e6878b4a868be0dddeba8bec00a2e07.1566397711.git.tony.nguyen.git@gmail.com> (raw)
In-Reply-To: <cover.1566397711.git.tony.nguyen.git@gmail.com>

Append MemTxAttrs to interfaces so we can pass along up coming Invert
Endian TTE bit on SPARC64.

Signed-off-by: Tony Nguyen <tony.nguyen@bt.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/sparc/mmu_helper.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c
index cbd1e91179..826e14b6f0 100644
--- a/target/sparc/mmu_helper.c
+++ b/target/sparc/mmu_helper.c
@@ -88,7 +88,7 @@ static const int perm_table[2][8] = {
 };
 
 static int get_physical_address(CPUSPARCState *env, hwaddr *physical,
-                                int *prot, int *access_index,
+                                int *prot, int *access_index, MemTxAttrs *attrs,
                                 target_ulong address, int rw, int mmu_idx,
                                 target_ulong *page_size)
 {
@@ -219,6 +219,7 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     target_ulong vaddr;
     target_ulong page_size;
     int error_code = 0, prot, access_index;
+    MemTxAttrs attrs = {};
 
     /*
      * TODO: If we ever need tlb_vaddr_to_host for this target,
@@ -229,7 +230,7 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     assert(!probe);
 
     address &= TARGET_PAGE_MASK;
-    error_code = get_physical_address(env, &paddr, &prot, &access_index,
+    error_code = get_physical_address(env, &paddr, &prot, &access_index, &attrs,
                                       address, access_type,
                                       mmu_idx, &page_size);
     vaddr = address;
@@ -490,8 +491,8 @@ static inline int ultrasparc_tag_match(SparcTLBEntry *tlb,
     return 0;
 }
 
-static int get_physical_address_data(CPUSPARCState *env,
-                                     hwaddr *physical, int *prot,
+static int get_physical_address_data(CPUSPARCState *env, hwaddr *physical,
+                                     int *prot, MemTxAttrs *attrs,
                                      target_ulong address, int rw, int mmu_idx)
 {
     CPUState *cs = env_cpu(env);
@@ -608,8 +609,8 @@ static int get_physical_address_data(CPUSPARCState *env,
     return 1;
 }
 
-static int get_physical_address_code(CPUSPARCState *env,
-                                     hwaddr *physical, int *prot,
+static int get_physical_address_code(CPUSPARCState *env, hwaddr *physical,
+                                     int *prot, MemTxAttrs *attrs,
                                      target_ulong address, int mmu_idx)
 {
     CPUState *cs = env_cpu(env);
@@ -686,7 +687,7 @@ static int get_physical_address_code(CPUSPARCState *env,
 }
 
 static int get_physical_address(CPUSPARCState *env, hwaddr *physical,
-                                int *prot, int *access_index,
+                                int *prot, int *access_index, MemTxAttrs *attrs,
                                 target_ulong address, int rw, int mmu_idx,
                                 target_ulong *page_size)
 {
@@ -716,11 +717,11 @@ static int get_physical_address(CPUSPARCState *env, hwaddr *physical,
     }
 
     if (rw == 2) {
-        return get_physical_address_code(env, physical, prot, address,
+        return get_physical_address_code(env, physical, prot, attrs, address,
                                          mmu_idx);
     } else {
-        return get_physical_address_data(env, physical, prot, address, rw,
-                                         mmu_idx);
+        return get_physical_address_data(env, physical, prot, attrs, address,
+                                         rw, mmu_idx);
     }
 }
 
@@ -734,10 +735,11 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     target_ulong vaddr;
     hwaddr paddr;
     target_ulong page_size;
+    MemTxAttrs attrs = {};
     int error_code = 0, prot, access_index;
 
     address &= TARGET_PAGE_MASK;
-    error_code = get_physical_address(env, &paddr, &prot, &access_index,
+    error_code = get_physical_address(env, &paddr, &prot, &access_index, &attrs,
                                       address, access_type,
                                       mmu_idx, &page_size);
     if (likely(error_code == 0)) {
@@ -747,7 +749,8 @@ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                                    env->dmmu.mmu_primary_context,
                                    env->dmmu.mmu_secondary_context);
 
-        tlb_set_page(cs, vaddr, paddr, prot, mmu_idx, page_size);
+        tlb_set_page_with_attrs(cs, vaddr, paddr, attrs, prot, mmu_idx,
+                                page_size);
         return true;
     }
     if (probe) {
@@ -849,9 +852,10 @@ static int cpu_sparc_get_phys_page(CPUSPARCState *env, hwaddr *phys,
 {
     target_ulong page_size;
     int prot, access_index;
+    MemTxAttrs attrs = {};
 
-    return get_physical_address(env, phys, &prot, &access_index, addr, rw,
-                                mmu_idx, &page_size);
+    return get_physical_address(env, phys, &prot, &access_index, &attrs, addr,
+                                rw, mmu_idx, &page_size);
 }
 
 #if defined(TARGET_SPARC64)
-- 
2.23.0



  parent reply	other threads:[~2019-08-21 15:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1566397711.git.tony.nguyen.git@gmail.com>
2019-08-21 15:08 ` [Qemu-devel] [PATCH v8 01/21] configure: Define TARGET_ALIGNED_ONLY in configure Tony Nguyen
2019-08-22  0:22   ` Richard Henderson
2019-08-21 15:08 ` [Qemu-devel] [PATCH v8 02/21] tcg: TCGMemOp is now accelerator independent MemOp Tony Nguyen
2019-08-21 15:08   ` [Qemu-riscv] " Tony Nguyen
2019-08-21 15:08 ` [Qemu-devel] [PATCH v8 03/21] memory: Introduce size_memop Tony Nguyen
2019-08-21 15:08 ` [Qemu-devel] [PATCH v8 04/21] target/mips: Access MemoryRegion with MemOp Tony Nguyen
2019-08-21 16:50   ` [Qemu-devel] [EXTERNAL] " Aleksandar Markovic
2019-08-21 15:08 ` [Qemu-devel] [PATCH v8 05/21] hw/s390x: " Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 06/21] hw/intc/armv7m_nic: " Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 07/21] hw/virtio: " Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 08/21] hw/vfio: " Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 09/21] exec: " Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 10/21] cputlb: " Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 11/21] memory: " Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 12/21] hw/s390x: Hard code size with MO_{8|16|32|64} Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 13/21] target/mips: " Tony Nguyen
2019-08-21 16:48   ` [Qemu-devel] [EXTERNAL] " Aleksandar Markovic
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 14/21] exec: " Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 16/21] cputlb: Replace size and endian operands for MemOp Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 17/21] memory: Single byte swap along the I/O path Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 18/21] cpu: TLB_FLAGS_MASK bit to force memory slow path Tony Nguyen
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 19/21] cputlb: Byte swap memory transaction attribute Tony Nguyen
2019-08-21 15:09 ` Tony Nguyen [this message]
2019-08-21 15:09 ` [Qemu-devel] [PATCH v8 21/21] target/sparc: sun4u Invert Endian TTE bit Tony Nguyen

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=9ba4b3413e6878b4a868be0dddeba8bec00a2e07.1566397711.git.tony.nguyen.git@gmail.com \
    --to=tony.nguyen.git@gmail.com \
    --cc=atar4qemu@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=tony.nguyen@bt.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 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.