Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp146578imm; Tue, 31 Jul 2018 15:33:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe/i806oBHt5UrSi4+U71/wqBMrPfV5pyOv9co/rJfMgF82ju8CeuRiAe31CgAQSYYYrRBn X-Received: by 2002:a17:902:27a8:: with SMTP id d37-v6mr22569722plb.290.1533076430291; Tue, 31 Jul 2018 15:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533076430; cv=none; d=google.com; s=arc-20160816; b=dBjqxWoLYxC8APJJYRvSwQ83WeWmXYm6nVGekfJszn+KDj2lbsRpsdF/I3DtN4xzdE vppWpuESGUkSevhMJ+BbeVvy3OJ6o+BSuRM4ugqa46+x1xRgJgVFNNFdY4vtbA2NA8/o f/HHCQbTkc15U2YFnFIArKHLtcqJzLHoJye/T8Y9+Rn4TzNKhAJ6FtlrzFvwc2bYV9Ns 1hlMkhBvuXYhA0J4XkmWUFheM+5Jr1RAPAR3KcPnDxltz7HrN1co3VcPY8lbw381bDau TQS4Z73pgY2wvqtmrW65qIEqRC1tRih3MEHFC8gl+1t7oUQw+31st3xXvWTN+obMCsbg KwQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature:arc-authentication-results; bh=cUldiSBlkj7H/UAA2DMoqTQntQ4WXIwQd8jMN7FJVCM=; b=S9C2edRMf9uUojH2IEnqQJrLRyox6+jECsKrxsYfrudfBojdEJuoHekBarUgA8Ph4U H4QtEuZV1tfe6WgV0L1qn8OFTvRQPKoYeGTCHOi6GYLuTvKLma75HXLLRZXh4CTwDNdc FDWklMhxxM81x3ofmVLCSoJvAXud7lxuMmVn/WoxXUptPfN/Q5XOtOC5r5S77YsnnSPZ Cp9dBLzXLW1aiQdwKPnEt0RyJYmI0KKL0IdGPIpVR8FawbyCU4BbYs7EGZLQC2QSdvtk PvddaDCXQRq3SG9yQQ7LXCKAAYvDZhMdpnE2fIma7HV8uYTsxQJV5tnLpRzPW0saRIQK 0ZJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ePIlP+hi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6-v6si14746143pgn.143.2018.07.31.15.33.35; Tue, 31 Jul 2018 15:33:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ePIlP+hi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732627AbeHAAPM (ORCPT + 99 others); Tue, 31 Jul 2018 20:15:12 -0400 Received: from mail-pg1-f176.google.com ([209.85.215.176]:39560 "EHLO mail-pg1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732379AbeHAAPL (ORCPT ); Tue, 31 Jul 2018 20:15:11 -0400 Received: by mail-pg1-f176.google.com with SMTP id a11-v6so9773808pgw.6 for ; Tue, 31 Jul 2018 15:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=cUldiSBlkj7H/UAA2DMoqTQntQ4WXIwQd8jMN7FJVCM=; b=ePIlP+hi16mmNh4G7d9kHSNeOr7fnF7DRCHIv0JbEFA/0B0hTMYI8IrmxwV8utPbQs vYSffKGu7TqmVovlYz/Xj1bEPTSqBSQ46zEIhz6qfP2g7aqxg6Howk7b7ADLmY8ja9DY UhhpEz1B0nMCtDRk+DVCVAtuTdWbQGypE38cSBZOmmI2H3UTzKkm8K9PFKvB6utgiscL QzCl2tqPBBv1znwbeWwL+nRcZ/5yTGhxZj9XRoFTySEHR6eeZ9D/DYOHl6Lk+CaRmfgL nAKr9FLmgVXGogU+m/OcltLoTa0K4ArxpbzCn120PtnJ8ZINmwqxXnGi6BFJFe6MUAPY Jk/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=cUldiSBlkj7H/UAA2DMoqTQntQ4WXIwQd8jMN7FJVCM=; b=K00qlSgifBDTphMTV8JdLQ4JVBx9l4CSdVMIqIw5u8C0oTVhCxeTDQ9ZddzS43/j+k jEnlKQPkYdP6jqdvK4GlWNf+ChuwLpXp4g6/C4loYPpoQBZQc5L+ojAwNoAkKuBGmeVg IH13rN1OHOGaF9WvqeIAwQ5hFL8OXGsS1M1MwTEWeWa16T2Gu/3oa1uDfwWXR0zL5Nr4 aPVXXAz5/Px4Q3kgQOnw4KBEG3pnGIm93LQg0IErxmhCyr1AQdFfW4AHmrs3P7VdxPAi INDmMFnuItfj7UrqHul0bBG8lwUyM2KPuaFEqgExBO7nkqGbk3F7QLyY0ninSBNN0mFT AzwQ== X-Gm-Message-State: AOUpUlGfrwp4ZpvbmbOHlik9EUuanhWub/z4NdZ5seaEeKdwft4Roszq 007n2OjHzFLXJZ5hqh6Nijn9J/x0RgCbRwqujKPmVIEbomLGzw== X-Received: by 2002:a62:ca0d:: with SMTP id n13-v6mr23858903pfg.69.1533076361644; Tue, 31 Jul 2018 15:32:41 -0700 (PDT) MIME-Version: 1.0 From: Nick Desaulniers Date: Tue, 31 Jul 2018 15:32:30 -0700 Message-ID: Subject: Getting the instruction pointer on a per arch basis To: LKML Cc: Pirama Arumuga Nainar , Greg Hackmann , Mark Salyzyn Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm currently looking into cleaning up the code duplication between current_text_addr() and _THIS_IP_, virtually every implementation of current_text_addr() and _THIS_IP_ itself are basically: #define _THIS_IP_ ({ __label__ _l; _l: &&_l; }) For a few arch's, they have inline assembly instead (for current_text_addr()). Examples: * s390 * sh * ia64 * x86 (um and 32b) * c6x * sparc I have a patch that cuts down on the duplication, but I don't understand why the few arch specific implementations are necessary. I could reduce the duplication further if it's ok to just use the statement expression. Does anyone know why this is the case? -- Thanks, ~Nick Desaulniers