[Top] [All Lists]

Re: [PATCH 1/3] Loongson-2F: Flush the branch target history such as BTB

To: Shinya Kuribayashi <>
Subject: Re: [PATCH 1/3] Loongson-2F: Flush the branch target history such as BTB and RAS
From: Wu Zhangjin <>
Date: Thu, 11 Mar 2010 11:35:20 +0800
Cc: Ralf Baechle <>, Greg KH <>,,, zhangfx <>, yanh <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:received:received:subject:from:reply-to:to:cc :in-reply-to:references:content-type:organization:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=/QwW/Sik4jBsqpPDDxfJPhsLwABrgYfVu9jhw/o9j6Q=; b=WHd6v6xNZYzPdCgbYETsoQMghJMpmaNyiBx8PQ3cNy4IZFi2NnCwJdP5qX34C/VDNP jxLjY93WobhwjhVhAYJO09IdHeaH5Stz2w9udUcPFQ/dJjAdUhR/CI/c712fV7W5AwOk 5t7+rw6ER4L7U0ThzZlLq0y34tKSlKbRfkm24=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=subject:from:reply-to:to:cc:in-reply-to:references:content-type :organization:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=qg1y9Qo1ZE+qSEb57dOD2ibzqxCAqqbZej6XAzLCatyrY+LjcBDciAPlWf+zkJVNSn 6wHYXXpiD14t2VNJM4zTLGBEw1agBgXz+BZHPCIRAlXIDHPQI9yranhsf8ItGBy82Ts6 fe3Z4dl4wCLa4hDPIg+nrvgs+Hg6g9KAmmtmM=
In-reply-to: <>
Organization: DSLab, Lanzhou University, China
Original-recipient: rfc822;
References: <> <> <>
On Thu, 2010-03-11 at 12:27 +0900, Shinya Kuribayashi wrote:
> Wu Zhangjin wrote:
> > From: Wu Zhangjin <>
> > 
> > As the Chapter 15: "Errata: Issue of Out-of-order in loongson"[1] shows, to
> > workaround the Issue of Loongson-2F,We need to do:
> > 
> > "When switching from user model to kernel model, you should flush the branch
> > target history such as BTB and RAS."
> Just wondered, model or mode?

Hmm, should be mode.

> > This patch did clear BTB(branch target buffer), forbid RAS(row address 
> > strobe)
> > via Loongson-2F's 64bit diagnostic register.
> Are you sure that RAS represents "Row Address Strobe", not "Return
> Address Stack?"

Hi, Yanhua(from Lemote), can you help to clear this part?

> By the way, we have a similar local workaround for vr55xx processors
> when switching from kernel mode to user mode.  It's not necessarily
> related to out-of-order issues, but we need to prevent the processor
> from doing instruction prefetch beyond "eret" instruction.
> In the long term, it would be appreciated that the kernel has a set
> of hooks when switching KUX-modes, so that each machine could have
> his own, processor-specific treatmens.

Good idea.


        Wu Zhangjin

<Prev in Thread] Current Thread [Next in Thread>