Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10709416rwl; Thu, 12 Jan 2023 01:16:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1pEti0AnHJ4NC+JXitMOvWotdmqhoBRUseBWNWKKj9tz3Sfva/RCt9WYRlFzGhTJCpcGu X-Received: by 2002:a05:6402:528c:b0:48e:c073:9453 with SMTP id en12-20020a056402528c00b0048ec0739453mr30625748edb.15.1673515006332; Thu, 12 Jan 2023 01:16:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673515006; cv=none; d=google.com; s=arc-20160816; b=y8LiPLMLqug4qpIhkyY0HrPjrzpYMr1O+6gN5iu+pcBmpLGd1wCCm+8E6fknXuBV4a UOexTDAiEFq5sgMHlvY2IpLu037rovriqHUqxQowEnVY+rUVMaRk178YevsvH+RQpCdl 94CFrV84GGUXVcE6JFVubszSQhieX08CZM4v63ocTmxw7i7sSs1E0X2EbBmViN1h0MBT RXsJjq0lNwEiKYUDDOd9nF7J0L3sNfsEOtVL1VCOzRJjxvBr+8oL7MJJqyIaHaa7jmhM JgIH855N6WorU5Io9Iws6l5yGxxtdzztcW+/SHDetkATh/iCg2+JH0i3DmbeYR2QBLTf lsyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=IL5ZIP9DYWv2XGsGuDCylsAv4oLuc8Ydy6IeN3eeYd4=; b=QTfVUhLhMD4OGafS1zOKDf5MHi1RV9534BC9pR0MSxIVN1CpxTlvoEPtpkWnwxeNGR TVdYYPz/ul7DJ264I8R9bbgiH3zWk9HdntHX+Od1EAoBIKPcdorMHjpdyy0f2q3p62Bx fdS8dVNyNLmqwVmvRpMg9KIMImjpXOoaswYSPCNDqUOzw0fZPPbDBbPRzP476YP4MBNO b5E30kejZPQoX2H6xc9vr3hKMok0QUr9SMZzESYqEiEw7+ixlJACvHbVpIlfld3VOie5 5NK9RrOSQdQ//vf8v9HRWbZU+7Wp1zOioWGlOuaqJ1x68kue/DIvu4z442fMhvT8r/rz kckA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gMBriOPk; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a056402441400b0048ea97eec14si22419744eda.609.2023.01.12.01.16.34; Thu, 12 Jan 2023 01:16:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gMBriOPk; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239983AbjALJMt (ORCPT + 50 others); Thu, 12 Jan 2023 04:12:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239952AbjALJKj (ORCPT ); Thu, 12 Jan 2023 04:10:39 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D895AE48; Thu, 12 Jan 2023 01:06:46 -0800 (PST) Date: Thu, 12 Jan 2023 09:06:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673514405; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IL5ZIP9DYWv2XGsGuDCylsAv4oLuc8Ydy6IeN3eeYd4=; b=gMBriOPkAjWzM9xfLa3A64Yd5U4lcLMC6VczYi2ZjqqZYkEBXE3sPgQtkvi/N7O2tH19yP sJJSaHpdLvFutSM33EimXj9jtprToVStt7CTkF23zTrFHxMpLk3dmpJvpDiwjRSqk5YLdg qP3fQsSWCDfF3nohundfiOeP+OS7e+xyng1CBYjRLDkTI90r878h0sw1pKjKbDwhF3xgv7 LBFF8xnDN/6HgPljCm7VcWTdMe5RLPL2qPgN8YqCY9DvPsf1soY9aFLkSvDoZzHpgsLt1e E9L5tBSi8JZcGrhy3dqAOWkd3CfK8hdNWyOBhloe/3d/fO1XTwvf4Ns6YYdRPQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673514405; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IL5ZIP9DYWv2XGsGuDCylsAv4oLuc8Ydy6IeN3eeYd4=; b=6Ithw1n9crRy+7vgHkI2hSAbatOvGxTYOQlxN9Qvf71fFnacFl2sJukVIW/ib45gdbUQfP OJwXYT6mmX9m+KDA== From: "tip-bot2 for Juergen Gross" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/mm: fix poking_init() for Xen PV guests Cc: Juergen Gross , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230109150922.10578-1-jgross@suse.com> References: <20230109150922.10578-1-jgross@suse.com> MIME-Version: 1.0 Message-ID: <167351440417.4906.2133498085196807325.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 8a6b240fef388e9c2c40dcb72d142ee781f6432a Gitweb: https://git.kernel.org/tip/8a6b240fef388e9c2c40dcb72d142ee781f6432a Author: Juergen Gross AuthorDate: Mon, 09 Jan 2023 16:09:22 +01:00 Committer: Peter Zijlstra CommitterDate: Thu, 12 Jan 2023 09:48:02 +01:00 x86/mm: fix poking_init() for Xen PV guests Commit 3f4c8211d982 ("x86/mm: Use mm_alloc() in poking_init()") broke the kernel for running as Xen PV guest. It seems as if the new address space is never activated before being used, resulting in Xen rejecting to accept the new CR3 value (the PGD isn't pinned). Fix that by adding the now missing call of paravirt_arch_dup_mmap() to poking_init(). That call was previously done by dup_mm()->dup_mmap() and it is a NOP for all cases but for Xen PV, where it is just doing the pinning of the PGD. Fixes: 3f4c8211d982 ("x86/mm: Use mm_alloc() in poking_init()") Signed-off-by: Juergen Gross Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230109150922.10578-1-jgross@suse.com --- arch/x86/mm/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index d398735..5f8ba53 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -804,6 +804,9 @@ void __init poking_init(void) poking_mm = mm_alloc(); BUG_ON(!poking_mm); + /* Xen PV guests need the PGD to be pinned. */ + paravirt_arch_dup_mmap(NULL, poking_mm); + /* * Randomize the poking address, but make sure that the following page * will be mapped at the same PMD. We need 2 pages, so find space for 3,