From: Thomas Gleixner <tglx@linutronix.de>
To: David Hildenbrand <david@redhat.com>,
Matthew Wilcox <willy@infradead.org>,
Sean Christopherson <seanjc@google.com>,
Andi Kleen <ak@linux.intel.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Michal Hocko <mhocko@suse.com>, Vlastimil Babka <vbabka@suse.cz>,
Dave Hansen <dave.hansen@intel.com>
Cc: linux-mm@kvack.org, x86@kernel.org
Subject: Re: [willy@infradead.org: Re: [syzbot] [mm?] BUG: Bad page map (7)]
Date: Wed, 13 Sep 2023 23:28:23 +0200 [thread overview]
Message-ID: <87jzstzrt4.ffs@tglx> (raw)
In-Reply-To: <2d760884-051a-372c-a33d-a4bfe2f25675@redhat.com>
On Mon, Sep 11 2023 at 19:50, David Hildenbrand wrote:
>> #ifndef set_ptes
>> /**
>> * set_ptes - Map consecutive pages to a contiguous range of addresses.
>> @@ -231,7 +235,10 @@ static inline void set_ptes(struct mm_struct *mm, unsigned long addr,
>> if (--nr == 0)
>> break;
>> ptep++;
>> - pte = __pte(pte_val(pte) + (1UL << PFN_PTE_SHIFT));
>> + if (__pte_needs_invert(pte_val(pte)))
>> + pte = __pte(pte_val(pte) - (1UL << PFN_PTE_SHIFT));
>> + else
>> + pte = __pte(pte_val(pte) + (1UL << PFN_PTE_SHIFT));
>> }
>
> Maybe we want some pte_advance() [or similar, you get the spirit] instead?
>
> Leaking this inverted-pte logic into common code really does look nasty.
Yes please
prev parent reply other threads:[~2023-09-13 21:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 14:57 [willy@infradead.org: Re: [syzbot] [mm?] BUG: Bad page map (7)] Matthew Wilcox
2023-09-11 17:50 ` David Hildenbrand
2023-09-13 21:28 ` Thomas Gleixner [this message]
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=87jzstzrt4.ffs@tglx \
--to=tglx@linutronix.de \
--cc=ak@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=david@redhat.com \
--cc=jpoimboe@redhat.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=seanjc@google.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.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.