lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170424172527.GA15532@us.ibm.com>
Date:   Mon, 24 Apr 2017 10:25:27 -0700
From:   Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
To:     Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc:     Michael Ellerman <mpe@...erman.id.au>, michael.neuling@....ibm.com,
        stewart@...ux.vnet.ibm.com, apopple@....ibm.com, hbabu@...ibm.com,
        oohall@...il.com, bsingharora@...il.com, linuxppc-dev@...abs.org,
        linux-kernel@...r.kernel.org, aneesh.kumar@...ux.vnet.ibm.com
Subject: Re: [PATCH v4 05/11] VAS: Define helpers for access MMIO regions

Benjamin Herrenschmidt [benh@...nel.crashing.org] wrote:
> On Thu, 2017-03-30 at 22:13 -0700, Sukadev Bhattiprolu wrote:
> > +static void *map_mmio_region(char *name, uint64_t start, int len)
> > +{
> > +       void *map;
> > +
> > +       if (!request_mem_region(start, len, name)) {
> > +               pr_devel("%s(): request_mem_region(0x%llx, %d) failed\n",
> > +                               __func__, start, len);
> > +               return NULL;
> > +       }
> > +
> > +       map = __ioremap(start, len, pgprot_val(pgprot_cached(__pgprot(0))));
> > +       if (!map) {
> > +               pr_devel("%s(): ioremap(0x%llx, %d) failed\n", __func__, start,
> > +                               len);
> > +               return NULL;
> > +       }
> > +
> > +       return map;
> > +}
> 
> That's very wrong. I assume this never worked right ?

Untl recently, only tested on simics and has been working there. On the
hardware, hitting a crash on the first mmio write...
> 
> MMIO regions must be mapped non-cachable. Only the paste region

which maybe due to this :-) Should I change to pgprot_noncached() for the
MMIO writes?

> requires being mapped cachable. Ask Aneesh for a cleaner way of
> doing it too while at it.

Ok.

> 
> > +/*
> > + * Unmap the MMIO regions for a window.
> > + */
> > +static void unmap_wc_paste_kaddr(struct vas_window *window)
> > +{
> > +       int len;
> 
> Don't use "wc"... that usually means "write combine".

Ok.

Thanks,

Sukadev

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ