Re: [Linux-nvdimm] [PATCH 3/3] x86: add support for the non-standard protected e820 type

2015-03-25 Thread Dan Williams
On Wed, Mar 25, 2015 at 9:04 AM, Christoph Hellwig  wrote:
> Various recent bioses support NVDIMMs or ADR using a non-standard
> e820 memory type, and Intel supplied reference Linux code using this
> type to various vendors.
>
> Wire this e820 table type up to export platform devices for the pmem
> driver so that we can use it in Linux, and also provide a memmap=
> argument to manually tag memory as protected, which can be used
> if the bios doesn't use the standard nonstandard interface, or
> we just want to test the pmem driver with regular memory.
>
> Based on an earlier patch from Dave Jiang 
> Signed-off-by: Christoph Hellwig 
> ---
[..]
> +static __init int register_pmem_devices(void)
> +{
> +   int i;
> +
> +   for (i = 0; i < e820.nr_map; i++) {
> +   struct e820entry *ei = [i];
> +
> +   if (ei->type == E820_PROTECTED_KERN) {
> +   struct resource res = {
> +   .flags  = IORESOURCE_MEM,
> +   .start  = ei->addr,
> +   .end= ei->addr + ei->size - 1,
> +   };
> +   register_pmem_device();
> +   }
> +   }
> +
> +   return 0;
> +}

Aside from the s/E820_PROTECTED_KERN/E820_PMEM/ suggestion this looks
ok to me.  The "vaporware" new way can be a superset of this
mechanism.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Linux-nvdimm] [PATCH 3/3] x86: add support for the non-standard protected e820 type

2015-03-25 Thread Dan Williams
On Wed, Mar 25, 2015 at 1:23 PM, Ross Zwisler
 wrote:
> On Wed, 2015-03-25 at 17:04 +0100, Christoph Hellwig wrote:
>> Various recent bioses support NVDIMMs or ADR using a non-standard
>> e820 memory type, and Intel supplied reference Linux code using this
>> type to various vendors.
>>
>> Wire this e820 table type up to export platform devices for the pmem
>> driver so that we can use it in Linux, and also provide a memmap=
>> argument to manually tag memory as protected, which can be used
>> if the bios doesn't use the standard nonstandard interface, or
>> we just want to test the pmem driver with regular memory.
>>
>> Based on an earlier patch from Dave Jiang 
>> Signed-off-by: Christoph Hellwig 
>
> 
>
>> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
>> index b7d31ca..93a27e4 100644
>> --- a/arch/x86/Kconfig
>> +++ b/arch/x86/Kconfig
>> @@ -1430,6 +1430,19 @@ config ILLEGAL_POINTER_VALUE
>>
>>  source "mm/Kconfig"
>>
>> +config X86_PMEM_LEGACY
>> + bool "Support non-stanard NVDIMMs and ADR protected memory"
>> + help
>> +   Treat memory marked using the non-stard e820 type of 12 as used
>> +   by the Intel Sandy Bridge-EP reference BIOS as protected memory.
>> +   The kernel will the offer these regions to the pmem driver so
>> +   they can be used for persistent storage.
>> +
>> +   If you say N the kernel will treat the ADR region like an e820
>> +   reserved region.
>> +
>> +   Say Y if unsure
>
> Would it make sense to have this default to "y", or is that too strong?

We never default new enabling to y.  Maybe some exceptions, but this
isn't one of them in my mind.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Linux-nvdimm] [PATCH 3/3] x86: add support for the non-standard protected e820 type

2015-03-25 Thread Dan Williams
On Wed, Mar 25, 2015 at 1:23 PM, Ross Zwisler
ross.zwis...@linux.intel.com wrote:
 On Wed, 2015-03-25 at 17:04 +0100, Christoph Hellwig wrote:
 Various recent bioses support NVDIMMs or ADR using a non-standard
 e820 memory type, and Intel supplied reference Linux code using this
 type to various vendors.

 Wire this e820 table type up to export platform devices for the pmem
 driver so that we can use it in Linux, and also provide a memmap=
 argument to manually tag memory as protected, which can be used
 if the bios doesn't use the standard nonstandard interface, or
 we just want to test the pmem driver with regular memory.

 Based on an earlier patch from Dave Jiang dave.ji...@intel.com
 Signed-off-by: Christoph Hellwig h...@lst.de

 snip

 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
 index b7d31ca..93a27e4 100644
 --- a/arch/x86/Kconfig
 +++ b/arch/x86/Kconfig
 @@ -1430,6 +1430,19 @@ config ILLEGAL_POINTER_VALUE

  source mm/Kconfig

 +config X86_PMEM_LEGACY
 + bool Support non-stanard NVDIMMs and ADR protected memory
 + help
 +   Treat memory marked using the non-stard e820 type of 12 as used
 +   by the Intel Sandy Bridge-EP reference BIOS as protected memory.
 +   The kernel will the offer these regions to the pmem driver so
 +   they can be used for persistent storage.
 +
 +   If you say N the kernel will treat the ADR region like an e820
 +   reserved region.
 +
 +   Say Y if unsure

 Would it make sense to have this default to y, or is that too strong?

We never default new enabling to y.  Maybe some exceptions, but this
isn't one of them in my mind.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Linux-nvdimm] [PATCH 3/3] x86: add support for the non-standard protected e820 type

2015-03-25 Thread Dan Williams
On Wed, Mar 25, 2015 at 9:04 AM, Christoph Hellwig h...@lst.de wrote:
 Various recent bioses support NVDIMMs or ADR using a non-standard
 e820 memory type, and Intel supplied reference Linux code using this
 type to various vendors.

 Wire this e820 table type up to export platform devices for the pmem
 driver so that we can use it in Linux, and also provide a memmap=
 argument to manually tag memory as protected, which can be used
 if the bios doesn't use the standard nonstandard interface, or
 we just want to test the pmem driver with regular memory.

 Based on an earlier patch from Dave Jiang dave.ji...@intel.com
 Signed-off-by: Christoph Hellwig h...@lst.de
 ---
[..]
 +static __init int register_pmem_devices(void)
 +{
 +   int i;
 +
 +   for (i = 0; i  e820.nr_map; i++) {
 +   struct e820entry *ei = e820.map[i];
 +
 +   if (ei-type == E820_PROTECTED_KERN) {
 +   struct resource res = {
 +   .flags  = IORESOURCE_MEM,
 +   .start  = ei-addr,
 +   .end= ei-addr + ei-size - 1,
 +   };
 +   register_pmem_device(res);
 +   }
 +   }
 +
 +   return 0;
 +}

Aside from the s/E820_PROTECTED_KERN/E820_PMEM/ suggestion this looks
ok to me.  The vaporware new way can be a superset of this
mechanism.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/