qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* target/arm: cp15.dacr migration
@ 2022-02-07 12:13 Pavel Dovgalyuk
  2022-02-07 13:44 ` Peter Maydell
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Dovgalyuk @ 2022-02-07 12:13 UTC (permalink / raw)
  To: QEMU Developers, qemu-arm, Peter Maydell

I recently encountered a problem with cp15.dacr register.
It has _s and _ns versions. During the migration only dacr_ns is 
saved/loaded.
But both of the values are used in get_phys_addr_v5 and get_phys_addr_v6 
functions. Therefore VM behavior becomes incorrect after loading the 
vmstate.

I found that kvm_to_cpreg_id is responsible for disabling dacr_s 
migration, because it always selects ns variant.

I used the following changes to solve the problem, but I'm not sure that 
these changes do not break anything in KVM.

Can anyone give me an advice about that?


diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index c6a4d50e82..d3ffef3640 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2510,11 +2510,6 @@ static inline uint32_t kvm_to_cpreg_id(uint64_t 
kvmid)
          if ((kvmid & CP_REG_SIZE_MASK) == CP_REG_SIZE_U64) {
              cpregid |= (1 << 15);
          }
-
-        /* KVM is always non-secure so add the NS flag on AArch32 register
-         * entries.
-         */
-         cpregid |= 1 << CP_REG_NS_SHIFT;
      }
      return cpregid;
  }


--
Pavel Dovgalyuk


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-08 10:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-07 12:13 target/arm: cp15.dacr migration Pavel Dovgalyuk
2022-02-07 13:44 ` Peter Maydell
2022-02-08  4:56   ` Pavel Dovgalyuk
2022-02-08 10:19     ` Peter Maydell

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).