Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2749036rwb; Mon, 7 Aug 2023 02:53:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRsUs/AmzUPnYecspdya2R9FqWZvcJdHFELpy7/TXF8PqQoPPUQAEMxvSErdeRwdygDhBw X-Received: by 2002:a05:6512:208d:b0:4fe:ca9:d9bd with SMTP id t13-20020a056512208d00b004fe0ca9d9bdmr5082575lfr.56.1691402009957; Mon, 07 Aug 2023 02:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691402009; cv=none; d=google.com; s=arc-20160816; b=ZqBWCPL1B74rRMYJ9o1xMWyoMiWAoCa0L2XvferNs3RcspbH0yUuJlMa792r4/v3mE 8oQw/hZ/oI/74QCi/jT+JekGhsnt2RbhkR9t4os3D+jsgYX5tFWw/w1Ks0Khk87/jK7I 9KyD3l5M4j8oRxR6ORc9Adzv+R1+iCR/WepPeAcUaKkg8Q3fuQwGzHIXfnkkzJdPm/YR xKVPCG/QE7IorI4RgTZpwQAOjcdPh262zN/c+CIJKOifTnL1z5Sg/1cC7pgvVpBrLTCS GXoKzJgzG2k59sOEqbkP2DuAZmclmk7dB2skVGQhh04Zq/7E2YFg3z0KrJpFb3RMkOHl sVEw== 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:dkim-signature; bh=9Ce2RfRSWjXvPESxYUjf188ztXlpWHuHBGpioVwB/nU=; fh=VrTnGR68Y99hwNsBluOJCeZcSYGIspJmV0F9ffNzTXA=; b=tqA9wJFTKTwpArX/9IoVISpldjnVq3ftNZOlhk3PnCFGHfFlm+OCmsHhX6XyYizRsd gzUserj43nendZt45n0Lu7C5P5655pk0GLHxiRb2Zfa5+sYMi75d/CGzs5zsbNrbqfv3 8Mo8IfRMTR40HyaHMVxsm19aR2UAtIJTYju8SnGUlkhOhGUb+w6AUYGE4vnRH2dWXPv9 aQruO/NPVOjJseeg17VkkoerK9MxBw+Vp6OqiSW8nGIvnBFOAsDlbnK+1PsEf/Bd+XFZ au+bvnSoOOTUWVewlmwT7eywmBLIV9zjiyme7OaQR6zyLWYokaACqbNm6JNcJoUQS5fv qJZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=G5vcEbYx; 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=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u24-20020a170906c41800b0099bd8c1f67csi5186981ejz.499.2023.08.07.02.53.05; Mon, 07 Aug 2023 02:53:29 -0700 (PDT) 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=@gmail.com header.s=20221208 header.b=G5vcEbYx; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229900AbjHGIrK (ORCPT + 99 others); Mon, 7 Aug 2023 04:47:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjHGIrJ (ORCPT ); Mon, 7 Aug 2023 04:47:09 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD5F21722 for ; Mon, 7 Aug 2023 01:47:07 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-686b9920362so2673127b3a.1 for ; Mon, 07 Aug 2023 01:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691398027; x=1692002827; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9Ce2RfRSWjXvPESxYUjf188ztXlpWHuHBGpioVwB/nU=; b=G5vcEbYx+xBn8cSL1PvNGGagpI004mry0a3I3zcBtA1G7Du69F2p0iOcVExMfTWuFQ NT7ZHEpTXoAjGcsCReHEZr/jZDkfl039Q7Im6z7q84WVhII9UKsfS+xM7y+4DEDZKVLP lI12gML978RAxgLt7zp899crgYgwdfZRiOsXYWSjtBf61R6BOqaSQeVcGbWp3ZLnKdpR lHPVyRTCcRXdeW1iyECcJF00QUEAHo1E8H/YaqKMZk4RISOh9xchvj8QqlMkmPNa+UMF wGdGIXMDEfjqXd/Guy2s+r0P6a4jBeLsNJibh4/GkJnOu7mi03h9yB7LsZhanHjE4892 ns5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691398027; x=1692002827; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9Ce2RfRSWjXvPESxYUjf188ztXlpWHuHBGpioVwB/nU=; b=QQUO46KXNa6budUEAYN5Xnxy+NklXjAeoiMhwe+GO+2z8JWJ2ZhSZgslfMot4dDZs1 7Ol/ktwQxZBWA+uByfZJCJnYR/UGnLK6P5lHMBrEReWHGaqfHaert9fBYqoSxELCv0LI NJ/YFvR+S56M4MsNsr6bqhT2OLTYJfo4NWh8oR9lZIxiJ6lTlNFY4xt8DgouNKKRt47P GIsckEmAiDKc/1mtFmAUFwCB/7gqQENFUxAXzGXFe0yUB/nl9O1Fm4+TSUVUTN5qd1wJ EZjyEHuS/C/hbVOqyK3/YlnUUHo/DY2l3HwydFNbvnfPtyCUxPPzaZOflVLAvennI0KQ 5lGw== X-Gm-Message-State: AOJu0YxVQxwppJCakmaRFMc2H1Nws0pr5Tc7wHfqAx8MH5VNHh5AbSO/ /0HaHoYG60COIz9J2+HPhoXNehDEsahHMg== X-Received: by 2002:a05:6a20:650:b0:12f:bb22:ad3b with SMTP id 16-20020a056a20065000b0012fbb22ad3bmr6205667pzm.62.1691398027134; Mon, 07 Aug 2023 01:47:07 -0700 (PDT) Received: from code.. ([144.202.108.46]) by smtp.gmail.com with ESMTPSA id s9-20020aa78d49000000b0064d47cd116esm5614053pfe.161.2023.08.07.01.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 01:47:06 -0700 (PDT) From: Yuntao Wang To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "Peter Zijlstra (Intel)" , Anshuman Khandual , Josh Poimboeuf , Pasha Tatashin , Joerg Roedel , Yuntao Wang Subject: [PATCH] x86/head: Fix incorrect size value of startup_gdt_descr Date: Mon, 7 Aug 2023 16:45:47 +0800 Message-ID: <20230807084547.217390-1-ytcoode@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,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 Since the size value is added to the base address to yield the last valid byte address of the GDT, the current size value of startup_gdt_descr is incorrect, fix it. Fixes: 866b556efa12 ("x86/head/64: Install startup GDT") Signed-off-by: Yuntao Wang --- arch/x86/kernel/head64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 49f7629b17f7..cfd70939a099 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -80,7 +80,7 @@ static struct desc_struct startup_gdt[GDT_ENTRIES] = { * while the kernel still uses a direct mapping. */ static struct desc_ptr startup_gdt_descr = { - .size = sizeof(startup_gdt), + .size = sizeof(startup_gdt) - 1, .address = 0, }; -- 2.41.0