From patchwork Wed May 23 07:02:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: simon X-Patchwork-Id: 10420531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D84B56016C for ; Wed, 23 May 2018 07:48:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAC2928DBA for ; Wed, 23 May 2018 07:48:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFD1928EA8; Wed, 23 May 2018 07:48:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 447A428DBA for ; Wed, 23 May 2018 07:48:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932109AbeEWHsy (ORCPT ); Wed, 23 May 2018 03:48:54 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:45403 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754499AbeEWHsW (ORCPT ); Wed, 23 May 2018 03:48:22 -0400 Received: by mail-pg0-f67.google.com with SMTP id w3-v6so9028360pgv.12; Wed, 23 May 2018 00:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sv+wSEYi/P2U+FE66EXFTDQi/XsnGcmWDB6FPSk48is=; b=NmWJha5XdQahVyTCSv3GzjO8ynp99oKuL+xIa7tmhdz2W+TFbQLOtzACuT5zMIPUMJ TrPT3UhUKENqwW2EmR6yIBV/JkOPk27We8TlV1WNZ8p0A4h/gzs1qeFjwmGgWYsA8zat cjefJjGD3/81WVXwxMcXemCGwynG9+n3foBZ09KgHpr04TC1YHKpvlTUXVNAfvSS6K1i nRLyI+MEvKaebf+NtRXPscLE/hcxNeloDjhHygfEo51FG6lort822Ocgc0fUN7QtVs0a GX4JDlIyxpvXRrDOGsST/vfJg4XvnT9QcIIGV6+eV/5o2K3PAXcMhLFiBitdL05VmXjK zBzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sv+wSEYi/P2U+FE66EXFTDQi/XsnGcmWDB6FPSk48is=; b=csHbry+ccVUiidTbKzAyu8umw49qHb708lM0S6qShdDG0qL+FJVgciq+OS7Y9Ia0uq VEkKP3401Mn80xRQ+m2f+SLH4Prnxo7n/OAkI2MDn8PK+BqBma/NhriK/LnDa1DciiWs kKyjzapnAfk508ZP+ioLccDKPbuGPgZO2DQxh1if9YgYjgODMGN9wlXvhrtNOKeovM/i Xe5CAePNPaDkcNKIVEFZQi5oje4lKknoUDq3+fZV92ikOu7nj3xOYWBJP6+kqsqO4brS EnHDpKdLbDWWAIX0eRuKIluUsB1lzdKH/KnVv3MAIAWrs9lXxULki+zfrHNJAaXkXqSv nnjQ== X-Gm-Message-State: ALKqPweelgtVgJ/QnIyyZSSfUrmqIC47luBVWA/61EVRE03jM88npEgM mhYfucPVRRKOtvljdCBafPMD6Q== X-Google-Smtp-Source: AB8JxZqricSp/tp/8ng5smW21l2R+hsWCGun/8yfZVvXWb3YMQoG+gd/zfqYCH4EDJppCrkqpayfJQ== X-Received: by 2002:a65:5d8e:: with SMTP id f14-v6mr1484536pgt.25.1527061702094; Wed, 23 May 2018 00:48:22 -0700 (PDT) Received: from simonLocalRHEL7.cn.ibm.com ([112.73.0.89]) by smtp.gmail.com with ESMTPSA id a4-v6sm39079171pfj.19.2018.05.23.00.48.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 00:48:21 -0700 (PDT) From: wei.guo.simon@gmail.com To: linuxppc-dev@lists.ozlabs.org Cc: Paul Mackerras , kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, Simon Guo Subject: [PATCH v4 25/29] KVM: PPC: Book3S PR: enable HTM for PR KVM for KVM_CHECK_EXTENSION ioctl Date: Wed, 23 May 2018 15:02:08 +0800 Message-Id: <1527058932-7434-26-git-send-email-wei.guo.simon@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1527058932-7434-1-git-send-email-wei.guo.simon@gmail.com> References: <1527058932-7434-1-git-send-email-wei.guo.simon@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Simon Guo With current patch set, PR KVM now supports HTM. So this patch turns it on for PR KVM. Tested with: https://github.com/justdoitqd/publicFiles/blob/master/test_kvm_htm_cap.c Signed-off-by: Simon Guo --- arch/powerpc/kvm/powerpc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index bef27b1..1fa5bbe 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -648,9 +648,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) #endif #ifdef CONFIG_PPC_TRANSACTIONAL_MEM case KVM_CAP_PPC_HTM: - r = hv_enabled && - (!!(cur_cpu_spec->cpu_user_features2 & PPC_FEATURE2_HTM) || - cpu_has_feature(CPU_FTR_P9_TM_HV_ASSIST)); + r = !!(cur_cpu_spec->cpu_user_features2 & PPC_FEATURE2_HTM) || + (hv_enabled && cpu_has_feature(CPU_FTR_P9_TM_HV_ASSIST)); break; #endif default: