From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 301B2C432C2 for ; Tue, 24 Sep 2019 08:51:08 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C04C32146E for ; Tue, 24 Sep 2019 08:51:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C04C32146E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.2) (envelope-from ) id 1iCgXK-0007p7-CU for kernelnewbies@archiver.kernel.org; Tue, 24 Sep 2019 04:51:06 -0400 Received: from omr1.cc.ipv6.vt.edu ([2607:b400:92:8300:0:c6:2117:b0e] helo=omr1.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) (envelope-from ) id 1iCgVS-0005gT-KD for kernelnewbies@kernelnewbies.org; Tue, 24 Sep 2019 04:49:10 -0400 Received: from mr6.cc.vt.edu (mr6.cc.vt.edu [IPv6:2607:b400:92:8500:0:af:2d00:4488]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id x8O8n85s018434 for ; Tue, 24 Sep 2019 04:49:09 -0400 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mr6.cc.vt.edu (8.14.7/8.14.7) with ESMTP id x8O8n1KY022471 for ; Tue, 24 Sep 2019 04:49:08 -0400 Received: by mail-qk1-f198.google.com with SMTP id h4so1115448qkd.18 for ; Tue, 24 Sep 2019 01:49:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=SjsMRNuOOXxcdqBZZStorqIsBc7t3ERzY4iHARuMI5s=; b=tsUrEtVs1ZzGm1Jc33V37OPT8FCi4jCY8drQypQVtVWabPo4sJj3SVpWgMEFMMa1uR DFrrZiURfW1z7O3tk7Y+cj9gVfc3H75UadGaCPYWbUdAHUmyGV1bwE/1Siyi3V285gqK gAZqvhn9Tuu9OpKgAFr7v0ylMKsGtvG/u+YiqZOT4bnpoVIVTQ7Aou8sS7lBoP3/PpIV 1O90ttJpVNRQaio8i3WDyXLLOCxCmMBWhutFZrOB5ZytCkFyyJdCEK1OlShRISbP3hy8 XffmA90eAySCtcJRcsHkDj2LvR3aurWpwmpN8FSUCcYqFZDqRuJeMrT+GLvWdNgByIQE mlYw== X-Gm-Message-State: APjAAAVIzPr4NbgqCSx+sR19zcYA5ejcYYolNcp8nkcPgqeAgK4GtX3b Xd4IBADSLnLaoP2MMiNNIY0vo9P1zczpnYNL4anlxxt0SHssLvENUUDbqJGlU/yK6VVMnlMCAZO v6UnRPXKJvEZU2g/7eFr368ziuIjjWIj1rlyoxCo= X-Received: by 2002:ac8:7309:: with SMTP id x9mr1717185qto.100.1569314941850; Tue, 24 Sep 2019 01:49:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLCCB/M6FSg6iQSxLHztNUDABkDzkrZzlzDTVKtzL/oIQ+l7niU4p8JvQ/RorAsumnzyJzvw== X-Received: by 2002:ac8:7309:: with SMTP id x9mr1717167qto.100.1569314941510; Tue, 24 Sep 2019 01:49:01 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:4341::359]) by smtp.gmail.com with ESMTPSA id z13sm553370qkj.34.2019.09.24.01.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 01:49:00 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: Sahibzada Irfanullah Subject: Re: Fwd: Need Help regarding Reading and Writting to a file from kernel function file In-Reply-To: References: Mime-Version: 1.0 Date: Tue, 24 Sep 2019 04:48:59 -0400 Message-ID: <233594.1569314939@turing-police> Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5531658282099215381==" Errors-To: kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org --===============5531658282099215381== Content-Type: multipart/signed; boundary="==_Exmh_1569314939_12454P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1569314939_12454P Content-Type: text/plain; charset=us-ascii On Tue, 24 Sep 2019 16:10:07 +0900, Sahibzada Irfanullah said: > subject line. The problem is: I am trying to write/read page faulted > physical addresses to a file in a kernel (v5.3-1) function, i.e., > handle_ept_violation() which is present in vmx.c. I have followed this > , Just because somebody on stackoverflow gave a guide doesn't mean it's a good idea. What problem are you trying to solve here? Are you trying to write the faulted pages themselves to a file? In that case, just creating the file, using something like 'dd if=/dev/zero of=/your/file/here bs=1M count=4096' and then using mkswap and swapon will probably work much better. If you're trying to produce a trace of what pages are being faulted, you can probably do a better job by using 'perf' to produce trace events with a lot of added data for you, or use debugfs or netlink and a userspace program to read the data and write it to disk from userspace. --==_Exmh_1569314939_12454P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXYnYegdmEQWDXROgAQJBjhAAlekAsVHTrrRkpbCudw4JCA04g4HwkRm0 gjEXRYX133AJNo0++GvEb/YoGPZ/5g4udehWjT03p4IUzBx9m9z2jK0c+lF8fy3U aYurCR9hbuwBdL7aJc1CHs0zQhvP7DjarGOkGuTb0m7JuljcLwVhLGMnBOPd3oX2 OS4GTdEX1yfOdB7XU5zWlzyc7m0K5HZ/wd62d5Ojmz7mSpSsHQyw8IK6SdHPhrRM 8B7gEDb32zv9piT1fpEI8t8vqeTzfdASHWiWALj5VwwIQOkEm1TUUOW5eZKqkVtd WZZCFZQdVR+BGBdOZqh0fR8jdGXnMO1id99PQi21Wg4oS3RisAebPQpG0gabUn0y yTVz/y7nWitiSoYcsVa3Hz6xObRWi0i8yH13AQsgwEOQsobHMVBzRkjw0BB5xpJD i0DuChIMjHVyYhTeISDZHq7RaMAGfNe+gIjguwVg346UBjadGS1o9pvGPvFqIAKf fo58LdK7uAa4Mhc9tBNUi/EnFAbdumXFMGqVlJHpp19uvaPSCnBNdbRAxIhgIiBV 76eknNxZbWR2zdJ9pGfp2eCIMmQl0UPB+WfrgDI6hdaUUOVZg4H2eAgW3bSqaqcM KxvnuvBQ9lPv0fSIjaY+P7xXbYNlQDeKkM7tcWnLoAkewZZ2BU7srLfan08IDMkz wB8Ek5ccQwA= =tTDa -----END PGP SIGNATURE----- --==_Exmh_1569314939_12454P-- --===============5531658282099215381== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============5531658282099215381==--