xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/AMD: re-use function wide variables in init_amd()
@ 2014-02-28 16:48 Jan Beulich
  2014-02-28 16:54 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2014-02-28 16:48 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 601 bytes --]

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -399,13 +399,9 @@ static void __devinit init_amd(struct cp
 		 * revision D (model = 0x14) and later actually support it.
 		 * (AMD Erratum #110, docId: 25759).
 		 */
-		unsigned int lo, hi;
-
 		clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
-		if (!rdmsr_amd_safe(0xc001100d, &lo, &hi)) {
-			hi &= ~1;
-			wrmsr_amd_safe(0xc001100d, lo, hi);
-		}
+		if (!rdmsr_amd_safe(0xc001100d, &l, &h))
+			wrmsr_amd_safe(0xc001100d, l, h & ~1);
 	}
 
 	switch(c->x86)




[-- Attachment #2: x86-AMD-init-reuse-vars.patch --]
[-- Type: text/plain, Size: 652 bytes --]

x86/AMD: re-use function wide variables in init_amd()

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -399,13 +399,9 @@ static void __devinit init_amd(struct cp
 		 * revision D (model = 0x14) and later actually support it.
 		 * (AMD Erratum #110, docId: 25759).
 		 */
-		unsigned int lo, hi;
-
 		clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
-		if (!rdmsr_amd_safe(0xc001100d, &lo, &hi)) {
-			hi &= ~1;
-			wrmsr_amd_safe(0xc001100d, lo, hi);
-		}
+		if (!rdmsr_amd_safe(0xc001100d, &l, &h))
+			wrmsr_amd_safe(0xc001100d, l, h & ~1);
 	}
 
 	switch(c->x86)

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/AMD: re-use function wide variables in init_amd()
  2014-02-28 16:48 [PATCH] x86/AMD: re-use function wide variables in init_amd() Jan Beulich
@ 2014-02-28 16:54 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2014-02-28 16:54 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Keir Fraser


[-- Attachment #1.1: Type: text/plain, Size: 643 bytes --]

Jan Beulich wrote:
>
> Signed-off-by: Jan Beulich<jbeulich@suse.com>


Acked-by: Keir Fraser <keir@xen.org>

>
>
> --- a/xen/arch/x86/cpu/amd.c
> +++ b/xen/arch/x86/cpu/amd.c
> @@ -399,13 +399,9 @@ static void __devinit init_amd(struct cp
> * revision D (model = 0x14) and later actually support it.
> * (AMD Erratum #110, docId: 25759).
> */
> - unsigned int lo, hi;
> -
> clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
> - if (!rdmsr_amd_safe(0xc001100d,&lo,&hi)) {
> - hi&= ~1;
> - wrmsr_amd_safe(0xc001100d, lo, hi);
> - }
> + if (!rdmsr_amd_safe(0xc001100d,&l,&h))
> + wrmsr_amd_safe(0xc001100d, l, h& ~1);
> }
>
> switch(c->x86)
>
>

[-- Attachment #1.2: Type: text/html, Size: 998 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-28 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-28 16:48 [PATCH] x86/AMD: re-use function wide variables in init_amd() Jan Beulich
2014-02-28 16:54 ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).