All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: Borislav Petkov <bp@alien8.de>
Cc: hpa@linux.intel.com, linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH 4/5] break up slow_virt_to_phys()
Date: Thu, 11 Apr 2013 09:28:59 -0700	[thread overview]
Message-ID: <5166E4CB.2060700@sr71.net> (raw)
In-Reply-To: <20130411122944.GA27062@pd.tnic>

On 04/11/2013 05:29 AM, Borislav Petkov wrote:
> On Wed, Apr 10, 2013 at 04:32:54PM -0700, Dave Hansen wrote:
>> +phys_addr_t slow_virt_to_phys(void *virt_addr)
>> +{
>> +	phys_addr_t result;
>> +	int ret;
>> +
>> +	ret = kernel_lookup_vaddr(virt_addr, &result);
>> +	BUG_ON(ret);
> 
> Isn't that BUG_ON still too harsh though? How about WARN_ON instead?
> It would still create a lot of noise so that it gets fixed without
> bringing down the system.

It's harsh for the cases where __pa()'s result never gets used directly,
like for checking against 'high_memory'.  If it gets used (like in
/dev/mem's case) the kernel really is doing something it does not intend
to do.  It's essentially reading or writing garbage.

On the other hand, I guess if we've been letting it do that bad thing
for years, we might as well continue.  We're not causing any _more_ damage.

I'm leaning toward making it a WARN_ON() at the moment. :)

  reply	other threads:[~2013-04-11 16:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 23:32 [PATCH 0/5] [RFC] rework /dev/mem code vs. highmem and DEBUG_VIRTUAL Dave Hansen
2013-04-10 23:32 ` [PATCH 1/5] clean up checks against "high_memory" variable Dave Hansen
2013-04-11  0:44   ` Borislav Petkov
2013-04-10 23:32 ` [PATCH 2/5] make /dev/kmem return error for highmem Dave Hansen
2013-04-11  9:58   ` Borislav Petkov
2013-04-10 23:32 ` [PATCH 3/5] avoid /dev/kmem oopses with DEBUG_VIRTUAL Dave Hansen
2013-04-10 23:32 ` [PATCH 4/5] break up slow_virt_to_phys() Dave Hansen
2013-04-11 12:29   ` Borislav Petkov
2013-04-11 16:28     ` Dave Hansen [this message]
2013-04-11 17:12       ` Borislav Petkov
2013-04-10 23:32 ` [PATCH 5/5] keep /dev/kmem from triggering BUG_ON() with DEBUG_VIRTUAL Dave Hansen
2013-04-11 12:37   ` Borislav Petkov

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=5166E4CB.2060700@sr71.net \
    --to=dave@sr71.net \
    --cc=bp@alien8.de \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.