All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Alimarine <artem.alimarine@stromasys.com>
To: unlisted-recipients:; (no To-header on input)
Cc: linux-parisc@vger.kernel.org
Subject: Re: Wierd code in Entry.S
Date: Fri, 10 Jul 2009 09:31:05 +0200	[thread overview]
Message-ID: <4A56EE39.7040906@stromasys.com> (raw)
In-Reply-To: <20090709225511.GE10979@lackof.org>

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

Hi Grant,

My point is that IDTLBT (see page 7-65 in the PA-RISC 2.0w spec) expects 
the U-bit in 12th bit of the 64-bit DWORD, thus, in the upper part 
instead of the lower part (see the code at dtlb_miss_20w). As you said, 
the bit is set in the lower part. I still suspect that the wrong bit is 
set on a 64-bit machine.

The confusion comes from the fact that the The PA1.1 instruction IDTLBP 
expects  U-bit in the bit 12 of the WORD, whereas PA2.0 IDTLBT expects 
it in bit 12 of the DWORD.

Best regards,
Artem

Grant Grundler wrote:
> On Thu, Jul 09, 2009 at 03:11:19PM +0200, Artem Alimarine wrote:
>   
>> Hi guys,
>>
>> I am new to PARISC and to this forum. I have a small question. There is  
>> an instruction in entry.S that I do not understand. It is in the the  
>> macro make_insert_tlb
>>
>> Kernel 2.6.26.2:
>>
>> 537        /* Enforce uncacheable pages.
>> 538         * This should ONLY be use for MMIO on PA 2.0 machines.
>> 539         * Memory/DMA is cache coherent on all PA2.0 machines we support
>> 540         * (that means T-class is NOT supported) and the memory controllers
>> 541         * on most of those machines only handles cache transactions.
>> 542         */
>> 543        extrd,u,*=      \pte,_PAGE_NO_CACHE_BIT+32,1,%r0
>> 544        depi            1,12,1,\prot
>>
>>
>>     
>
> The "*=" in line 543 will determine if "depi" instruction (line 544)
> gets executed or not. You'll need the "PA-RISC 2.0 Architecture":
>     http://www.parisc-linux.org/documentation/index.html
>     http://ftp.parisc-linux.org/docs/arch/parisc2.0.pdf
>
> And read page 7-47, 7-48, and Table D-14.
>
>
>   
>> The DEPI instruction on a 64-bit machine sets bit 44=32+12,
>> whereas we use the value as the argument to IDTLBT, which expects bit 12  
>> to be used instead.
>>
>> Does it mean that the U-bit is never set and the  
>> authorization id gets corrupted???
>>     
>
> U-bit will get set only if _PAGE_NO_CACHE_BIT+32 is also set.
>
> The bit enumeration is *reverse* with MSb being 0 for all ASM instructions
> and all references in the PA2.0 Arch manual.
>
> Because this is a 64 bit build, "+32" is needed to refer to the lower half
> of the double word (word == 32 bits).
>
>   
>> Is it a bug or my misunderstanding of the code???
>>     
>
> It looks correct to me. "12" here always seems to refer to the U-bit as
> defined in the PA2.0 Arch manual.
>
> hth,
> grant
>
>   


[-- Attachment #2: artem_alimarine.vcf --]
[-- Type: text/x-vcard, Size: 283 bytes --]

begin:vcard
fn:dr. Artem Alimarine
n:Alimarine;Artem
org:STROMASYS SA
adr:;;De Zaale 11;Eindhoven;;5612AJ;The Netherlands
email;internet:artem.alimarine@stromasys.com
title:Software Architect
tel;work:+31-40-2390863
tel;fax:+31-40-2390800
x-mozilla-html:FALSE
version:2.1
end:vcard


      parent reply	other threads:[~2009-07-10  7:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-09 13:11 Wierd code in Entry.S Artem Alimarine
2009-07-09 22:55 ` Grant Grundler
2009-07-10  0:15   ` John David Anglin
2009-07-10 15:36     ` Grant Grundler
2009-07-10 15:55       ` John David Anglin
2009-07-10 16:18         ` James Bottomley
2009-07-10 18:48           ` John David Anglin
2009-07-15  6:38           ` Grant Grundler
2009-07-15 12:41             ` James Bottomley
2009-07-15 15:00               ` Matthew Wilcox
2009-07-22  5:34               ` Grant Grundler
2009-07-10 16:11       ` Artem Alimarine
2009-07-15  6:40         ` Grant Grundler
2009-07-10 15:52     ` James Bottomley
2009-07-10 16:25       ` Artem Alimarine
2009-07-11  0:12       ` John David Anglin
2009-07-11  0:30         ` John David Anglin
2009-07-11  1:05           ` John David Anglin
2009-07-12 19:40             ` John David Anglin
2009-07-13  1:15               ` Kyle McMartin
2009-07-13  1:44                 ` John David Anglin
2009-07-13  1:54                   ` Kyle McMartin
2009-07-13  2:18                     ` John David Anglin
2009-07-10  7:31   ` Artem Alimarine [this message]

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=4A56EE39.7040906@stromasys.com \
    --to=artem.alimarine@stromasys.com \
    --cc=linux-parisc@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 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.