mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'xuesong Chen' <xuesong1977@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: Question about output of kmalloc()
Date: Tue, 14 Jan 2020 10:36:55 +0000	[thread overview]
Message-ID: <22e494d8f2c7448dbf75a70a949d1280@AcuMS.aculab.com> (raw)
In-Reply-To: <CAJKSTDwPX3D956yMaNakgjbHSd7hyyU7YbGN-nM=LmR3qXMtxQ@mail.gmail.com>

From:  xuesong Chen
> Sent: 14 January 2020 07:21
> Below code snippet in the .ko:
> 
> unsigned long *p = (unsigned long *)kmalloc(sizeof(*p), GFP_KERNEL);
> printk("Addr of p = 0x%p\n", p);
> 
> The output is:
> Addr of p = 0x0000000018606ce7
> 
> In my mind, during the early day, the p should be 0xfffff...., can
> anybody give some tips why the output looks like it's a physical
> address?

The printed value is hashed to avoid leaking info.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2020-01-14 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14  7:20 xuesong Chen
2020-01-14 10:36 ` David Laight [this message]
2020-01-14 11:50   ` xuesong Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22e494d8f2c7448dbf75a70a949d1280@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xuesong1977@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®