All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"ashish.kalra@amd.com" <ashish.kalra@amd.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"luto@kernel.org" <luto@kernel.org>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"bp@alien8.de" <bp@alien8.de>
Cc: "jgross@suse.com" <jgross@suse.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"Rodel, Jorg" <jroedel@suse.de>,
	"mhklinux@outlook.com" <mhklinux@outlook.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"peterx@redhat.com" <peterx@redhat.com>,
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>
Subject: Re: [PATCH] x86/mm: fix lookup_address() to handle physical memory holes in direct mapping
Date: Fri, 28 Jun 2024 16:36:20 -0500	[thread overview]
Message-ID: <e633c592-5513-bf5e-800d-b92fece86c33@amd.com> (raw)
In-Reply-To: <0226cae0f31c4e1143bbe1e3ac49b67bf101576d.camel@intel.com>

On 6/28/24 16:33, Edgecombe, Rick P wrote:
> On Fri, 2024-06-28 at 16:22 -0500, Kalra, Ashish wrote:
>>>> @@ -717,7 +718,11 @@ pte_t *lookup_address_in_pgd_attr(pgd_t *pgd,
>>>> unsigned
>>>> long address,
>>>>         *nx |= pmd_flags(*pmd) & _PAGE_NX;
>>>>         *rw &= pmd_flags(*pmd) & _PAGE_RW;
>>>>  
>>>> -       return pte_offset_kernel(pmd, address);
>>>> +       pte = pte_offset_kernel(pmd, address);
>>>> +       if (pte_none(*pte))
>>>> +               return NULL;
>>>> +
>>>> +       return pte;
>>> The other levels check for pXX_none() before adjusting *level. Not sure what
>>> the
>>> effect would be, but I think it should be the same behavior for all.
>>
>> If we are returning NULL, why should adjusting *level matter.
> 
> Well, I think symmetry is enough of a reason, but actually it should be ok.
> 
> I was looking at this diff compared to my working tree, but this tip commit

Ditto for me.

Thanks,
Tom

> (which is about that scenario) makes it set *level before checking none for all
> of them:
> https://lore.kernel.org/lkml/171871930159.10875.16081839197437299007.tip-bot2@tip-bot2/
> 
> So sorry, nevermind.

  reply	other threads:[~2024-06-28 21:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-28 20:52 [PATCH] x86/mm: fix lookup_address() to handle physical memory holes in direct mapping Ashish Kalra
2024-06-28 20:58 ` Edgecombe, Rick P
2024-06-28 21:22   ` Kalra, Ashish
2024-06-28 21:33     ` Edgecombe, Rick P
2024-06-28 21:36       ` Tom Lendacky [this message]
2024-06-28 21:31   ` Tom Lendacky
2024-06-29 10:20 ` Jürgen Groß
2024-06-29 15:16   ` Tom Lendacky
2024-06-29 16:50     ` Jürgen Groß
2024-07-01 17:57   ` Kalra, Ashish
2024-07-01 18:38     ` Jürgen Groß
2024-07-01 18:59       ` Kalra, Ashish
2024-07-01 19:13         ` Edgecombe, Rick P
2024-07-01 19:39           ` Kalra, Ashish
2024-07-02  5:29             ` Jürgen Groß

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=e633c592-5513-bf5e-800d-b92fece86c33@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=ashish.kalra@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=jroedel@suse.de \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mhklinux@outlook.com \
    --cc=mingo@redhat.com \
    --cc=peterx@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=tglx@linutronix.de \
    --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.