From: Benjamin LaHaise <bcrl@redhat.com>
To: linux-mm@kvack.org
Subject: [bcrl@redhat.com: [PATCH] 2.4.19-pre8 vm86 smp locking fix]
Date: Thu, 23 May 2002 16:57:36 -0400 [thread overview]
Message-ID: <20020523165736.B27881@redhat.com> (raw)
----- Forwarded message from Benjamin LaHaise <bcrl@redhat.com> -----
Subject: [PATCH] 2.4.19-pre8 vm86 smp locking fix
From: Benjamin LaHaise <bcrl@redhat.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>, linux-mm@redhat.com
Date: Thu, 23 May 2002 16:51:05 -0400
arch/i386/kernel/vm86.c performs page table operations without obtaining
any locks. This patch obtains page_table_lock around the the table walk
and modification.
-ben
--
"You will be reincarnated as a toad; and you will be much happier."
diff -urN v2.4.19-pre8/arch/i386/kernel/vm86.c work/arch/i386/kernel/vm86.c
--- v2.4.19-pre8/arch/i386/kernel/vm86.c Thu Mar 7 16:39:56 2002
+++ work/arch/i386/kernel/vm86.c Thu May 23 16:21:38 2002
@@ -97,21 +97,22 @@
pte_t *pte;
int i;
+ spin_lock(&tsk->mm->page_table_lock);
pgd = pgd_offset(tsk->mm, 0xA0000);
if (pgd_none(*pgd))
- return;
+ goto out;
if (pgd_bad(*pgd)) {
pgd_ERROR(*pgd);
pgd_clear(pgd);
- return;
+ goto out;
}
pmd = pmd_offset(pgd, 0xA0000);
if (pmd_none(*pmd))
- return;
+ goto out;
if (pmd_bad(*pmd)) {
pmd_ERROR(*pmd);
pmd_clear(pmd);
- return;
+ goto out;
}
pte = pte_offset(pmd, 0xA0000);
for (i = 0; i < 32; i++) {
@@ -119,6 +120,8 @@
set_pte(pte, pte_wrprotect(*pte));
pte++;
}
+out:
+ spin_unlock(&tsk->mm->page_table_lock);
flush_tlb();
}
----- End forwarded message -----
--
"You will be reincarnated as a toad; and you will be much happier."
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/
next reply other threads:[~2002-05-23 20:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-23 20:57 Benjamin LaHaise [this message]
2002-05-23 22:33 ` William Lee Irwin III
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=20020523165736.B27881@redhat.com \
--to=bcrl@redhat.com \
--cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox