> Is that OK if I use the following code?
...
>       if (is_in_pci_mem_space(addr)) {
>               if (!user_mode(regs)) {
>                       ret = probe_kernel_address(regs->nip, inst);
> 
>                       if (!ret) {
>                               rd = get_rt(inst);
>                               regs->gpr[rd] = 0xffffffff;
>                       }
>               }

Don't you need to check that the instruction is actually
a memory read?

I also know that there are people mapping PCIe addresses
directly into userspace for 'simple' access to things like
fpga devices.

I suspect that such devices are the ones likely to generate
the faulting cycles. So you probably do want to handle
faults from normal userspace addresses.

        David



_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to