From patchwork Tue Feb 27 17:37:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: simon X-Patchwork-Id: 10245873 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 6D6FA60384 for ; Tue, 27 Feb 2018 17:38:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B9B428A1D for ; Tue, 27 Feb 2018 17:38:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5005828A20; Tue, 27 Feb 2018 17:38:54 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 E677428A1D for ; Tue, 27 Feb 2018 17:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751568AbeB0Riv (ORCPT ); Tue, 27 Feb 2018 12:38:51 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:44551 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777AbeB0Rib (ORCPT ); Tue, 27 Feb 2018 12:38:31 -0500 Received: by mail-pf0-f196.google.com with SMTP id 17so8233914pfw.11; Tue, 27 Feb 2018 09:38:31 -0800 (PST) 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=iqLrOER+eC+3uHBd4xUOXubvHwiqGbRcZ+0On3c9pQc=; b=JovSDJuFOvE+dZHUtwpuqBSCEbXvo80AZaTn+3E4llQ9Cgy8pUEuXNFntM7LzyfsS8 bote7x0ufBQwg9HMCSR9ehkiDMv9y8TZQeja+b0OUVyVQo+gSmgGQmnZDHVcNkYaOGyp Wl6B6Ks6BX3e+t8xMzNFOEIQF4LU/ywInUyYjI0iS84VEeSPBX8VcTKAG5JcjwVJU4hM Cjtk1Pg+J0cLWe2h8QbK70cf7PE4WM6OgqJmbwvdHuALDpSwljMDItcawjbGJbrrpA+t YOTuruNh/6M/rtyfCjjFmZy75XxwoJi82o1bawN3GRiau+I8lEbQvVtr7Fjujg9TosLw 7E8w== 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=iqLrOER+eC+3uHBd4xUOXubvHwiqGbRcZ+0On3c9pQc=; b=aqKNUBJIHGJGOweP+MwYaQB/Zkhmy+zG+D4x7bVL4gmNdyhtEh95P7LJJrTY7ljxNB KzGOfNE66RqUD302lNW3vmqotgv4I1DBVwwrAQv/OAFfEkYpxURwsWHiPtt/RywlWhMG yBLLqjsWVqinpz9/qzgA76ezfDxtEOMJd9K1ssjcrLyz5nbRQPUOYSqHc8QFVg33BYnY E15usEsNjU4nzb2pfc1DjG27trOOKgKBwGWmJNxdBGjfwkHOvJxCmnHwa0/DN2VyiRyO eNmwXUjtPzoMCUyOOniJffkXnGkYg9LIGomZI4qT9/yRx/xl1J20+er7pXybMax/KD8H LeBg== X-Gm-Message-State: APf1xPA1UnuHAVqSDOIstOq62cQvgqaL+8K/83OymDI3BUO/8wcVZeeJ XtE0TCBBoaX1hlFCnSNY0fE= X-Google-Smtp-Source: AH8x226acyJxamN3nxcZ9FyhMkKmUzAt60L8UuVIMaIVB9f6dR0NDR3utPJiOKOnQLYl13kniZaPDA== X-Received: by 10.98.71.3 with SMTP id u3mr15003842pfa.219.1519753111478; Tue, 27 Feb 2018 09:38:31 -0800 (PST) Received: from simonLocalRHEL7.x64 ([101.80.181.226]) by smtp.gmail.com with ESMTPSA id q87sm14734143pfa.29.2018.02.27.09.38.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 09:38:31 -0800 (PST) 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 v2 06/30] KVM: PPC: Book3S PR: turn on FP/VSX/VMX MSR bits in kvmppc_save_tm() Date: Wed, 28 Feb 2018 01:37:13 +0800 Message-Id: <1519753057-11059-7-git-send-email-wei.guo.simon@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1519753057-11059-1-git-send-email-wei.guo.simon@gmail.com> References: <1519753057-11059-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 kvmppc_save_tm() invokes store_fp_state/store_vr_state(). So it is mandatory to turn on FP/VSX/VMX MSR bits for its execution, just like what kvmppc_restore_tm() did. Previsouly HV KVM has turned the bits on outside of function kvmppc_save_tm(). Now we include this bit change in kvmppc_save_tm() so that the logic is more clean. And PR KVM can reuse it later. Signed-off-by: Simon Guo Reviewed-by: Paul Mackerras --- arch/powerpc/kvm/tm.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kvm/tm.S b/arch/powerpc/kvm/tm.S index e779b15..2d6fe5b 100644 --- a/arch/powerpc/kvm/tm.S +++ b/arch/powerpc/kvm/tm.S @@ -43,6 +43,8 @@ _GLOBAL(kvmppc_save_tm) mfmsr r8 li r0, 1 rldimi r8, r0, MSR_TM_LG, 63-MSR_TM_LG + ori r8, r8, MSR_FP + oris r8, r8, (MSR_VEC | MSR_VSX)@h mtmsrd r8 rldicl. r4, r4, 64 - MSR_TS_S_LG, 62