From owner-dev-commits-src-all@freebsd.org Sun Jan 10 21:44:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6B2F4DADE5 for ; Sun, 10 Jan 2021 21:44:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDVjN554pz3ljS for ; Sun, 10 Jan 2021 21:44:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f53.google.com with SMTP id a6so12286009wmc.2 for ; Sun, 10 Jan 2021 13:44:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=waDWz+nugdqZxDXUc2gkCkpki2vSAfv5HWfdiSOE8AQ=; b=iP5GDIBMsHeQ7/LOez0J9Z3vXW45Cu7L+w6OQhA0l+GTchE94JV9yGgx6uSgd3dPSX PP2xi1alG++x34tApm4KPUeCoT4CnPthWSPcuObWBJxgUCcWoX84Xjo2f82K4XalHgMr GYabovJivXWWnbU584ktMqfhZnxr/N4zfGEqMqkxU7pTJKcBJ4dqqJROVYY42u5E/Nee vWNIAydj7HjS1+hbSZm1cm/PErQ5ozuftdPGDIdq8riwF8UILJku1eRf974Q+GacM90U 9OlPB5gYqjqM5osaw7lwlrvdJL51Y4y8RgbHNXvuWL6b0Or9zqlzpjBZP3T1cUZRFtIP tcAg== X-Gm-Message-State: AOAM530yFBG1mD55/PwGo1D+PUW92dFnXN1KiiemJobJFqPl/7SoMRZy Axg3CvvLHz9EBa9r1n73w8lPDA== X-Google-Smtp-Source: ABdhPJz3J5bUoZyY7fUMYiC6gu5Ec2Jv64F59tiyxrS6vBEWBv6xvsKQ20EsHV77tsZ6DdR3VelkQg== X-Received: by 2002:a7b:c04c:: with SMTP id u12mr12425641wmc.185.1610315063295; Sun, 10 Jan 2021 13:44:23 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id z13sm26542623wmz.3.2021.01.10.13.44.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jan 2021 13:44:22 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: facdd1cd2045 - main - cgem: add 64-bit support From: Jessica Clarke In-Reply-To: Date: Sun, 10 Jan 2021 21:44:22 +0000 Cc: Mitchell Horne , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: <8EE9AF5A-E74C-470E-B3E5-A347E3367777@freebsd.org> References: <202101102053.10AKrGqv070360@gitrepo.freebsd.org> <51C7F0DA-0EA2-45EF-A817-53984205C648@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DDVjN554pz3ljS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2021 21:44:24 -0000 On 10 Jan 2021, at 21:41, Konstantin Belousov wrote: > On Sun, Jan 10, 2021 at 09:33:16PM +0000, Jessica Clarke wrote: >> On 10 Jan 2021, at 21:31, Konstantin Belousov wrote: >>> On Sun, Jan 10, 2021 at 09:17:48PM +0000, Jessica Clarke wrote: >>>> On 10 Jan 2021, at 20:53, Mitchell Horne wrote: >>>>> diff --git a/sys/dev/cadence/if_cgem.c b/sys/dev/cadence/if_cgem.c >>>>> index 3c5277452469..77337e977dcc 100644 >>>>> --- a/sys/dev/cadence/if_cgem.c >>>>> +++ b/sys/dev/cadence/if_cgem.c >>>>> @@ -77,6 +77,14 @@ __FBSDID("$FreeBSD$"); >>>>> #include >>>>> #include >>>>> >>>>> +#ifdef EXT_RESOURCES >>>>> +#include >>>>> +#endif >>>>> + >>>>> +#if INTPTR_MAX == INT64_MAX >>>>> +#define CGEM64 >>>>> +#endif >>>> >>>> This isn't going to work with CHERI. Perhaps a BUS_SPACE_MAXADDR check, >>>> or SIZE_MAX? The former is probably preferable for PAE systems. >>> >>> Wouldn't it be spelled as __LP64__ ? >> >> It shouldn't be, because the P stands for pointer(s), which we make >> 128-bit, though in practice for compatibility we have a hack to define >> it anyway (but the compiler *won't*, it's in bsd.cpu.mk or similar). >> Only the integer addresses are 128-bit. > > I have no idea about CHERI, I mean how this statement should be handled > for FreeBSD. Well, ideally in a way that works for FreeBSD and CHERI. This one happens to do that, though it doesn't feel very idiomatic, and a comparison against SIZE_MAX or BUS_SPACE_MAXADDR would seem more accurate (depending on the behaviour you want for PAE systems). FreeBSD *can* use __LP64__ but it causes pain for us downstream so we prefer people to be more specific in what they mean (i.e., do you care about the size of the address space or the size of the representation of pointers). Jess