Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2361775rwb; Thu, 27 Jul 2023 06:15:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBHt52bs51YsnuUsL306B3ahJAAXJhb/0VFu9lrpl1i4DP3RZeHkFEp/H+f4mKQostP28Q X-Received: by 2002:a17:90b:3b4a:b0:263:35ed:2756 with SMTP id ot10-20020a17090b3b4a00b0026335ed2756mr3926355pjb.41.1690463712880; Thu, 27 Jul 2023 06:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690463712; cv=none; d=google.com; s=arc-20160816; b=JQ18DahxaKp+1Vc1Ftr/mZD1fNntwT8q8B3/2MJ9sr+84cYPver6U8qGpmuEUgpUc8 tIhfJ5PI7mkB3AGnTwgT+AvaFetJo5HhjHukgJkWz0emXTZq0hdNBo9vqALC1zGVQUJ2 /chrERWPD3qMrIlwdwvW1xfMm6JHgg5diYk3NXglm/k1QqpkCQqzf3Wgj8y0yBvwj8+G orxA3Zz3+NfLU66aOpnKGhBuZnMHjGrxrY4tXu3jTDcf/jdE9hYRewqbowxM/jxQ2uFn f4zlxzHvLMCU3qI66pXF2aPyGrDXkY0bx52TKERUczOhvXp9DDYG3WwYac+8uWXa0gh2 /hKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Dk3LN9ysCMp0nX/c571qwFAAMC2Qp+rntI/6p9s/CFU=; fh=jJF+GkmW1n7Nv2Q0bNxnrFEIs3lslz+wGWCjZ1rWFQY=; b=cmbk1k2lkhzVNXSfOengd7O7qk9UnSrmIaf/avH0hANjlJec+a9lUP9U19lW4zB4R7 OX34fZushgYeaV5ZA5G/nLlUIRizp+phcdfXbgCUSLdMWCYgEfBLesPs13ABBERbE0bW 5izq1ukJBl53bh4xVclIJEMnTJe+lqy67QDDfnU9f7B8krh9IbmPWcCNj6dBdT0i9te+ B+nM7t8mOVY5/UrTcpaHozNZBerJhoN5hmn6cdXmfRqgj9kcBXdOWq4A3zEoojqZuuiJ 2Nz/zsLIvHo+OWAs092wkcpHPkfWi8F0PWaQ3/95UL2u2K/+dHKrazACjdo9Dlft2IQ3 O5DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U3NuZVGQ; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a10-20020a631a4a000000b00563de62f2bbsi1205943pgm.340.2023.07.27.06.14.52; Thu, 27 Jul 2023 06:15:12 -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=@redhat.com header.s=mimecast20190719 header.b=U3NuZVGQ; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232697AbjG0LEv (ORCPT + 99 others); Thu, 27 Jul 2023 07:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbjG0LEt (ORCPT ); Thu, 27 Jul 2023 07:04:49 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D049F30D2 for ; Thu, 27 Jul 2023 04:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690455845; h=from:from: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=Dk3LN9ysCMp0nX/c571qwFAAMC2Qp+rntI/6p9s/CFU=; b=U3NuZVGQwSwuLwWTmTtzjcntHvaj3sRMmpjQhgDuhwFaJuUbnH6INY6nXRSiuWj2KciT8G q68MhdiUkFOENuXzBS+YR6HIPxreA+Zk7cdoSX2R/tbk9JTRY2vVPBCMmW2a07Ss+WVcUR 6qUK+vGD6YoSFovCcOq8DCd05QNfwLg= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-288-TcWP7TS-PI2LdyOhCHXttg-1; Thu, 27 Jul 2023 07:04:04 -0400 X-MC-Unique: TcWP7TS-PI2LdyOhCHXttg-1 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-51bee352ffcso536744a12.1 for ; Thu, 27 Jul 2023 04:04:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690455843; x=1691060643; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dk3LN9ysCMp0nX/c571qwFAAMC2Qp+rntI/6p9s/CFU=; b=K7SAzuaX64yGwDbkqCPS23Pom8agIhipSlSFksb3ZwmCji4MTxoVl72NFsUh7n8K2B fFkYEkUNYPFT9qmk292DDP+ztMogRSS5M90bT5oEPE7h+H1Uzsj9GVDeZTfp9e1MFdcK dwsv5eRWF4c0kyBTxbdyO5ORce/Y+FOukEG9AyhWeiCoNGh3/+dtvNKh4heMZeJzf3Xb A5QclH/hDVjVznv2nVgXHNnCGpW0x3GVl9iwVID7TZBnCanKm4HporKwoNdlEtovum2P Bzas2kH8tYD+qRkojJ0B4itCJop2c6VERurZwNIDwE62OGjFXc5XimMO7ZpgaWOLPqYH CAjg== X-Gm-Message-State: ABy/qLbQCxJBncJ4HY1D9s9txLGispJeTwww2ZnafVwre2x6TmB4sM3n PPeDHj3KTM9UGakwp7DDm1GFDQ7u2U7x+4JvwMsxo92QXoFFmBlSWVUZShK/X/5kB5KKVKat8aZ 8jXzSIn7RqbOfjQIkfU68RKhX3KdN0AspR0yAKy7I X-Received: by 2002:a05:6402:1816:b0:522:3790:1303 with SMTP id g22-20020a056402181600b0052237901303mr1439875edy.32.1690455843443; Thu, 27 Jul 2023 04:04:03 -0700 (PDT) X-Received: by 2002:a05:6402:1816:b0:522:3790:1303 with SMTP id g22-20020a056402181600b0052237901303mr1439861edy.32.1690455843131; Thu, 27 Jul 2023 04:04:03 -0700 (PDT) MIME-Version: 1.0 References: <20230601072043.24439-1-ltao@redhat.com> <20230713100459.GEZK/MS69XbphJa+tN@fat_crate.local> <20230717141409.GGZLVMsU6d/9mpJvMO@fat_crate.local> In-Reply-To: <20230717141409.GGZLVMsU6d/9mpJvMO@fat_crate.local> From: Tao Liu Date: Thu, 27 Jul 2023 19:03:26 +0800 Message-ID: Subject: Re: [PATCH v2] x86/kexec: Add EFI config table identity mapping for kexec kernel To: Borislav Petkov Cc: tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, linux-kernel@vger.kernel.org, bhe@redhat.com, dyoung@redhat.com, kexec@lists.infradead.org, linux-efi@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Hi Borislav, Sorry for the late response. I spent some time retesting your patch against 6.5.0-rc1 and 6.5.0-rc3, and it is OK. So Reported-and-tested-by: Tao Liu And will we use this patch as a workaround or will we wait for a better solution as proposed by Michael? On Mon, Jul 17, 2023 at 10:14=E2=80=AFPM Borislav Petkov wro= te: > > On Mon, Jul 17, 2023 at 09:53:06PM +0800, Tao Liu wrote: > > ...snip... > > [ 21.360763] nvme0n1: p1 p2 p3 > > [ 21.364207] igc 0000:03:00.0: PTM enabled, 4ns granularity > > [ 21.421097] pps pps1: new PPS source ptp1 > > [ 21.425396] igc 0000:03:00.0 (unnamed net_device) (uninitialized): P= HC added > > [ 21.457005] igc 0000:03:00.0: 4.000 Gb/s available PCIe bandwidth > > (5.0 GT/s PCIe x1 link) > > [ 21.465210] igc 0000:03:00.0 eth1: MAC: ...snip... > > [ 21.473424] igc 0000:03:00.0 enp3s0: renamed from eth1 > > [ 21.479446] BUG: kernel NULL pointer dereference, address: 000000000= 0000008 > > [ 21.486405] #PF: supervisor read access in kernel mode > > [ 21.491519] mmc1: Failed to initialize a non-removable card > > [ 21.491538] #PF: error_code(0x0000) - not-present page > > [ 21.502229] PGD 0 P4D 0 > > [ 21.504773] Oops: 0000 [#1] PREEMPT SMP NOPTI > > [ 21.509133] CPU: 3 PID: 402 Comm: systemd-udevd Not tainted 6.5.0-rc= 1+ #1 > > [ 21.515905] Hardware name: ...snip... > > [ 21.522851] RIP: 0010:kernfs_dop_revalidate+0x2b/0x120 > > So something's weird here - my patch should not cause a null ptr deref > here. The random kernel panic I encountered is irrelevant to this patch, and I'm pretty sure it is caused by some driver, highly suspicious it is the graphic card driver i915.ko. When I apply this patch, 1) disconnect the monitor(using serial port to login) and keep i915, or 2) connect the monitor but remove i915, the kexec kernel will not fail. Though i915 has provided a pci shutdown function, maybe some bug triggered and caused memory overwrite after kexec. Anyway, it is another issue. Thanks, Tao Liu > > > [ 21.527995] Code: 1f 44 00 00 83 e6 40 0f 85 07 01 00 00 41 55 41 > > 54 55 53 48 8b 47 30 48 89 fb 48 85 c0 0f 84 a2 00 00 00 48 8b a87 > > This looks weird too. There's no "<>" brackets denoting which byte it > was exactly where RIP pointed to when the NULL ptr happened. > > Do > > make fs/kernfs/dir.s > > and upload dir.s and the dir.o file somewhere. > > In any case, my patch shouldn't be causing this. At least I don't see > it. > > I'm testing a better version of the patch and it should not cause this > thing even less. > > > The stack trace may not be the same all the time, I didn't dive deep > > into the root cause, but it looks to me the patch will cause an > > unknown issue. Also I tested the patch on kernel-5.14.0-318.el9, it > > This is the upstream kernel mailing list so those Frankenstein kernels > are all left to you. > > Good luck. :-) > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette >