Skip to contentSkip to conversation

kexec: typo in machine_kexec()

PATCH In review Horms 4 participants 10 messages Apr 5, 2006 – May 21, 2006 kexec

lore
Share & tools
lore

Horms

author
#0 lore raw

PATCH 1/1 kexec: typo in machine_kexec()

 machine_kexec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

b242c77f387d75d1bfa377d1870c0037d9e0c364

arch/i386/kernel/machine_kexec.c +1 -1
index f73d737..beaad58 100644
@@ -194,7 +194,7 @@ NORET_TYPE void machine_kexec(struct kim
 	 * set them to a specific selector, but this table is never
 	 * accessed again you set the segment to a different selector.
 	 *
-	 * The more common model is are caches where the behide
+	 * The more common model is are caches where the behind
 	 * the scenes work is done, but is also dropped at arbitrary
 	 * times.
 	 *
#1 lore raw
Quoted 4 lines · On Wed, 5 Apr 2006 08:48:08 +0900 Horms wrote:
 machine_kexec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Can you use diffstat -p1 ? does git allow/support that option, so that more complete filenames are visible?

arch/i386/kernel/machine_kexec.c NORET_TYPE void machine_kexec(struct kim · line 197

Quoted 11 lines

b242c77f387d75d1bfa377d1870c0037d9e0c364

arch/i386/kernel/machine_kexec.c +1 -1
index f73d737..beaad58 100644
@@ -194,7 +194,7 @@ NORET_TYPE void machine_kexec(struct kim
 	 * set them to a specific selector, but this table is never
 	 * accessed again you set the segment to a different selector.
 	 *
-	 * The more common model is are caches where the behide
+	 * The more common model is are caches where the behind

Also delete /are/, but that sentence and the previous one still need some work, so fixing "behide" isn't a big deal IMO. However, Eric can decide about the patch; he is the kexec maintainer.

arch/i386/kernel/machine_kexec.c NORET_TYPE void machine_kexec(struct kim · line 200

Quoted 3 lines
arch/i386/kernel/machine_kexec.c +0 -0
 	 * the scenes work is done, but is also dropped at arbitrary
 	 * times.
 	 *

---
~Randy

#2 lore raw
Quoted 13 lines · Randy.Dunlap
Quoted 4 lines · On Wed, 5 Apr 2006 08:48:08 +0900 Horms wrote:
 machine_kexec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Can you use diffstat -p1 ? does git allow/support that option, so that more complete filenames are visible?

Review

Quoted 2 lines

b242c77f387d75d1bfa377d1870c0037d9e0c364

(quoted diff) +0 -0

b/arch/i386/kernel/machine_kexec.c

Quoted 13 lines

arch/i386/kernel/machine_kexec.c NORET_TYPE void machine_kexec(struct kim · line 197

Quoted 9 lines

index f73d737..beaad58 100644

arch/i386/kernel/machine_kexec.c +1 -1
@@ -194,7 +194,7 @@ NORET_TYPE void machine_kexec(struct kim
 	 * set them to a specific selector, but this table is never
 	 * accessed again you set the segment to a different selector.
 	 *
-	 * The more common model is are caches where the behide
+	 * The more common model is are caches where the behind

Also delete /are/, but that sentence and the previous one still need some work, so fixing "behide" isn't a big deal IMO. However, Eric can decide about the patch; he is the kexec maintainer.

Ok. Randy I think your name is still in Maintainers. Should we send Linus a bugfix patch to remove it ?

Eric

#4 lore raw
In reply to Horms
Quoted 11 lines · Horms
 machine_kexec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

b242c77f387d75d1bfa377d1870c0037d9e0c364

(quoted diff) +0 -0

b/arch/i386/kernel/machine_kexec.c index f73d737..beaad58 100644

arch/i386/kernel/machine_kexec.c NORET_TYPE void machine_kexec(struct kim · line 197

Quoted 5 lines
arch/i386/kernel/machine_kexec.c +1 -1
@@ -194,7 +194,7 @@ NORET_TYPE void machine_kexec(struct kim
 	 * set them to a specific selector, but this table is never
 	 * accessed again you set the segment to a different selector.
 	 *
-	 * The more common model is are caches where the behide
+	 * The more common model is are caches where the behind

If you're going to fix that how about fixing the "is are"

Cheers,
Con

author
#5 lore raw
Quoted 9 lines · Randy.Dunlap
Quoted 4 lines · On Wed, 5 Apr 2006 08:48:08 +0900 Horms wrote:
 machine_kexec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Can you use diffstat -p1 ? does git allow/support that option, so that more complete filenames are visible?

Sure, I have done that. I actually use a script to grab the changelog (of my local commit), do the diffstat, and get the patch, as I'm not sure how to get git to do that in one pass.

Quoted 6 lines

Review

Quoted 2 lines
(quoted diff) +1 -1
-	 * The more common model is are caches where the behide
+	 * The more common model is are caches where the behind

Also delete /are/, but that sentence and the previous one still need some work, so fixing "behide" isn't a big deal IMO. However, Eric can decide about the patch; he is the kexec maintainer.

Yeah, I puzzled over it a bit which is why I send in my original (poor) fix. Removing the are helps a lot. Here is an updated patch which is marginally better than my first pass.

kexec: comment fixes in machine_kexec()

 arch/i386/kernel/machine_kexec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

720f4f4a47cf856a705b59875c099770d3b4bd5f

arch/i386/kernel/machine_kexec.c +1 -1
index f73d737..d31d250 100644
@@ -194,7 +194,7 @@ NORET_TYPE void machine_kexec(struct kim
 	 * set them to a specific selector, but this table is never
 	 * accessed again you set the segment to a different selector.
 	 *
-	 * The more common model is are caches where the behide
+	 * The more common model is caches where the behind
 	 * the scenes work is done, but is also dropped at arbitrary
 	 * times.
 	 *
#6 lore raw

arch/i386/kernel/machine_kexec.c NORET_TYPE void machine_kexec(struct kim · line 200

Quoted 5 lines · Horms
arch/i386/kernel/machine_kexec.c +1 -1
-	 * The more common model is are caches where the behide
+	 * The more common model is caches where the behind
 	 * the scenes work is done, but is also dropped at arbitrary
 	 * times.
 	 *

How about

The common model usually involves caches behind the scenes where the work is done, but dropped at arbitrary times.

Cheers,
Con

#7 lore raw

How does this look for making that comment readable?

Eric

arch/i386/kernel/machine_kexec.c +5 -8
index f73d737..7a344b6 100644
@@ -189,14 +189,11 @@ NORET_TYPE void machine_kexec(struct kim
 	memcpy((void *)reboot_code_buffer, relocate_new_kernel,
 						relocate_new_kernel_size);
 
-	/* The segment registers are funny things, they are
-	 * automatically loaded from a table, in memory wherever you
-	 * set them to a specific selector, but this table is never
-	 * accessed again you set the segment to a different selector.
-	 *
-	 * The more common model is are caches where the behide
-	 * the scenes work is done, but is also dropped at arbitrary
-	 * times.
+	/* The segment registers are funny things, they have both a
+	 * visible and an invisible part.  Whenver the visible part is
+	 * set to a specific selector, the invisible part is loaded
+	 * with from a table in memory.  At no other time is the
+	 * descriptor table in memory accessed. 
 	 *
 	 * I take advantage of this here by force loading the
 	 * segments, before I zap the gdt with an invalid value.
#8 lore raw

On Wed, 05 Apr 2006 09:49:40 -0600 Eric W. Biederman wrote:

one typo (below):

Quoted 13 lines

How does this look for making that comment readable?

Eric

arch/i386/kernel/machine_kexec.c +0 -0
index f73d737..7a344b6 100644
@@ -189,14 +189,11 @@ NORET_TYPE void machine_kexec(struct kim
 	memcpy((void *)reboot_code_buffer, relocate_new_kernel,
 						relocate_new_kernel_size);
 

arch/i386/kernel/machine_kexec.c NORET_TYPE void machine_kexec(struct kim · line 193

Quoted 10 lines
arch/i386/kernel/machine_kexec.c +2 -8
-	/* The segment registers are funny things, they are
-	 * automatically loaded from a table, in memory wherever you
-	 * set them to a specific selector, but this table is never
-	 * accessed again you set the segment to a different selector.
-	 *
-	 * The more common model is are caches where the behide
-	 * the scenes work is done, but is also dropped at arbitrary
-	 * times.
+	/* The segment registers are funny things, they have both a
+	 * visible and an invisible part.  Whenver the visible part is

* Whenever

arch/i386/kernel/machine_kexec.c NORET_TYPE void machine_kexec(struct kim · line 199

Quoted 6 lines
arch/i386/kernel/machine_kexec.c +3 -0
+	 * set to a specific selector, the invisible part is loaded
+	 * with from a table in memory.  At no other time is the
+	 * descriptor table in memory accessed. 
 	 *
 	 * I take advantage of this here by force loading the
 	 * segments, before I zap the gdt with an invalid value.

Much better, thanks.

---
~Randy

author
#9 lore raw
In reply to Horms

kexec: rework kexec_crash logic to make it a little less nested

 kernel/kexec.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

6d28ed0c03ff2d9345a5b198a52f6ee3cc7dd424

kernel/kexec.c +9 -9
index bf39d28..281736f 100644
@@ -1042,6 +1042,7 @@ #endif
 
 void crash_kexec(struct pt_regs *regs)
 {
+	struct pt_regs fixed_regs;
 	struct kimage *image;
 	int locked;
 
@@ -1055,16 +1056,15 @@ void crash_kexec(struct pt_regs *regs)
 	 * sufficient.  But since I reuse the memory...
 	 */
 	locked = xchg(&kexec_lock, 1);
-	if (!locked) {
-		image = xchg(&kexec_crash_image, NULL);
-		if (image) {
-			struct pt_regs fixed_regs;
-			crash_setup_regs(&fixed_regs, regs);
-			machine_crash_shutdown(&fixed_regs);
-			machine_kexec(image);
-		}
-		xchg(&kexec_lock, 0);
+	if (locked)
+		return;
+	image = xchg(&kexec_crash_image, NULL);
+	if (image) {
+		crash_setup_regs(&fixed_regs, regs);
+		machine_crash_shutdown(&fixed_regs);
+		machine_kexec(image);
 	}
+	xchg(&kexec_lock, 0);
 }
 
 static int __init crash_notes_memory_init(void)