Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1406157ybi; Wed, 3 Jul 2019 15:19:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7R8rD2xzAdNqkDtTtGo1tk0dQ0qgN4vu8+e0qoHFJRhXHzh7JzHZxa2il+CuCzXxqhST3 X-Received: by 2002:a63:2246:: with SMTP id t6mr27028612pgm.209.1562192373159; Wed, 03 Jul 2019 15:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562192373; cv=none; d=google.com; s=arc-20160816; b=XsfLf4G2qN6sRfcqzJOyVpyuNtZywvs/uEPoYhrK+nimZotHUIJBky5lOBT2hGbzKe DQRgHsPjgtxD3dVZ8ct0pMSz+LVjZUhYpS9lgB9NtAY2w3sE0t2F6ciz5dijZvVVyXxv TdlnQuFYZqf1Xu9MMZwzL547BSa+68WPwrbOtBlRhbZx4E7GmrI8ssaZpnmDTK+oWgMU lHpAjtjFgGU+vDB/Pr8gVPdyVMsoG8womZv4qjommUU3xauowp/fHvOAt9OpHK6lHnnt zUZunnAP0T8zgz+Q2GfO0AP/CV+w2z+T6MaFh+V6WtmUtGLXy4ww3wljNy3Z/48Y2Qc9 JiBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XmNRMZPexYeFI2JOkBwrntyrv2GLwXAQxAQNTx885uI=; b=uO5KEkI/mR7D9A3ORuRhU2Ha6bVIWDI3X3USPJoxzzhaJkCr/tvygQ3CSYL5vXY2Ak AYZMx4v7zpRm8YK6LeqQWFWLyhm0dml47DXlxBz0ApFxK+qQbAdpvzSBItJsjCitfZDn kweh/h5jMYmc+igXX6k3y+WWNMfuqLtjHEMtI1Hruced5xWXTaOlOhADsnrJb+tppYMm n5mragPx8rdaUJQrSW3Ks5nQE0vMfT6amy1XFSW5bVfTRFOH1zbQUGMwLlSvwKlDvqIn b35h02WUo1Lmbva5lz9e72wj2+UsYaPlSuwocSpwL3C99rb9ZaDy7HTT8UHGfmVPPFrv 1cGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GF7p0TUH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si3260202plj.115.2019.07.03.15.19.17; Wed, 03 Jul 2019 15:19:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GF7p0TUH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727222AbfGCWSV (ORCPT + 99 others); Wed, 3 Jul 2019 18:18:21 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:36862 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727056AbfGCWSU (ORCPT ); Wed, 3 Jul 2019 18:18:20 -0400 Received: by mail-lj1-f193.google.com with SMTP id i21so4121394ljj.3 for ; Wed, 03 Jul 2019 15:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XmNRMZPexYeFI2JOkBwrntyrv2GLwXAQxAQNTx885uI=; b=GF7p0TUHyVuJCGDIY9EyZ2Z1cC3qsnfvz5onDlEY4h8gR13S9VkdQy/4cxfwyHR0B3 8gCQhZMZCNKxYTWwZuuAeea6LVdTZ706VwzVpFA90Vd6i3TXF69pPv+Xel1T/SMft1Av XL/LAUrQRe+NItpFOvgLI6PMsX5fM2ETsJfWacfajPjbecLqTrgawQmT6TwqazuP6B8G eEyEpTDgpkCbv1gaI4XmdX9q3QysJnjuZD0Y/5ByTWfdQjyFTYF3qqbwm+Yz+OqTeZAp FTjl3tHGfVqOtS5+1Az32rkH86Z3686vmLjDRsMGBgJvKY7MEO7Wux+rlEnIgGZ3AzTn kQEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XmNRMZPexYeFI2JOkBwrntyrv2GLwXAQxAQNTx885uI=; b=W8/ASjjNZ7UENqV95uOcAy1GgZTPqnt0TdpI20I9X0HVb1Ru7Cp11/1012oTHhFl5l Bm/0GYuAGGLpti53uS6/ymDT2EWlA5F0y7RqIrhYaJlxgtwSzFPapxic+56bS1WXALR1 O6ziZjcgKHUEQZ+ePAUmHlMqnzjwc1z393KeKVJUat6TFW0KgfxI2rkHda04ei2761Rv SzwT8mBs71pTDDj4C2PnFbEU4G5jhjiALKupVZWl79lfW2sKU7aTFzL68mDvgHWMpyUE 8dNYekkHi9VSwzuj9YqEOC+BKmcl7XZLNgIc1w3lYMqKuyuxuufB/0cJXorxNP57i/pd 4THg== X-Gm-Message-State: APjAAAX6fNYeVovP8jJk5P76ryoMgIdFeL2Wuy5YzvWYYh3O9GoH+Mie O4hYDN2wI5eZahMDIy4XGfgUUC6OjpZ8GXpd50w= X-Received: by 2002:a2e:9758:: with SMTP id f24mr6429781ljj.58.1562192298725; Wed, 03 Jul 2019 15:18:18 -0700 (PDT) MIME-Version: 1.0 References: <20190703001842.12238-1-alistair.francis@wdc.com> <20190703001842.12238-3-alistair.francis@wdc.com> In-Reply-To: From: Alistair Francis Date: Wed, 3 Jul 2019 15:15:13 -0700 Message-ID: Subject: Re: [PATCH 2/2] riscv/include/uapi: Define a custom __SIGINFO struct for RV32 To: Arnd Bergmann Cc: Alistair Francis , linux-riscv-bounces@lists.infradead.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 3, 2019 at 12:47 PM Arnd Bergmann wrote: > > On Wed, Jul 3, 2019 at 8:45 PM Alistair Francis wrote: > > > > On Wed, Jul 3, 2019 at 1:41 AM Arnd Bergmann wrote: > > > > > > On Wed, Jul 3, 2019 at 2:21 AM Alistair Francis > > > wrote: > > > > > > > > The glibc implementation of siginfo_t results in an allignment of 8 bytes > > > > for the union _sifields on RV32. The kernel has an allignment of 4 bytes > > > > for the _sifields union. This results in information being lost when > > > > glibc parses the siginfo_t struct. > > > > > > I think the problem is that you incorrectly defined clock_t to 64-bit, > > > while it is 32 bit in the kernel. You should fix the clock_t definition > > > instead, it would otherwise cause additional problems. > > > > That is the problem. I assume we want to change the kernel to use a > > 64-bit clock_t. > > Certainly not! > > Doing so would likely involve deprecating all system calls that > take a clock_t (anything passing a struct siginfo or struct tms) and > replacements based on clock64_t. Ah, that's really easy to fix then. > > > What I don't understand though is how that impacted this struct, it > > doesn't use clock_t at all, everything in the struct is an int or > > void*. > > si_utime/si_stime in siginfo are clock_t. But they are further down the struct. I just assumed that GCC would align those as required, I guess it aligns the start of the struct to match some 64-bit members which seems strange. Alistair > > Arnd