Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3718189imu; Mon, 7 Jan 2019 08:14:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN7K6YsNILmJMmeYtzoIiqBvijO/LeKBs685CriVB9eKrj8N6FHzStZwVKRG64Z/fWe3fckj X-Received: by 2002:a17:902:2bc5:: with SMTP id l63mr62741277plb.107.1546877654304; Mon, 07 Jan 2019 08:14:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546877654; cv=none; d=google.com; s=arc-20160816; b=UKmD8OYC9GgxeC2DTATaVeP8j7AJu1ihLu6BNhxZq7ehjp08z9qqR1unuU1KR/QOJw v62dD3fpl3fPjIwYFQm7Uj66d6c5SPm0hPjlWG+fErbo0IifmOO2ijtZ4ejwrjofDUSZ sXqZvRftGqCRPKZvLfdfUvQkS1WiEGO/cavpgKasZ1ZhjQe07id8GL/jySET7n6I3cDB IyVnxwR/SWviMlCfSHkzXfIOp2IaoV05EKjfkdEoJ0BSWBUlio3xP04dXNcVCdjPTfaP eU0alqhMbY8YpcQapo/6DKoM+JjHUULpxTvMVlHU+knpwi9ITFMcBa2y/FdBFTJpIc/I NlqA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Icj5i+rayGntBubJjXPt/IQygpO/pJQULTRQR4wJTsQ=; b=W2N41rEYWLM5yFvOuZlzCNFLcYfOqTc3hcf2fba3ry0VJDb7U2Zra/pug7gWpop2bA FUhOHmOX9r3X10tuXOnvxznVcORB+zVZzSKQMWlmlNLTQWWDAe1KX4rf6b4/lgz4InvY K1uZltCjdWEKWgWz+GqDEN0nSW7kFZLDKP34Z/MZIHNZ0IajjfudkBdzSU9PIZVcSuZJ sE5AWJGpHb2UQpqlMKHcgdmbK7+mu4D4WfvuBOkxGLAENYRx06akaiPYXBd+6lWb26Vh iMKGO8vpit0UsSwtwVmGkVjRv9c9fOPyBo4ioMxn04OwUlHzDqxWpk6rT7YbiCnubxUH ayYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2KcrsPqY; 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 s59si48385741plb.350.2019.01.07.08.13.58; Mon, 07 Jan 2019 08:14:14 -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; dkim=pass header.i=@kernel.org header.s=default header.b=2KcrsPqY; 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 S1730039AbfAGM6q (ORCPT + 99 others); Mon, 7 Jan 2019 07:58:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:46312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729693AbfAGM6m (ORCPT ); Mon, 7 Jan 2019 07:58:42 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 581582089F; Mon, 7 Jan 2019 12:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546865921; bh=gICO6e/uKGw8F1EZ0NV+ViFg+4AfXTAQopilmKO2ERo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2KcrsPqYEZ/gWpFoB7UTZHRj2zxhysCl2N51iZTzddc1XB77klcsqmxHcuVS23iAU +Q6d6kLrEiup2sjAwKMYauKwD0MIMg4uuaiHOvYcXD0qSB9EARBb89WyDHqw7P98YG K4n0u4GpdVB8EyL1y3HvO0UODFYfRQroPkI2D20k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier , Christoffer Dall , Will Deacon Subject: [PATCH 4.19 159/170] arm64: KVM: Avoid setting the upper 32 bits of VTCR_EL2 to 1 Date: Mon, 7 Jan 2019 13:33:06 +0100 Message-Id: <20190107104511.749370281@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104452.953560660@linuxfoundation.org> References: <20190107104452.953560660@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Will Deacon commit df655b75c43fba0f2621680ab261083297fd6d16 upstream. Although bit 31 of VTCR_EL2 is RES1, we inadvertently end up setting all of the upper 32 bits to 1 as well because we define VTCR_EL2_RES1 as signed, which is sign-extended when assigning to kvm->arch.vtcr. Lucky for us, the architecture currently treats these upper bits as RES0 so, whilst we've been naughty, we haven't set fire to anything yet. Cc: Cc: Marc Zyngier Cc: Christoffer Dall Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/kvm_arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h @@ -104,7 +104,7 @@ TCR_EL2_ORGN0_MASK | TCR_EL2_IRGN0_MASK | TCR_EL2_T0SZ_MASK) /* VTCR_EL2 Registers bits */ -#define VTCR_EL2_RES1 (1 << 31) +#define VTCR_EL2_RES1 (1U << 31) #define VTCR_EL2_HD (1 << 22) #define VTCR_EL2_HA (1 << 21) #define VTCR_EL2_PS_MASK TCR_EL2_PS_MASK