From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Neuling Subject: Re: [PATCH 3/3] KVM: PPC: Book3S HV: Add H_SET_MODE hcall handling Date: Thu, 29 May 2014 15:47:42 +1000 Message-ID: <1401342462.4116.4.camel@ale.ozlabs.ibm.com> References: <1401106626-13130-1-git-send-email-paulus@samba.org> <1401106626-13130-4-git-send-email-paulus@samba.org> <5385E620.5090703@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: Paul Mackerras , kvm-ppc@vger.kernel.org, "kvm@vger.kernel.org" To: Alexander Graf Return-path: In-Reply-To: <5385E620.5090703@suse.de> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Alex, > > +static int kvmppc_h_set_mode(struct kvm_vcpu *vcpu, unsigned long mflags, > > + unsigned long resource, unsigned long value1, > > + unsigned long value2) > > +{ > > + switch (resource) { > > + case H_SET_MODE_RESOURCE_SET_CIABR: > > + if (!kvmppc_power8_compatible(vcpu)) > > + return H_P2; > > + if (value2) > > + return H_P4; > > + if (mflags) > > + return H_UNSUPPORTED_FLAG_START; > > + if ((value1 & 0x3) == 0x3) > > What is this? It's what it says in PAPR (I wish that was public!!!). Joking aside... If you refer to the 2.07 HW arch (not PAPR), the bottom two bits of the CIABR tell you what mode to match in. 0x3 means match in hypervisor, which we obviously don't want the guest to be able to do. I'll add some #defines to make it a clearer and repost. Mikey