public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* IA64 probe instruction
@ 2004-09-14  9:55 Christian Hildner
  2004-09-14 10:53 ` Darren Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Hildner @ 2004-09-14  9:55 UTC (permalink / raw)
  To: linux-ia64

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

Hi,

there is  behavior of the probe instruction that confuses me a little 
bit. Testing of the attached module shows differences whether executed 
with interrupts enabled or not.

# cat cpuinfo
processor  : 0
vendor     : GenuineIntel
arch       : IA-64
family     : Itanium 2
model      : 0
revision   : 7
archrev    : 0
features   : branchlong
cpu number : 0
cpu regs   : 4
cpu MHz    : 900.000000
itc MHz    : 900.000000
BogoMIPS   : 1346.37

#dmesg
init_module called ...
init_module result 0x0000000000000001
init_module done
cleanup_module called ...
Unable to handle kernel paging request at virtual address e00000404391fe30
...

Of course the reported address has nothing to do with the (nested!) 
fault of the second
probe instruction since interrupt resources are not written. But why 
does the second
probe interrupt instead of returning 0 or 1? The reference manual does 
not distinct between
psr.ic 0 or 1.

Although this is not really linux related maybe someone from Intel can 
comment on this.

Christian

[-- Attachment #2: probe.c --]
[-- Type: text/plain, Size: 1146 bytes --]

#include <linux/kernel.h>
#include <linux/module.h>

MODULE_DESCRIPTION("Probe test");
MODULE_AUTHOR("Christian Hildner");
MODULE_LICENSE("GPL");

int init_module(void)
{
    unsigned long addr;
    unsigned long res;

    printk("init_module called ...\n");
    asm volatile ("\n\n"
        "movl %0=0xe000100000000000\n\n"
        ";;\n\n"
        "probe.r %1=%0,0\n\n"
        ";;\n\n"
        : "=r"(addr), "=r"(res)
        :);
    printk("init_module result 0x%016lx\n", res);
    printk("init_module done\n");
    return(0);
}

void cleanup_module(void)
{
    unsigned long addr;
    unsigned long res;

    printk("cleanup_module called ...\n");
    asm volatile ("\n\n"
        "rsm psr.i | psr.ic\n\n"
        "movl %0=0xe000100000000000\n\n"
        ";;\n\n"
        "srlz.i\n\n"
        ";;\n\n"
        "probe.r %1=%0,0\n\n"
        ";;\n\n"
        "ssm psr.ic\n\n"
        ";;\n\n"
        "srlz.d\n\n"
        "ssm psr.i\n\n"
        ";;\n\n"
        "srlz.i\n\n"
        ";;\n\n"
        : "=r"(addr), "=r"(res)
        :);
    printk("cleanup_module result 0x%016lx\n", res);
    printk("cleanup_module done\n");
    return;
}


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

* Re: IA64 probe instruction
  2004-09-14  9:55 IA64 probe instruction Christian Hildner
@ 2004-09-14 10:53 ` Darren Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Darren Williams @ 2004-09-14 10:53 UTC (permalink / raw)
  To: linux-ia64

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

Hi Christian

We have an ia64 technical mailing list at:
ia64-technical@gelato.unsw.edu.au

that has just started for this pariticlar type
of question you can sign up for the list at:
https://www.gelato.unsw.edu.au/mailman/listinfo/ia64-technical

Regards
Darren

On Tue, 14 Sep 2004, Christian Hildner wrote:

> Hi,
> 
> there is  behavior of the probe instruction that confuses me a little 
> bit. Testing of the attached module shows differences whether executed 
> with interrupts enabled or not.
> 
> # cat cpuinfo
> processor  : 0
> vendor     : GenuineIntel
> arch       : IA-64
> family     : Itanium 2
> model      : 0
> revision   : 7
> archrev    : 0
> features   : branchlong
> cpu number : 0
> cpu regs   : 4
> cpu MHz    : 900.000000
> itc MHz    : 900.000000
> BogoMIPS   : 1346.37
> 
> #dmesg
> init_module called ...
> init_module result 0x0000000000000001
> init_module done
> cleanup_module called ...
> Unable to handle kernel paging request at virtual address e00000404391fe30
> ...
> 
> Of course the reported address has nothing to do with the (nested!) 
> fault of the second
> probe instruction since interrupt resources are not written. But why 
> does the second
> probe interrupt instead of returning 0 or 1? The reference manual does 
> not distinct between
> psr.ic 0 or 1.
> 
> Although this is not really linux related maybe someone from Intel can 
> comment on this.
> 
> Christian

> #include <linux/kernel.h>
> #include <linux/module.h>
> 
> MODULE_DESCRIPTION("Probe test");
> MODULE_AUTHOR("Christian Hildner");
> MODULE_LICENSE("GPL");
> 
> int init_module(void)
> {
>     unsigned long addr;
>     unsigned long res;
> 
>     printk("init_module called ...\n");
>     asm volatile ("\n\n"
>         "movl %0=0xe000100000000000\n\n"
>         ";;\n\n"
>         "probe.r %1=%0,0\n\n"
>         ";;\n\n"
>         : "=r"(addr), "=r"(res)
>         :);
>     printk("init_module result 0x%016lx\n", res);
>     printk("init_module done\n");
>     return(0);
> }
> 
> void cleanup_module(void)
> {
>     unsigned long addr;
>     unsigned long res;
> 
>     printk("cleanup_module called ...\n");
>     asm volatile ("\n\n"
>         "rsm psr.i | psr.ic\n\n"
>         "movl %0=0xe000100000000000\n\n"
>         ";;\n\n"
>         "srlz.i\n\n"
>         ";;\n\n"
>         "probe.r %1=%0,0\n\n"
>         ";;\n\n"
>         "ssm psr.ic\n\n"
>         ";;\n\n"
>         "srlz.d\n\n"
>         "ssm psr.i\n\n"
>         ";;\n\n"
>         "srlz.i\n\n"
>         ";;\n\n"
>         : "=r"(addr), "=r"(res)
>         :);
>     printk("cleanup_module result 0x%016lx\n", res);
>     printk("cleanup_module done\n");
>     return;
> }
> 

--------------------------------------------------
Darren Williams <dsw AT gelato.unsw.edu.au>
Gelato@UNSW <www.gelato.unsw.edu.au>
--------------------------------------------------

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2004-09-14 10:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-14  9:55 IA64 probe instruction Christian Hildner
2004-09-14 10:53 ` Darren Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox