Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1386464rdb; Fri, 16 Feb 2024 14:18:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWMhLMfcMGttTG7xPrglGiqJLH2+hCk5m+ipaeLRZlYBbjseEm9y3rc1ujo0fbi/X+IMdy+HU5Ro0fS/4IbuX1GMoy+0njKPS6LB5/wgA== X-Google-Smtp-Source: AGHT+IHUkFQmF1w5U3qUv1hjUcnQPl4Xdz1CMw1qgabktHz76+5axBuL3zTjuU3tGzwGoJvGScYU X-Received: by 2002:a05:6e02:108f:b0:363:bdb9:72af with SMTP id r15-20020a056e02108f00b00363bdb972afmr3132777ilj.23.1708121913816; Fri, 16 Feb 2024 14:18:33 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e38-20020a631e26000000b005dc0e9aefeasi481901pge.809.2024.02.16.14.18.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 14:18:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69372-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linutronix.de header.s=2020 header.b=gAVIuj6q; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-69372-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69372-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 30031B22908 for ; Fri, 16 Feb 2024 21:45:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44D2D146904; Fri, 16 Feb 2024 21:45:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gAVIuj6q"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fFG6Fv0u" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBBF61353E4; Fri, 16 Feb 2024 21:45:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708119949; cv=none; b=R3RpxczHHwLUOpD3NQosoBFrf8Jk7KyuZzsvDJWwqqIab0wdibgxZzalWmzPRCct8RBCB6ghBW4+GZ6JYa+KnK9auIrpFugJ+DO1+XHmk0qJ73YiHoHjOsH7MNupGSG5lkwc9DHlhw9uQFLolsC85ovb2+9NT5FYPwVOqXvLJ9s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708119949; c=relaxed/simple; bh=Mk0nxUw+sq35db+ZT9456aN5/fkc1vmq/3qOwOy1K4M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ZiV6IaFQQN58flB8b+3uvKPRkEuR5LCj8O9oaFejo0HKsEhaQgmY2Mb5LeQakRQxXOyjSk3rs5Hm/2s9kyVr9asOuvAgAk0W1lE68g0cZL5jl9O2yyFelTiblgz2qkvxQR9Q4NFPF3VMfqc8O8S0FK0LQmdSmbR1nOgLvb4+syw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gAVIuj6q; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=fFG6Fv0u; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708119946; 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: in-reply-to:in-reply-to:references:references; bh=etwgo5N1QWBMtShX9v3D2p+zgcQeVtP2GzdDLktsQC8=; b=gAVIuj6qniijsqgHgtIzLeiQgR3BMvBcoIEPyBGKmP+zphoPaMN3uCeMQpVzwLe3/RiFEp UZhZ5x70uxt5E4tB9R53WM/x6VohRsdB+2PV9HUuN338zr24EjVEzEprL/6ZSu7opblo0+ bLUvyUMTnCW134TEkRLD0Us7i04zR17Ch6fNoYCIgdeppiNZZSbv9baFd0rm760cGZqQWM zNqcQYAwN3jIwAUlLSsmpoGMQzcMg51shu79JgwsKvaxu0RGKMepS+umoWN3/C2dX6gOmj W7fwaHcZveJlqPIfWqx+vzUaT5QAOwfgPig+BVZmQVgZ6+5cP6etJchZaflXXg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708119946; 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: in-reply-to:in-reply-to:references:references; bh=etwgo5N1QWBMtShX9v3D2p+zgcQeVtP2GzdDLktsQC8=; b=fFG6Fv0uT9s8hVazM4DMd94ET+uX8+bc9eWd1hNGvJMzF+aU064xWN5Hxft0bOsfnGLEs8 u0zXOdvBmVkPJ/Cg== To: Paolo Bonzini , Xin Li , Sean Christopherson , Max Kellermann Cc: hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Stephen Rothwell , kvm@vger.kernel.org Subject: Re: [PATCH] arch/x86/entry_fred: don't set up KVM IRQs if KVM is disabled In-Reply-To: <5a332064-0a26-4bb9-8a3e-c99604d2d919@redhat.com> References: <20240215133631.136538-1-max.kellermann@ionos.com> <5a332064-0a26-4bb9-8a3e-c99604d2d919@redhat.com> Date: Fri, 16 Feb 2024 22:45:45 +0100 Message-ID: <87ttm8axrq.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Fri, Feb 16 2024 at 07:31, Paolo Bonzini wrote: > On 2/16/24 03:10, Xin Li wrote: > > It is intentional that KVM-related things are compiled out completely > if !IS_ENABLED(CONFIG_KVM), because then it's also not necessary to > have That's a matter of taste. In both cases _ALL_ KVM related things are compiled out. #ifdeffing out the vector numbers is silly to begin with because these vector numbers stay assigned to KVM whether KVM is enabled or not. And no, I don't think it's a net win to have the #ifdeffery in that table. Look at apic_idts[] in arch/x86/kernel/idt.c how this ends up looking. It's unreadable gunk. The few NULL defines in a header file next to the real stuff #if IS_ENABLED(CONFIG_KVM) .... #else # define fred_sysvec_kvm_posted_intr_ipi NULL # define fred_sysvec_kvm_posted_intr_wakeup_ipi NULL # define fred_sysvec_kvm_posted_intr_nested_ipi NULL #endif are not hurting at all and they are at a place where #ifdeffery is required anyway. That's a very common pattern all over the kernel and it limits the #ifdef horror to _ONE_ place. With your change you propagate the #ifdefffery to the multiple and the very wrong places for absolutely zero practical value. The resulting binary code is exactly the same for the price of tasteless #ifdeffery in places where it matters. Please get rid of this #ifdef in the vector header and don't inflict bad taste on everyone. Thanks, tglx