From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 4F4C821CC4B for ; Thu, 9 Oct 2025 16:12:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760026352; cv=none; b=VyyBiddty4Lk+IbDUZxJMlSiAFi85qBhKOPCDlOYWoVufPFv+HH8WVm/I/X3ueIAv5M2mJ6oIi916NeCZrZlvdZ/i7XMVUvhsKdJ9YJdxoFR82Fh7SqGaoFH/uaLr6f8kgPZQsUXPFTnvVf4ILL6tdGi6+wVSBWGUefSgNb/n5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760026352; c=relaxed/simple; bh=vt4Xr6majFlHqQzO6UU/LJul2QasGvXgAd+DJc28JMo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RtjuF6WsGMmaXhJo4/WO/DVgKQIyG2ZBm+o6T8U4CtD8Z9JULGGZceMQYh0mQvYiLvByWh/y6R9x1wMltqHJ6VDrZ5GZiTqzpA8avQpPPfgtxqqj8iOSVwRt5hA3s8thckUTEumlcOLxzCOk5+25VZmtOiRIfqS1cgX89El/vxE= 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=J9qbG4Vz; arc=none smtp.client-ip=209.85.128.50 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J9qbG4Vz" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-45b4d89217aso6992105e9.2 for ; Thu, 09 Oct 2025 09:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760026348; x=1760631148; 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=vt4Xr6majFlHqQzO6UU/LJul2QasGvXgAd+DJc28JMo=; b=J9qbG4Vz6uAkx2+Unz5KNMI4Ycv/n9Gv+EX8ZVjOP945xoEv5nJt1zCGp+nyvBgs/P 4YXNXPgTTbofdtaf6B457UaYZie7+bcRA3uREZZ1XdHQVtiFtBshjVJVzerbqtvfz3Q3 rJEzOIvhNqK0qZXNtTy3zbTmBcUumNLM3gSyCKlLswjm770TMXte2GkTXBOfTJO+CObk Cd29ODmlLyma7Hs2Psby/9htyOFJxsn5U6YE/kuTMzvmYAcNXAtHpUSetDNpAYMCsApi P58q5NBhNnOhJC6emL/ifjr37PvIVIRH3tADHqaaqD6nWHxsxiIGpgj4xB4bbw+dQW7/ bF1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760026348; x=1760631148; 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=vt4Xr6majFlHqQzO6UU/LJul2QasGvXgAd+DJc28JMo=; b=Wj5bJZ/IAlSJc96FiZdddkMbE9d7VywBmfQzghmBfyXaLLNNeQjhcxDXFEgjjsoYpu yBSSP6QJKSF4W/bQtKLxQ83oYrIOS6TN0sacSUbPCRipj+C6Lp5TezXN7UqD63RVoQvK t7MUjtx2eKn5vEHCM0qH/8FTOktkWH2CiggIFii6AVjyK2z236qHfRDxUwYYrL0d4nDI rSQ7v+iUYAwyOhNW5HE68kln68qnPieCdEvJ3uRiIoMJ34g8Oi6/NMfrx9b5gtvgoWnJ uc4VmtzCaGKf3sUN8UvOtd8ziS2jDHdHQPit6yz5l3k8eqk++R+2rJUCtYRekmj0aBGl j49w== X-Forwarded-Encrypted: i=1; AJvYcCVQlrhhhXQzIW/QCH2YeK8QeGIZ0KFin89gGABFONaYhKBjyPHkytO2ZahR8EGJwR3ofyZYJrjEQPJRguU=@vger.kernel.org X-Gm-Message-State: AOJu0YwWG6/2arn1xOWPti3sAmdgEzraqIBYXKlEqxcIaL4AXHNo5bnW sZIl/4Uur4P2nmn0hP1UdMPc+ogzXWXzgo/RnLNdHxH2tF2ogn6yWuBA62xGUDIN9O7dspdmzpL z5mQXpJ28/jtDKSt0ZTPy+zZ9mwKdoUs= X-Gm-Gg: ASbGnctgFOwaFq+aXITrwpA9eOwd8TKTrAmqJd6lLvrImitRrUmGlqvL/Q8cXBN3jVr aEKkeMQ9dEplfs7zODkWeT5Vh2IO6rl+hVL4j+hTMvM1gfO2kXIbZJJSzpMyElNWjRTeDp2Gpcc CUYr4LxIADNL18JwthgiPBqChhiHrjt15TOG7tcyVrmpLVuq2RVYCQUcqe7Gj/FYuE+SnJSD/YU /ohMuKEw6co52zOWROhS8nVyEBi3GhGzbccj7dEweZb/k9WxHVVaIdZthGmdvS8 X-Google-Smtp-Source: AGHT+IFI12A7o4l5UIWszOSSqVwW7+IdmNEVBD602Qs920M96fLWTNMVF9DKFjQfLowasrstk8O4FuoK3byvRdyjw34= X-Received: by 2002:a05:600c:19c6:b0:46e:3d17:b614 with SMTP id 5b1f17b1804b1-46fa9a9440emr67530035e9.6.1760026348350; Thu, 09 Oct 2025 09:12:28 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <807cfee43bbcb34cdc6452b083ccdc754344d624.1759875560.git.fthain@linux-m68k.org> <20251009070206.GA4067720@noisy.programming.kicks-ass.net> In-Reply-To: From: Alexei Starovoitov Date: Thu, 9 Oct 2025 09:12:17 -0700 X-Gm-Features: AS18NWAh8o7ul2E7KaW4Pi6pgz_IUWTKFALZRPApDvY8RHlwRKBhNejOgDh2MHw Message-ID: Subject: Re: [RFC v3 2/5] bpf: Explicitly align bpf_res_spin_lock To: Arnd Bergmann Cc: Peter Zijlstra , Finn Thain , Will Deacon , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Andrew Morton , Boqun Feng , Jonathan Corbet , Mark Rutland , LKML , Linux-Arch , Geert Uytterhoeven , linux-m68k@vger.kernel.org, Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 9, 2025 at 9:02=E2=80=AFAM Arnd Bergmann wrote: > > On Thu, Oct 9, 2025, at 17:17, Alexei Starovoitov wrote: > > On Thu, Oct 9, 2025 at 12:02=E2=80=AFAM Peter Zijlstra wrote: > >> > >> On Wed, Oct 08, 2025 at 07:10:13PM -0700, Alexei Starovoitov wrote: > >> > >> > Are you saying 'int' on m68k is not 4 byte aligned by default, > >> > so you have to force 4 byte align? > >> > >> This; m68k has u16 alignment, just to keep life interesting I suppose > >> :-) > > > > It's not "interesting". It adds burden to the rest of the kernel > > for this architectural quirk. > > Linus put the foot down for big-endian on arm64 and riscv. > > We should do the same here. > > x86 uses -mcmodel=3Dkernel for 64-bit and -mregparm=3D3 for 32-bit. > > m68k can do the same. > > They can adjust the compiler to make 'int' 4 byte aligned under some > > compiler flag. The kernel is built standalone, so it doesn't have > > to conform to native calling convention or anything else. > > I agree that building the kernel with -malign-int makes a lot > of sense here, there is even a project to rebuild the entire > user space with the same flag. > > However, changing either the kernel or userspace to build with > -malign-int also has its cost, since for ABI compatibility > reasons any include/uapi/*/*.h header that defines a structure > with a misaligned word needs a custom annotation in order to > still define the layout to be the same as before, and the > annotations do complicate the common headers. > > See > https://lore.kernel.org/all/534e8ff8-70cb-4b78-b0b4-f88645bd180a@app.fast= mail.com/ > for a list of structures that likely need to be annotated, > and the thread around it for more of the nasty details that > make this nontrivial. I see. So this is a lesser evil. Acked-by: Alexei Starovoitov for the patch then.