Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1741287imu; Wed, 28 Nov 2018 14:26:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ui3EQ6l2FnwHQWKhNhcXrfrRzuEvJOmwBi4dvKYR4Mpe/9xJ2/MNTvfPzTG9DJEEiYkbZk X-Received: by 2002:a17:902:5588:: with SMTP id g8mr23130285pli.22.1543443986488; Wed, 28 Nov 2018 14:26:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543443986; cv=none; d=google.com; s=arc-20160816; b=F1GnCQ3eY0js8U3HxdXwmDOLmid8+Ee+uz7AhnabBkCJgPk633ZPI5K+hEozlAFghH JmO6NwT6DsmUxvS/gMsyLw45lNePCr5Mi/AtDlkDBMRTz/0oaqjwjakxkaiW2uOj4Ih0 nTQ3OWMa5PTBpADffPSg4U3EWxSH03N1NtvLQTs0RTxKeDg3/yOIbOiM/1l5/sEFTaKj KjX26/flUiLwOr6Ub7jBNYFZUVCl3RlNH+VR9iETbn0ixzM8n3Od997jTLgHK4Re5J07 rA/yV+hzgz7t3CnCRCKfqKblf7K08SruqjNau32UHnkQeFoDrQxhDWxGDfZQ+pxvcSpb N8Zg== 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=U0UvJvCQhLd6epv8lWpGAoPnAJBGb302adR+o/4JZu8=; b=DB3Tpt/G2bAql6IvpFoptNrnkkirPRvTvjB3txqn6Pul7wKbI6J1VFfiejkZAk0brO MibfYjOr+GT3xWYVhXYms6RNDnNakzEOqxeCuXEDaM3LWI3vnh1NMDIOOWg7Tys+jpO3 SyEW1EJ5ORbVpySYRtPcVxFzATEKeZczZDeM7Y7sgawgDhKsKAxkZJVbipnRESG4/4Hp YeTcvejqfR+BLLIfJoU3Y/DjRlf2T+ryam5Ygbrmf6sbivI+Z/5BKnYgW40cmF9fb6R2 4JcMziXn9Uv9hiwW3mdzs0osqVOGymt6tozNfN3lLP99GOcvFzgzdEFtfQFtD2dF217Z oqNA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si10007119plk.373.2018.11.28.14.26.11; Wed, 28 Nov 2018 14:26:26 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726614AbeK2JYF (ORCPT + 99 others); Thu, 29 Nov 2018 04:24:05 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33033 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726368AbeK2JYF (ORCPT ); Thu, 29 Nov 2018 04:24:05 -0500 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1gS8CQ-0001GX-7e; Wed, 28 Nov 2018 23:20:50 +0100 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Andy Lutomirski , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , kvm@vger.kernel.org, "Jason A. Donenfeld" , Rik van Riel , Dave Hansen , Sebastian Andrzej Siewior Subject: [PATCH 01/29] x86/fpu: Use ULL for shift in xfeature_uncompacted_offset() Date: Wed, 28 Nov 2018 23:20:07 +0100 Message-Id: <20181128222035.2996-2-bigeasy@linutronix.de> X-Mailer: git-send-email 2.20.0.rc1 In-Reply-To: <20181128222035.2996-1-bigeasy@linutronix.de> References: <20181128222035.2996-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The xfeature mask is 64bit so a shift from a number to its mask should have LL prefix or else nr > 31 will be lost. This is not a problem now but should XFEATURE_MASK_SUPERVISOR gain a bit >31 then this check won't catch it. Use BIT_ULL() to compute a mask from a number. Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/kernel/fpu/xstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index 87a57b7642d36..69d5740ed2546 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -444,7 +444,7 @@ static int xfeature_uncompacted_offset(int xfeature_nr) * format. Checking a supervisor state's uncompacted offset is * an error. */ - if (XFEATURE_MASK_SUPERVISOR & (1 << xfeature_nr)) { + if (XFEATURE_MASK_SUPERVISOR & BIT_ULL(xfeature_nr)) { WARN_ONCE(1, "No fixed offset for xstate %d\n", xfeature_nr); return -1; } -- 2.20.0.rc1