Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp792140imm; Mon, 21 May 2018 14:32:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrWZFVcVDqyC/o7qFu3KnJy6UFiMinHFhgsOx+/KYJEd4R/uMxGxVn7yI0i9dneF3wcAdUZ X-Received: by 2002:a65:4502:: with SMTP id n2-v6mr16540271pgq.95.1526938375378; Mon, 21 May 2018 14:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526938375; cv=none; d=google.com; s=arc-20160816; b=yOwzwLrE33kPEYBqfVrDOwSHtfryUY1lA6dWDDTqjZWMghUsmdJW0wmJhp/8GG3C/7 i3pmUBxJWM4zKJchKhcXmPFIpyb0Z5Ow2/lk9kogTbccS8Whgkfn5LwAP3/jxU2Vo9n3 HVv67z/zeryGj2uQBVO6VFvYoSs8UYVvaHZ707PL8jOJedXtlDJTgFwJ3VQMJVYvjFID rxJmfahntVMGK2xDdX1cEyPev+K5OAMZ2xm/K8lRG6iEVTRCT0MnzcXYfKCBBKgt4o6c Q6hRKqo06N4njtV6FbmI44P3+LSCjlHOz3ofYfeKJTsYbsNnDQdP05U+4uF+P+CTVvtP Fk0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=y05wfrRwglc4jN8l9OEQ1/DFGnUqfbzSNdrqQnk7jhY=; b=Dcmlr8hmUFgP/49sqWHeLp2pc5yEiyYNkYvMghIEfZu/DA8AuwAyLuitUZDrLiBJ/u rP3bwJp1xMbcySTIimembqT2A6ns4ts+kE7T5IbGJoRMIeSnmGSrGhWPC4sHNjJ97CYD QANpvdLDUyfUsh4o+a1TV+scaIBIUJ1a3HVeT3fDR2h5QYBvlkJL8OrSqhXZOMyFArvo bKMXbnmRze99Twpnrt3BThPCypM+216lKhbEbjciVJxWyP6g/RuEjGhI8FQjq4f8f+jF 60SiXEdGpi9vuz6eAw/Ni/UgmrRi7djOXsumRLGvhCRrdo8dZvT0x1W2jGYL+Ways0yj LzTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BWP6ALTh; 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 k16-v6si15566693pli.171.2018.05.21.14.32.40; Mon, 21 May 2018 14:32:55 -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=@kernel.org header.s=default header.b=BWP6ALTh; 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 S1754454AbeEUV0W (ORCPT + 99 others); Mon, 21 May 2018 17:26:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:41056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932510AbeEUV0P (ORCPT ); Mon, 21 May 2018 17:26:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6504220853; Mon, 21 May 2018 21:26:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526937974; bh=dBkMEMFLgmSkhqDv6p0NJK8e+3yAC2oW3qgfG5Wnp2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BWP6ALThTHdvtgnWTv2/A+kOK6MREA3TbDEtPsXrxhpxvY3oboopAh6jrW6nAU96T SKa8+A2me0HVVIcBffWANqaUknKhw5HMKIoYD6DoUiulImYlLbL+b3UMsKqwmlgUWU uDHjT3Oata2ojdXVOgPRsHDfE59iky9dEX1HO7QU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jim Mattson , Konrad Rzeszutek Wilk , Thomas Gleixner , Linus Torvalds Subject: [PATCH 4.16 093/110] x86/cpu: Make alternative_msr_write work for 32-bit code Date: Mon, 21 May 2018 23:12:30 +0200 Message-Id: <20180521210514.103306437@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180521210503.823249477@linuxfoundation.org> References: <20180521210503.823249477@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jim Mattson commit 5f2b745f5e1304f438f9b2cd03ebc8120b6e0d3b upstream Cast val and (val >> 32) to (u32), so that they fit in a general-purpose register in both 32-bit and 64-bit code. [ tglx: Made it u32 instead of uintptr_t ] Fixes: c65732e4f721 ("x86/cpu: Restore CPUID_8000_0008_EBX reload") Signed-off-by: Jim Mattson Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner Acked-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/nospec-branch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -265,8 +265,8 @@ void alternative_msr_write(unsigned int { asm volatile(ALTERNATIVE("", "wrmsr", %c[feature]) : : "c" (msr), - "a" (val), - "d" (val >> 32), + "a" ((u32)val), + "d" ((u32)(val >> 32)), [feature] "i" (feature) : "memory"); }