Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3129687lqo; Tue, 21 May 2024 07:42:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVH5STNWFgGo/ddLVKWHO9f4SA1MVH68Kh5WmmmTYvvBxJ41zIO0RMylfJW/KKwPOftZB3j39AfquawkoHvB4lISt9xMrfUxr5O3O/nrg== X-Google-Smtp-Source: AGHT+IEQRZ9ArNIufqnFa/3GHU4oIJ8XzD74/nSkymLkEQ2BJ+MBwD97mpL65NOZjdB5V4EMh9/o X-Received: by 2002:a17:90b:2e8b:b0:2b2:6339:b1a3 with SMTP id 98e67ed59e1d1-2b6ccd8df0dmr35794122a91.37.1716302563496; Tue, 21 May 2024 07:42:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716302563; cv=pass; d=google.com; s=arc-20160816; b=Tupv4+0gmmCprh6kFB7MXQBvMH7jmkLV264ceNiGdF1Aazg51A8qpY4Gj5yeAm6FAl Orj1DADoWUTNrUa0nYh+zTn8itNRlJlLA4wraBhaUimpWXUIOIe2PLcek6How8ZXmvzA yX9oyhQCBrotD/X4JA+NK4wdaen0YUHRvA0iwmLj45dYwgn/+MQI6uLUGgmpu6q3TGMG QaPcF289DueB2F9B0/53dKeyGKid+k4HJu22GE+c8bs3BV1ZFU3q+29urFPVY2oyy+nG F4/mdz6B1a/myefnc9dsHbo+t0ZjgFBQHZ/245p8BOzLa2kS3SfAe1+wEtc8ct8BABHC mW8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=hBe3vNhy5rd6p0YbIFGsDgfDT7OSLlZtKRupRbi27uI=; fh=fzbG96Au/dLa6w0yXrDe3DLulmmfzpWSc6jqLCgWcrY=; b=wpBy9x6R2mE/oU9FC6/DL0C8WO5orPdRQxDA+TpKdmDDeT+Rgs9qtkhAU+shOZXO6h +hIBiLXoE1Oq+DIBGP85PBphyU7zeX+gBc7lDdAU+n2zE5n7rsbG7BNyKk1CWfkYczBG szZ/4p1Q7OufbR2xVuLkW/ABzjFN5I5j+EQQrWq7d+hGXrwySWRrOopEuldbVQEWdcVf w8HHftemyOh9q6S1aH6AjEywsEt0kdapRcezsY7APaOMQUQ7gXS6BK2tculUQG3mLs6C gIhYEFl8vrua7xpqSsVZzwe3Tb3oilrzfbOnCJiXY+iBXr54hhXz4MRBocLRBKiDhY9j X/Cg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eAASLyei; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-185108-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bd9317fcecsi1043861a91.1.2024.05.21.07.42.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 07:42:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185108-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eAASLyei; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-185108-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1CB24282748 for ; Tue, 21 May 2024 14:42:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B32E14372D; Tue, 21 May 2024 14:42:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eAASLyei" Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1E02142E6C for ; Tue, 21 May 2024 14:42:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716302537; cv=none; b=F1NoXmIeCd6zX9Abmn6TU0ZuDOWwo8h7m04WlHUca2OnfYDKRRqbcFNVwtw0bGVBsn9QWX/a2fcL9IpKyTOO9VWWlTDw7dp6azz0aeJ4kpGpZzfFA5ZD8WLTxKG8/7AHhlXimW/3QkUbaJ3EbHcvvbRGWU15wjRCNPIdajashxI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716302537; c=relaxed/simple; bh=hBe3vNhy5rd6p0YbIFGsDgfDT7OSLlZtKRupRbi27uI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=R5NoSFveVnFzO+pR2YBsLPduWpEGWCYhxqQi8wjVbBke6w6b6SK3b+Av2+sWde7e+x7UEx7UZrK7yv5bji6r588HuQf+xjNztKMClrZNu6PfEJrlW1icrs0wtCr6PsZ4H75r0hOxbv3gEWCO88O7sx8CTrFuyQLVWh+/v7ZlMFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eAASLyei; arc=none smtp.client-ip=209.85.217.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-f41.google.com with SMTP id ada2fe7eead31-488e8cb86c9so857085137.1 for ; Tue, 21 May 2024 07:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716302534; x=1716907334; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hBe3vNhy5rd6p0YbIFGsDgfDT7OSLlZtKRupRbi27uI=; b=eAASLyeiKEMhxoYGfS6+BUY+ZaNKdNMkJYOWkeJssjK6b7xscjUBm7/bvVit1ky3Es Gqw6vjIv+k04eS1I7Va4GPeLjsTRo4xUgyqwc4Sd86yqCxlyjJ9zaVz6qu2R9w/kTEYO JfZmc3MzFxkHsnkD46LYBcf/ikJ7aYjPiRoUfdnwPBKHy4WQzBVh4r+oTwmUTnNUlmLK 0RQRbGCWGfPNhhCy4meoFW1kvx1Xcx+gr90Ot+1fatOdQP84r9Se82jhiEOFAIbTXQcS Z8GIc/gmT6l5xc79FtaeOR+J6kxOJgxlpnzy95ogVLqDWs3P3lM2N1ZiJ4LnqBatBIHl SFfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716302534; x=1716907334; 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=hBe3vNhy5rd6p0YbIFGsDgfDT7OSLlZtKRupRbi27uI=; b=eM9PYVUcPiW+75k0vEr19LhcBTrkRH2wcpZQhi88RkrjGNsKU5wjYXRxv3XXDr7Gta SjECJ6t1AGyXwkjftV3QDzCByw4bqqVforYR1q4Jjrlt9R2+XhrchvDZAjUWbn0588dZ 0LD2KUgMlAc10S+g3FWUbzqjcHJHOGtT7dFjIVT2GasmbJ9UkYPNQMUQ8T8bngEcW2Gj FOkI9zp3BL8pUXVcXxy077hbEm61c36b3Z0VcWpkM9svOVX9D8oCJ/pxda0KhaHqtiWJ VKgHlLEaRpDn1LgFWOmmLU7y0FojxthHTz9WFnlZ8opMOAJPkSb8PWaPGsVW3Bq6sMWe oz0Q== X-Forwarded-Encrypted: i=1; AJvYcCX67m8V6GLWdKsR0fdgOjvwe4q5XYeZBreWZfPKaJz5yUUFqVsWKqJN5098MzhqMmMw4zshqJz1qSESA45y89AsRhIgXLw6j86aDrue X-Gm-Message-State: AOJu0YxndtD6sqb7DqJ0xYLPAwlXKDutCO5WC4dIjpvDQHjNwtrzXj+B cVSft/p26O0Uuxu5tzgrqBD6G7mjYqEuiYq7D359F4c9j8wBi39AIoIx4bbEWT/rkwOf7zUltXY TUEma0kmGiQmaloG22qL/MVWa3G4= X-Received: by 2002:a05:6102:6d3:b0:47f:2478:b763 with SMTP id ada2fe7eead31-48077e9dd37mr28234583137.33.1716302533056; Tue, 21 May 2024 07:42:13 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240516174357.26755-1-jim.cromie@gmail.com> <20240516174357.26755-5-jim.cromie@gmail.com> In-Reply-To: From: jim.cromie@gmail.com Date: Tue, 21 May 2024 08:41:45 -0600 Message-ID: Subject: Re: [PATCH v8-RESEND 04/33] dyndbg: make ddebug_class_param union members same size To: =?UTF-8?Q?=C5=81ukasz_Bartosik?= Cc: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 21, 2024 at 5:42=E2=80=AFAM =C5=81ukasz Bartosik wrote: > > On Thu, May 16, 2024 at 7:44=E2=80=AFPM Jim Cromie = wrote: > > > > struct ddebug_class_param keeps a ref to the state-storage of the > > param; make both class-types use the same unsigned long storage type. > > ISTM this is simpler and safer. > > Why is it safer for members of a union to have the same size ? > Its mostly extra paranoia. but if 2 users somehow get the class-type mixed up, at least theres no alignment issue added into it. And a problem like this would naturally happen (murphys law) when the PARAM_REF macro is used, which uses/shares the existing storage, so that existing code can use that storage. For example, DRM uses PARAM_REF so it can continue to use __drm_debug for a few spots in code that still examine the value during normal operatio= ns. I'll reword the commit msg to say that more clearly (than this?)