From patchwork Fri Oct 20 09:08:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Wenlong X-Patchwork-Id: 155898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp922327vqb; Fri, 20 Oct 2023 02:09:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEu35sxCXFMv0rN48xeFyAwENhWtHUBEWPgaBgVMXx14kaVHHHyn4M590a/nY3VJTed6ceP X-Received: by 2002:a17:90b:1016:b0:27d:23f1:ddf5 with SMTP id gm22-20020a17090b101600b0027d23f1ddf5mr1144290pjb.30.1697792947179; Fri, 20 Oct 2023 02:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697792947; cv=none; d=google.com; s=arc-20160816; b=KKbCXWOEy2gPIKlQQVRnLK8Wy1d/j7GgaG/2qerM1pxkf3AD8YLwh9SE25EuFuSbl7 8O+SwBd3VC+fiEs6u0c60rhqUCMLRjLQUz8LQs/z95xqlx1rUf1KqZj5gV5ROiLg8SAU SYb3pFuaFUJ0OrtS0Fp9EHl22DKojZtYCdB5uPnwhL1BL2bz9Adm6tKylxGtj/4X4rzw 6yfB3BcpuLr/KngFPk0fWE61JgkpGjH8QaB/G/HRj/l3QKEsUtrxIhb3p5BRx2QbX/3o B14RTZOmEaVBy0Gmj73vjlGfyE62MQKZ6JeKTw4+0bcja2AswQrHpFGiy68JBkwzFGXS BKng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sdhD6UJ5kNvE6rBRVwmtclM5i9jrGVO5sVfdDSZpK8A=; fh=hKzLdgK4HR+tiTg9dLSK89ALadeChc5zAyrWEZxRg98=; b=WsplVSGrEmZIuozkWc154ekq252xXHkYRCCFq50yVxXg58x3aXruBsLZvEYSXklGTl pDJTKsk5VX8vbymLBq+S4Ncp5uC7vu0YYkkT1oDnxdpo79j4HJfOim0kHVdSa32Onpt7 HDMqbNyrjBnQXkHISSStvovU3B1XhO+6htel+2tx07eH7wglDaWtFmLBbJTTZxMunGFl rtWsDqExhotiRaiv6SAYAlqRwNbAHQUwiwlS1VEKh0emgivUIsHPNQRJJh7VO/ufT/Vc 4g1C/q6ckh4zMT5hmMSerRIkBav5PQD4Uy8AI5w2C84Kn9Z8iGuB3k+18tZXYy54iuuE 9DUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id oc15-20020a17090b1c0f00b0025eeb3cc4b2si1666094pjb.9.2023.10.20.02.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:09:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E32448258996; Fri, 20 Oct 2023 02:09:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376562AbjJTJI6 (ORCPT + 25 others); Fri, 20 Oct 2023 05:08:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376523AbjJTJI5 (ORCPT ); Fri, 20 Oct 2023 05:08:57 -0400 Received: from out0-198.mail.aliyun.com (out0-198.mail.aliyun.com [140.205.0.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96182AB; Fri, 20 Oct 2023 02:08:55 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R401e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047193;MF=houwenlong.hwl@antgroup.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---.V3aO7cu_1697792930; Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.V3aO7cu_1697792930) by smtp.aliyun-inc.com; Fri, 20 Oct 2023 17:08:51 +0800 From: "Hou Wenlong" To: linux-kernel@vger.kernel.org Cc: "Hou Wenlong" , "Juergen Gross" , "Boris Ostrovsky" , "Darren Hart" , "Andy Shevchenko" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , " =?utf-8?q?maintainer=3AX86_A?= =?utf-8?q?RCHITECTURE_32-BIT_AND_64-BIT?= " , "H. Peter Anvin" , " =?utf-8?q?moderated_list=3AXEN_HYPERVIS?= =?utf-8?q?OR_X86?= " , " =?utf-8?q?open_lis?= =?utf-8?q?t=3AX86_PLATFORM_DRIVERS_-_ARCH?= " Subject: [PATCH] x86/xen/pvh: Enable PAE mode for 32-bit guest only when CONFIG_X86_PAE is set Date: Fri, 20 Oct 2023 17:08:42 +0800 Message-Id: <8c5448eeebbba998a7fff9ed9b2f7e7f3e437967.1697792461.git.houwenlong.hwl@antgroup.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 20 Oct 2023 02:09:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780264937274510087 X-GMAIL-MSGID: 1780264937274510087 The PVH entry is available for 32-bit KVM guests, and 32-bit KVM guests do not depend on CONFIG_X86_PAE. However, mk_early_pgtbl_32() builds different pagetables depending on whether CONFIG_X86_PAE is set. Therefore, enabling PAE mode for 32-bit KVM guests without CONFIG_X86_PAE being set would result in a boot failure during CR3 loading. Signed-off-by: Hou Wenlong Reviewed-by: Juergen Gross --- arch/x86/platform/pvh/head.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S index c4365a05ab83..085adb1b2313 100644 --- a/arch/x86/platform/pvh/head.S +++ b/arch/x86/platform/pvh/head.S @@ -70,10 +70,12 @@ SYM_CODE_START_LOCAL(pvh_start_xen) mov $_pa(early_stack_end), %esp +#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) /* Enable PAE mode. */ mov %cr4, %eax orl $X86_CR4_PAE, %eax mov %eax, %cr4 +#endif #ifdef CONFIG_X86_64 /* Enable Long mode. */