mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muli Ben-Yehuda <muli@il.ibm.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	Glauber de Oliveira Costa <gcosta@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd
Date: Sat, 21 Jul 2007 21:11:37 +0300	[thread overview]
Message-ID: <20070721181137.GH4152@rhun.haifa.ibm.com> (raw)
In-Reply-To: <200707202119.l6KLJwcd004205@tazenda.hos.anvin.org>

On Fri, Jul 20, 2007 at 02:19:58PM -0700, H. Peter Anvin wrote:
> Create an inline function for clflush(), with the proper arguments,
> and use it instead of hard-coding the instruction.
> 
> This also removes one instance of hard-coded wbinvd, based on a patch
> by Bauder de Oliveira Costa.
> 
> Cc: Andi Kleen <andi@firstfloor.org>
> Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
> Signed-off-by: H. Peter Anvin <hpa@zytor.com>

Mostly looks good, but see below.

> diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c
> index df8da72..41f46df 100644
> --- a/drivers/char/agp/efficeon-agp.c
> +++ b/drivers/char/agp/efficeon-agp.c
> @@ -221,7 +221,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge)
>  		SetPageReserved(virt_to_page((char *)page));
>  
>  		for (offset = 0; offset < PAGE_SIZE; offset += clflush_chunk)
> -			asm volatile("clflush %0" : : "m" (*(char *)(page+offset)));
> +			clflush((char *)page+offset);

The original code flushes (*(page+offset)) whereas the new code
flushes (pagee+offset). Assuming this is a bug-fix, it should go as a
separate patch.

> @@ -268,15 +268,16 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int t
>  		*page = insert;
>  
>  		/* clflush is slow, so don't clflush until we have to */
> -		if ( last_page &&
> -		     ((unsigned long)page^(unsigned long)last_page) & clflush_mask )
> -		    asm volatile("clflush %0" : : "m" (*last_page));
> +		if (last_page &&
> +		    (((unsigned long)page^(unsigned long)last_page) &
> +		     clflush_mask))
> +			clflush(last_page);

Same thing.


>  		last_page = page;
>  	}
>  
>  	if ( last_page )
> -		asm volatile("clflush %0" : : "m" (*last_page));
> +		clflush(last_page);

Here too.

Cheers,
Muli

  parent reply	other threads:[~2007-07-21 18:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 22:55 [PATCH] Use wbinvd() macro instead of raw inline assembly in .c files Glauber de Oliveira Costa
2007-07-20 11:43 ` Andi Kleen
2007-07-20 17:22   ` H. Peter Anvin
2007-07-21  7:32     ` Muli Ben-Yehuda
2007-07-20 21:19 ` [PATCH] x86: Create clflush() inline, remove hardcoded wbinvd H. Peter Anvin
2007-07-20 21:27   ` Andi Kleen
2007-07-20 21:33     ` H. Peter Anvin
2007-07-22  9:18       ` Andi Kleen
2007-07-22 18:05         ` H. Peter Anvin
2007-07-22 19:55           ` Andi Kleen
2007-07-22 20:02             ` H. Peter Anvin
2007-07-20 23:37   ` Glauber de Oliveira Costa
2007-07-20 23:43     ` H. Peter Anvin
2007-07-21 18:11   ` Muli Ben-Yehuda [this message]
2007-07-21 19:52     ` H. Peter Anvin
2007-07-21 20:16       ` Muli Ben-Yehuda
2007-07-21 20:18         ` H. Peter Anvin
2007-07-21 20:44           ` Muli Ben-Yehuda
2007-07-21 22:09             ` H. Peter Anvin
2007-07-21 22:24               ` H. Peter Anvin
2007-07-22  4:20               ` Muli Ben-Yehuda

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=20070721181137.GH4152@rhun.haifa.ibm.com \
    --to=muli@il.ibm.com \
    --cc=andi@firstfloor.org \
    --cc=gcosta@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®