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=-5.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 77480ECE59D for ; Wed, 16 Oct 2019 04:55:56 +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 EF4A3217D6 for ; Wed, 16 Oct 2019 04:55:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=dke-khu-ac-kr.20150623.gappssmtp.com header.i=@dke-khu-ac-kr.20150623.gappssmtp.com header.b="Pc0sj6CC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF4A3217D6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dke.khu.ac.kr Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1iKbLL-0007pl-6l; Wed, 16 Oct 2019 00:55:27 -0400 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1iKbLI-0007pf-TJ for kernelnewbies@kernelnewbies.org; Wed, 16 Oct 2019 00:55:25 -0400 Received: by mail-lj1-x241.google.com with SMTP id b20so22529330ljj.5 for ; Tue, 15 Oct 2019 21:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dke-khu-ac-kr.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=FCCVVQCEhFMhzLNH2qaBShd61Kc6oSTFyxDSGPwEz8w=; b=Pc0sj6CC3d6JZFBgxp8L65APESg2JKMw0kIwEvqyy4Br4AqZsBj+YLdy3cOKvRan+A FFrnOmxz6LXtuhoQiuQGGu263K9x1548ErmUZq26i+JGlP/HBiW2F0RG+4vN77AgbY6E XTOuRrFlaL7O3Cqcz5Y5cI1Dm1yIhFhTd/0878TZnB0Mq8h9x2zIxgV+KlxXrFznm0pH oyN+M3zahBYb5XUML7Nsrbq/0lRozmtSCCTAPMNAv4c6orRaEalS7OFsWy09eiFVBRrt 9QlBChVdZGHp1eJZYCyRtZ2Bl2vFH959cT6WwN+51Auii6d9xvMr4ru0ZLvIPAXNvQaU Y2mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=FCCVVQCEhFMhzLNH2qaBShd61Kc6oSTFyxDSGPwEz8w=; b=R1JJZ4HQ3KcuGrNcSUNYB/GFvjYwSOHYS4FKBmCeLyZRtMqM5Sf7hJOXZXQWkuKVgI xiHxolBpO7/tCG8GcO2ZNIz2LaUTqnCANwsOAbfcy3g7k2iK3ascP9E9z/ssZcFE21z0 k06v6NhgWToxKpd0xwQHOIrtwVkS6KYvDeI1bG7j/CymQQi/s2nzytWAq5GNMZz/VAIL KkKbPh5JFwopBivdNRBqtvULSmUmiTJvkT/a5rFtk97cKpUB5/XUDC86UjvIm7MRcwDJ l+CD/7TbXXJHWCddYxhuzc/3mpiMs9GKCt4TCXWsWGeCMVIOhcUqOSwvUJw9PQ5M4iUJ lOQw== X-Gm-Message-State: APjAAAWYWp5bA5NYWeFqbtEhGeu/guRLGWXNGJPQGa6tLu1fO5Uvb7MQ GPLAfPRYoSzzl9bKTfc+QUXxBKxDNKzqiY0xXT8oFiv7yd8= X-Google-Smtp-Source: APXvYqzje2Lfmiz7WvZU8JI4E+K8yqOnBjreXWFwV+0V0O3j1i/mrA8r63XhG3NGoVRLr+vDZm/onjNafiscsWboa7w= X-Received: by 2002:a2e:8893:: with SMTP id k19mr6728618lji.199.1571201659679; Tue, 15 Oct 2019 21:54:19 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?SXJmYW4gVWxsYWggKOyauOudvCDsnbTrpbTtjJAp?= Date: Wed, 16 Oct 2019 13:54:08 +0900 Message-ID: Subject: Getting netlink socket creation returns NULL in the kernel To: 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="===============4430626925838500803==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============4430626925838500803== Content-Type: multipart/alternative; boundary="000000000000cbcf780594ffe42a" --000000000000cbcf780594ffe42a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear All, I am trying to implement prefetching using machine learning in the kernel. I need some data from the kernel directly. In this regard I have got very useful comment that > Don't do that (directly). Pass the data to userspace via netlink or debugfs or shared memory or other means, and have userspace handle it. I am trying to pass data to the kernel space using netlink. Following this link , I have developed kernel space, and user space programs. Kernel and user space programs working perfectly when I load and run these modules from the terminal using =E2=80=9Csudo insmod kernelmodule.ko=E2=80=9D, and =E2=80=9C= ./userspaceApp=E2=80=9D respectively. But, when I try to use kernel program (directly as a header file #include "kernelmodule.h") with the kernel original file that is =E2=80=9Cvmx.c=E2=80=9D then it returns =E2=80=9CNULL=E2=80=9D while creati= ng socket (nl_sk =3D NULL in nl_sk =3D netlink_kernel_create(&init_net, NETLINK_USER, &cfg);) . I call user defined function, i.e., create_socket(unsigned long int addr) of kernelmodule.h from handle_ept_voilation() in vmx.c. handle_ept_voilation() is called when ept fault occurs in case of virtual machine. Furthermore, I have observed one weird behaviour: if I put 1-3 seconds sleep just before the socket creating statement , then it works just during booting of my virtual machine, after successful boot I get the same socket NULL error. Thank you for your help. --=20 *Best Regards,* *Mr. Irfan Ullah* PhD Candidate Data and Knowledge Engineering(DKE) Lab Department of Computer Science and Engineering Kyung Hee University, South Korea. +82-010-591-51651 <+82%2010-3877-8867> sahibzada.iu@gmail.com sahibzada_irfanullah --000000000000cbcf780594ffe42a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear All,
I am trying to implement prefetching using m= achine learning in the kernel. I need some data from the kernel directly. I= n this regard I have got very useful comment that=C2=A0

> Don't do that (directly).=C2=A0= Pass the data to userspace via netlink or debugfs or shared
memory or other means, and have userspace handle = it.=C2=A0=C2=A0

<= div>=C2=A0 =C2=A0 =C2=A0 I am trying to pass data to the kernel space using= netlink. Following this link, I have developed kernel space, and user space prog= rams.=C2=A0 Kernel and user space programs working perfectly when I load an= d run these modules from the terminal using =E2=80=9Csudo insmod kernelmodu= le.ko=E2=80=9D, and =E2=80=9C./userspaceApp=E2=80=9D respectively.=C2=A0 Bu= t, when I try to use kernel program =C2=A0(directly as a header file #inclu= de "kernelmodule.h") with the kernel original file that is =E2=80= =9Cvmx.c=E2=80=9D then it returns =E2=80=9CNULL=E2=80=9D while creating soc= ket (nl_sk =3D NULL in nl_sk =3D netlink_kernel_create(&init_net, NETLI= NK_USER, &cfg);) .=C2=A0 I call =C2=A0user defined function, i.e., crea= te_socket(unsigned long int addr) of kernelmodule.h from handle_ept_voilati= on() in vmx.c.=20 handle_ept_voilation()=C2=A0 is called when ept fault occurs in case of vir= tual machine.
Furthermore,=C2=A0 I have observed one weird be= haviour: if I put 1-3 seconds sleep just before the socket creating stateme= nt , then it works just during booting of my virtual machine, after success= ful boot I get the same socket NULL error.=C2=A0
Thank you=C2=A0f= or your help.
=C2=A0=C2=A0

<= br>
--
Best Regards,


Mr. Irfan Ullah
<= font color=3D"#666666">PhD Candidate
Data and Knowledge Engineering(DKE) Lab
Department of Computer Science and Engineering
Kyung Hee University, South Korea.
=C2=A0=C2=A0sahibzada.iu@gmail.com
=C2=A0sahibzada_irfanullah
--000000000000cbcf780594ffe42a-- --===============4430626925838500803== 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 --===============4430626925838500803==--