From owner-dev-commits-src-main@freebsd.org Sun Jan 10 21:44:24 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D6C674DAFF3 for ; Sun, 10 Jan 2021 21:44:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 4DDVjN54Tkz3lr4 for ; Sun, 10 Jan 2021 21:44:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f44.google.com with SMTP id k10so12303209wmi.3 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=C7opMpTuf2Toj/ikNrwnB1S9STa9HBdAxVdEOtQ3gP3rxgOBveLBYeLpS0xxx2br3S 1eN2iYsAZECTRHCv3g8/88gBJP2f7FqWHtNxI1A43SeEeGz5vhy8iwWXkxJF2aZEefCe Aq1Mu4nbsQ0egh6DrmaPGpcpnohaoovU9OqrWOEnxkRkqLdy9k00AzYmul7ttIa3jX0I qQrPT/DzrmuKFC6b/ikj249JOajbCthpFnpza6VejojnoFUkwiGmh2Ui5jKqYVYGUp+5 d8O+XsJtuoglAd1Pw2rd7g4a8av4ZfWg/ItbbO/C6eEJLGTsLvaRFGqERcs9zhWLQLHn 8LXg== X-Gm-Message-State: AOAM532u32I1aVLFZpQvopRSyR5mYMfvR19KYu3UlLye6pJ4vkW38vIa J5Kr3NyjmvBJqNE4sXQ+Iy4AOw== 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: 4DDVjN54Tkz3lr4 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-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch 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