From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [RFC PATCH 5/5] KVM: PPC: Book3S: Make kvmppc_handle_load/store handle any load or store Date: Mon, 28 Jul 2014 14:14:58 +0200 Message-ID: <53D63EC2.5090605@suse.de> References: <1405764872-8744-1-git-send-email-paulus@samba.org> <1405764872-8744-6-git-send-email-paulus@samba.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Paul Mackerras , kvm-ppc@vger.kernel.org Return-path: In-Reply-To: <1405764872-8744-6-git-send-email-paulus@samba.org> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 19.07.14 12:14, Paul Mackerras wrote: > At present, kvmppc_handle_load and kvmppc_handle_store only handle > emulated MMIO loads and stores. This extends them to be able to handle > loads and stores to guest memory as well. This is so that > kvmppc_emulate_instruction can be used to emulate loads and stores > in cases other than when an attempt to execute the instruction by the > CPU has resulted in an interrupt. > > To avoid having to look up the translation for the effective address > again in kvmppc_handle_load/store when the caller of kvmppc_emulate_mmio > has already done it, we arrange to pass down the translation in a new > struct kvmppc_translated_address, which is a new argument to > kvmppc_emulate_mmio() and kvmppc_emulate_instruction(). This also > enables us to check that the guest hasn't replaced a load with a store > instruction. > > This also makes the register updates for the paired-single FPU registers > match for emulated MMIO accesses what is done for accesses to normal > memory. > > The new code for accessing normal guest memory uses kvmppc_ld and kvmppc_st, > which call kvmppc_xlate, which is only defined for Book 3S. For Book E, > kvmppc_handle_load/store still only work for emulated MMIO. > > Signed-off-by: Paul Mackerras Please check out my other patch set where I made kvmppc_ld/st available for BookE and also split the MMIO path off completely. Since we do want to take the shortcut through paddr that we only know for memory traps, I really think we're better off treating that whole optimized code path as a separate piece. Alex