All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: [PATCH 1/4] x86: remove unused x87 remnants of 32-bit days
Date: Wed, 14 Oct 2015 15:05:18 +0100	[thread overview]
Message-ID: <561E611E.9020106@citrix.com> (raw)
In-Reply-To: <561E5F2E.9020604@citrix.com>

On 14/10/15 14:57, Andrew Cooper wrote:
> On 14/10/15 14:29, Jan Beulich wrote:
>> x86-64 requires FXSR, XMM, and XMM2, so there's no point in hiding
>> respective code behind conditionals.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>, with two
> suggestions.
>
>> --- a/xen/arch/x86/setup.c
>> +++ b/xen/arch/x86/setup.c
>> @@ -1295,10 +1295,8 @@ void __init noreturn __start_xen(unsigne
>>  
>>      identify_cpu(&boot_cpu_data);
>>  
>> -    if ( cpu_has_fxsr )
>> -        set_in_cr4(X86_CR4_OSFXSR);
>> -    if ( cpu_has_xmm )
>> -        set_in_cr4(X86_CR4_OSXMMEXCPT);
>> +    set_in_cr4(X86_CR4_OSFXSR);
>> +    set_in_cr4(X86_CR4_OSXMMEXCPT);
> set_in_cr4() takes a mask, so could take both of these at once, to be
> slightly more efficient.
>
> If the bsp path gained an unconditional write_cr4(mmu_cr4_features) then
> it might be better to fold them into the initialiser for mmu_cr4_features.
>
>> --- a/xen/include/asm-x86/page.h
>> +++ b/xen/include/asm-x86/page.h
>> @@ -206,13 +206,10 @@ typedef struct { u64 pfn; } pagetable_t;
>>  #define pagetable_null()        pagetable_from_pfn(0)
>>  
>>  void clear_page_sse2(void *);
>> -#define clear_page(_p)      (cpu_has_xmm2 ?                             \
>> -                             clear_page_sse2((void *)(_p)) :            \
>> -                             (void)memset((void *)(_p), 0, PAGE_SIZE))
>>  void copy_page_sse2(void *, const void *);
>> -#define copy_page(_t,_f)    (cpu_has_xmm2 ?                             \
>> -                             copy_page_sse2(_t, _f) :                   \
>> -                             (void)memcpy(_t, _f, PAGE_SIZE))
>> +
>> +#define clear_page(_p)      clear_page_sse2(_p)
>> +#define copy_page(_t,_f)    copy_page_sse2(_t, _f)
> As you are changing this, an extra space following the comma.
>
> ~Andrew

A third suggestion to delete the trailing whitespace before fninit in
the following hunk.

--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -19,15 +19,12 @@
 
 static void fpu_init(void)
 {
-    unsigned long val;
+    uint32_t val = MXCSR_DEFAULT;
     
     asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
+
+    /* load default value into MXCSR control/status register */
+    asm volatile ( "ldmxcsr %0" : : "m" (val) );
 }
 

~Andrew

  reply	other threads:[~2015-10-14 14:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 13:22 [PATCH 0/4] x86: capabilities handling adjustments Jan Beulich
2015-10-14 13:29 ` [PATCH 1/4] x86: remove unused x87 remnants of 32-bit days Jan Beulich
2015-10-14 13:57   ` Andrew Cooper
2015-10-14 14:05     ` Andrew Cooper [this message]
2015-10-14 13:30 ` [PATCH 2/4] x86: drop further constant cpu_has_* predicates Jan Beulich
2015-10-14 14:02   ` Andrew Cooper
2015-10-14 13:31 ` [PATCH 3/4] x86: don't use FPU instructions when there is no FPU Jan Beulich
2015-10-14 14:30   ` Andrew Cooper
2015-10-14 14:46     ` Jan Beulich
2015-10-14 13:31 ` [PATCH 4/4] x86/capabilities: set/clear them using non-locked bitops Jan Beulich
2015-10-14 14:36   ` Andrew Cooper

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=561E611E.9020106@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xenproject.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.