From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Date: Tue, 09 Aug 2011 16:40:53 +0000 Subject: Re: [PATCH 07/10] KVM: PPC: Add PAPR hypercall code for PR mode Message-Id: <4E416315.2080800@redhat.com> List-Id: References: <1312907508-14599-1-git-send-email-agraf@suse.de> <1312907508-14599-8-git-send-email-agraf@suse.de> In-Reply-To: <1312907508-14599-8-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexander Graf Cc: kvm-ppc@vger.kernel.org, linuxppc-dev@ozlabs.org, kvm@vger.kernel.org, paulus@samba.org On 08/09/2011 07:31 PM, Alexander Graf wrote: > When running a PAPR guest, we need to handle a few hypercalls in kernel space, > most prominently the page table invalidation (to sync the shadows). > > So this patch adds handling for a few PAPR hypercalls to PR mode KVM. I tried > to share the code with HV mode, but it ended up being a lot easier this way > around, as the two differ too much in those details. > > > +++ b/arch/powerpc/kvm/book3s_pr_papr.c > @@ -0,0 +1,158 @@ > +/* > + * Copyright (C) 2011. Freescale Inc. All rights reserved. > + * > + * Authors: > + * Alexander Graf > + * Paul Mackerras > + * > + * Description: > + * > + * Hypercall handling for running PAPR guests in PR KVM on Book 3S > + * processors. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License, version 2, as > + * published by the Free Software Foundation. > + */ Copyright freescale, authors Paul and yourself? > + > +static unsigned long get_pteg_addr(struct kvm_vcpu *vcpu, long pte_index) > +{ > + struct kvmppc_vcpu_book3s *vcpu_book3s = to_book3s(vcpu); > + unsigned long pteg_addr; > + > + pte_index<<= 4; > + pte_index&= ((1<< ((vcpu_book3s->sdr1& 0x1f) + 11)) - 1)<< 7 | 0x70; > + pteg_addr = vcpu_book3s->sdr1& 0xfffffffffffc0000ULL; > + pteg_addr |= pte_index; > + > + return pteg_addr; > +} Evil space crept in. -- error compiling committee.c: too many arguments to function