Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1958480rwb; Fri, 5 Aug 2022 10:32:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Da9ygiGdjFylrLapbU/LB57UqZQ5p0zA65ASkwKlRpwsmTTvHKzQNrawRoEmWNzdo1vbP X-Received: by 2002:a17:90a:7b89:b0:1f3:26f3:d7c0 with SMTP id z9-20020a17090a7b8900b001f326f3d7c0mr17285790pjc.43.1659720724334; Fri, 05 Aug 2022 10:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659720724; cv=none; d=google.com; s=arc-20160816; b=n5J+jVF971wG3Fv97B3RV44rLUh02NhlAZHCuXA78Ie3SZqIZFtrJISXOx5I+b/yzf BrOUThwn5geJbOMceTocLBafoJT/lgZEsIbe3iJbLgVZGsG6lM3PjJRzr4M9xVVnwA5P XPtj88d5WIitVkimU4rjQw9G2cEGjPn/kDPHvkvPovLZ7qHv3hpz7UiJukAkez6P45nj fk1EHfQCjRrR7hQOxTsuu1ssV5UZBPl5nIIRZi7pyFqTT/X3pQJmeYExvESrtzr3FJlP Eg7JKJvSLJaxX+3Jgxv03NP5FO5x4eMmlIki26at54oL6IjoMFGGDlu6qzjp3fP5jBmn f25A== 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=Hn26U2yDHJk28Or+fP9YBGOcX1br4SVIkPtlex5cDLk=; b=zxuRmW8vpnFcil5WHXTjLsHjUUxlP8svpwQvB4GW1WiIHCkGozGLYaekrvKUlLic9G 6onQWwy3OiadiNVnHDMCTzWPQpO6tQlxNMybbzQ2gNVnamqFtKY9LuHam98LTtpjN/C7 XfYNdo07NIMS5A+2tCT2XM0NYp3t0W371GigESQ8oExb3yBFO6dODQbzQEDRmIWcv+8k hZKw69aJdCYrqCrhZyimF+9dlNTDc5SJEg0bCdY7fuxAI9vBgoG5i1XDVtaFKLP0lZK1 5SGoIFDG3h7N6q7hvESWqdR2sJQUR0U6uY9BtLRz/hI7H4CfxzmvDaIrTkI7mEXlLgHL fBpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GljWQ+Nl; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n1-20020a63b441000000b00419f2d09e77si3692585pgu.99.2022.08.05.10.31.49; Fri, 05 Aug 2022 10:32:04 -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=@intel.com header.s=Intel header.b=GljWQ+Nl; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241382AbiHERau (ORCPT + 99 others); Fri, 5 Aug 2022 13:30:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241301AbiHERag (ORCPT ); Fri, 5 Aug 2022 13:30:36 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76E0D19C03 for ; Fri, 5 Aug 2022 10:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659720627; x=1691256627; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=lNpl3WpX5qBLgUm1l2qwRW/uFaqWkaKUUWTJTe511pE=; b=GljWQ+Nl9aioX0ZwA6tmsf/IDgb/8l9DiSeges51mje1zNmisFi+IZ46 ZWjca0QMOf2GzopGKAu6UMJ4G/0VfdPGTkocw9aN2fOnHqr3cBvvthot4 dckwiMBTJ76HKlflH1yCpoZqGcm+LLW7biupXGk+KYkA9qMY/nqBU1/w9 fMp5MY41NXzLBe0/g83LGdjZH+Sb9yUUV62Z9DLfd1NOA+1ZEVB5pmFPJ hXNgAffF2lrdd0pFgQp5UCAtkV9U8vU3Gl1ZSCalJj0DXttwC4zsqP3jk sbZRAiqAdV/SJ0XTpLxX5b3i2qrx4huetE4zjtz2l7VM2JwMxZDi+LumY Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10430"; a="287814607" X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="287814607" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2022 10:30:20 -0700 X-IronPort-AV: E=Sophos;i="5.93,216,1654585200"; d="scan'208";a="663064578" Received: from amecham-mobl.amr.corp.intel.com (HELO localhost) ([10.255.0.242]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2022 10:30:19 -0700 From: ira.weiny@intel.com To: Rik van Riel , Borislav Petkov , Dave Hansen Cc: Ira Weiny , x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [RFC PATCH 0/5] Print CPU at segfault time Date: Fri, 5 Aug 2022 10:30:04 -0700 Message-Id: <20220805173009.3128098-1-ira.weiny@intel.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Ira Weiny Rik reported that the knowledge of which CPU's are seeing faults can help in determining which CPUs are failing in a large data center.[1] Storing the CPU at exception entry time allows this print to report the CPU which actually took the exception. This still may not be the CPU which is failing but it should be closer. Dave and Boris recognized that the auxiliary pt_regs work I did for the PKS series could help to store this value and avoid passing the CPU throughout the fault handler call stack. I'm posting this RFC for a few reasons. 1) I've left in arch_restore_aux_pt_regs(). This is called on exception exit and is not needed for this use case but I believe it is better to leave it for symmetry within the generic entry code. This also means that patch 1/5 could be dropped completely. 2) I want to see if 0day has any issues with the Kconfig option changes I made which may creep in from a 32bit build. 3) The final patch could be squashed with Rik's but it seemed better to leave them split for authorship clarity. Compile tested only. [1] https://lore.kernel.org/all/20220805101644.2e674553@imladris.surriel.com/ Ira Weiny (4): entry: Pass pt_regs to irqentry_exit_cond_resched() entry: Add calls for save/restore auxiliary pt_regs x86/entry: Add auxiliary pt_regs space x86/entry: Store CPU info on exception entry Rik van Riel (1): x86,mm: print likely CPU at segfault time arch/arm64/include/asm/preempt.h | 2 +- arch/arm64/kernel/entry-common.c | 4 +-- arch/x86/Kconfig | 4 +++ arch/x86/entry/calling.h | 19 ++++++++++++++ arch/x86/entry/common.c | 2 +- arch/x86/entry/entry_64.S | 22 ++++++++++++++++ arch/x86/entry/entry_64_compat.S | 6 +++++ arch/x86/include/asm/entry-common.h | 12 +++++++++ arch/x86/include/asm/ptrace.h | 19 ++++++++++++++ arch/x86/kernel/asm-offsets_64.c | 15 +++++++++++ arch/x86/kernel/head_64.S | 6 +++++ arch/x86/mm/fault.c | 10 ++++++++ include/linux/entry-common.h | 25 +++++++++++++----- kernel/entry/common.c | 29 ++++++++++++++++----- kernel/sched/core.c | 40 ++++++++++++++--------------- 15 files changed, 178 insertions(+), 37 deletions(-) base-commit: b2a88c212e652e94f1e4b635910972ac57ba4e97 -- 2.35.3