All of lore.kernel.org
 help / color / mirror / Atom feed
From: joeyli <jlee@suse.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>, Lee,
Subject: Re: [PATCH] libnvdimm, nfit: treat volatile virtual CD region as read-only pmem
Date: Sun, 5 Jun 2016 22:45:36 +0800	[thread overview]
Message-ID: <20160605144536.GB4558@linux-rxt1.site> (raw)
In-Reply-To: <CAPcyv4jY_jaN2kMxBAger6akJYjmF0RfsE4PSqEgOePjdVPgcw@mail.gmail.com>

On Sat, Jun 04, 2016 at 09:24:54AM -0700, Dan Williams wrote:
> On Sat, Jun 4, 2016 at 4:01 AM, joeyli <jlee@suse.com> wrote:
> > Hi Dan,
> >
> > Thanks for your review.
> >
> > On Fri, Jun 03, 2016 at 12:27:34PM -0700, Dan Williams wrote:
> >> On Fri, Jun 3, 2016 at 12:13 AM, Lee, Chun-Yi <joeyli.kernel@gmail.com> wrote:
> >> > This patch adds codes to treat a volatile virtual CD region as a
> >> > read-only pmem region, then read-only /dev/pmem* device can be mounted
> >> > with iso9660.
> >> >
> >> > It's useful to work with the httpboot in EFI firmware to pull a remote
> >> > ISO file to the local memory region for booting and installation.
> >> >
> >> > Wiki page of UEFI HTTPBoot with OVMF:
> >> >         https://en.opensuse.org/UEFI_HTTPBoot_with_OVMF
> >> >
> >> > Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
> >> > Cc: Gary Lin <GLin@suse.com>
> >> > Cc: Dan Williams <dan.j.williams@intel.com>
> >> > Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> >> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> >> > ---
> >> >  drivers/acpi/nfit.c          |  8 +++++++-
> >> >  drivers/nvdimm/region_devs.c | 26 +++++++++++++++++++++++++-
> >> >  include/linux/libnvdimm.h    |  2 ++
> >> >  3 files changed, 34 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> >> > index 2215fc8..b100a17 100644
> >> > --- a/drivers/acpi/nfit.c
> >> > +++ b/drivers/acpi/nfit.c
> >> > @@ -1949,6 +1949,7 @@ static int acpi_nfit_init_mapping(struct acpi_nfit_desc *acpi_desc,
> >> >         switch (nfit_spa_type(spa)) {
> >> >         case NFIT_SPA_PM:
> >> >         case NFIT_SPA_VOLATILE:
> >> > +       case NFIT_SPA_VCD:
> >> >                 nd_mapping->start = memdev->address;
> >> >                 nd_mapping->size = memdev->region_size;
> >> >                 break;
> >>
> >> Why do we need to distinguish NFIT_SPA_VOLATILE vs NFIT_SPA_VCD, i.e.
> >> what happens if something writes to a VCD device?
> >
> > Actually I didn't try to write SPA-VCD device before. Every time I mount it
> > that the system responses read-only:
> >
> > # mount /dev/pmem0 /mnt/
> > mount: /dev/pmem0 is write-protected, mounting read-only
> >
> > If it can be written, then I think there have no difference between
> > NFIT_SPA_VOLATILE with NFIT_SPA_VCD region.
> >
> > I implemented this patch to treat VCD region as read-only pmem because the
> > pmem region generates /dev/pmem* device that it can be mounted.
> >
> > Maybe I missed. Does NFIT_SPA_VOLATILE region also generate a device in /dev
> > that it can be mounted with filesystem? Then I think treat the VCD region as
> > a read-only VOLATILE region that's also a solution.
> 
> My question is why does it need to be read-only?  If it's a volatile
> region, does it matter if we allow writes at the block device level?
> Especially if it is formatted as iso9660, it won't be writable through
> the filesystem anyway.

The httpboot function of EFI firmware downloads iso image from http server
, then it allocates a big enough continuity memory region and extract iso to
the region.

Actually you are right, it does not need to be read-only. It's similar with
a volatile region, just the type is NFIT_SPA_VCD and it contains the data
that extracted from a iso file.

Do you have better approach to treat the SPA_VCD region as a block device
that it can be mounted by iso9660? Maybe I missed something... Can I mount a
volatile region with iso9660? If yes, maybe just treat VCD SPA as a VOLATILE
region?


Thanks a lot!
Joey Lee
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

WARNING: multiple messages have this Message-ID (diff)
From: joeyli <jlee@suse.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Gary Lin <GLin@suse.com>
Subject: Re: [PATCH] libnvdimm, nfit: treat volatile virtual CD region as read-only pmem
Date: Sun, 5 Jun 2016 22:45:36 +0800	[thread overview]
Message-ID: <20160605144536.GB4558@linux-rxt1.site> (raw)
In-Reply-To: <CAPcyv4jY_jaN2kMxBAger6akJYjmF0RfsE4PSqEgOePjdVPgcw@mail.gmail.com>

On Sat, Jun 04, 2016 at 09:24:54AM -0700, Dan Williams wrote:
> On Sat, Jun 4, 2016 at 4:01 AM, joeyli <jlee@suse.com> wrote:
> > Hi Dan,
> >
> > Thanks for your review.
> >
> > On Fri, Jun 03, 2016 at 12:27:34PM -0700, Dan Williams wrote:
> >> On Fri, Jun 3, 2016 at 12:13 AM, Lee, Chun-Yi <joeyli.kernel@gmail.com> wrote:
> >> > This patch adds codes to treat a volatile virtual CD region as a
> >> > read-only pmem region, then read-only /dev/pmem* device can be mounted
> >> > with iso9660.
> >> >
> >> > It's useful to work with the httpboot in EFI firmware to pull a remote
> >> > ISO file to the local memory region for booting and installation.
> >> >
> >> > Wiki page of UEFI HTTPBoot with OVMF:
> >> >         https://en.opensuse.org/UEFI_HTTPBoot_with_OVMF
> >> >
> >> > Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
> >> > Cc: Gary Lin <GLin@suse.com>
> >> > Cc: Dan Williams <dan.j.williams@intel.com>
> >> > Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> >> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> >> > ---
> >> >  drivers/acpi/nfit.c          |  8 +++++++-
> >> >  drivers/nvdimm/region_devs.c | 26 +++++++++++++++++++++++++-
> >> >  include/linux/libnvdimm.h    |  2 ++
> >> >  3 files changed, 34 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> >> > index 2215fc8..b100a17 100644
> >> > --- a/drivers/acpi/nfit.c
> >> > +++ b/drivers/acpi/nfit.c
> >> > @@ -1949,6 +1949,7 @@ static int acpi_nfit_init_mapping(struct acpi_nfit_desc *acpi_desc,
> >> >         switch (nfit_spa_type(spa)) {
> >> >         case NFIT_SPA_PM:
> >> >         case NFIT_SPA_VOLATILE:
> >> > +       case NFIT_SPA_VCD:
> >> >                 nd_mapping->start = memdev->address;
> >> >                 nd_mapping->size = memdev->region_size;
> >> >                 break;
> >>
> >> Why do we need to distinguish NFIT_SPA_VOLATILE vs NFIT_SPA_VCD, i.e.
> >> what happens if something writes to a VCD device?
> >
> > Actually I didn't try to write SPA-VCD device before. Every time I mount it
> > that the system responses read-only:
> >
> > # mount /dev/pmem0 /mnt/
> > mount: /dev/pmem0 is write-protected, mounting read-only
> >
> > If it can be written, then I think there have no difference between
> > NFIT_SPA_VOLATILE with NFIT_SPA_VCD region.
> >
> > I implemented this patch to treat VCD region as read-only pmem because the
> > pmem region generates /dev/pmem* device that it can be mounted.
> >
> > Maybe I missed. Does NFIT_SPA_VOLATILE region also generate a device in /dev
> > that it can be mounted with filesystem? Then I think treat the VCD region as
> > a read-only VOLATILE region that's also a solution.
> 
> My question is why does it need to be read-only?  If it's a volatile
> region, does it matter if we allow writes at the block device level?
> Especially if it is formatted as iso9660, it won't be writable through
> the filesystem anyway.

The httpboot function of EFI firmware downloads iso image from http server
, then it allocates a big enough continuity memory region and extract iso to
the region.

Actually you are right, it does not need to be read-only. It's similar with
a volatile region, just the type is NFIT_SPA_VCD and it contains the data
that extracted from a iso file.

Do you have better approach to treat the SPA_VCD region as a block device
that it can be mounted by iso9660? Maybe I missed something... Can I mount a
volatile region with iso9660? If yes, maybe just treat VCD SPA as a VOLATILE
region?


Thanks a lot!
Joey Lee

WARNING: multiple messages have this Message-ID (diff)
From: joeyli <jlee@suse.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Gary Lin <GLin@suse.com>
Subject: Re: [PATCH] libnvdimm, nfit: treat volatile virtual CD region as read-only pmem
Date: Sun, 5 Jun 2016 22:45:36 +0800	[thread overview]
Message-ID: <20160605144536.GB4558@linux-rxt1.site> (raw)
In-Reply-To: <CAPcyv4jY_jaN2kMxBAger6akJYjmF0RfsE4PSqEgOePjdVPgcw@mail.gmail.com>

On Sat, Jun 04, 2016 at 09:24:54AM -0700, Dan Williams wrote:
> On Sat, Jun 4, 2016 at 4:01 AM, joeyli <jlee@suse.com> wrote:
> > Hi Dan,
> >
> > Thanks for your review.
> >
> > On Fri, Jun 03, 2016 at 12:27:34PM -0700, Dan Williams wrote:
> >> On Fri, Jun 3, 2016 at 12:13 AM, Lee, Chun-Yi <joeyli.kernel@gmail.com> wrote:
> >> > This patch adds codes to treat a volatile virtual CD region as a
> >> > read-only pmem region, then read-only /dev/pmem* device can be mounted
> >> > with iso9660.
> >> >
> >> > It's useful to work with the httpboot in EFI firmware to pull a remote
> >> > ISO file to the local memory region for booting and installation.
> >> >
> >> > Wiki page of UEFI HTTPBoot with OVMF:
> >> >         https://en.opensuse.org/UEFI_HTTPBoot_with_OVMF
> >> >
> >> > Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
> >> > Cc: Gary Lin <GLin@suse.com>
> >> > Cc: Dan Williams <dan.j.williams@intel.com>
> >> > Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> >> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> >> > ---
> >> >  drivers/acpi/nfit.c          |  8 +++++++-
> >> >  drivers/nvdimm/region_devs.c | 26 +++++++++++++++++++++++++-
> >> >  include/linux/libnvdimm.h    |  2 ++
> >> >  3 files changed, 34 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> >> > index 2215fc8..b100a17 100644
> >> > --- a/drivers/acpi/nfit.c
> >> > +++ b/drivers/acpi/nfit.c
> >> > @@ -1949,6 +1949,7 @@ static int acpi_nfit_init_mapping(struct acpi_nfit_desc *acpi_desc,
> >> >         switch (nfit_spa_type(spa)) {
> >> >         case NFIT_SPA_PM:
> >> >         case NFIT_SPA_VOLATILE:
> >> > +       case NFIT_SPA_VCD:
> >> >                 nd_mapping->start = memdev->address;
> >> >                 nd_mapping->size = memdev->region_size;
> >> >                 break;
> >>
> >> Why do we need to distinguish NFIT_SPA_VOLATILE vs NFIT_SPA_VCD, i.e.
> >> what happens if something writes to a VCD device?
> >
> > Actually I didn't try to write SPA-VCD device before. Every time I mount it
> > that the system responses read-only:
> >
> > # mount /dev/pmem0 /mnt/
> > mount: /dev/pmem0 is write-protected, mounting read-only
> >
> > If it can be written, then I think there have no difference between
> > NFIT_SPA_VOLATILE with NFIT_SPA_VCD region.
> >
> > I implemented this patch to treat VCD region as read-only pmem because the
> > pmem region generates /dev/pmem* device that it can be mounted.
> >
> > Maybe I missed. Does NFIT_SPA_VOLATILE region also generate a device in /dev
> > that it can be mounted with filesystem? Then I think treat the VCD region as
> > a read-only VOLATILE region that's also a solution.
> 
> My question is why does it need to be read-only?  If it's a volatile
> region, does it matter if we allow writes at the block device level?
> Especially if it is formatted as iso9660, it won't be writable through
> the filesystem anyway.

The httpboot function of EFI firmware downloads iso image from http server
, then it allocates a big enough continuity memory region and extract iso to
the region.

Actually you are right, it does not need to be read-only. It's similar with
a volatile region, just the type is NFIT_SPA_VCD and it contains the data
that extracted from a iso file.

Do you have better approach to treat the SPA_VCD region as a block device
that it can be mounted by iso9660? Maybe I missed something... Can I mount a
volatile region with iso9660? If yes, maybe just treat VCD SPA as a VOLATILE
region?


Thanks a lot!
Joey Lee

  reply	other threads:[~2016-06-05 14:47 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03  7:13 [PATCH] libnvdimm, nfit: treat volatile virtual CD region as read-only pmem Lee, Chun-Yi
2016-06-03  7:13 ` Lee, Chun-Yi
2016-06-03  7:13 ` Lee, Chun-Yi
2016-06-03 19:27 ` Dan Williams
2016-06-03 19:27   ` Dan Williams
2016-06-03 19:27   ` Dan Williams
2016-06-04 11:01   ` joeyli
2016-06-04 11:01     ` joeyli
2016-06-04 11:01     ` joeyli
2016-06-04 16:24     ` Dan Williams
2016-06-04 16:24       ` Dan Williams
2016-06-04 16:24       ` Dan Williams
2016-06-05 14:45       ` joeyli [this message]
2016-06-05 14:45         ` joeyli
2016-06-05 14:45         ` joeyli
2016-06-05 14:52       ` joeyli
2016-06-05 14:52         ` joeyli
2016-06-05 14:52         ` joeyli
2016-06-09 22:08     ` Linda Knippers
2016-06-09 22:08       ` Linda Knippers
2016-06-09 22:08       ` Linda Knippers
2016-06-09 22:34       ` Dan Williams
2016-06-09 22:34         ` Dan Williams
2016-06-09 22:34         ` Dan Williams
2016-06-12  2:10         ` joeyli
2016-06-12  2:10           ` joeyli
2016-06-12  2:10           ` joeyli
2016-06-12  1:58       ` joeyli
2016-06-12  1:58         ` joeyli
2016-06-12  1:58         ` joeyli

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=20160605144536.GB4558@linux-rxt1.site \
    --to=jlee@suse.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=rjw@rjwysocki.net \
    /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.