From owner-svn-src-head@freebsd.org Tue Feb 5 15:04:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 225BE14BC23A; Tue, 5 Feb 2019 15:04:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com [209.85.166.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B132276EB5; Tue, 5 Feb 2019 15:04:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f174.google.com with SMTP id m62so9030289ith.5; Tue, 05 Feb 2019 07:04:09 -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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K/834gwK5+l3WHJ/xiOVfw3RUwm8jKeEnnckS9nrqPY=; b=HCSB15kO2iXSZOI2YceQsEByDeBiSGiTi4xNbhXp8ciVBJiuvzf8QT8Ygtmd2NMWuz OFxCTZN9yGawDD6zZp2BaMDPmYZev/fjPCAaHwn3pQqw/Zd+g45DHEc6yOZW04Jei1Ib d9betZFET29LoG7ZY8ApQi3/HTVpQCjDPb4EczpNOywFxSTNg7yk86ueP4i6F55Am4wC rad/llo4RPGyZOYBXkpq9sjRGJrUyqT9dyzD2vx1JjQgG9PGuJmPIcGoO2m6ss0QElbi s9wKaTi5uNrU2FdUNr4HdqHZjQyCphg4FHh6h3J5IQrg6h96dvBn+X/zM+3f3WdwYBgM j5ow== X-Gm-Message-State: AHQUAubuwzgBTBVqBWhXO8MrW7Zy5KqYVlB0YsljR4hUJqlHpF2ZDWrT cJAO8Iv7BeECbRwYSKr7q24b0jhrLMCtOuNLdPNeNZbZ X-Google-Smtp-Source: AHgI3IbCvD8JLcp+8VQoYugBfXALBiCqK8nDkZWbx0IMnou68R3lmB/EfCEjJE88nk0+RZQw6xzJgTmTe3Y9IggubiU= X-Received: by 2002:a5d:88ce:: with SMTP id i14mr3399446iol.66.1549377547810; Tue, 05 Feb 2019 06:39:07 -0800 (PST) MIME-Version: 1.0 References: <201711112330.vABNUwXC077395@repo.freebsd.org> <20190205202145.A1080@besplex.bde.org> In-Reply-To: <20190205202145.A1080@besplex.bde.org> From: Ed Maste Date: Tue, 5 Feb 2019 09:38:54 -0500 Message-ID: Subject: Re: svn commit: r325728 - head/lib/libkvm To: Bruce Evans Cc: Will Andrews , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: B132276EB5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.981,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2019 15:04:10 -0000 On Tue, 5 Feb 2019 at 05:17, Bruce Evans wrote: > > On Mon, 4 Feb 2019, Ed Maste wrote: > > > On Sat, 11 Nov 2017 at 18:31, Will Andrews wrote: > >> > >> Author: will > >> Date: Sat Nov 11 23:30:58 2017 > >> New Revision: 325728 > >> URL: https://svnweb.freebsd.org/changeset/base/325728 > >> > >> Log: > >> libkvm: add kvm_walk_pages API. (Replying here only to the comments on the issues I brought up.) >>> + u_long paddr; > > Further pollution in the type and struct member names. Further misformatting > > The include of sys/_types.h was apparently changed to sys/types.h to support > using u_long. If we change the types then we can presumably revert that part. > > This should probably be uin64_t to support cross-debugging cores from > > 64-bit machines on 32-bit hosts; also for i386 PAE. Or, on IRC jhb > > suggested we introduce a kpaddr_t typedef akin to kvaddr_t. > > The correct type is vm_paddr_t or maybe a kvm wrapper of this. That precludes cross-arch and cross-size use of kvm_walk_pages; kvm supports this use (see kvm_read2) so it should be a 64-bit kvm wrapper. > >> + u_long kmap_vaddr; > >> + u_long dmap_vaddr; > > > > These two should be kvaddr_t. > > Further pollution and style bugs in names, types and formatting. Somewhat difficult to change now though... but what about: struct kvm_page { u_int kp_version; kpaddr_t kp_paddr; kvaddr_t kp_kmap_vaddr; kvaddr_t kp_dmap_vaddr; vm_prot_t kp_prot; off_t kp_offset; size_t kp_len; }; > [kvaddr_t] is currently hard-coded as __uint64_t. That works for all supported > arches now, but eventually some typedefs will actually be needed for their > purpose of being implementation-depended and changeable. Except that these should be MI for cross-debugging. > >> + vm_prot_t prot; > >> + u_long offset; > > > > off_t? > > Further pollution and style bugs in names, types and formatting. > > Maybe uoff_t. off_t is 64-bits signed so can't reach most kernel addresses > on some 64-bit arches like amd64. I believe the offset here is the offset of the page in the vmcore file, so off_t should be appropriate. > >> + size_t len; > > Further pollution and style bugs 1 name and formatting. Off hand I'm not sure of the appropriate type for a MI size; in practice now though this len will be page size.