Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4956311pxj; Wed, 12 May 2021 17:41:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFurBv+qBX8NcWibfuYT6iuNjUL8QrwOXp4zJbKbU05HG0XmjJAA+P1d3rE8/8S8f8rnC2 X-Received: by 2002:aa7:d5c9:: with SMTP id d9mr47208881eds.153.1620866497702; Wed, 12 May 2021 17:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620866497; cv=none; d=google.com; s=arc-20160816; b=ixQNHn1REGoWrgRb5+1ckDVIzwNm+xXTk7J4O+CjtHHmCf6lfCuyIRjFB8eJMgznf6 Do+ObqlYRlPysTU2UGyIUjlPG3hi/sK7WLfNVq8QN4YooXiNF6RznS0X9FomM8DzUavS H3fm5VRNeGZNzNMPdPizBm6yV2rWp+AmHfiMe496gZ5H4woM4a0gENpSL0XIq5+zC8lc m19AyK5rNZBJyysHX4w8qC4L5VM4fnoEj5fOotMfVgYS7/H22GdqAegajXzfc8Navv+A 3diyOERfmxZGXNlP/O5MdKOdKs3ahVj4LcKAbeKTWcIWSqZZE/HQCgc2Zwa13sLTlMXQ lU+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=OkykOuJqZae9glR7PkYcJ6/fmElj4y6zH2p9RvY0yOE=; b=bgTQfijaQ9YAhPt3lpJbZeMZXGaMrugdul0BAY3J6z8wDtW4HF0fmxEd7EcIuopwCV qlflJ53uY5LiENv9URMTedNIsj2uFoDB9zYjFiYqLAMMA0cOzLaIxhRMGUKu2csSO03E huCxit465JcDfxOTuhmtiJ10H4KPNU87Af7HH6GQ+3xyp+UC0ioRm5Cm1bPG/DQuwcEL 8qzvXL4FMJb/+9fumwO/oSTojRZsxTMEaYjmbHaw0fIRlDIzcuFs1A+SCooPvtJFCxFT HQ7g7S5Y3N68fH2SYIHaPr/fnordn/iijA2aC3yp+CppvSqAL2lc/wWSuej6m+nIlDEK Xnag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="q4YLVmA/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si1155124edy.605.2021.05.12.17.41.14; Wed, 12 May 2021 17:41:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="q4YLVmA/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384808AbhELUCZ (ORCPT + 99 others); Wed, 12 May 2021 16:02:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358187AbhELSnF (ORCPT ); Wed, 12 May 2021 14:43:05 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9012AC06138D for ; Wed, 12 May 2021 11:40:56 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id g14so28288479edy.6 for ; Wed, 12 May 2021 11:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OkykOuJqZae9glR7PkYcJ6/fmElj4y6zH2p9RvY0yOE=; b=q4YLVmA/vXDoeMzZwiqs0gAK4tI7M1zCqcEN5dUWxzdE/VBfjWFbLAqRdEO+d0MDjP z00HVfmGM3LNt8e0pY51YznMD/FX5SLAIoaqNqQdUDBqPwbn8GlInANggFNSKYGWWxLL KunfGkhdKxtzEw8wLm+gmZzyzsgDuNxnyoeocVJQr36fYt81u+O+G3OA2ilQIAUSz/bj BfduaQr0uRn1z/7zhDz2mOuF6pTLtPvEcoIMC/NIqp1Lh2YgtDYP40USFmyejGp8DTbU bKdWyy0Ffc/Mfgy7lfbdoTefjK8TiDQuXfFVGrTT6NTDktzO3+HQw79IwKBe+mrxeWxj BnWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=OkykOuJqZae9glR7PkYcJ6/fmElj4y6zH2p9RvY0yOE=; b=Z6syFp9aJKO8opmTfkyAdp0ez0PjHHoXdDcvn8B/wJxP2bvGYRZKjEftmsdZSuazAq ABFW4A/reE6JRlNGXVWnvdBMN76I6/2I8O/NUsp4cIczVobyKhlxi4YcDPdQQWT44doj xNEY6tfTWmqlRZeQXea58XO8Dy7s1i+i8wlafAtf7Qpey6WFMCdopDfsRsFD/SHDuXxq a5lf627VXtAIO6G5He85/gGrbM5SxqhP6ML/hb4Csfba45PJGVRxhGLEcl6CgW07qQRz I2hDcwAWP1uuuq133Kj9y0bhugIlG3pggwVg/e/w7wtUYCWfGgiNllDnhQzv4RrrD/xI 8Rug== X-Gm-Message-State: AOAM530GM8756uEz755dKmfvHHc/ReAIJkgm5WEx8Ujv1A7LxgSsWyTl dN7ICw+L2IZaPZOmVJ7wDJw= X-Received: by 2002:a05:6402:3546:: with SMTP id f6mr45368980edd.267.1620844855337; Wed, 12 May 2021 11:40:55 -0700 (PDT) Received: from gmail.com (0526E777.dsl.pool.telekom.hu. [5.38.231.119]) by smtp.gmail.com with ESMTPSA id ga3sm344287ejb.34.2021.05.12.11.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 11:40:54 -0700 (PDT) Sender: Ingo Molnar Date: Wed, 12 May 2021 20:40:53 +0200 From: Ingo Molnar To: "H. Peter Anvin" Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski , Steve Wahl , Mike Travis , Dimitri Sivanich , Russ Anderson , Linux Kernel Mailing List Subject: Re: [PATCH 4/6] x86/irq: merge common code in DEFINE_IDTENTRY_SYSVEC[_SIMPLE] Message-ID: References: <20210511005531.1065536-1-hpa@zytor.com> <20210511005531.1065536-5-hpa@zytor.com> <87lf8lfizj.ffs@nanos.tec.linutronix.de> <35c78aaa-4621-6a32-5c53-c2680a4b66c5@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35c78aaa-4621-6a32-5c53-c2680a4b66c5@zytor.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * H. Peter Anvin wrote: > > > On 5/12/21 1:38 AM, Ingo Molnar wrote: > > > > * H. Peter Anvin wrote: > > > > > On 5/11/21 7:22 AM, Thomas Gleixner wrote: > > > > > > > > That's not really making the code more readable. Something like the > > > > below perhaps? > > > > > > > > #define IDTENTRY_INVOKE_SYSVEC(func, regs, raw) \ > > > > do { \ > > > > irqentry_state_t state = irqentry_enter(regs); \ > > > > \ > > > > instrumentation_begin(); \ > > > > kvm_set_cpu_l1tf_flush_l1d(); \ > > > > if (raw) { \ > > > > __irq_enter_raw(); \ > > > > func(regs); \ > > > > __irq_exit_raw(); \ > > > > } else { \ > > > > run_sysvec_on_irqstack_cond(func, regs); \ > > > > } \ > > > > instrumentation_end(); \ > > > > irqentry_exit(regs, state); \ > > > > } while (0) \ > > > > > > > > > > Digging more into it, it looks like a *lot* of the macros in > > > and can be replaced with inlines without > > > any change in functionality or generated code. > > > > That would be a much preferred outcome ... > > Well, here is an RFC. This is obviously a much bigger change and I don't > feel it is mature yet, but it would be good to know if you (plural) feel it > is in the right direction. Looks much cleaner IMO, and there's also some linecount reduction: > 7 files changed, 117 insertions(+), 142 deletions(-) Thanks, Ingo