Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4083791rdb; Mon, 11 Dec 2023 08:22:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuttAJ4DU9rIWTn/BddC0NXlMPUXZp03E+9+JHAEXQMehi+eVYQftWA4MLNPG4ltiUrti3 X-Received: by 2002:a05:6a00:1304:b0:6d0:8595:ab0c with SMTP id j4-20020a056a00130400b006d08595ab0cmr1031076pfu.52.1702311748746; Mon, 11 Dec 2023 08:22:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702311748; cv=none; d=google.com; s=arc-20160816; b=hJrH7srfIAl2fzbb6TcXEBXCKAoBNVx9sOyogaYbLukMWYlEzAjaT4qdi7E9RbGjuJ tCxTuox0//NGDr6sCNiWXQjwvgrQzCzffds/Bu06cDjXrk1Qsa+2+HJ+7kYL/CLwsYdv bwwdlE+/v7B2f42b8UsCM/UadL9Z/LxFor/YYwX2hL42qBLmkqMfnK8leRcVdZrselrm OnWbBm4wXXCB5aREwwsoIBBOtFkSv5CESvmcoQ6xfrFPxQ1HwrGRiSDus0pke7gsmSy7 UN4AWVz7KoAa5i8cJ/LTljJEDado2eV5VuPG41lJpgWYcFKKTrRslbzgLEvNdzkm3oUp JqJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:content-language:references:cc:to:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=8Z8Ra1IdyFp35IPv47Pv41uAN8QOIjS9aUiMKff1qQw=; fh=QXYJd3WWBUb7QQhT3roE9WYMRy/vZWykBHxgGocCui0=; b=leuYwRCzyxnFeaJDdYobhT9Cm1d2IoUP022xf03NET7eIREcgL0lhasPqz91kShIRI 09Z7exgfqahXe28R+SNH8jTj+MYeAeIewFtdvuORw/dhTOlguQZXc8U6e2a3W1pooB4l FgsUbeOBy19EwQ39Fi4dJpT+RXE4UiGyo6JRCzTV8LKzDOcdqzE9ZjgkOfFLjXfVKeZg CCOT7wKtF8ZrInulykjc9V3MDWB9TCbsAUYh5sNHAsf0af/KSIX3Kkhzt/cuU5G/Q6SG clParKoAVN6Nxirvc6CjQnj0Qw2Zkubentx7IGwIzOvoXi2C1uLu/Eh3irxQ2yaRYPkP 1vWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FVFvbCXm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id z5-20020aa78885000000b006cb4d47cfa9si6190737pfe.270.2023.12.11.08.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 08:22:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FVFvbCXm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7F0ED806A426; Mon, 11 Dec 2023 08:22:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343931AbjLKQWS (ORCPT + 99 others); Mon, 11 Dec 2023 11:22:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229984AbjLKQWQ (ORCPT ); Mon, 11 Dec 2023 11:22:16 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50EE595 for ; Mon, 11 Dec 2023 08:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702311741; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=8Z8Ra1IdyFp35IPv47Pv41uAN8QOIjS9aUiMKff1qQw=; b=FVFvbCXmJx8e0PhUvo4t3KOzoB/Kff1wozeH4PenNe5ndUS2eFWme8afHTcwE54qbKFNu2 z5+WL4K4BI3ixJ+01Rt0JISVGyXIz4IQcsgx7yF9p5dtaOA+FLqlND4zjUpxTm7s7TtG2f gaP61BGLQqvkXGoA0zHhaeuvl+kBagg= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-0mAxhZuzMhiHUHs5jbT4Ug-1; Mon, 11 Dec 2023 11:22:20 -0500 X-MC-Unique: 0mAxhZuzMhiHUHs5jbT4Ug-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-40c1e05ad32so35519375e9.0 for ; Mon, 11 Dec 2023 08:22:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702311739; x=1702916539; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8Z8Ra1IdyFp35IPv47Pv41uAN8QOIjS9aUiMKff1qQw=; b=jYn6apGlvJwkYgmHvWxNqWtP8JO1TWCxLiFRI8Sj8wzbqW+YiZb0nzHGU+T9jgkJf8 xm0QWGEaM6bqIZ9A1vl7aRQQlhOqktTee1FFbKBk1e3oVN+qIonrYQeWb96zRH2cC2k9 fsJj48kFqaomz4e/8U16SHPLm3rZoAQ/A5Bu0uzXdF2k2eC9Lb4SQUn68iBpaNbkpu8G cG0DlTvo/pTcMklYI/ceQUVxjtk8M3BZdYMfEp5NmyosGV/yDTjfvU5+H/EE2tvnwpom D0W5fvEgT1dVGVQGQWKIsRiQQNQg43afhcteHAIx7rl1LA6O+ULxiYLN15pr8AqJFwWg ItAg== X-Gm-Message-State: AOJu0YxtuZTe88KsXLWOcexCXNC/e3HfwaSPOdqRZe6MUs6zl78dGlyZ u4JeV9eaZl2JXVuK7D2AdGOjvsC0BVyFkmzRlcGvynKJZhWXdrIrZeBBzNvwbJu3NcM68o+akG3 nzHT6p8/s6s8z+g6xw9mihilQ X-Received: by 2002:a7b:cbd1:0:b0:40c:2acd:824b with SMTP id n17-20020a7bcbd1000000b0040c2acd824bmr2246948wmi.144.1702311739088; Mon, 11 Dec 2023 08:22:19 -0800 (PST) X-Received: by 2002:a7b:cbd1:0:b0:40c:2acd:824b with SMTP id n17-20020a7bcbd1000000b0040c2acd824bmr2246941wmi.144.1702311738715; Mon, 11 Dec 2023 08:22:18 -0800 (PST) Received: from [192.168.0.6] (ip-109-43-178-138.web.vodafone.de. [109.43.178.138]) by smtp.gmail.com with ESMTPSA id fc17-20020a05600c525100b0040c42681fcesm6577710wmb.15.2023.12.11.08.22.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Dec 2023 08:22:18 -0800 (PST) Message-ID: Date: Mon, 11 Dec 2023 17:22:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] hexagon: Remove CONFIG_HEXAGON_ARCH_VERSION from uapi header To: Arnd Bergmann Cc: "linux-kernel@vger.kernel.org" , Oleg Nesterov , "linux-hexagon@vger.kernel.org" , Brian Cain References: <20231026113114.195854-1-thuth@redhat.com> Content-Language: en-US From: Thomas Huth Autocrypt: addr=thuth@redhat.com; keydata= xsFNBFH7eUwBEACzyOXKU+5Pcs6wNpKzrlJwzRl3VGZt95VCdb+FgoU9g11m7FWcOafrVRwU yYkTm9+7zBUc0sW5AuPGR/dp3pSLX/yFWsA/UB4nJsHqgDvDU7BImSeiTrnpMOTXb7Arw2a2 4CflIyFqjCpfDM4MuTmzTjXq4Uov1giGE9X6viNo1pxyEpd7PanlKNnf4PqEQp06X4IgUacW tSGj6Gcns1bCuHV8OPWLkf4hkRnu8hdL6i60Yxz4E6TqlrpxsfYwLXgEeswPHOA6Mn4Cso9O 0lewVYfFfsmokfAVMKWzOl1Sr0KGI5T9CpmRfAiSHpthhHWnECcJFwl72NTi6kUcUzG4se81 O6n9d/kTj7pzTmBdfwuOZ0YUSqcqs0W+l1NcASSYZQaDoD3/SLk+nqVeCBB4OnYOGhgmIHNW 0CwMRO/GK+20alxzk//V9GmIM2ACElbfF8+Uug3pqiHkVnKqM7W9/S1NH2qmxB6zMiJUHlTH gnVeZX0dgH27mzstcF786uPcdEqS0KJuxh2kk5IvUSL3Qn3ZgmgdxBMyCPciD/1cb7/Ahazr 3ThHQXSHXkH/aDXdfLsKVuwDzHLVSkdSnZdt5HHh75/NFHxwaTlydgfHmFFwodK8y/TjyiGZ zg2Kje38xnz8zKn9iesFBCcONXS7txENTzX0z80WKBhK+XSFJwARAQABzR5UaG9tYXMgSHV0 aCA8dGh1dGhAcmVkaGF0LmNvbT7CwXgEEwECACIFAlVgX6oCGwMGCwkIBwMCBhUIAgkKCwQW AgMBAh4BAheAAAoJEC7Z13T+cC21EbIP/ii9cvT2HHGbFRl8HqGT6+7Wkb+XLMqJBMAIGiQK QIP3xk1HPTsLfVG0ao4hy/oYkGNOP8+ubLnZen6Yq3zAF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66yshF9HkcUPGVeC4B0TPwz+HFcVhheo6hoJjLq knFOPLRj+0h+ZL+D0GenyqD3CyuyeTT5dGcNU9qT74bdSr20k/CklvI7S9yoQje8BeQAHtdV cvO8XCLrpGuw9SgOS7OP5oI26a0548M4KldAY+kqX6XVphEw3/6U1KTf7WxW5zYLTtadjISB X9xsRWSU+Yqs3C7oN5TIPSoj9tXMoxZkCIHWvnqGwZ7JhwARAQABwsFfBBgBAgAJBQJR+3lM AhsMAAoJEC7Z13T+cC21hPAQAIsBL9MdGpdEpvXs9CYrBkd6tS9mbaSWj6XBDfA1AEdQkBOn ZH1Qt7HJesk+qNSnLv6+jP4VwqK5AFMrKJ6IjE7jqgzGxtcZnvSjeDGPF1h2CKZQPpTw890k fy18AvgFHkVk2Oylyexw3aOBsXg6ukN44vIFqPoc+YSU0+0QIdYJp/XFsgWxnFIMYwDpxSHS 5fdDxUjsk3UBHZx+IhFjs2siVZi5wnHIqM7eK9abr2cK2weInTBwXwqVWjsXZ4tq5+jQrwDK cvxIcwXdUTLGxc4/Z/VRH1PZSvfQxdxMGmNTGaXVNfdFZjm4fz0mz+OUi6AHC4CZpwnsliGV ODqwX8Y1zic9viSTbKS01ZNp175POyWViUk9qisPZB7ypfSIVSEULrL347qY/hm9ahhqmn17 Ng255syASv3ehvX7iwWDfzXbA0/TVaqwa1YIkec+/8miicV0zMP9siRcYQkyTqSzaTFBBmqD oiT+z+/E59qj/EKfyce3sbC9XLjXv3mHMrq1tKX4G7IJGnS989E/fg6crv6NHae9Ckm7+lSs IQu4bBP2GxiRQ+NV3iV/KU3ebMRzqIC//DCOxzQNFNJAKldPe/bKZMCxEqtVoRkuJtNdp/5a yXFZ6TfE1hGKrDBYAm4vrnZ4CXFSBDllL59cFFOJCkn4Xboj/aVxxJxF30bn In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 11 Dec 2023 08:22:27 -0800 (PST) On 29/11/2023 04.42, Brian Cain wrote: > > >> -----Original Message----- >> From: Thomas Huth >> Sent: Thursday, October 26, 2023 6:31 AM >> To: Arnd Bergmann ; linux-hexagon@vger.kernel.org; Brian >> Cain >> Cc: linux-kernel@vger.kernel.org; Oleg Nesterov >> Subject: [PATCH] hexagon: Remove CONFIG_HEXAGON_ARCH_VERSION from >> uapi header >> >> WARNING: This email originated from outside of Qualcomm. Please be wary of >> any links or attachments, and do not enable macros. >> >> uapi headers should not expose CONFIG switches since they are not >> available in userspace. Fix it in arch/hexagon/include/uapi/asm/user.h >> by always defining the cs0 and cs1 entries instead of pad values. >> >> Suggested-by: Arnd Bergmann >> Signed-off-by: Thomas Huth >> --- >> Based-on: <20231025073802.117625-1-thuth@redhat.com> >> >> Compile tested only (with CONFIG_HEXAGON_ARCH_VERSION set to 2 >> and with CONFIG_HEXAGON_ARCH_VERSION set to 4) >> >> arch/hexagon/include/uapi/asm/user.h | 7 +------ >> arch/hexagon/kernel/ptrace.c | 7 +++++-- >> scripts/headers_install.sh | 1 - >> 3 files changed, 6 insertions(+), 9 deletions(-) >> >> diff --git a/arch/hexagon/include/uapi/asm/user.h >> b/arch/hexagon/include/uapi/asm/user.h >> index 7327ec59b22f..abae6a4b5813 100644 >> --- a/arch/hexagon/include/uapi/asm/user.h >> +++ b/arch/hexagon/include/uapi/asm/user.h >> @@ -56,15 +56,10 @@ struct user_regs_struct { >> unsigned long pc; >> unsigned long cause; >> unsigned long badva; >> -#if CONFIG_HEXAGON_ARCH_VERSION < 4 >> - unsigned long pad1; /* pad out to 48 words total */ >> - unsigned long pad2; /* pad out to 48 words total */ >> - unsigned long pad3; /* pad out to 48 words total */ >> -#else >> + /* cs0 and cs1 are only available with HEXAGON_ARCH_VERSION >= 4 */ >> unsigned long cs0; >> unsigned long cs1; >> unsigned long pad1; /* pad out to 48 words total */ >> -#endif >> }; >> >> #endif >> diff --git a/arch/hexagon/kernel/ptrace.c b/arch/hexagon/kernel/ptrace.c >> index 125f19995b76..905b06790ab7 100644 >> --- a/arch/hexagon/kernel/ptrace.c >> +++ b/arch/hexagon/kernel/ptrace.c >> @@ -74,7 +74,7 @@ static int genregs_set(struct task_struct *target, >> unsigned int pos, unsigned int count, >> const void *kbuf, const void __user *ubuf) >> { >> - int ret; >> + int ret, ignore_offset; >> unsigned long bucket; >> struct pt_regs *regs = task_pt_regs(target); >> >> @@ -111,12 +111,15 @@ static int genregs_set(struct task_struct *target, >> #if CONFIG_HEXAGON_ARCH_VERSION >=4 >> INEXT(®s->cs0, cs0); >> INEXT(®s->cs1, cs1); >> + ignore_offset = offsetof(struct user_regs_struct, pad1); >> +#else >> + ignore_offset = offsetof(struct user_regs_struct, cs0); >> #endif >> >> /* Ignore the rest, if needed */ >> if (!ret) >> user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, >> - offsetof(struct user_regs_struct, pad1), -1); >> + ignore_offset, -1); >> else >> return ret; >> >> diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh >> index c3064ac31003..f7d9b114de8f 100755 >> --- a/scripts/headers_install.sh >> +++ b/scripts/headers_install.sh >> @@ -74,7 +74,6 @@ >> arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_16K >> arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_4K >> arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE >> arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8 >> -arch/hexagon/include/uapi/asm/user.h:CONFIG_HEXAGON_ARCH_VERSION >> arch/m68k/include/uapi/asm/ptrace.h:CONFIG_COLDFIRE >> arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO >> arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT >> -- >> 2.41.0 > > Acked-by: Brian Cain Thanks! Arnd, could you maybe take this patch through your "generic include/asm header files" tree? Thomas