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: <20210222082038epcms2p761e3c08ed3ec77854a693d48dc9f1357@epcms2p7>
Date:   Mon, 22 Feb 2021 17:20:38 +0900
From:   Daejun Park <daejun7.park@...sung.com>
To:     Avri Altman <Avri.Altman@....com>,
        Daejun Park <daejun7.park@...sung.com>,
        Greg KH <gregkh@...uxfoundation.org>,
        "jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
        "stanley.chu@...iatek.com" <stanley.chu@...iatek.com>,
        "cang@...eaurora.org" <cang@...eaurora.org>,
        "bvanassche@....org" <bvanassche@....org>,
        "huobean@...il.com" <huobean@...il.com>,
        ALIM AKHTAR <alim.akhtar@...sung.com>
CC:     "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        JinHwan Park <jh.i.park@...sung.com>,
        Javier Gonzalez <javier.gonz@...sung.com>,
        SEUNGUK SHIN <seunguk.shin@...sung.com>,
        Sung-Jun Park <sungjun07.park@...sung.com>,
        yongmyung lee <ymhungry.lee@...sung.com>,
        Jinyoung CHOI <j-young.choi@...sung.com>,
        BoRam Shin <boram.shin@...sung.com>
Subject: RE: RE: [PATCH v21 3/4] scsi: ufs: Prepare HPB read for cached
 sub-region

> +static u64 ufshpb_get_ppn(struct ufshpb_lu *hpb,
> > +                         struct ufshpb_map_ctx *mctx, int pos, int *error)
> > +{
> > +       u64 *ppn_table;
> > +       struct page *page;
> > +       int index, offset;
> > +
> > +       index = pos / (PAGE_SIZE / HPB_ENTRY_SIZE);
> > +       offset = pos % (PAGE_SIZE / HPB_ENTRY_SIZE);
> > +
> > +       page = mctx->m_page[index];
> > +       if (unlikely(!page)) {
> > +               *error = -ENOMEM;
> > +               dev_err(&hpb->sdev_ufs_lu->sdev_dev,
> > +                       "error. cannot find page in mctx\n");
> > +               return 0;
> > +       }
> > +
> > +       ppn_table = page_address(page);
> > +       if (unlikely(!ppn_table)) {
> > +               *error = -ENOMEM;
> > +               dev_err(&hpb->sdev_ufs_lu->sdev_dev,
> > +                       "error. cannot get ppn_table\n");
> > +               return 0;
> > +       }
> > +
> > +       return ppn_table[offset];
> How about memcpy here as well?
> This way it is clear that the host is not manipulating the physical addresses in any way,
> And you won't need to invent the new ufshpb_fill_ppn_from_page.
>  
I changed the code to use ufshpb_fill_ppn_from_page() because it is more
genenal for use than ufshpb_get_ppn(). And I fixed to use memcpy for
setting cdb of HPB read.

Thanks,
Daejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ