Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1119123imm; Fri, 5 Oct 2018 19:13:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV62OSFvhlgoLxYZwkGR4sxd4T/agE5seW6OdKiRStUQQ74acbubpzPgu/dvC0hA0ie1pCYro X-Received: by 2002:a17:902:123:: with SMTP id 32-v6mr8692289plb.145.1538791994798; Fri, 05 Oct 2018 19:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538791994; cv=none; d=google.com; s=arc-20160816; b=M0em0jSWwvPR24aZjqepuS33Lvp43lr5c3vyON8vOHacCnkRHARmvhZz/uWXfkcJtf Kaf5SarkqgVZFlRO67GWhZzALIaM8OrBjXrWv/IVihtCoKNX8jxFVVyHLWtOQp5zeNbj 1TKveIOYBI5fvJDVvc0NIIzScR/4F0fjsvteIVgs9ys9kT+/xYL3BLSa6poRQB9OY5dT H8Ic/fnSOUwWKLrVkyX9PkkLKuLmEuPNPsIxBP1+wslUh1iSYF1TcWMro/zt5rPo+EpQ yAyZA5Qz4HAEvxFR7U0OVBWXmkpb8geUE641/nYbidRv0+Vc6Q5DNdMfxJJlz7Zv1i1D 6rHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=S5aMYtlnSuUjS8iAbO6i4IfWiFA10GU4WN9xz1P7jEk=; b=H4Z1Z2IQHXKuRBeaceAi6O3nd72LJwlJCsg3Xrw13ixDjkLgy/vSoKE1Ot2SLgUM0g wrzaoWoH2IgbPfmLTKAUMNHwQDucCE5E/TMBCA8qo4ZHxgsa/JRhrOavaCqRp0ZUU3qW Off72AqMckEjcB6Raj0IaX/viTVHVL0Z3VT65DZh4VKh64ybGbJ4m3aq8KEeAUwPS5dk a8fTdzA1yTws9xef5szAQVJ8iS4bQieVEDncvkB0CXz/lrZDRRjq3kAlt4a+mMwrsUL5 NvuF3t03e+OBPUT2+vQ3anuM83isTl/rq47vnjr3momkXorlXGgce3fMCqkU//F8+StF xoeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iZZdWmaQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y25-v6si10790675pff.249.2018.10.05.19.12.59; Fri, 05 Oct 2018 19:13:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iZZdWmaQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729403AbeJFJM4 (ORCPT + 99 others); Sat, 6 Oct 2018 05:12:56 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:33092 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726505AbeJFJM4 (ORCPT ); Sat, 6 Oct 2018 05:12:56 -0400 Received: by mail-ed1-f66.google.com with SMTP id h13-v6so1693941edq.0; Fri, 05 Oct 2018 19:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=S5aMYtlnSuUjS8iAbO6i4IfWiFA10GU4WN9xz1P7jEk=; b=iZZdWmaQoPxOwoVJ5LNpA8k10+nc4V1cLoI2PA7mAptXnt4pQ+4fN3pwcLUnO/Ap9R 4N7NzptiTeGa4Cd8JGhdNaGMMIQLNABb9P1R63ZuvAA4QVihc7j4KkJpx3L3uUPmQ4Cn 5Xcow6XfRVign6XiI1s9GMfJdHpoBDpOp38mH3Rpt2hHjpx48WzdLOXva7Jn3OlN1pBo 654UALbQ1uVUUQwqysHtsIw4zPDRAdSJiV9EqN+tSijIKCZx6LgIrar2ZFrb2YFIoXiF F9VsvROiiw9LK+mbcmPmz/4NggZ2AWCy9ci9bXlyzcQiHXtzxnzii2dpDCcu2FRmB6QV lqiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=S5aMYtlnSuUjS8iAbO6i4IfWiFA10GU4WN9xz1P7jEk=; b=VwQ4QgSgP1yLuJAiFdCa5tMKZP5ml42ici3lJYBaHsXnA8GXg2w/c7+lOAj7YsMOBB fo8fH8XRSKSS3fZECzPoVd137oEd0xJS3CEwGxf/+UCZGYIy/CkZ42IEcoAja4m5aDiK 92OO+gG223oBO/sLGbJK9441GtvylUY8qegXsXLVbai6gKw07Anu2D7Wlo3YIDotIiGy RuWxGfCXdhRZKwDEJJKPsuoaXJ33HLmtaWw7dq5yx0P731tT7A3/TpA4mrngiy99m9Cu OfyOgRSIOfzm9Okl47ipVtFh3O4Bs/J+scnDticL8bNGSV2YN3qWoMOPfB3HGD+eZDmE EQwQ== X-Gm-Message-State: ABuFfojbVKFMtRL7F3AEOrQRKY78mY5RFosFjPsC1lHcCucNiJRfhTwg hspV22za7j07IgfeEtNDz60= X-Received: by 2002:a05:6402:1284:: with SMTP id w4mr17459512edv.143.1538791888713; Fri, 05 Oct 2018 19:11:28 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a16-v6sm1671186ejv.65.2018.10.05.19.11.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 19:11:27 -0700 (PDT) Date: Sat, 6 Oct 2018 02:11:27 +0000 From: Wei Yang To: Peng Hao Cc: pbonzini@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, joro@8bytes.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, Peng Hao Subject: Re: [PATCH] kvm/x86 : avoid shifting signed 32-bit value by 31 bits Message-ID: <20181006021127.zuic7afw42b3hzw2@master> Reply-To: Wei Yang References: <1538675238-27356-1-git-send-email-penghao122@sina.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1538675238-27356-1-git-send-email-penghao122@sina.com.cn> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 04, 2018 at 01:47:18PM -0400, Peng Hao wrote: > >From: Peng Hao > > modify AVIC_LOGICAL_ID_ENTRY_VALID_MASK to unsigned > >Signed-off-by: Peng Hao >--- > arch/x86/kvm/svm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c >index d96092b..bf1ded4 100644 >--- a/arch/x86/kvm/svm.c >+++ b/arch/x86/kvm/svm.c >@@ -262,7 +262,7 @@ struct amd_svm_iommu_ir { > }; > > #define AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK (0xFF) >-#define AVIC_LOGICAL_ID_ENTRY_VALID_MASK (1 << 31) >+#define AVIC_LOGICAL_ID_ENTRY_VALID_MASK (1UL << 31) It is reasonable to change to unsigned, while not necessary to unsigned long? > > #define AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK (0xFFULL) > #define AVIC_PHYSICAL_ID_ENTRY_BACKING_PAGE_MASK (0xFFFFFFFFFFULL << 12) >-- >1.8.3.1 > -- Wei Yang Help you, Help me