Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp936727pxa; Thu, 27 Aug 2020 21:49:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyksULQYtDSeuoiKetkMd2AHEG2PmXAllGuchCLHcoQsT5jUe6b8+3M13HaggskjyZYZGqP X-Received: by 2002:a05:6402:745:: with SMTP id p5mr83935edy.94.1598590176291; Thu, 27 Aug 2020 21:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598590176; cv=none; d=google.com; s=arc-20160816; b=eYrz7XnlbJrBKdjzNbn3rSF7k+KCKRihb63EFM/v97LaX4o/CrFZiSHUDVDKtIuqeR zCGpgTnRDrfhtJGGQnN2thd0QkmqMPHvyGkWrQQQ6Osq5zU27/IFrl/Xuijtz8oxnzv2 cKeozg2idXPopNCFBMtgcUp/5ajMh5znXgord3b22qFIvXCxjlpGKoDRPStIJCNXuVY+ wmiEt0zZjj8FcqSJZgx1MCeXkOsW2bLJidV7/7du6OxTs7gSYDmxz+G21lZWaYTjB8Bc oz/Sz/C63i3bn3nYrR0a8oG6I6AMpheniFNEZXwh78iSfF5ieg7xjMe5rB0QWZdU3HO8 x1Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VoHjgG7QKE51iIfhD6VjTDAp7Ojtyk5HJQxEFibU7HM=; b=EmECB0lRQaTYX5mJl7mUmUMKbiBYWxZS4bxQqbOxWncm7GR9Il061H79/R4vukPzLK sB2gNnN/PobsikBSLOcN45JV19MHt1OZDPEyg/HcLFbXnWUxjBoSJfyoGgoK0L6rO/PD y0akcTEMezeGrmyGS0OouRA/s/xRRqwBpeR35ReGEZAJMzV+qNPV3kbPoAY0u863qHeS LDb2Je+Re61EbUIyq+Kk9HTH+0FPhVKPE3ZEVP3J0O6UFk0j2RlxmQSmOpiUoSTcQUqw NCX7zdfcORQoDoUD47GvfGu93fU1bSJF5OcKx9kY4ZQjgVgyjmE6eMJ7xM6dkjSz6L4c Z+cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=w4bavdWt; 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 s7si2403518ejx.119.2020.08.27.21.49.13; Thu, 27 Aug 2020 21:49:36 -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; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=w4bavdWt; 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 S1726446AbgH1Er3 (ORCPT + 99 others); Fri, 28 Aug 2020 00:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726330AbgH1Er2 (ORCPT ); Fri, 28 Aug 2020 00:47:28 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31FE8C06121B for ; Thu, 27 Aug 2020 21:47:28 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id l7so30393wrx.8 for ; Thu, 27 Aug 2020 21:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VoHjgG7QKE51iIfhD6VjTDAp7Ojtyk5HJQxEFibU7HM=; b=w4bavdWtOQoS3sfGaaTkABme/fmWscqxZ5LrFLLfrldCDaD5j15cu3uS+4KRzGWtAD jL5fKfr/VbGOMCueuYkDR/IHdD3S+K2HmqNHE33cZe92yF3E730cfcNfvJRvvjtvpofv o4VjvLoEiX/gTqSaMavHf835jiuIHMP9e29nXHVG3LCcfX1ntDV6SrcZNkxl9BbWySpQ L0xCcy75cNcozpbzciAGbPd0mlviVTMYGY1OdS6hsy7vPnm4oCc9i0TaN8v5awlLyqP8 wKvDiHVEv3U0CxqaC7XDBCMfulRckM5RDLbgkftLx/QA7YHy9JcF1QvK7zu0sHK6W0NZ GRqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VoHjgG7QKE51iIfhD6VjTDAp7Ojtyk5HJQxEFibU7HM=; b=IFByRBGL2HtqVf6AHO1XTW9E3vKx07mtnrZJYf5TNwC/QSCaiY3r9kTnOQ5bACYHil 53bp1czJqXxXiXAiNKNCGntQ4/LuMz9FlttiB7nug6qglGc2h5V0QZDTY6xVh3DY/e6F vq/edAlOMTpD+RRTLNwNUIvhnJCIEfLu+MXerHAMYg9+aMAyyK5KCeJ1F8PcMHbQ4b8H i4KBEkwzGkRRAH1M4a+x2BOCjrPaoPEk/sEwPaJa6wwqiYSXq74moe9VXr3BDiBIl/0n 9fYTn5iMlmv/KNCZW6GgIvv39DxniPf2csiHFo7hHcw1KoyZUvuXBfglJ+kioi9ZqoZ8 t61Q== X-Gm-Message-State: AOAM533viRwta7dr3aOCIqvYgSKwFNTyQ2trld2Hx6NVtEDq6MMXNanX INOkr/An5uaxwxYKsEr1HWtouyFNSSkmuV7o+9PrdQ== X-Received: by 2002:adf:fb87:: with SMTP id a7mr24852823wrr.390.1598590045816; Thu, 27 Aug 2020 21:47:25 -0700 (PDT) MIME-Version: 1.0 References: <20200827082251.1591-1-jiangyifei@huawei.com> <20200827082251.1591-2-jiangyifei@huawei.com> In-Reply-To: <20200827082251.1591-2-jiangyifei@huawei.com> From: Anup Patel Date: Fri, 28 Aug 2020 10:17:14 +0530 Message-ID: Subject: Re: [PATCH RFC 1/2] riscv/kvm: Fix use VSIP_VALID_MASK mask HIP register To: Yifei Jiang Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Alistair Francis , Atish Patra , deepa.kernel@gmail.com, kvm-riscv@lists.infradead.org, KVM General , linux-riscv , "linux-kernel@vger.kernel.org List" , "Zhangxiaofeng (F)" , wu.wubin@huawei.com, Zhanghailiang , "dengkai (A)" , yinyipeng Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 1:53 PM Yifei Jiang wrote: > > 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; Thanks for this fix. I have squashed it into PATCH5 of KVM RISC-V v14 series. Regards, Anup