From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acxWL-0005Ij-9j for qemu-devel@nongnu.org; Mon, 07 Mar 2016 10:56:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acxWH-0007lX-5w for qemu-devel@nongnu.org; Mon, 07 Mar 2016 10:56:33 -0500 References: <1457317586-15122-1-git-send-email-david@gibson.dropbear.id.au> <1457317586-15122-3-git-send-email-david@gibson.dropbear.id.au> From: Thomas Huth Message-ID: <56DDA4A8.1020705@redhat.com> Date: Mon, 7 Mar 2016 16:56:24 +0100 MIME-Version: 1.0 In-Reply-To: <1457317586-15122-3-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2 2/3] target-ppc: Add helpers for updating a CPU's SDR1 and external HPT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , gkurz@linux.vnet.ibm.com, aik@ozlabs.ru Cc: lvivier@redhat.com, qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org On 07.03.2016 03:26, David Gibson wrote: > When a Power cpu with 64-bit hash MMU has it's hash page table (HPT) > pointer updated by a write to the SDR1 register we need to update some > derived variables. Likewise, when the cpu is configured for an external > HPT (one not in the guest memory space) some derived variables need to be > updated. > > Currently the logic for this is (partially) duplicated in ppc_store_sdr1() > and in spapr_cpu_reset(). In future we're going to need it in some other > places, so make some common helpers for this update. > > In addition the new ppc_hash64_set_external_hpt() helper also updates > SDR1 in KVM - it's not updated by the normal runtime KVM <-> qemu CPU > synchronization. In a sense this belongs logically in the > ppc_hash64_set_sdr1() helper, but that is called from > kvm_arch_get_registers() so can't itself call cpu_synchronize_state() > without infinite recursion. In practice this doesn't matter because > the only other caller is TCG specific. > > Currently there aren't situations where updating SDR1 at runtime in KVM > matters, but there are going to be in future. > > Signed-off-by: David Gibson > --- > hw/ppc/spapr.c | 13 ++----------- > target-ppc/kvm.c | 2 +- > target-ppc/kvm_ppc.h | 6 ++++++ > target-ppc/mmu-hash64.c | 43 +++++++++++++++++++++++++++++++++++++++++++ > target-ppc/mmu-hash64.h | 6 ++++++ > target-ppc/mmu_helper.c | 13 ++++++------- > 6 files changed, 64 insertions(+), 19 deletions(-) Reviewed-by: Thomas Huth