[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 56/72] hw/ppc/spapr: Convert HPTE_DIRTY() macro as hpte_is_dirty()
From: |
Nicholas Piggin |
Subject: |
[PULL 56/72] hw/ppc/spapr: Convert HPTE_DIRTY() macro as hpte_is_dirty() method |
Date: |
Tue, 11 Mar 2025 22:57:50 +1000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Convert HPTE_DIRTY() macro as hpte_is_dirty() method.
sPAPR data structures including the hash page table are big-endian
regardless of current CPU endian mode, so use the big-endian LD/ST
API to access the hash PTEs.
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Message-ID: <20241220213103.6314-4-philmd@linaro.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
hw/ppc/spapr.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index daf997cea1..dd81398445 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1414,7 +1414,11 @@ static bool hpte_is_valid(SpaprMachineState *s, unsigned
index)
return ldq_be_p(hpte_get_ptr(s, index)) & HPTE64_V_VALID;
}
-#define HPTE_DIRTY(_hpte) (tswap64(*((uint64_t *)(_hpte))) &
HPTE64_V_HPTE_DIRTY)
+static bool hpte_is_dirty(SpaprMachineState *s, unsigned index)
+{
+ return ldq_be_p(hpte_get_ptr(s, index)) & HPTE64_V_HPTE_DIRTY;
+}
+
#define CLEAN_HPTE(_hpte) ((*(uint64_t *)(_hpte)) &=
tswap64(~HPTE64_V_HPTE_DIRTY))
#define DIRTY_HPTE(_hpte) ((*(uint64_t *)(_hpte)) |=
tswap64(HPTE64_V_HPTE_DIRTY))
@@ -2259,7 +2263,7 @@ static int htab_save_later_pass(QEMUFile *f,
SpaprMachineState *spapr,
/* Consume non-dirty HPTEs */
while ((index < htabslots)
- && !HPTE_DIRTY(hpte_get_ptr(spapr, index))) {
+ && !hpte_is_dirty(spapr, index)) {
index++;
examined++;
}
@@ -2267,7 +2271,7 @@ static int htab_save_later_pass(QEMUFile *f,
SpaprMachineState *spapr,
chunkstart = index;
/* Consume valid dirty HPTEs */
while ((index < htabslots) && (index - chunkstart < USHRT_MAX)
- && HPTE_DIRTY(hpte_get_ptr(spapr, index))
+ && hpte_is_dirty(spapr, index)
&& hpte_is_valid(spapr, index)) {
CLEAN_HPTE(hpte_get_ptr(spapr, index));
index++;
@@ -2277,7 +2281,7 @@ static int htab_save_later_pass(QEMUFile *f,
SpaprMachineState *spapr,
invalidstart = index;
/* Consume invalid dirty HPTEs */
while ((index < htabslots) && (index - invalidstart < USHRT_MAX)
- && HPTE_DIRTY(hpte_get_ptr(spapr, index))
+ && hpte_is_dirty(spapr, index)
&& !hpte_is_valid(spapr, index)) {
CLEAN_HPTE(hpte_get_ptr(spapr, index));
index++;
--
2.47.1
- [PULL 45/72] target/ppc: Move ppc_ldl_code() to tcg-excp_helper.c, (continued)
- [PULL 45/72] target/ppc: Move ppc_ldl_code() to tcg-excp_helper.c, Nicholas Piggin, 2025/03/11
- [PULL 41/72] hw/ppc/spapr: Restrict CONFER hypercall to TCG, Nicholas Piggin, 2025/03/11
- [PULL 44/72] target/ppc: Move TCG specific exception handlers to tcg-excp_helper.c, Nicholas Piggin, 2025/03/11
- [PULL 38/72] hw/ssi/pnv_spi: Use local var seq_index instead of get_seq_index()., Nicholas Piggin, 2025/03/11
- [PULL 43/72] target/ppc: Make ppc_ldl_code() declaration public, Nicholas Piggin, 2025/03/11
- [PULL 49/72] target/ppc: Restrict exception helpers to TCG, Nicholas Piggin, 2025/03/11
- [PULL 52/72] target/ppc: Make powerpc_excp() prototype public, Nicholas Piggin, 2025/03/11
- [PULL 53/72] target/ppc: Restrict ATTN / SCV / PMINSN helpers to TCG, Nicholas Piggin, 2025/03/11
- [PULL 54/72] hw/ppc/spapr: Convert HPTE() macro as hpte_get_ptr() method, Nicholas Piggin, 2025/03/11
- [PULL 55/72] hw/ppc/spapr: Convert HPTE_VALID() macro as hpte_is_valid() method, Nicholas Piggin, 2025/03/11
- [PULL 56/72] hw/ppc/spapr: Convert HPTE_DIRTY() macro as hpte_is_dirty() method,
Nicholas Piggin <=
- [PULL 65/72] target/ppc: Avoid warning message for zero process table entries, Nicholas Piggin, 2025/03/11
- [PULL 63/72] target/ppc: fix timebase register reset state, Nicholas Piggin, 2025/03/11
- [PULL 72/72] docs/system/ppc/amigang.rst: Update for NVRAM emulation, Nicholas Piggin, 2025/03/11
- [PULL 67/72] ppc/amigaone: Simplify replacement dummy_fw, Nicholas Piggin, 2025/03/11
- [PULL 40/72] hw/ssi/pnv_spi: Put a limit to RDR match failures, Nicholas Piggin, 2025/03/11
- [PULL 50/72] target/ppc: Restrict various common helpers to TCG, Nicholas Piggin, 2025/03/11
- [PULL 57/72] hw/ppc/spapr: Convert CLEAN_HPTE() macro as hpte_set_clean() method, Nicholas Piggin, 2025/03/11
- [PULL 61/72] ppc: spapr: Enable 2nd DAWR on Power10 pSeries machine, Nicholas Piggin, 2025/03/11
- [PULL 62/72] spapr: nested: Add support for reporting Hostwide state counter, Nicholas Piggin, 2025/03/11
- [PULL 39/72] hw/ssi/pnv_spi: Make bus names distinct for each controllers of a socket, Nicholas Piggin, 2025/03/11