Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp265554pxa; Thu, 27 Aug 2020 01:25:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWqqRjASc6DGqOejDaHIY8cD5EF3Ntjfzxlol74vHHISKKGnSYpTwditb5r5Q5Rc63OfoA X-Received: by 2002:a17:906:c34a:: with SMTP id ci10mr19381733ejb.356.1598516721723; Thu, 27 Aug 2020 01:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598516721; cv=none; d=google.com; s=arc-20160816; b=DdMSOp0/tJr6evGN8ygytkkytv8amghKcmtTQqn42FCQTMsghDcLBvjgnPE7bsMVtE QOKF3zs1Ht8Rq2ois0IjrTkpHAAe1D94hYfiMAtDcfO6JyKF+j4kEmMQFIDL0cGtQvZ3 gSmzwKI6d0kRt8kGEZTINeAR7vsp1k9TQEeIOa/RgwwjEvy3X1wVsQlf+u4OtJ21xFcq sTeGhiaqesz27IFfY8MW2tCewvaw6Jlsd1wurbglR4aNFeIBnKYgxDq8WKcwM3kWOIiW 7vqGr8JMTCAAKHJcMAh0R4VbDwvMTIbuXcPMboNdB3SsBvYE2lhInrTpLAZw0gXBFhyH deQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=AbzWWcUYZolkEIqtSBXZ0hUIbGDYV7oUUrNkXbOeJ74=; b=tvxTSeSoOvG9FYnWRWqxYvG6yMNowyIKr+pC1An2Qxkhyuc6mB4J7W3Sy052MCKkpH YSACMYrj1eBFH9T+DUBtkNH1n6VP0vBcKlpn/6PAKfT2lnDicjOwBI+/iCM85EZCIznE uAC75XS8QoICZm0w0csa8fLdE/O2WcPrRoIJoRNQ0lNeMwvPEpprMbbR6cx7Wgizu5O5 mgikDjPBNHUaDMFR6Kn8KteJG2Uyy8x8DwxqZLaH0di6t25c0F93h7QSiHl/mwx7KO7i 5UNackryxhrZivypZySlCdZICfzHV/VZDWbey3cov+oMiAnxCSU8rn5UVyV7BsedKg4f rX6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si862444eju.283.2020.08.27.01.24.59; Thu, 27 Aug 2020 01:25:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728266AbgH0IXx (ORCPT + 99 others); Thu, 27 Aug 2020 04:23:53 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:45808 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726395AbgH0IXv (ORCPT ); Thu, 27 Aug 2020 04:23:51 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6322BE11D85A99240666; Thu, 27 Aug 2020 16:23:48 +0800 (CST) Received: from huawei.com (10.174.187.31) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Thu, 27 Aug 2020 16:23:42 +0800 From: Yifei Jiang To: , , , , , , CC: , , , , , , , , , Yifei Jiang Subject: [PATCH RFC 1/2] riscv/kvm: Fix use VSIP_VALID_MASK mask HIP register Date: Thu, 27 Aug 2020 16:22:50 +0800 Message-ID: <20200827082251.1591-2-jiangyifei@huawei.com> X-Mailer: git-send-email 2.26.2.windows.1 In-Reply-To: <20200827082251.1591-1-jiangyifei@huawei.com> References: <20200827082251.1591-1-jiangyifei@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Originating-IP: [10.174.187.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The correct sip/sie 0x222 could mask wrong 0x000 by VSIP_VALID_MASK, This patch fix it. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- arch/riscv/kvm/vcpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c index adb0815951aa..2976666e921f 100644 --- a/arch/riscv/kvm/vcpu.c +++ b/arch/riscv/kvm/vcpu.c @@ -419,8 +419,8 @@ static int kvm_riscv_vcpu_set_reg_csr(struct kvm_vcpu *vcpu, if (reg_num == KVM_REG_RISCV_CSR_REG(sip) || reg_num == KVM_REG_RISCV_CSR_REG(sie)) { - reg_val = reg_val << VSIP_TO_HVIP_SHIFT; reg_val = reg_val & VSIP_VALID_MASK; + reg_val = reg_val << VSIP_TO_HVIP_SHIFT; } ((unsigned long *)csr)[reg_num] = reg_val; -- 2.19.1