From owner-freebsd-questions@FreeBSD.ORG Wed Sep 1 05:03:10 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4410216A5AF for ; Wed, 1 Sep 2004 05:03:10 +0000 (GMT) Received: from hotmail.com (bay1-f28.bay1.hotmail.com [65.54.245.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E7E643D62 for ; Wed, 1 Sep 2004 05:03:10 +0000 (GMT) (envelope-from pineful@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 31 Aug 2004 22:03:10 -0700 Received: from 61.187.54.13 by by1fd.bay1.hotmail.msn.com with HTTP; Wed, 01 Sep 2004 05:03:09 GMT X-Originating-IP: [61.187.54.13] X-Originating-Email: [pineful@hotmail.com] X-Sender: pineful@hotmail.com From: "Pine Ful" To: freebsd-questions@freebsd.org Date: Wed, 01 Sep 2004 05:03:09 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 01 Sep 2004 05:03:10.0117 (UTC) FILETIME=[F9E49550:01C48FE0] Subject: Question::page fault::vm:::encrypt and decrypt file data X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2004 05:03:10 -0000 hi, Q1: How to produce a page fault? Q2: How translate physical memory address into virtual memory address? Because phys addr is 64 bit and virtual addr is 32 bit. Q1 description:: I have succeed to add hook in vfs layer to encrypt file data before write and decrypt file data after read. Now, when I use cp command, system will reboot, it seem to caused by encrypt data whose addr is uio->uio_iov->iov_base. Is it ok if only I produce a page fault manually? Q2 description:: I try to decrypt file data when page fault. I find it's easy to get physical address from virtual address, but when page fault, kern will page in several pages including page we require, how can I get virtual memory address of these pages? May I access data in physical memory directly? If yes, how tranlate 64 bit phys addr into 32 bit virt addr? Thanks!!!! pine _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963