Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9523314ybi; Wed, 24 Jul 2019 05:39:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmFVzSCKb62kdKkn4vrAIsC0EESbxH7rmHR75fSIT/W0dLmzq25avJ0vQDxKDOdVfW9mGU X-Received: by 2002:a62:e910:: with SMTP id j16mr11479390pfh.123.1563971975478; Wed, 24 Jul 2019 05:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563971975; cv=none; d=google.com; s=arc-20160816; b=am61Ht3vnZV32L5UqWUg/mEbtay6HMA7wDJyk685nBTlIia071qY8zTefLSMe3wYMc Wu5eucML+5keCvkQYZqahVhbI/+v0CR8xrEDOz1sTOx8adeKHYU/fKZN67RaCaY2CTMd 2JaPHAF37hAqYZhWC9IgeMSCoejyQ6IvxolzLV82oqVSiDS+tkQaMFi8VpEhgiNE1Kbt wwpESv45EfXakPysSc2f4+A8M+t4cICcsXaeWT3M80TCM7NfroyLH7okbUpVtL4IG5cM 8wFf/V71k/M/krfU3kx+ydBhHADt7eKcpearYnjUEvJL7d5gfPwKIc0KlM2ToXk1vXR1 /WKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=Cb6E/AEJ31z78Bst6yAAp5yYD+unp+whSXcGVbkFmjM=; b=UzW4ax4FwSlOULKby9kT+TPo2YxShvLdFbMYyxO1+fXI0fNftcw94G7IWXqD9cOE/u 4kZ9mR0MqxsfIqz6T9Ptd4PuMRkXGoTebCiekz22k7jEKQeHkxIeLC2D+Ivg8VwTj9qS 6y9e2e+TsAV7qCtM6LxeMpj5rpEDodgSSoyX8G5vD1Ez6TfPA4bvDkWstdKKgAfHRlL4 mnZCQlTd9hTb+hEom823uwsKJzpDFENCswbURFoCD807bDCsbmjuv0fwPvcaP6De3HmE KX5ytBgftJLFEHYuuTA8+tQfr39Ey88r0Mncel/zPQL+o4+QSH3jDAxID7oI0BhxAIn1 a1Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=SMLOGUG8; 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=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si6395731pgj.257.2019.07.24.05.39.21; Wed, 24 Jul 2019 05:39:35 -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=@zytor.com header.s=2019071901 header.b=SMLOGUG8; 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=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbfGXKWp (ORCPT + 99 others); Wed, 24 Jul 2019 06:22:45 -0400 Received: from terminus.zytor.com ([198.137.202.136]:51451 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbfGXKWp (ORCPT ); Wed, 24 Jul 2019 06:22:45 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x6OAMLAE490320 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 24 Jul 2019 03:22:21 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x6OAMLAE490320 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1563963741; bh=Cb6E/AEJ31z78Bst6yAAp5yYD+unp+whSXcGVbkFmjM=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=SMLOGUG8Dx/WtB0K6FqYnkQE3FRgHrK+oURXYcyu8lnjRNPe9fctxkZ1NAdqPrpBV rXtJcG3ToUdRMFvT8LiA4eSBQgT+b1n5khe+M5/GttWmabuAzIfC05MD84zRsPcsiu 7UnPc7ar7V4/MNBYOgPQc9zhq0hMZ03NNpkX2vGsqSaD5HYn1GTmeoNach+NwRmDtS ZyhjuMQYIxvlIsuHGZmYegwgasqm/LvH/YM8pNPv+OHeEzE/mTtWo3g92Am1TC0093 /6G9Supfn4JOlo3lKU5M2ylbMUfpbvy/BqvEB7M695uNOrlFE2EIxZ4focf+ZRewQg OYqvNVpstrOAA== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x6OAMKlm490317; Wed, 24 Jul 2019 03:22:20 -0700 Date: Wed, 24 Jul 2019 03:22:20 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Matt Mullins Message-ID: Cc: mmullins@fb.com, mingo@kernel.org, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org Reply-To: tglx@linutronix.de, hpa@zytor.com, mmullins@fb.com, mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org In-Reply-To: <20190724042058.24506-1-mmullins@fb.com> References: <20190724042058.24506-1-mmullins@fb.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/entry/32: Pass cr2 to do_async_page_fault() Git-Commit-ID: b8f70953c1251d8b16276995816a95639f598e70 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b8f70953c1251d8b16276995816a95639f598e70 Gitweb: https://git.kernel.org/tip/b8f70953c1251d8b16276995816a95639f598e70 Author: Matt Mullins AuthorDate: Tue, 23 Jul 2019 21:20:58 -0700 Committer: Thomas Gleixner CommitDate: Wed, 24 Jul 2019 12:17:39 +0200 x86/entry/32: Pass cr2 to do_async_page_fault() Commit a0d14b8909de ("x86/mm, tracing: Fix CR2 corruption") added the address parameter to do_async_page_fault(), but does not pass it from the 32-bit entry point. To plumb it through, factor-out common_exception_read_cr2 in the same fashion as common_exception, and uses it from both page_fault and async_page_fault. For a 32-bit KVM guest, this fixes: Run /sbin/init as init process Starting init: /sbin/init exists but couldn't execute it (error -14) Fixes: a0d14b8909de ("x86/mm, tracing: Fix CR2 corruption") Signed-off-by: Matt Mullins Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20190724042058.24506-1-mmullins@fb.com --- arch/x86/entry/entry_32.S | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index 2bb986f305ac..4f86928246e7 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -1443,8 +1443,12 @@ BUILD_INTERRUPT3(hv_stimer0_callback_vector, HYPERV_STIMER0_VECTOR, ENTRY(page_fault) ASM_CLAC - pushl $0; /* %gs's slot on the stack */ + pushl $do_page_fault + jmp common_exception_read_cr2 +END(page_fault) +common_exception_read_cr2: + /* the function address is in %gs's slot on the stack */ SAVE_ALL switch_stacks=1 skip_gs=1 ENCODE_FRAME_POINTER @@ -1452,6 +1456,7 @@ ENTRY(page_fault) /* fixup %gs */ GS_TO_REG %ecx + movl PT_GS(%esp), %edi REG_TO_PTGS %ecx SET_KERNEL_GS %ecx @@ -1463,9 +1468,9 @@ ENTRY(page_fault) TRACE_IRQS_OFF movl %esp, %eax # pt_regs pointer - call do_page_fault + CALL_NOSPEC %edi jmp ret_from_exception -END(page_fault) +END(common_exception_read_cr2) common_exception: /* the function address is in %gs's slot on the stack */ @@ -1595,7 +1600,7 @@ END(general_protection) ENTRY(async_page_fault) ASM_CLAC pushl $do_async_page_fault - jmp common_exception + jmp common_exception_read_cr2 END(async_page_fault) #endif