From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Subject: Re: [PATCH] KVM: PPC: powerpc: Add count cache flush parameters to kvmppc_get_cpu_char() Date: Fri, 01 Mar 2019 17:52:51 +1100 Message-ID: <87bm2vjdbw.fsf@concordia.ellerman.id.au> References: <20190301032516.29919-1-sjitindarsingh@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Cc: linuxppc-dev@lists.ozlabs.org, paulus@samba.org, Suraj Jitindar Singh , kvm@vger.kernel.org To: Suraj Jitindar Singh , kvm-ppc@vger.kernel.org Return-path: In-Reply-To: <20190301032516.29919-1-sjitindarsingh@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" List-Id: kvm.vger.kernel.org Suraj Jitindar Singh writes: > Add KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST & > KVM_PPC_CPU_BEHAV_FLUSH_COUNT_CACHE to the characteristics returned from > the H_GET_CPU_CHARACTERISTICS H-CALL, as queried from either the > hypervisor or the device tree. > > Signed-off-by: Suraj Jitindar Singh > --- > arch/powerpc/include/uapi/asm/kvm.h | 2 ++ > arch/powerpc/kvm/powerpc.c | 18 ++++++++++++++---- > 2 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index b90a7d154180..a99dcac91e50 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -2251,12 +2253,16 @@ static int kvmppc_get_cpu_char(struct kvm_ppc_cpu_char *cp) > if (have_fw_feat(fw_features, "enabled", > "fw-count-cache-disabled")) > cp->character |= KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS; > + if (have_fw_feat(fw_features, "enabled", > + "fw-count-cache-flush-bcctr2,0,0")) I don't think there's any reason KVM needs to be querying the device tree directly, is there? Can't it just use the security flags (security_features.h), that are initialised by the powernv platform code based on the device tree. I seem to remember we didn't do it that way originally just because we didn't have time to get everything lined up. cheers