Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1002803pxb; Wed, 6 Apr 2022 06:28:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxruSFR8f4IWtLQG7+7h6OSVAPF6JASPC2tWLiqeCk+JVI++VBPbf+zd+BgM3Yaik0bQ1Ak X-Received: by 2002:a17:902:6b47:b0:156:ae54:deaf with SMTP id g7-20020a1709026b4700b00156ae54deafmr8424303plt.129.1649251737838; Wed, 06 Apr 2022 06:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649251737; cv=none; d=google.com; s=arc-20160816; b=Q/GuA9hj9JfEaRW7WHKc3lQF4PGCYE5OSnhjjdAAvWTrQiWsXn8E+fYg7C/mihpYdN lFIpj52T3tfSvKeblIm66x4cXe2Nbc5Nm+f+3P+krJT46F/TcD6uyAAuvNLEnYH7hu5Z gYIpxFHsMrAd7ihwKnxWgTyfOu12JjJIO3fXc1keybXXoRp6iNsHnNN3GzkNahJnn2ax ZRm7yxGWkNlQ4Z6yPhpurHzXmuM1uv5YGuE0+aiu53ketR8QdCo9TPX6wjBvi3+PKqpI /bsnOH6sSh8QK9SahpXv5cJpXNB0+D5TAsiLW0zfGQAyLPodLhdorFICE+SZSQBkV0KZ w57w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uwLWFFknx+hYU5cwQQBKQpHOgAsOlRicJj3DMMrwQQM=; b=w1oubrFr5a0cdz5F9rtFN3s5b2PwjCLx0TLAL/KFmcZewpdoQdPvygBLkNSHjo+Ahe EcFG84M3Nm3pdOFJw9xT8o4wIDQnpQ7IJv6jJwOt85koRQDxYEqzwh9OaBjb9/Nyjoex a0BjZyloT255L4dCvMz/ZL+hnLozsdC3axk2tc0/1VXdTMLzksYe1ExaZMc3Gk/7Ygk+ i6aReiYMHs3WxuDBemUgqhSArYHwhHQio4Ts19IPsnJIGnIHjmwFE8bxmgMwHJlVEmpY zB+eRd4l62eg1b+/vNknsMDSYWGTrQkHKcnppBgGYHWzugw1FnDT+D1MCDXH4h5UtGVq kHog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0OqChbwz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e14-20020a17090301ce00b00155f37a9df9si16730884plh.525.2022.04.06.06.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:28:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0OqChbwz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B188454B534; Wed, 6 Apr 2022 04:07:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1455623AbiDEWkz (ORCPT + 99 others); Tue, 5 Apr 2022 18:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348902AbiDEJsp (ORCPT ); Tue, 5 Apr 2022 05:48:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 222AAECB14; Tue, 5 Apr 2022 02:37:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B2D0161368; Tue, 5 Apr 2022 09:37:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C771EC385A0; Tue, 5 Apr 2022 09:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151424; bh=cx+9DuQm7ggC+82XW4jTWuP85l/QRF2PKc9DxovvWRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0OqChbwzdrktv0aGZHTYSfcVZcbPnKkv3T0H+kvA8YDqkLFO3MqPYnht5zMnoKvSf RNnfHxm03RGwo5U8TPAhTNUBkaAklbt3W2cmCwih4mslpffr6B836va2s1U5Ui7nZL 8Prejg2ufca6YKKWrim74sIURhOvuR/v2AOTmlHY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabiano Rosas , Nicholas Piggin , Michael Ellerman , Sasha Levin Subject: [PATCH 5.15 408/913] KVM: PPC: Fix vmx/vsx mixup in mmio emulation Date: Tue, 5 Apr 2022 09:24:30 +0200 Message-Id: <20220405070352.076081080@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fabiano Rosas [ Upstream commit b99234b918c6e36b9aa0a5b2981e86b6bd11f8e2 ] The MMIO emulation code for vector instructions is duplicated between VSX and VMX. When emulating VMX we should check the VMX copy size instead of the VSX one. Fixes: acc9eb9305fe ("KVM: PPC: Reimplement LOAD_VMX/STORE_VMX instruction ...") Signed-off-by: Fabiano Rosas Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220125215655.1026224-3-farosas@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/kvm/powerpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index b4e6f70b97b9..ee305455bd8d 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -1507,7 +1507,7 @@ int kvmppc_handle_vmx_load(struct kvm_vcpu *vcpu, { enum emulation_result emulated = EMULATE_DONE; - if (vcpu->arch.mmio_vsx_copy_nums > 2) + if (vcpu->arch.mmio_vmx_copy_nums > 2) return EMULATE_FAIL; while (vcpu->arch.mmio_vmx_copy_nums) { @@ -1604,7 +1604,7 @@ int kvmppc_handle_vmx_store(struct kvm_vcpu *vcpu, unsigned int index = rs & KVM_MMIO_REG_MASK; enum emulation_result emulated = EMULATE_DONE; - if (vcpu->arch.mmio_vsx_copy_nums > 2) + if (vcpu->arch.mmio_vmx_copy_nums > 2) return EMULATE_FAIL; vcpu->arch.io_gpr = rs; -- 2.34.1