LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH V2 1/2] ASoC: fsl_asrc: replace the process_option table with function
From: Nicolin Chen @ 2019-04-11 20:06 UTC (permalink / raw)
  To: S.j. Wang
  Cc: alsa-devel@alsa-project.org, timur@kernel.org,
	Xiubo.Lee@gmail.com, festevam@gmail.com,
	linux-kernel@vger.kernel.org, broonie@kernel.org,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <a04859bff36ba26cb4cb51ff092a3f2e2eca455d.1554975348.git.shengjiu.wang@nxp.com>

On Thu, Apr 11, 2019 at 09:39:06AM +0000, S.j. Wang wrote:
  
> +/*
> + * Select the pre-processing and post-processing options

By aligning with other function comments:
/**
 * Select the pre-processing and post-processing options

> + *
> + * Fsin: input sample rate
> + * Fsout: output sample rate

I would suggest to use inrate and outrate to keep naming consistent.

> + * pre_proc: return value for pre-processing option
> + * post_proc: return value for post-processing option
> + */
> +static int fsl_asrc_sel_proc(int Fsin, int Fsout, int *pre_proc, int *post_proc)
> +{
> +	bool det_out_op2_cond;
> +	bool det_out_op0_cond;

By looking at the comments below. Probably better to rename them
	bool post_proc_cond2, post_proc_cond0;

> +	/* Codition for selection of post-processing */

"Codition" -> "Conditions"

> +	det_out_op2_cond = (((Fsin * 15 > Fsout * 16) & (Fsout < 56000)) |
> +					((Fsin > 56000) & (Fsout < 56000)));

Combining Daniel's comments + indentation alignment:
	det_out_op2_cond = (Fsin * 15 > Fsout * 16 && Fsout < 56000) ||
			   (Fsin > 56000 && Fsout < 56000);

> +	det_out_op0_cond = (Fsin * 23 < Fsout * 8);
> +
> +	/*
> +	 * unsupported case: Tsout>16.125*Tsin, and Tsout>8.125*Tsin.

Funny thing is that there'd be no point in checking the 16.125, if
Tsout is bigger than 8.125 times of Tsin, i.e. only one condition:
	Tsout > 8.125 * Tsin

> +	 * Tsout>16.125*Tsin -> Fsin * 8 > 129 * Fsout
> +	 * Tsout>8.125*Tsin  -> Fsin * 8 > 65 * Fsout
> +	 * Tsout>4.125*Tsin  -> Fsin * 8 > 33 * Fsout
> +	 * Tsout>1.875*Tsin  -> Fsin * 8 > 15 * Fsout

Took me a while to understand what it is saying....

Better to write like this:
	/* Does not support cases: Tsout > 8.125 * Tsin */
	if (Fsin * 8 > 65 * Fsout) {
		pair_err("Does not support %d > 8.125 * %d\n", Fsout, Fsin);
		return -EINVAL;
	}

	/* Otherwise, select pre_proc between [0, 2] */
	if (Fsin * 8 > 33 * Fsout)
> +		*pre_proc = 2;
> +	else if (Fsin * 8 > 15 * Fsout) {
> +		if (Fsin > 152000)
> +			*pre_proc = 2;
> +		else
> +			*pre_proc = 1;
> +	} else if (Fsin < 76000)
> +		*pre_proc = 0;
> +	else if (Fsin > 152000)
> +		*pre_proc = 2;
> +	else
> +		*pre_proc = 1;

<== Would look better by moving post_cond calculations here.

> +	if (det_out_op2_cond)
> +		*post_proc = 2;
> +	else if (det_out_op0_cond)
> +		*post_proc = 0;
> +	else
> +		*post_proc = 1;

And we could remove this check below:
> +	/* unsupported options */
> +	if (*pre_proc == 4 || *pre_proc == 5)
> +		return -EINVAL;

So basically we are doing:
	1) Error out unsupported cases
	2) Select pre_proc
	3) Calculate conditions for post_proc
	4) Select post_proc

Thanks

^ permalink raw reply

* Re: [PATCH v2 00/21] Convert hwmon documentation to ReST
From: Jonathan Corbet @ 2019-04-11 18:43 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-arm-kernel, linux-hwmon, Jean Delvare, linux-aspeed,
	Linux Doc Mailing List, Andrew Jeffery, Sudeep Holla, Liviu Dudau,
	linux-kernel, Mauro Carvalho Chehab, Lorenzo Pieralisi,
	Paul Mackerras, Joel Stanley, linuxppc-dev, Guenter Roeck
In-Reply-To: <cover.1554923967.git.mchehab+samsung@kernel.org>

On Wed, 10 Apr 2019 16:22:37 -0300
Mauro Carvalho Chehab <mchehab+samsung@kernel.org> wrote:

> This series converts the contents of Documentation/hwmon to ReST
> format.
> 
> PS.: I opted to group the conversion files per groups of maintainer
> set, as, if I were to generate one patch per file, it would give around
> 160 patches.
> 
> I also added those patches to my development tree at:
> 	https://git.linuxtv.org/mchehab/experimental.git/log/?h=hwmon
> 
> If you want to see the results, they're at:
> 	https://www.infradead.org/~mchehab/hwmon/

This set seems generally good and could probably be applied as-is.  But I
have to ask...is there a reason to not take the last step and actually
bring this stuff into the Sphinx doc tree?

We seem to be mostly documenting sysfs files and such.  I am *guessing*
that perhaps the set should move to Documentation/admin-guide/hwmon?  Or
have I misunderstood the intended audience here?

Thanks,

jon

^ permalink raw reply

* Re: [PATCH kernel v3] powerpc/powernv: Isolate NVLinks between GV100GL on Witherspoon
From: Alex Williamson @ 2019-04-11 16:52 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: Jose Ricardo Ziviani, kvm, Sam Bobroff, linuxppc-dev,
	Daniel Henrique Barboza, kvm-ppc, Piotr Jaroszynski,
	Leonardo Augusto Guimarães Garcia, Reza Arbab, David Gibson
In-Reply-To: <20190411064844.8241-1-aik@ozlabs.ru>

On Thu, 11 Apr 2019 16:48:44 +1000
Alexey Kardashevskiy <aik@ozlabs.ru> wrote:

> The NVIDIA V100 SXM2 GPUs are connected to the CPU via PCIe links and
> (on POWER9) NVLinks. In addition to that, GPUs themselves have direct
> peer-to-peer NVLinks in groups of 2 to 4 GPUs with no buffers/latches
> between GPUs.
> 
> Because of these interconnected NVLinks, the POWERNV platform puts such
> interconnected GPUs to the same IOMMU group. However users want to pass
> GPUs through individually which requires separate IOMMU groups.
> 
> Thankfully V100 GPUs implement an interface to disable arbitrary links
> by programming link disabling mask via the GPU's BAR0. Once a link is
> disabled, it only can be enabled after performing the secondary bus reset
> (SBR) on the GPU. Since these GPUs do not advertise any other type of
> reset, it is reset by the platform's SBR handler.
> 
> This adds an extra step to the POWERNV's SBR handler to block NVLinks to
> GPUs which do not belong to the same group as the GPU being reset.
> 
> This adds a new "isolate_nvlink" kernel parameter to force GPU isolation;
> when enabled, every GPU gets placed in its own IOMMU group. The new
> parameter is off by default to preserve the existing behaviour.
> 
> Before isolating:
> [nvdbg ~]$ nvidia-smi topo -m
>         GPU0    GPU1    GPU2    CPU Affinity
> GPU0     X      NV2     NV2     0-0
> GPU1    NV2      X      NV2     0-0
> GPU2    NV2     NV2      X      0-0
> 
> After isolating:
> [nvdbg ~]$ nvidia-smi topo -m
>         GPU0    GPU1    GPU2    CPU Affinity
> GPU0     X      PHB     PHB     0-0
> GPU1    PHB      X      PHB     0-0
> GPU2    PHB     PHB      X      0-0
> 
> Where:
>   X    = Self
>   PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
>   NV#  = Connection traversing a bonded set of # NVLinks
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> Changes:
> v3:
> * added pci_err() for failed ioremap
> * reworked commit log
> 
> v2:
> * this is rework of [PATCH kernel RFC 0/2] vfio, powerpc/powernv: Isolate GV100GL
> but this time it is contained in the powernv platform
> ---
>  arch/powerpc/platforms/powernv/Makefile      |   2 +-
>  arch/powerpc/platforms/powernv/pci.h         |   1 +
>  arch/powerpc/platforms/powernv/eeh-powernv.c |   1 +
>  arch/powerpc/platforms/powernv/npu-dma.c     |  24 +++-
>  arch/powerpc/platforms/powernv/nvlinkgpu.c   | 137 +++++++++++++++++++
>  5 files changed, 162 insertions(+), 3 deletions(-)
>  create mode 100644 arch/powerpc/platforms/powernv/nvlinkgpu.c
> 
> diff --git a/arch/powerpc/platforms/powernv/Makefile b/arch/powerpc/platforms/powernv/Makefile
> index da2e99efbd04..60a10d3b36eb 100644
> --- a/arch/powerpc/platforms/powernv/Makefile
> +++ b/arch/powerpc/platforms/powernv/Makefile
> @@ -6,7 +6,7 @@ obj-y			+= opal-msglog.o opal-hmi.o opal-power.o opal-irqchip.o
>  obj-y			+= opal-kmsg.o opal-powercap.o opal-psr.o opal-sensor-groups.o
>  
>  obj-$(CONFIG_SMP)	+= smp.o subcore.o subcore-asm.o
> -obj-$(CONFIG_PCI)	+= pci.o pci-ioda.o npu-dma.o pci-ioda-tce.o
> +obj-$(CONFIG_PCI)	+= pci.o pci-ioda.o npu-dma.o pci-ioda-tce.o nvlinkgpu.o
>  obj-$(CONFIG_CXL_BASE)	+= pci-cxl.o
>  obj-$(CONFIG_EEH)	+= eeh-powernv.o
>  obj-$(CONFIG_PPC_SCOM)	+= opal-xscom.o
> diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
> index 8e36da379252..9fd3f391482c 100644
> --- a/arch/powerpc/platforms/powernv/pci.h
> +++ b/arch/powerpc/platforms/powernv/pci.h
> @@ -250,5 +250,6 @@ extern void pnv_pci_unlink_table_and_group(struct iommu_table *tbl,
>  extern void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
>  		void *tce_mem, u64 tce_size,
>  		u64 dma_offset, unsigned int page_shift);
> +extern void pnv_try_isolate_nvidia_v100(struct pci_dev *gpdev);
>  
>  #endif /* __POWERNV_PCI_H */
> diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
> index f38078976c5d..464b097d9635 100644
> --- a/arch/powerpc/platforms/powernv/eeh-powernv.c
> +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
> @@ -937,6 +937,7 @@ void pnv_pci_reset_secondary_bus(struct pci_dev *dev)
>  		pnv_eeh_bridge_reset(dev, EEH_RESET_HOT);
>  		pnv_eeh_bridge_reset(dev, EEH_RESET_DEACTIVATE);
>  	}
> +	pnv_try_isolate_nvidia_v100(dev);
>  }
>  
>  static void pnv_eeh_wait_for_pending(struct pci_dn *pdn, const char *type,
> diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
> index dc23d9d2a7d9..d4f9ee6222b5 100644
> --- a/arch/powerpc/platforms/powernv/npu-dma.c
> +++ b/arch/powerpc/platforms/powernv/npu-dma.c
> @@ -22,6 +22,23 @@
>  
>  #include "pci.h"
>  
> +static bool isolate_nvlink;
> +
> +static int __init parse_isolate_nvlink(char *p)
> +{
> +	bool val;
> +
> +	if (!p)
> +		val = true;
> +	else if (kstrtobool(p, &val))
> +		return -EINVAL;
> +
> +	isolate_nvlink = val;
> +
> +	return 0;
> +}
> +early_param("isolate_nvlink", parse_isolate_nvlink);
> +
>  /*
>   * spinlock to protect initialisation of an npu_context for a particular
>   * mm_struct.
> @@ -549,7 +566,7 @@ struct iommu_table_group *pnv_try_setup_npu_table_group(struct pnv_ioda_pe *pe)
>  
>  	hose = pci_bus_to_host(npdev->bus);
>  
> -	if (hose->npu) {
> +	if (hose->npu && !isolate_nvlink) {
>  		table_group = &hose->npu->npucomp.table_group;
>  
>  		if (!table_group->group) {
> @@ -559,7 +576,10 @@ struct iommu_table_group *pnv_try_setup_npu_table_group(struct pnv_ioda_pe *pe)
>  					pe->pe_number);
>  		}
>  	} else {
> -		/* Create a group for 1 GPU and attached NPUs for POWER8 */
> +		/*
> +		 * Create a group for 1 GPU and attached NPUs for
> +		 * POWER8 (always) or POWER9 (when isolate_nvlink).
> +		 */
>  		pe->npucomp = kzalloc(sizeof(*pe->npucomp), GFP_KERNEL);
>  		table_group = &pe->npucomp->table_group;
>  		table_group->ops = &pnv_npu_peers_ops;
> diff --git a/arch/powerpc/platforms/powernv/nvlinkgpu.c b/arch/powerpc/platforms/powernv/nvlinkgpu.c
> new file mode 100644
> index 000000000000..2a97cb15b6d0
> --- /dev/null
> +++ b/arch/powerpc/platforms/powernv/nvlinkgpu.c
> @@ -0,0 +1,137 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * A helper to disable NVLinks between GPUs on IBM Withersponn platform.
> + *
> + * Copyright (C) 2019 IBM Corp.  All rights reserved.
> + *     Author: Alexey Kardashevskiy <aik@ozlabs.ru>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/device.h>
> +#include <linux/of.h>
> +#include <linux/iommu.h>
> +#include <linux/pci.h>
> +
> +static int nvlinkgpu_is_ph_in_group(struct device *dev, void *data)
> +{
> +	return dev->of_node->phandle == *(phandle *) data;
> +}
> +
> +static u32 nvlinkgpu_get_disable_mask(struct device *dev)
> +{
> +	int npu, peer;
> +	u32 mask;
> +	struct device_node *dn;
> +	struct iommu_group *group;
> +
> +	dn = dev->of_node;
> +	if (!of_find_property(dn, "ibm,nvlink-peers", NULL))
> +		return 0;
> +
> +	group = iommu_group_get(dev);
> +	if (!group)
> +		return 0;
> +
> +	/*
> +	 * Collect links to keep which includes links to NPU and links to
> +	 * other GPUs in the same IOMMU group.
> +	 */
> +	for (npu = 0, mask = 0; ; ++npu) {
> +		u32 npuph = 0;
> +
> +		if (of_property_read_u32_index(dn, "ibm,npu", npu, &npuph))
> +			break;
> +
> +		for (peer = 0; ; ++peer) {
> +			u32 peerph = 0;
> +
> +			if (of_property_read_u32_index(dn, "ibm,nvlink-peers",
> +					peer, &peerph))
> +				break;
> +
> +			if (peerph != npuph &&
> +				!iommu_group_for_each_dev(group, &peerph,
> +					nvlinkgpu_is_ph_in_group))
> +				continue;
> +
> +			mask |= 1 << (peer + 16);
> +		}
> +	}
> +	iommu_group_put(group);
> +
> +	/* Disabling mechanism takes links to disable so invert it here */
> +	mask = ~mask & 0x3F0000;
> +
> +	return mask;
> +}
> +
> +void pnv_try_isolate_nvidia_v100(struct pci_dev *bridge)
> +{
> +	u32 mask, val;
> +	void __iomem *bar0_0, *bar0_120000, *bar0_a00000;
> +	struct pci_dev *pdev;
> +	u16 cmd = 0, cmdmask = PCI_COMMAND_MEMORY;
> +
> +	if (!bridge->subordinate)
> +		return;
> +
> +	pdev = list_first_entry_or_null(&bridge->subordinate->devices,
> +			struct pci_dev, bus_list);
> +	if (!pdev)
> +		return;
> +
> +	if (pdev->vendor != PCI_VENDOR_ID_NVIDIA)
> +		return;
> +
> +	mask = nvlinkgpu_get_disable_mask(&pdev->dev);
> +	if (!mask)
> +		return;
> +
> +	bar0_0 = pci_iomap_range(pdev, 0, 0, 0x10000);
> +	if (!bar0_0) {
> +		pci_err(pdev, "Error mapping BAR0 @0\n");
> +		return;
> +	}
> +	bar0_120000 = pci_iomap_range(pdev, 0, 0x120000, 0x10000);
> +	if (!bar0_120000) {
> +		pci_err(pdev, "Error mapping BAR0 @120000\n");
> +		goto bar0_0_unmap;
> +	}
> +	bar0_a00000 = pci_iomap_range(pdev, 0, 0xA00000, 0x10000);
> +	if (!bar0_a00000) {
> +		pci_err(pdev, "Error mapping BAR0 @A00000\n");
> +		goto bar0_120000_unmap;
> +	}

Is it really necessary to do three separate ioremaps vs one that would
cover them all here?  I suspect you're just sneaking in PAGE_SIZE with
the 0x10000 size mappings anyway.  Seems like it would simplify setup,
error reporting, and cleanup to to ioremap to the PAGE_ALIGN'd range
of the highest register accessed. Thanks,

Alex

> +
> +	pci_restore_state(pdev);
> +	pci_read_config_word(pdev, PCI_COMMAND, &cmd);
> +	if ((cmd & cmdmask) != cmdmask)
> +		pci_write_config_word(pdev, PCI_COMMAND, cmd | cmdmask);
> +
> +	/*
> +	 * The sequence is from "Tesla P100 and V100 SXM2 NVLink Isolation on
> +	 * Multi-Tenant Systems".
> +	 * The register names are not provided there either, hence raw values.
> +	 */
> +	iowrite32(0x4, bar0_120000 + 0x4C);
> +	iowrite32(0x2, bar0_120000 + 0x2204);
> +	val = ioread32(bar0_0 + 0x200);
> +	val |= 0x02000000;
> +	iowrite32(val, bar0_0 + 0x200);
> +	val = ioread32(bar0_a00000 + 0x148);
> +	val |= mask;
> +	iowrite32(val, bar0_a00000 + 0x148);
> +
> +	if ((cmd | cmdmask) != cmd)
> +		pci_write_config_word(pdev, PCI_COMMAND, cmd);
> +
> +	pci_iounmap(pdev, bar0_a00000);
> +bar0_120000_unmap:
> +	pci_iounmap(pdev, bar0_120000);
> +bar0_0_unmap:
> +	pci_iounmap(pdev, bar0_0);
> +}


^ permalink raw reply

* Re: [PATCH v2 3/7] drivers/clocksource: timer-fsl-ftm: use common header for FlexTimer #defines
From: Daniel Lezcano @ 2019-04-11 16:40 UTC (permalink / raw)
  To: Patrick Havelange, William Breathitt Gray, Rob Herring,
	Mark Rutland, Shawn Guo, Li Yang, Thomas Gleixner, Thierry Reding,
	Esben Haabendal, linux-iio, linux-kernel, devicetree,
	linux-arm-kernel, linux-pwm, linuxppc-dev, Jonathan Cameron
In-Reply-To: <20190306111208.7454-4-patrick.havelange@essensium.com>

On 06/03/2019 12:12, Patrick Havelange wrote:
> Common #defines have been moved to "linux/fsl/ftm.h". Thus making use of
> this file.
> Also FTM_SC_CLK_SHIFT has been renamed to FTM_SC_CLK_MASK_SHIFT.
> 
> Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
> Reviewed-by: Esben Haabendal <esben@haabendal.dk>

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>

> ---
> Changes v2
>      - None
> ---
>  drivers/clocksource/timer-fsl-ftm.c | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-fsl-ftm.c b/drivers/clocksource/timer-fsl-ftm.c
> index 846d18daf893..e1c34b2f53a5 100644
> --- a/drivers/clocksource/timer-fsl-ftm.c
> +++ b/drivers/clocksource/timer-fsl-ftm.c
> @@ -19,20 +19,9 @@
>  #include <linux/of_irq.h>
>  #include <linux/sched_clock.h>
>  #include <linux/slab.h>
> +#include <linux/fsl/ftm.h>
>  
> -#define FTM_SC		0x00
> -#define FTM_SC_CLK_SHIFT	3
> -#define FTM_SC_CLK_MASK	(0x3 << FTM_SC_CLK_SHIFT)
> -#define FTM_SC_CLK(c)	((c) << FTM_SC_CLK_SHIFT)
> -#define FTM_SC_PS_MASK	0x7
> -#define FTM_SC_TOIE	BIT(6)
> -#define FTM_SC_TOF	BIT(7)
> -
> -#define FTM_CNT		0x04
> -#define FTM_MOD		0x08
> -#define FTM_CNTIN	0x4C
> -
> -#define FTM_PS_MAX	7
> +#define FTM_SC_CLK(c)	((c) << FTM_SC_CLK_MASK_SHIFT)
>  
>  struct ftm_clock_device {
>  	void __iomem *clksrc_base;
> 


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply

* Re: [PATCH stable v4.9 00/35] powerpc spectre backports for 4.9
From: Sasha Levin @ 2019-04-11 15:25 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: gregkh, stable, diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

On Thu, Apr 11, 2019 at 09:45:55PM +1000, Michael Ellerman wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hi Greg,
>
>Please queue up these powerpc patches for 4.9 if you have no objections.
>
>There's one build fix for newer toolchains, and the rest are spectre related.

I've queued it up, thank you.

--
Thanks,
Sasha

^ permalink raw reply

* Re: [PATCH] crypto: vmx - fix copy-paste error in CTR mode
From: Daniel Axtens @ 2019-04-11 14:47 UTC (permalink / raw)
  To: Eric Biggers
  Cc: leo.barbosa, Herbert Xu, Stephan Mueller, nayna, omosnacek,
	leitao, pfsmorigo, linux-crypto, marcelo.cerri, linuxppc-dev
In-Reply-To: <20190410070234.GA12406@sol.localdomain>

Eric Biggers <ebiggers@kernel.org> writes:

> Hi Daniel,
>
> On Fri, Mar 15, 2019 at 04:23:02PM +1100, Daniel Axtens wrote:
>> Eric Biggers <ebiggers@kernel.org> writes:
>> 
>> > Hi Daniel,
>> >
>> > On Fri, Mar 15, 2019 at 03:24:35PM +1100, Daniel Axtens wrote:
>> >> Hi Eric,
>> >> 
>> >> >> The original assembly imported from OpenSSL has two copy-paste
>> >> >> errors in handling CTR mode. When dealing with a 2 or 3 block tail,
>> >> >> the code branches to the CBC decryption exit path, rather than to
>> >> >> the CTR exit path.
>> >> >
>> >> > So does this need to be fixed in OpenSSL too?
>> >> 
>> >> Yes, I'm getting in touch with some people internally (at IBM) about
>> >> doing that.
>> >> 
>> >> >> This leads to corruption of the IV, which leads to subsequent blocks
>> >> >> being corrupted.
>> >> >> 
>> >> >> This can be detected with libkcapi test suite, which is available at
>> >> >> https://github.com/smuellerDD/libkcapi
>> >> >> 
>> >> >
>> >> > Is this also detected by the kernel's crypto self-tests, and if not why not?
>> >> > What about with the new option CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y?
>> >> 
>> >> It seems the self-tests do not catch it. To catch it, there has to be a
>> >> test where the blkcipher_walk creates a walk.nbytes such that
>> >> [(the number of AES blocks) mod 8] is either 2 or 3. This happens with
>> >> AF_ALG pretty frequently, but when I booted with self-tests it only hit
>> >> 1, 4, 5, 6 and 7 - it missed 0, 2 and 3.
>> >> 
>> >> I don't have the EXTRA_TESTS option - I'm testing with 5.0-rc6. Is it in
>> >> -next?
>> >> 
>> >> Regards,
>> >> Daniel
>> >
>> > The improvements I recently made to the self-tests are intended to catch exactly
>> > this sort of bug.  They were just merged for v5.1, so try the latest mainline.
>> > This almost certainly would be caught by EXTRA_TESTS (and if not I'd want to
>> > know), but it may be caught by the regular self-tests now too.
>> 
>> Well, even the patched code fails with the new self-tests, so clearly
>> they're catching something! I'll investigate in more detail next week.
>> 
>> Regards,
>> Daniel
>> 
>> >
>> > - Eric

Hi Eric,

>
> Are you still planning to fix the remaining bug?  I booted a ppc64le VM, and I
> see the same test failure (I think) you were referring to:
>
> alg: skcipher: p8_aes_ctr encryption test failed (wrong result) on test vector 3, cfg="uneven misaligned splits, may sleep"
>

Yes, that's the one I saw. I don't have time to follow it up at the
moment, but Nayna is aware of it.

Regards,
Daniel

> - Eric

^ permalink raw reply

* Re: [PATCH RFC 1/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options
From: Josh Poimboeuf @ 2019-04-11 13:15 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Peter Zijlstra, Heiko Carstens, Paul Mackerras, H . Peter Anvin,
	Ingo Molnar, Andrea Arcangeli, linux-s390, x86, Linus Torvalds,
	linux-arm-kernel, Catalin Marinas, Waiman Long, linux-arch,
	Will Deacon, Jiri Kosina, Borislav Petkov, Andy Lutomirski,
	Jon Masters, Greg Kroah-Hartman, linux-kernel, Tyler Hicks,
	Martin Schwidefsky, linuxppc-dev
In-Reply-To: <alpine.DEB.2.21.1904101408580.3479@nanos.tec.linutronix.de>

On Wed, Apr 10, 2019 at 02:10:01PM +0200, Thomas Gleixner wrote:
> On Wed, 10 Apr 2019, Michael Ellerman wrote:
> > Josh Poimboeuf <jpoimboe@redhat.com> writes:
> > 
> > > On Fri, Apr 05, 2019 at 06:01:36PM +0200, Borislav Petkov wrote:
> > >> Thinking about this more, we can shave off the first 4 chars and have it
> > >> be:
> > >> 
> > >> spec_mitigations=
> > >> 
> > >> I think it is painfully clear which speculation mitigations we mean. And
> > >> the other switches don't have "cpu_" prefixes too so...
> > >
> > > Sure, I'm ok with renaming it to that, if there are no objections.
> > 
> > What about when we have a mitigation for a non-speculation related bug :)
> 
> Those kind of silicon bugs are usually mitigated unconditionally.

Right.

But at least "mitigations=" is nice and short.  We could clarify in the
documentation that it doesn't apply to *all* mitigations, only the ones
which are optional and which can affect performance.

And it would give us the freedom to include any future "optional"
mitigations, spec or not.

I kind of like it.  But I could go either way.

-- 
Josh

^ permalink raw reply

* Re: [PATCH] MAINTAINERS: Update remaining @linux.vnet.ibm.com addresses
From: Paul E. McKenney @ 2019-04-11 13:12 UTC (permalink / raw)
  To: Joe Perches
  Cc: Tyrel Datwyler, Josh Boyer, linux-kernel, linux-pci,
	Lukas Bulwahn, linuxppc-dev
In-Reply-To: <921408ed6a19d9c6fed18182f03a6dac5ea42aae.camel@perches.com>

On Thu, Apr 11, 2019 at 05:27:31AM -0700, Joe Perches wrote:
> On Thu, 2019-04-11 at 22:07 +1000, Michael Ellerman wrote:
> > Joe Perches <joe@perches.com> writes:
> > > On Thu, 2019-04-11 at 06:27 +0200, Lukas Bulwahn wrote:
> > > > Paul McKenney attempted to update all email addresses @linux.vnet.ibm.com
> > > > to @linux.ibm.com in commit 1dfddcdb95c4
> > > > ("MAINTAINERS: Update from @linux.vnet.ibm.com to @linux.ibm.com"), but
> > > > some still remained.
> > > > 
> > > > We update the remaining email addresses in MAINTAINERS, hopefully finally
> > > > catching all cases for good.
> > > 
> > > Perhaps update all the similar addresses in other files too
> > > 
> > > $ git grep --name-only 'linux\.vnet\.ibm\.com' | wc -l
> > > 315
> > 
> > A good number of them are no longer valid. So I'm not sure it's worth
> > updating them en masse to addresses that won't ever work.
> > 
> > We have git now, we don't need email addresses in files, they're just
> > prone to bitrot like this.
> > 
> > Should we just change them all like so?
> > 
> >   -arch/powerpc/boot/dts/bamboo.dts: * Josh Boyer <jwboyer@linux.vnet.ibm.com>
> >   +arch/powerpc/boot/dts/bamboo.dts: * Josh Boyer (IBM)
> > 
> > To indicate the author was at IBM when they wrote it?
> 
> If that's desired, perhaps:
> 
> $ git grep -P --name-only '<?[\w\.]+(?:@| at )linux\.vnet\.ibm\.com>?' | \
>   grep -vP '\.mailmap|MAINTAINERS' | \
>   xargs perl -p -i -e 's/<?[\w\.]+(?:@|\ at\ )linux\.vnet\.ibm\.com>?/(IBM)/g'
> 
> > Or should we try and update them with current addresses? Though then the
> > authors might start getting mails they don't want.
> 
> That'd be my preference.
> 
> If authors get emails they don't want, then those contact
> emails should be removed.

I have updated most of mine, with one more installment of patches to go
into the next merge window and another into the merge window after that.
More churn than I would have expected, though.  If my email address were
to change again, I would instead go with the "(IBM)" approach and let
the git log and MAINTAINERS file keep the contact information.  Not that
we get to update the git log, of course.  ;-)

I might not have bothered except for combining with the SPDX-tag
commits.

							Thanx, Paul


^ permalink raw reply

* Re: [PATCH v2 21/21] docs: hwmon: Add an index file and rename docs to *.rst
From: Liviu Dudau @ 2019-04-11 13:07 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Mark Rutland, Dirk Eibach, linux-aspeed, Linux Doc Mailing List,
	Clemens Ladisch, Kamil Debski, Marc Hulsman, devicetree,
	Huang Rui, Paul Mackerras, Jim Cromie, Lorenzo Pieralisi,
	Jonathan Corbet, Joel Stanley, Guenter Roeck, Steve Glendinning,
	Fenghua Yu, Jean Delvare, Bartlomiej Zolnierkiewicz,
	Mauro Carvalho Chehab, Hans de Goede, Rob Herring, Rudolf Marek,
	linux-arm-kernel, linux-hwmon, Support Opensource, George Joseph,
	Andreas Werner, Andrew Jeffery, patches, linux-kernel,
	Juerg Haefliger, Sudeep Holla, linuxppc-dev
In-Reply-To: <6d80bfc14608f4bb5514b79721d30b486f50c987.1554923967.git.mchehab+samsung@kernel.org>

On Wed, Apr 10, 2019 at 04:22:58PM -0300, Mauro Carvalho Chehab wrote:
> Now that all files were converted to ReST format, rename them
> and add an index.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> ---
>  .../devicetree/bindings/hwmon/g762.txt        |   2 +-
>  Documentation/hwmon/{ab8500 => ab8500.rst}    |   2 +-
>  ...guru-datasheet => abituguru-datasheet.rst} |   0
>  .../hwmon/{abituguru => abituguru.rst}        |   0
>  .../hwmon/{abituguru3 => abituguru3.rst}      |   0
>  Documentation/hwmon/{abx500 => abx500.rst}    |   0
>  ...{acpi_power_meter => acpi_power_meter.rst} |   2 +-
>  Documentation/hwmon/{ad7314 => ad7314.rst}    |   0
>  .../hwmon/{adc128d818 => adc128d818.rst}      |   0
>  Documentation/hwmon/{adm1021 => adm1021.rst}  |   0
>  Documentation/hwmon/{adm1025 => adm1025.rst}  |   0
>  Documentation/hwmon/{adm1026 => adm1026.rst}  |   0
>  Documentation/hwmon/{adm1031 => adm1031.rst}  |   0
>  Documentation/hwmon/{adm1275 => adm1275.rst}  |   4 +-
>  Documentation/hwmon/{adm9240 => adm9240.rst}  |   0
>  Documentation/hwmon/{ads1015 => ads1015.rst}  |   0
>  Documentation/hwmon/{ads7828 => ads7828.rst}  |   0
>  Documentation/hwmon/{adt7410 => adt7410.rst}  |   0
>  Documentation/hwmon/{adt7411 => adt7411.rst}  |   0
>  Documentation/hwmon/{adt7462 => adt7462.rst}  |   0
>  Documentation/hwmon/{adt7470 => adt7470.rst}  |   0
>  Documentation/hwmon/{adt7475 => adt7475.rst}  |   0
>  Documentation/hwmon/{amc6821 => amc6821.rst}  |   0
>  Documentation/hwmon/{asb100 => asb100.rst}    |   0
>  Documentation/hwmon/{asc7621 => asc7621.rst}  |   0
>  ...{aspeed-pwm-tacho => aspeed-pwm-tacho.rst} |   0
>  .../hwmon/{coretemp => coretemp.rst}          |   0
>  Documentation/hwmon/{da9052 => da9052.rst}    |   0
>  Documentation/hwmon/{da9055 => da9055.rst}    |   0
>  Documentation/hwmon/{dme1737 => dme1737.rst}  |   0
>  Documentation/hwmon/{ds1621 => ds1621.rst}    |   0
>  Documentation/hwmon/{ds620 => ds620.rst}      |   0
>  Documentation/hwmon/{emc1403 => emc1403.rst}  |   0
>  Documentation/hwmon/{emc2103 => emc2103.rst}  |   0
>  .../hwmon/{emc6w201 => emc6w201.rst}          |   0
>  Documentation/hwmon/{f71805f => f71805f.rst}  |   0
>  .../hwmon/{f71882fg => f71882fg.rst}          |   0
>  .../hwmon/{fam15h_power => fam15h_power.rst}  |   0
>  .../hwmon/{ftsteutates => ftsteutates.rst}    |   0
>  Documentation/hwmon/{g760a => g760a.rst}      |   0
>  Documentation/hwmon/{g762 => g762.rst}        |   2 +-
>  Documentation/hwmon/{gl518sm => gl518sm.rst}  |   0
>  Documentation/hwmon/{hih6130 => hih6130.rst}  |   0
>  ...on-kernel-api.txt => hwmon-kernel-api.rst} |   4 +-
>  .../hwmon/{ibm-cffps => ibm-cffps.rst}        |   0
>  Documentation/hwmon/{ibmaem => ibmaem.rst}    |   0
>  .../hwmon/{ibmpowernv => ibmpowernv.rst}      |   0
>  Documentation/hwmon/{ina209 => ina209.rst}    |   0
>  Documentation/hwmon/{ina2xx => ina2xx.rst}    |   2 +-
>  Documentation/hwmon/{ina3221 => ina3221.rst}  |   0
>  Documentation/hwmon/index.rst                 | 179 ++++++++++++++++++
>  Documentation/hwmon/{ir35221 => ir35221.rst}  |   0
>  Documentation/hwmon/{it87 => it87.rst}        |   0
>  Documentation/hwmon/{jc42 => jc42.rst}        |   0
>  Documentation/hwmon/{k10temp => k10temp.rst}  |   0
>  Documentation/hwmon/{k8temp => k8temp.rst}    |   0
>  .../hwmon/{lineage-pem => lineage-pem.rst}    |   0
>  Documentation/hwmon/{lm25066 => lm25066.rst}  |   2 +-
>  Documentation/hwmon/{lm63 => lm63.rst}        |   0
>  Documentation/hwmon/{lm70 => lm70.rst}        |   0
>  Documentation/hwmon/{lm73 => lm73.rst}        |   0
>  Documentation/hwmon/{lm75 => lm75.rst}        |   0
>  Documentation/hwmon/{lm77 => lm77.rst}        |   0
>  Documentation/hwmon/{lm78 => lm78.rst}        |   0
>  Documentation/hwmon/{lm80 => lm80.rst}        |   0
>  Documentation/hwmon/{lm83 => lm83.rst}        |   0
>  Documentation/hwmon/{lm85 => lm85.rst}        |   0
>  Documentation/hwmon/{lm87 => lm87.rst}        |   0
>  Documentation/hwmon/{lm90 => lm90.rst}        |   0
>  Documentation/hwmon/{lm92 => lm92.rst}        |   0
>  Documentation/hwmon/{lm93 => lm93.rst}        |   0
>  Documentation/hwmon/{lm95234 => lm95234.rst}  |   0
>  Documentation/hwmon/{lm95245 => lm95245.rst}  |   0
>  Documentation/hwmon/{ltc2945 => ltc2945.rst}  |   0
>  Documentation/hwmon/{ltc2978 => ltc2978.rst}  |   0
>  Documentation/hwmon/{ltc2990 => ltc2990.rst}  |   0
>  Documentation/hwmon/{ltc3815 => ltc3815.rst}  |   0
>  Documentation/hwmon/{ltc4151 => ltc4151.rst}  |   0
>  Documentation/hwmon/{ltc4215 => ltc4215.rst}  |   0
>  Documentation/hwmon/{ltc4245 => ltc4245.rst}  |   0
>  Documentation/hwmon/{ltc4260 => ltc4260.rst}  |   0
>  Documentation/hwmon/{ltc4261 => ltc4261.rst}  |   0
>  .../hwmon/{max16064 => max16064.rst}          |   2 +-
>  .../hwmon/{max16065 => max16065.rst}          |   0
>  Documentation/hwmon/{max1619 => max1619.rst}  |   0
>  Documentation/hwmon/{max1668 => max1668.rst}  |   0
>  Documentation/hwmon/{max197 => max197.rst}    |   0
>  .../hwmon/{max20751 => max20751.rst}          |   2 +-
>  .../hwmon/{max31722 => max31722.rst}          |   0
>  .../hwmon/{max31785 => max31785.rst}          |   0
>  .../hwmon/{max31790 => max31790.rst}          |   0
>  .../hwmon/{max34440 => max34440.rst}          |   2 +-
>  Documentation/hwmon/{max6639 => max6639.rst}  |   0
>  Documentation/hwmon/{max6642 => max6642.rst}  |   0
>  Documentation/hwmon/{max6650 => max6650.rst}  |   0
>  Documentation/hwmon/{max6697 => max6697.rst}  |   0
>  Documentation/hwmon/{max8688 => max8688.rst}  |   2 +-
>  .../hwmon/{mc13783-adc => mc13783-adc.rst}    |   0
>  Documentation/hwmon/{mcp3021 => mcp3021.rst}  |   0
>  .../hwmon/{menf21bmc => menf21bmc.rst}        |   0
>  .../hwmon/{mlxreg-fan => mlxreg-fan.rst}      |   0
>  Documentation/hwmon/{nct6683 => nct6683.rst}  |   0
>  Documentation/hwmon/{nct6775 => nct6775.rst}  |   0
>  Documentation/hwmon/{nct7802 => nct7802.rst}  |   0
>  Documentation/hwmon/{nct7904 => nct7904.rst}  |   0
>  .../{npcm750-pwm-fan => npcm750-pwm-fan.rst}  |   0
>  Documentation/hwmon/{nsa320 => nsa320.rst}    |   0
>  .../{ntc_thermistor => ntc_thermistor.rst}    |   0
>  Documentation/hwmon/{occ => occ.rst}          |   0
>  Documentation/hwmon/{pc87360 => pc87360.rst}  |   0
>  Documentation/hwmon/{pc87427 => pc87427.rst}  |   0
>  Documentation/hwmon/{pcf8591 => pcf8591.rst}  |   0
>  .../hwmon/{pmbus-core => pmbus-core.rst}      |   0
>  Documentation/hwmon/{pmbus => pmbus.rst}      |   0
>  .../hwmon/{powr1220 => powr1220.rst}          |   0
>  Documentation/hwmon/{pwm-fan => pwm-fan.rst}  |   0
>  ...aspberrypi-hwmon => raspberrypi-hwmon.rst} |   0
>  Documentation/hwmon/{sch5627 => sch5627.rst}  |   0
>  Documentation/hwmon/{sch5636 => sch5636.rst}  |   0
>  .../hwmon/{scpi-hwmon => scpi-hwmon.rst}      |   0
>  Documentation/hwmon/{sht15 => sht15.rst}      |   0
>  Documentation/hwmon/{sht21 => sht21.rst}      |   0
>  Documentation/hwmon/{sht3x => sht3x.rst}      |   0
>  Documentation/hwmon/{shtc1 => shtc1.rst}      |   0
>  Documentation/hwmon/{sis5595 => sis5595.rst}  |   0
>  Documentation/hwmon/{smm665 => smm665.rst}    |   0
>  .../hwmon/{smsc47b397 => smsc47b397.rst}      |   0
>  .../hwmon/{smsc47m1 => smsc47m1.rst}          |   0
>  .../hwmon/{smsc47m192 => smsc47m192.rst}      |   0
>  ...mitting-patches => submitting-patches.rst} |   6 +-
>  .../{sysfs-interface => sysfs-interface.rst}  |   0
>  Documentation/hwmon/{tc654 => tc654.rst}      |   0
>  Documentation/hwmon/{tc74 => tc74.rst}        |   0
>  Documentation/hwmon/{thmc50 => thmc50.rst}    |   0
>  Documentation/hwmon/{tmp102 => tmp102.rst}    |   2 +-
>  Documentation/hwmon/{tmp103 => tmp103.rst}    |   2 +-
>  Documentation/hwmon/{tmp108 => tmp108.rst}    |   2 +-
>  Documentation/hwmon/{tmp401 => tmp401.rst}    |   2 +-
>  Documentation/hwmon/{tmp421 => tmp421.rst}    |   0
>  .../hwmon/{tps40422 => tps40422.rst}          |   2 +-
>  ...4030-madc-hwmon => twl4030-madc-hwmon.rst} |   0
>  Documentation/hwmon/{ucd9000 => ucd9000.rst}  |   4 +-
>  Documentation/hwmon/{ucd9200 => ucd9200.rst}  |   4 +-
>  .../{userspace-tools => userspace-tools.rst}  |   0
>  .../hwmon/{vexpress => vexpress.rst}          |   0
>  Documentation/hwmon/{via686a => via686a.rst}  |   0
>  Documentation/hwmon/{vt1211 => vt1211.rst}    |   0
>  .../hwmon/{w83627ehf => w83627ehf.rst}        |   0
>  .../hwmon/{w83627hf => w83627hf.rst}          |   0
>  Documentation/hwmon/{w83773g => w83773g.rst}  |   0
>  Documentation/hwmon/{w83781d => w83781d.rst}  |   0
>  Documentation/hwmon/{w83791d => w83791d.rst}  |   2 +-
>  Documentation/hwmon/{w83792d => w83792d.rst}  |   0
>  Documentation/hwmon/{w83793 => w83793.rst}    |   0
>  Documentation/hwmon/{w83795 => w83795.rst}    |   0
>  .../hwmon/{w83l785ts => w83l785ts.rst}        |   0
>  .../hwmon/{w83l786ng => w83l786ng.rst}        |   0
>  Documentation/hwmon/{wm831x => wm831x.rst}    |   0
>  Documentation/hwmon/{wm8350 => wm8350.rst}    |   0
>  .../hwmon/{xgene-hwmon => xgene-hwmon.rst}    |   0
>  Documentation/hwmon/{zl6100 => zl6100.rst}    |   2 +-
>  Documentation/index.rst                       |   1 +
>  Documentation/thermal/sysfs-api.txt           |   2 +-
>  MAINTAINERS                                   | 108 +++++------
>  drivers/hwmon/Kconfig                         |   8 +-
>  drivers/hwmon/ads7828.c                       |   2 +-
>  drivers/hwmon/max197.c                        |   2 +-
>  drivers/hwmon/sht15.c                         |   2 +-
>  include/linux/platform_data/ads7828.h         |   2 +-
>  include/linux/platform_data/ds620.h           |   2 +-
>  include/linux/platform_data/ina2xx.h          |   2 +-
>  include/linux/platform_data/max197.h          |   2 +-
>  include/linux/platform_data/ntc_thermistor.h  |   2 +-
>  173 files changed, 275 insertions(+), 95 deletions(-)
>  rename Documentation/hwmon/{ab8500 => ab8500.rst} (86%)
>  rename Documentation/hwmon/{abituguru-datasheet => abituguru-datasheet.rst} (100%)
>  rename Documentation/hwmon/{abituguru => abituguru.rst} (100%)
>  rename Documentation/hwmon/{abituguru3 => abituguru3.rst} (100%)
>  rename Documentation/hwmon/{abx500 => abx500.rst} (100%)
>  rename Documentation/hwmon/{acpi_power_meter => acpi_power_meter.rst} (97%)
>  rename Documentation/hwmon/{ad7314 => ad7314.rst} (100%)
>  rename Documentation/hwmon/{adc128d818 => adc128d818.rst} (100%)
>  rename Documentation/hwmon/{adm1021 => adm1021.rst} (100%)
>  rename Documentation/hwmon/{adm1025 => adm1025.rst} (100%)
>  rename Documentation/hwmon/{adm1026 => adm1026.rst} (100%)
>  rename Documentation/hwmon/{adm1031 => adm1031.rst} (100%)
>  rename Documentation/hwmon/{adm1275 => adm1275.rst} (97%)
>  rename Documentation/hwmon/{adm9240 => adm9240.rst} (100%)
>  rename Documentation/hwmon/{ads1015 => ads1015.rst} (100%)
>  rename Documentation/hwmon/{ads7828 => ads7828.rst} (100%)
>  rename Documentation/hwmon/{adt7410 => adt7410.rst} (100%)
>  rename Documentation/hwmon/{adt7411 => adt7411.rst} (100%)
>  rename Documentation/hwmon/{adt7462 => adt7462.rst} (100%)
>  rename Documentation/hwmon/{adt7470 => adt7470.rst} (100%)
>  rename Documentation/hwmon/{adt7475 => adt7475.rst} (100%)
>  rename Documentation/hwmon/{amc6821 => amc6821.rst} (100%)
>  rename Documentation/hwmon/{asb100 => asb100.rst} (100%)
>  rename Documentation/hwmon/{asc7621 => asc7621.rst} (100%)
>  rename Documentation/hwmon/{aspeed-pwm-tacho => aspeed-pwm-tacho.rst} (100%)
>  rename Documentation/hwmon/{coretemp => coretemp.rst} (100%)
>  rename Documentation/hwmon/{da9052 => da9052.rst} (100%)
>  rename Documentation/hwmon/{da9055 => da9055.rst} (100%)
>  rename Documentation/hwmon/{dme1737 => dme1737.rst} (100%)
>  rename Documentation/hwmon/{ds1621 => ds1621.rst} (100%)
>  rename Documentation/hwmon/{ds620 => ds620.rst} (100%)
>  rename Documentation/hwmon/{emc1403 => emc1403.rst} (100%)
>  rename Documentation/hwmon/{emc2103 => emc2103.rst} (100%)
>  rename Documentation/hwmon/{emc6w201 => emc6w201.rst} (100%)
>  rename Documentation/hwmon/{f71805f => f71805f.rst} (100%)
>  rename Documentation/hwmon/{f71882fg => f71882fg.rst} (100%)
>  rename Documentation/hwmon/{fam15h_power => fam15h_power.rst} (100%)
>  rename Documentation/hwmon/{ftsteutates => ftsteutates.rst} (100%)
>  rename Documentation/hwmon/{g760a => g760a.rst} (100%)
>  rename Documentation/hwmon/{g762 => g762.rst} (97%)
>  rename Documentation/hwmon/{gl518sm => gl518sm.rst} (100%)
>  rename Documentation/hwmon/{hih6130 => hih6130.rst} (100%)
>  rename Documentation/hwmon/{hwmon-kernel-api.txt => hwmon-kernel-api.rst} (99%)
>  rename Documentation/hwmon/{ibm-cffps => ibm-cffps.rst} (100%)
>  rename Documentation/hwmon/{ibmaem => ibmaem.rst} (100%)
>  rename Documentation/hwmon/{ibmpowernv => ibmpowernv.rst} (100%)
>  rename Documentation/hwmon/{ina209 => ina209.rst} (100%)
>  rename Documentation/hwmon/{ina2xx => ina2xx.rst} (97%)
>  rename Documentation/hwmon/{ina3221 => ina3221.rst} (100%)
>  create mode 100644 Documentation/hwmon/index.rst
>  rename Documentation/hwmon/{ir35221 => ir35221.rst} (100%)
>  rename Documentation/hwmon/{it87 => it87.rst} (100%)
>  rename Documentation/hwmon/{jc42 => jc42.rst} (100%)
>  rename Documentation/hwmon/{k10temp => k10temp.rst} (100%)
>  rename Documentation/hwmon/{k8temp => k8temp.rst} (100%)
>  rename Documentation/hwmon/{lineage-pem => lineage-pem.rst} (100%)
>  rename Documentation/hwmon/{lm25066 => lm25066.rst} (97%)
>  rename Documentation/hwmon/{lm63 => lm63.rst} (100%)
>  rename Documentation/hwmon/{lm70 => lm70.rst} (100%)
>  rename Documentation/hwmon/{lm73 => lm73.rst} (100%)
>  rename Documentation/hwmon/{lm75 => lm75.rst} (100%)
>  rename Documentation/hwmon/{lm77 => lm77.rst} (100%)
>  rename Documentation/hwmon/{lm78 => lm78.rst} (100%)
>  rename Documentation/hwmon/{lm80 => lm80.rst} (100%)
>  rename Documentation/hwmon/{lm83 => lm83.rst} (100%)
>  rename Documentation/hwmon/{lm85 => lm85.rst} (100%)
>  rename Documentation/hwmon/{lm87 => lm87.rst} (100%)
>  rename Documentation/hwmon/{lm90 => lm90.rst} (100%)
>  rename Documentation/hwmon/{lm92 => lm92.rst} (100%)
>  rename Documentation/hwmon/{lm93 => lm93.rst} (100%)
>  rename Documentation/hwmon/{lm95234 => lm95234.rst} (100%)
>  rename Documentation/hwmon/{lm95245 => lm95245.rst} (100%)
>  rename Documentation/hwmon/{ltc2945 => ltc2945.rst} (100%)
>  rename Documentation/hwmon/{ltc2978 => ltc2978.rst} (100%)
>  rename Documentation/hwmon/{ltc2990 => ltc2990.rst} (100%)
>  rename Documentation/hwmon/{ltc3815 => ltc3815.rst} (100%)
>  rename Documentation/hwmon/{ltc4151 => ltc4151.rst} (100%)
>  rename Documentation/hwmon/{ltc4215 => ltc4215.rst} (100%)
>  rename Documentation/hwmon/{ltc4245 => ltc4245.rst} (100%)
>  rename Documentation/hwmon/{ltc4260 => ltc4260.rst} (100%)
>  rename Documentation/hwmon/{ltc4261 => ltc4261.rst} (100%)
>  rename Documentation/hwmon/{max16064 => max16064.rst} (96%)
>  rename Documentation/hwmon/{max16065 => max16065.rst} (100%)
>  rename Documentation/hwmon/{max1619 => max1619.rst} (100%)
>  rename Documentation/hwmon/{max1668 => max1668.rst} (100%)
>  rename Documentation/hwmon/{max197 => max197.rst} (100%)
>  rename Documentation/hwmon/{max20751 => max20751.rst} (96%)
>  rename Documentation/hwmon/{max31722 => max31722.rst} (100%)
>  rename Documentation/hwmon/{max31785 => max31785.rst} (100%)
>  rename Documentation/hwmon/{max31790 => max31790.rst} (100%)
>  rename Documentation/hwmon/{max34440 => max34440.rst} (98%)
>  rename Documentation/hwmon/{max6639 => max6639.rst} (100%)
>  rename Documentation/hwmon/{max6642 => max6642.rst} (100%)
>  rename Documentation/hwmon/{max6650 => max6650.rst} (100%)
>  rename Documentation/hwmon/{max6697 => max6697.rst} (100%)
>  rename Documentation/hwmon/{max8688 => max8688.rst} (97%)
>  rename Documentation/hwmon/{mc13783-adc => mc13783-adc.rst} (100%)
>  rename Documentation/hwmon/{mcp3021 => mcp3021.rst} (100%)
>  rename Documentation/hwmon/{menf21bmc => menf21bmc.rst} (100%)
>  rename Documentation/hwmon/{mlxreg-fan => mlxreg-fan.rst} (100%)
>  rename Documentation/hwmon/{nct6683 => nct6683.rst} (100%)
>  rename Documentation/hwmon/{nct6775 => nct6775.rst} (100%)
>  rename Documentation/hwmon/{nct7802 => nct7802.rst} (100%)
>  rename Documentation/hwmon/{nct7904 => nct7904.rst} (100%)
>  rename Documentation/hwmon/{npcm750-pwm-fan => npcm750-pwm-fan.rst} (100%)
>  rename Documentation/hwmon/{nsa320 => nsa320.rst} (100%)
>  rename Documentation/hwmon/{ntc_thermistor => ntc_thermistor.rst} (100%)
>  rename Documentation/hwmon/{occ => occ.rst} (100%)
>  rename Documentation/hwmon/{pc87360 => pc87360.rst} (100%)
>  rename Documentation/hwmon/{pc87427 => pc87427.rst} (100%)
>  rename Documentation/hwmon/{pcf8591 => pcf8591.rst} (100%)
>  rename Documentation/hwmon/{pmbus-core => pmbus-core.rst} (100%)
>  rename Documentation/hwmon/{pmbus => pmbus.rst} (100%)
>  rename Documentation/hwmon/{powr1220 => powr1220.rst} (100%)
>  rename Documentation/hwmon/{pwm-fan => pwm-fan.rst} (100%)
>  rename Documentation/hwmon/{raspberrypi-hwmon => raspberrypi-hwmon.rst} (100%)
>  rename Documentation/hwmon/{sch5627 => sch5627.rst} (100%)
>  rename Documentation/hwmon/{sch5636 => sch5636.rst} (100%)
>  rename Documentation/hwmon/{scpi-hwmon => scpi-hwmon.rst} (100%)
>  rename Documentation/hwmon/{sht15 => sht15.rst} (100%)
>  rename Documentation/hwmon/{sht21 => sht21.rst} (100%)
>  rename Documentation/hwmon/{sht3x => sht3x.rst} (100%)
>  rename Documentation/hwmon/{shtc1 => shtc1.rst} (100%)
>  rename Documentation/hwmon/{sis5595 => sis5595.rst} (100%)
>  rename Documentation/hwmon/{smm665 => smm665.rst} (100%)
>  rename Documentation/hwmon/{smsc47b397 => smsc47b397.rst} (100%)
>  rename Documentation/hwmon/{smsc47m1 => smsc47m1.rst} (100%)
>  rename Documentation/hwmon/{smsc47m192 => smsc47m192.rst} (100%)
>  rename Documentation/hwmon/{submitting-patches => submitting-patches.rst} (98%)
>  rename Documentation/hwmon/{sysfs-interface => sysfs-interface.rst} (100%)
>  rename Documentation/hwmon/{tc654 => tc654.rst} (100%)
>  rename Documentation/hwmon/{tc74 => tc74.rst} (100%)
>  rename Documentation/hwmon/{thmc50 => thmc50.rst} (100%)
>  rename Documentation/hwmon/{tmp102 => tmp102.rst} (93%)
>  rename Documentation/hwmon/{tmp103 => tmp103.rst} (92%)
>  rename Documentation/hwmon/{tmp108 => tmp108.rst} (95%)
>  rename Documentation/hwmon/{tmp401 => tmp401.rst} (97%)
>  rename Documentation/hwmon/{tmp421 => tmp421.rst} (100%)
>  rename Documentation/hwmon/{tps40422 => tps40422.rst} (96%)
>  rename Documentation/hwmon/{twl4030-madc-hwmon => twl4030-madc-hwmon.rst} (100%)
>  rename Documentation/hwmon/{ucd9000 => ucd9000.rst} (97%)
>  rename Documentation/hwmon/{ucd9200 => ucd9200.rst} (97%)
>  rename Documentation/hwmon/{userspace-tools => userspace-tools.rst} (100%)
>  rename Documentation/hwmon/{vexpress => vexpress.rst} (100%)

For the vexpress part:

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu


>  rename Documentation/hwmon/{via686a => via686a.rst} (100%)
>  rename Documentation/hwmon/{vt1211 => vt1211.rst} (100%)
>  rename Documentation/hwmon/{w83627ehf => w83627ehf.rst} (100%)
>  rename Documentation/hwmon/{w83627hf => w83627hf.rst} (100%)
>  rename Documentation/hwmon/{w83773g => w83773g.rst} (100%)
>  rename Documentation/hwmon/{w83781d => w83781d.rst} (100%)
>  rename Documentation/hwmon/{w83791d => w83791d.rst} (99%)
>  rename Documentation/hwmon/{w83792d => w83792d.rst} (100%)
>  rename Documentation/hwmon/{w83793 => w83793.rst} (100%)
>  rename Documentation/hwmon/{w83795 => w83795.rst} (100%)
>  rename Documentation/hwmon/{w83l785ts => w83l785ts.rst} (100%)
>  rename Documentation/hwmon/{w83l786ng => w83l786ng.rst} (100%)
>  rename Documentation/hwmon/{wm831x => wm831x.rst} (100%)
>  rename Documentation/hwmon/{wm8350 => wm8350.rst} (100%)
>  rename Documentation/hwmon/{xgene-hwmon => xgene-hwmon.rst} (100%)
>  rename Documentation/hwmon/{zl6100 => zl6100.rst} (98%)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/g762.txt b/Documentation/devicetree/bindings/hwmon/g762.txt
> index 25cc6d8ee575..6d154c4923de 100644
> --- a/Documentation/devicetree/bindings/hwmon/g762.txt
> +++ b/Documentation/devicetree/bindings/hwmon/g762.txt
> @@ -21,7 +21,7 @@ If an optional property is not set in .dts file, then current value is kept
>  unmodified (e.g. u-boot installed value).
>  
>  Additional information on operational parameters for the device is available
> -in Documentation/hwmon/g762. A detailed datasheet for the device is available
> +in Documentation/hwmon/g762.rst. A detailed datasheet for the device is available
>  at http://natisbad.org/NAS/refs/GMT_EDS-762_763-080710-0.2.pdf.
>  
>  Example g762 node:
> diff --git a/Documentation/hwmon/ab8500 b/Documentation/hwmon/ab8500.rst
> similarity index 86%
> rename from Documentation/hwmon/ab8500
> rename to Documentation/hwmon/ab8500.rst
> index d87c61151239..33f93a9cec04 100644
> --- a/Documentation/hwmon/ab8500
> +++ b/Documentation/hwmon/ab8500.rst
> @@ -18,7 +18,7 @@ Authors:
>  Description
>  -----------
>  
> -See also Documentation/hwmon/abx500. This is the ST-Ericsson AB8500 specific
> +See also Documentation/hwmon/abx500.rst. This is the ST-Ericsson AB8500 specific
>  driver.
>  
>  Currently only the AB8500 internal sensor and one external sensor for battery
> diff --git a/Documentation/hwmon/abituguru-datasheet b/Documentation/hwmon/abituguru-datasheet.rst
> similarity index 100%
> rename from Documentation/hwmon/abituguru-datasheet
> rename to Documentation/hwmon/abituguru-datasheet.rst
> diff --git a/Documentation/hwmon/abituguru b/Documentation/hwmon/abituguru.rst
> similarity index 100%
> rename from Documentation/hwmon/abituguru
> rename to Documentation/hwmon/abituguru.rst
> diff --git a/Documentation/hwmon/abituguru3 b/Documentation/hwmon/abituguru3.rst
> similarity index 100%
> rename from Documentation/hwmon/abituguru3
> rename to Documentation/hwmon/abituguru3.rst
> diff --git a/Documentation/hwmon/abx500 b/Documentation/hwmon/abx500.rst
> similarity index 100%
> rename from Documentation/hwmon/abx500
> rename to Documentation/hwmon/abx500.rst
> diff --git a/Documentation/hwmon/acpi_power_meter b/Documentation/hwmon/acpi_power_meter.rst
> similarity index 97%
> rename from Documentation/hwmon/acpi_power_meter
> rename to Documentation/hwmon/acpi_power_meter.rst
> index 7665ca6ba957..4a0941ade0ca 100644
> --- a/Documentation/hwmon/acpi_power_meter
> +++ b/Documentation/hwmon/acpi_power_meter.rst
> @@ -21,7 +21,7 @@ the ACPI 4.0 spec (Chapter 10.4).  These devices have a simple set of
>  features--a power meter that returns average power use over a configurable
>  interval, an optional capping mechanism, and a couple of trip points.  The
>  sysfs interface conforms with the specification outlined in the "Power" section
> -of Documentation/hwmon/sysfs-interface.
> +of Documentation/hwmon/sysfs-interface.rst.
>  
>  Special Features
>  ----------------
> diff --git a/Documentation/hwmon/ad7314 b/Documentation/hwmon/ad7314.rst
> similarity index 100%
> rename from Documentation/hwmon/ad7314
> rename to Documentation/hwmon/ad7314.rst
> diff --git a/Documentation/hwmon/adc128d818 b/Documentation/hwmon/adc128d818.rst
> similarity index 100%
> rename from Documentation/hwmon/adc128d818
> rename to Documentation/hwmon/adc128d818.rst
> diff --git a/Documentation/hwmon/adm1021 b/Documentation/hwmon/adm1021.rst
> similarity index 100%
> rename from Documentation/hwmon/adm1021
> rename to Documentation/hwmon/adm1021.rst
> diff --git a/Documentation/hwmon/adm1025 b/Documentation/hwmon/adm1025.rst
> similarity index 100%
> rename from Documentation/hwmon/adm1025
> rename to Documentation/hwmon/adm1025.rst
> diff --git a/Documentation/hwmon/adm1026 b/Documentation/hwmon/adm1026.rst
> similarity index 100%
> rename from Documentation/hwmon/adm1026
> rename to Documentation/hwmon/adm1026.rst
> diff --git a/Documentation/hwmon/adm1031 b/Documentation/hwmon/adm1031.rst
> similarity index 100%
> rename from Documentation/hwmon/adm1031
> rename to Documentation/hwmon/adm1031.rst
> diff --git a/Documentation/hwmon/adm1275 b/Documentation/hwmon/adm1275.rst
> similarity index 97%
> rename from Documentation/hwmon/adm1275
> rename to Documentation/hwmon/adm1275.rst
> index 5c5860011d6e..9a1913e5b4d9 100644
> --- a/Documentation/hwmon/adm1275
> +++ b/Documentation/hwmon/adm1275.rst
> @@ -68,7 +68,7 @@ integrated 12 bit analog-to-digital converter (ADC), accessed using a
>  PMBus interface.
>  
>  The driver is a client driver to the core PMBus driver. Please see
> -Documentation/hwmon/pmbus for details on PMBus client drivers.
> +Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
>  
>  
>  Usage Notes
> @@ -90,7 +90,7 @@ Platform data support
>  ---------------------
>  
>  The driver supports standard PMBus driver platform data. Please see
> -Documentation/hwmon/pmbus for details.
> +Documentation/hwmon/pmbus.rst for details.
>  
>  
>  Sysfs entries
> diff --git a/Documentation/hwmon/adm9240 b/Documentation/hwmon/adm9240.rst
> similarity index 100%
> rename from Documentation/hwmon/adm9240
> rename to Documentation/hwmon/adm9240.rst
> diff --git a/Documentation/hwmon/ads1015 b/Documentation/hwmon/ads1015.rst
> similarity index 100%
> rename from Documentation/hwmon/ads1015
> rename to Documentation/hwmon/ads1015.rst
> diff --git a/Documentation/hwmon/ads7828 b/Documentation/hwmon/ads7828.rst
> similarity index 100%
> rename from Documentation/hwmon/ads7828
> rename to Documentation/hwmon/ads7828.rst
> diff --git a/Documentation/hwmon/adt7410 b/Documentation/hwmon/adt7410.rst
> similarity index 100%
> rename from Documentation/hwmon/adt7410
> rename to Documentation/hwmon/adt7410.rst
> diff --git a/Documentation/hwmon/adt7411 b/Documentation/hwmon/adt7411.rst
> similarity index 100%
> rename from Documentation/hwmon/adt7411
> rename to Documentation/hwmon/adt7411.rst
> diff --git a/Documentation/hwmon/adt7462 b/Documentation/hwmon/adt7462.rst
> similarity index 100%
> rename from Documentation/hwmon/adt7462
> rename to Documentation/hwmon/adt7462.rst
> diff --git a/Documentation/hwmon/adt7470 b/Documentation/hwmon/adt7470.rst
> similarity index 100%
> rename from Documentation/hwmon/adt7470
> rename to Documentation/hwmon/adt7470.rst
> diff --git a/Documentation/hwmon/adt7475 b/Documentation/hwmon/adt7475.rst
> similarity index 100%
> rename from Documentation/hwmon/adt7475
> rename to Documentation/hwmon/adt7475.rst
> diff --git a/Documentation/hwmon/amc6821 b/Documentation/hwmon/amc6821.rst
> similarity index 100%
> rename from Documentation/hwmon/amc6821
> rename to Documentation/hwmon/amc6821.rst
> diff --git a/Documentation/hwmon/asb100 b/Documentation/hwmon/asb100.rst
> similarity index 100%
> rename from Documentation/hwmon/asb100
> rename to Documentation/hwmon/asb100.rst
> diff --git a/Documentation/hwmon/asc7621 b/Documentation/hwmon/asc7621.rst
> similarity index 100%
> rename from Documentation/hwmon/asc7621
> rename to Documentation/hwmon/asc7621.rst
> diff --git a/Documentation/hwmon/aspeed-pwm-tacho b/Documentation/hwmon/aspeed-pwm-tacho.rst
> similarity index 100%
> rename from Documentation/hwmon/aspeed-pwm-tacho
> rename to Documentation/hwmon/aspeed-pwm-tacho.rst
> diff --git a/Documentation/hwmon/coretemp b/Documentation/hwmon/coretemp.rst
> similarity index 100%
> rename from Documentation/hwmon/coretemp
> rename to Documentation/hwmon/coretemp.rst
> diff --git a/Documentation/hwmon/da9052 b/Documentation/hwmon/da9052.rst
> similarity index 100%
> rename from Documentation/hwmon/da9052
> rename to Documentation/hwmon/da9052.rst
> diff --git a/Documentation/hwmon/da9055 b/Documentation/hwmon/da9055.rst
> similarity index 100%
> rename from Documentation/hwmon/da9055
> rename to Documentation/hwmon/da9055.rst
> diff --git a/Documentation/hwmon/dme1737 b/Documentation/hwmon/dme1737.rst
> similarity index 100%
> rename from Documentation/hwmon/dme1737
> rename to Documentation/hwmon/dme1737.rst
> diff --git a/Documentation/hwmon/ds1621 b/Documentation/hwmon/ds1621.rst
> similarity index 100%
> rename from Documentation/hwmon/ds1621
> rename to Documentation/hwmon/ds1621.rst
> diff --git a/Documentation/hwmon/ds620 b/Documentation/hwmon/ds620.rst
> similarity index 100%
> rename from Documentation/hwmon/ds620
> rename to Documentation/hwmon/ds620.rst
> diff --git a/Documentation/hwmon/emc1403 b/Documentation/hwmon/emc1403.rst
> similarity index 100%
> rename from Documentation/hwmon/emc1403
> rename to Documentation/hwmon/emc1403.rst
> diff --git a/Documentation/hwmon/emc2103 b/Documentation/hwmon/emc2103.rst
> similarity index 100%
> rename from Documentation/hwmon/emc2103
> rename to Documentation/hwmon/emc2103.rst
> diff --git a/Documentation/hwmon/emc6w201 b/Documentation/hwmon/emc6w201.rst
> similarity index 100%
> rename from Documentation/hwmon/emc6w201
> rename to Documentation/hwmon/emc6w201.rst
> diff --git a/Documentation/hwmon/f71805f b/Documentation/hwmon/f71805f.rst
> similarity index 100%
> rename from Documentation/hwmon/f71805f
> rename to Documentation/hwmon/f71805f.rst
> diff --git a/Documentation/hwmon/f71882fg b/Documentation/hwmon/f71882fg.rst
> similarity index 100%
> rename from Documentation/hwmon/f71882fg
> rename to Documentation/hwmon/f71882fg.rst
> diff --git a/Documentation/hwmon/fam15h_power b/Documentation/hwmon/fam15h_power.rst
> similarity index 100%
> rename from Documentation/hwmon/fam15h_power
> rename to Documentation/hwmon/fam15h_power.rst
> diff --git a/Documentation/hwmon/ftsteutates b/Documentation/hwmon/ftsteutates.rst
> similarity index 100%
> rename from Documentation/hwmon/ftsteutates
> rename to Documentation/hwmon/ftsteutates.rst
> diff --git a/Documentation/hwmon/g760a b/Documentation/hwmon/g760a.rst
> similarity index 100%
> rename from Documentation/hwmon/g760a
> rename to Documentation/hwmon/g760a.rst
> diff --git a/Documentation/hwmon/g762 b/Documentation/hwmon/g762.rst
> similarity index 97%
> rename from Documentation/hwmon/g762
> rename to Documentation/hwmon/g762.rst
> index 54574e26df21..0371b3365c48 100644
> --- a/Documentation/hwmon/g762
> +++ b/Documentation/hwmon/g762.rst
> @@ -7,7 +7,7 @@ modes - PWM or DC - are supported by the device.
>  
>  For additional information, a detailed datasheet is available at
>  http://natisbad.org/NAS/ref/GMT_EDS-762_763-080710-0.2.pdf. sysfs
> -bindings are described in Documentation/hwmon/sysfs-interface.
> +bindings are described in Documentation/hwmon/sysfs-interface.rst.
>  
>  The following entries are available to the user in a subdirectory of
>  /sys/bus/i2c/drivers/g762/ to control the operation of the device.
> diff --git a/Documentation/hwmon/gl518sm b/Documentation/hwmon/gl518sm.rst
> similarity index 100%
> rename from Documentation/hwmon/gl518sm
> rename to Documentation/hwmon/gl518sm.rst
> diff --git a/Documentation/hwmon/hih6130 b/Documentation/hwmon/hih6130.rst
> similarity index 100%
> rename from Documentation/hwmon/hih6130
> rename to Documentation/hwmon/hih6130.rst
> diff --git a/Documentation/hwmon/hwmon-kernel-api.txt b/Documentation/hwmon/hwmon-kernel-api.rst
> similarity index 99%
> rename from Documentation/hwmon/hwmon-kernel-api.txt
> rename to Documentation/hwmon/hwmon-kernel-api.rst
> index b56343f5c2c4..5766bee64153 100644
> --- a/Documentation/hwmon/hwmon-kernel-api.txt
> +++ b/Documentation/hwmon/hwmon-kernel-api.rst
> @@ -12,10 +12,10 @@ drivers that want to use the hardware monitoring framework.
>  This document does not describe what a hardware monitoring (hwmon) Driver or
>  Device is. It also does not describe the API which can be used by user space
>  to communicate with a hardware monitoring device. If you want to know this
> -then please read the following file: Documentation/hwmon/sysfs-interface.
> +then please read the following file: Documentation/hwmon/sysfs-interface.rst.
>  
>  For additional guidelines on how to write and improve hwmon drivers, please
> -also read Documentation/hwmon/submitting-patches.
> +also read Documentation/hwmon/submitting-patches.rst.
>  
>  The API
>  -------
> diff --git a/Documentation/hwmon/ibm-cffps b/Documentation/hwmon/ibm-cffps.rst
> similarity index 100%
> rename from Documentation/hwmon/ibm-cffps
> rename to Documentation/hwmon/ibm-cffps.rst
> diff --git a/Documentation/hwmon/ibmaem b/Documentation/hwmon/ibmaem.rst
> similarity index 100%
> rename from Documentation/hwmon/ibmaem
> rename to Documentation/hwmon/ibmaem.rst
> diff --git a/Documentation/hwmon/ibmpowernv b/Documentation/hwmon/ibmpowernv.rst
> similarity index 100%
> rename from Documentation/hwmon/ibmpowernv
> rename to Documentation/hwmon/ibmpowernv.rst
> diff --git a/Documentation/hwmon/ina209 b/Documentation/hwmon/ina209.rst
> similarity index 100%
> rename from Documentation/hwmon/ina209
> rename to Documentation/hwmon/ina209.rst
> diff --git a/Documentation/hwmon/ina2xx b/Documentation/hwmon/ina2xx.rst
> similarity index 97%
> rename from Documentation/hwmon/ina2xx
> rename to Documentation/hwmon/ina2xx.rst
> index 95badf9c396f..94b9a260c518 100644
> --- a/Documentation/hwmon/ina2xx
> +++ b/Documentation/hwmon/ina2xx.rst
> @@ -78,7 +78,7 @@ refer to the Documentation/devicetree/bindings/hwmon/ina2xx.txt for bindings
>  if the device tree is used.
>  
>  Additionally ina226 supports update_interval attribute as described in
> -Documentation/hwmon/sysfs-interface. Internally the interval is the sum of
> +Documentation/hwmon/sysfs-interface.rst. Internally the interval is the sum of
>  bus and shunt voltage conversion times multiplied by the averaging rate. We
>  don't touch the conversion times and only modify the number of averages. The
>  lower limit of the update_interval is 2 ms, the upper limit is 2253 ms.
> diff --git a/Documentation/hwmon/ina3221 b/Documentation/hwmon/ina3221.rst
> similarity index 100%
> rename from Documentation/hwmon/ina3221
> rename to Documentation/hwmon/ina3221.rst
> diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
> new file mode 100644
> index 000000000000..893804414510
> --- /dev/null
> +++ b/Documentation/hwmon/index.rst
> @@ -0,0 +1,179 @@
> +=========================
> +Linux Hardware Monitoring
> +=========================
> +
> +.. toctree::
> +   :maxdepth: 1
> +
> +   hwmon-kernel-api.rst
> +   pmbus-core.rst
> +   submitting-patches.rst
> +   sysfs-interface.rst
> +   userspace-tools.rst
> +
> +Hardware Monitoring Kernel Drivers
> +==================================
> +
> +.. toctree::
> +   :maxdepth: 1
> +
> +   ab8500.rst
> +   abituguru.rst
> +   abituguru3.rst
> +   abx500.rst
> +   acpi_power_meter.rst
> +   ad7314.rst
> +   adc128d818.rst
> +   adm1021.rst
> +   adm1025.rst
> +   adm1026.rst
> +   adm1031.rst
> +   adm1275.rst
> +   adm9240.rst
> +   ads1015.rst
> +   ads7828.rst
> +   adt7410.rst
> +   adt7411.rst
> +   adt7462.rst
> +   adt7470.rst
> +   adt7475.rst
> +   amc6821.rst
> +   asb100.rst
> +   asc7621.rst
> +   aspeed-pwm-tacho.rst
> +   coretemp.rst
> +   da9052.rst
> +   da9055.rst
> +   dme1737.rst
> +   ds1621.rst
> +   ds620.rst
> +   emc1403.rst
> +   emc2103.rst
> +   emc6w201.rst
> +   f71805f.rst
> +   f71882fg.rst
> +   fam15h_power.rst
> +   ftsteutates.rst
> +   g760a.rst
> +   g762.rst
> +   gl518sm.rst
> +   hih6130.rst
> +   ibmaem.rst
> +   ibm-cffps.rst
> +   ibmpowernv.rst
> +   ina209.rst
> +   ina2xx.rst
> +   ina3221.rst
> +   ir35221.rst
> +   it87.rst
> +   jc42.rst
> +   k10temp.rst
> +   k8temp.rst
> +   lineage-pem.rst
> +   lm25066.rst
> +   lm63.rst
> +   lm70.rst
> +   lm73.rst
> +   lm75.rst
> +   lm77.rst
> +   lm78.rst
> +   lm80.rst
> +   lm83.rst
> +   lm85.rst
> +   lm87.rst
> +   lm90.rst
> +   lm92.rst
> +   lm93.rst
> +   lm95234.rst
> +   lm95245.rst
> +   ltc2945.rst
> +   ltc2978.rst
> +   ltc2990.rst
> +   ltc3815.rst
> +   ltc4151.rst
> +   ltc4215.rst
> +   ltc4245.rst
> +   ltc4260.rst
> +   ltc4261.rst
> +   max16064.rst
> +   max16065.rst
> +   max1619.rst
> +   max1668.rst
> +   max197.rst
> +   max20751.rst
> +   max31722.rst
> +   max31785.rst
> +   max31790.rst
> +   max34440.rst
> +   max6639.rst
> +   max6642.rst
> +   max6650.rst
> +   max6697.rst
> +   max8688.rst
> +   mc13783-adc.rst
> +   mcp3021.rst
> +   menf21bmc.rst
> +   mlxreg-fan.rst
> +   nct6683.rst
> +   nct6775.rst
> +   nct7802.rst
> +   nct7904.rst
> +   npcm750-pwm-fan.rst
> +   nsa320.rst
> +   ntc_thermistor.rst
> +   occ.rst
> +   pc87360.rst
> +   pc87427.rst
> +   pcf8591.rst
> +   pmbus.rst
> +   powr1220.rst
> +   pwm-fan.rst
> +   raspberrypi-hwmon.rst
> +   sch5627.rst
> +   sch5636.rst
> +   scpi-hwmon.rst
> +   sht15.rst
> +   sht21.rst
> +   sht3x.rst
> +   shtc1.rst
> +   sis5595.rst
> +   smm665.rst
> +   smsc47b397.rst
> +   smsc47m192.rst
> +   smsc47m1.rst
> +   tc654.rst
> +   tc74.rst
> +   thmc50.rst
> +   tmp102.rst
> +   tmp103.rst
> +   tmp108.rst
> +   tmp401.rst
> +   tmp421.rst
> +   tps40422.rst
> +   twl4030-madc-hwmon.rst
> +   ucd9000.rst
> +   ucd9200.rst
> +   vexpress.rst
> +   via686a.rst
> +   vt1211.rst
> +   w83627ehf.rst
> +   w83627hf.rst
> +   w83773g.rst
> +   w83781d.rst
> +   w83791d.rst
> +   w83792d.rst
> +   w83793.rst
> +   w83795.rst
> +   w83l785ts.rst
> +   w83l786ng.rst
> +   wm831x.rst
> +   wm8350.rst
> +   xgene-hwmon.rst
> +   zl6100.rst
> +
> +.. only::  subproject and html
> +
> +   Indices
> +   =======
> +
> +   * :ref:`genindex`
> diff --git a/Documentation/hwmon/ir35221 b/Documentation/hwmon/ir35221.rst
> similarity index 100%
> rename from Documentation/hwmon/ir35221
> rename to Documentation/hwmon/ir35221.rst
> diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87.rst
> similarity index 100%
> rename from Documentation/hwmon/it87
> rename to Documentation/hwmon/it87.rst
> diff --git a/Documentation/hwmon/jc42 b/Documentation/hwmon/jc42.rst
> similarity index 100%
> rename from Documentation/hwmon/jc42
> rename to Documentation/hwmon/jc42.rst
> diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp.rst
> similarity index 100%
> rename from Documentation/hwmon/k10temp
> rename to Documentation/hwmon/k10temp.rst
> diff --git a/Documentation/hwmon/k8temp b/Documentation/hwmon/k8temp.rst
> similarity index 100%
> rename from Documentation/hwmon/k8temp
> rename to Documentation/hwmon/k8temp.rst
> diff --git a/Documentation/hwmon/lineage-pem b/Documentation/hwmon/lineage-pem.rst
> similarity index 100%
> rename from Documentation/hwmon/lineage-pem
> rename to Documentation/hwmon/lineage-pem.rst
> diff --git a/Documentation/hwmon/lm25066 b/Documentation/hwmon/lm25066.rst
> similarity index 97%
> rename from Documentation/hwmon/lm25066
> rename to Documentation/hwmon/lm25066.rst
> index 60b7f2722931..da15e3094c8c 100644
> --- a/Documentation/hwmon/lm25066
> +++ b/Documentation/hwmon/lm25066.rst
> @@ -69,7 +69,7 @@ LM25066, LM5064, and LM5066/LM5066I Power Management, Monitoring,
>  Control, and Protection ICs.
>  
>  The driver is a client driver to the core PMBus driver. Please see
> -Documentation/hwmon/pmbus for details on PMBus client drivers.
> +Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
>  
>  
>  Usage Notes
> diff --git a/Documentation/hwmon/lm63 b/Documentation/hwmon/lm63.rst
> similarity index 100%
> rename from Documentation/hwmon/lm63
> rename to Documentation/hwmon/lm63.rst
> diff --git a/Documentation/hwmon/lm70 b/Documentation/hwmon/lm70.rst
> similarity index 100%
> rename from Documentation/hwmon/lm70
> rename to Documentation/hwmon/lm70.rst
> diff --git a/Documentation/hwmon/lm73 b/Documentation/hwmon/lm73.rst
> similarity index 100%
> rename from Documentation/hwmon/lm73
> rename to Documentation/hwmon/lm73.rst
> diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75.rst
> similarity index 100%
> rename from Documentation/hwmon/lm75
> rename to Documentation/hwmon/lm75.rst
> diff --git a/Documentation/hwmon/lm77 b/Documentation/hwmon/lm77.rst
> similarity index 100%
> rename from Documentation/hwmon/lm77
> rename to Documentation/hwmon/lm77.rst
> diff --git a/Documentation/hwmon/lm78 b/Documentation/hwmon/lm78.rst
> similarity index 100%
> rename from Documentation/hwmon/lm78
> rename to Documentation/hwmon/lm78.rst
> diff --git a/Documentation/hwmon/lm80 b/Documentation/hwmon/lm80.rst
> similarity index 100%
> rename from Documentation/hwmon/lm80
> rename to Documentation/hwmon/lm80.rst
> diff --git a/Documentation/hwmon/lm83 b/Documentation/hwmon/lm83.rst
> similarity index 100%
> rename from Documentation/hwmon/lm83
> rename to Documentation/hwmon/lm83.rst
> diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85.rst
> similarity index 100%
> rename from Documentation/hwmon/lm85
> rename to Documentation/hwmon/lm85.rst
> diff --git a/Documentation/hwmon/lm87 b/Documentation/hwmon/lm87.rst
> similarity index 100%
> rename from Documentation/hwmon/lm87
> rename to Documentation/hwmon/lm87.rst
> diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90.rst
> similarity index 100%
> rename from Documentation/hwmon/lm90
> rename to Documentation/hwmon/lm90.rst
> diff --git a/Documentation/hwmon/lm92 b/Documentation/hwmon/lm92.rst
> similarity index 100%
> rename from Documentation/hwmon/lm92
> rename to Documentation/hwmon/lm92.rst
> diff --git a/Documentation/hwmon/lm93 b/Documentation/hwmon/lm93.rst
> similarity index 100%
> rename from Documentation/hwmon/lm93
> rename to Documentation/hwmon/lm93.rst
> diff --git a/Documentation/hwmon/lm95234 b/Documentation/hwmon/lm95234.rst
> similarity index 100%
> rename from Documentation/hwmon/lm95234
> rename to Documentation/hwmon/lm95234.rst
> diff --git a/Documentation/hwmon/lm95245 b/Documentation/hwmon/lm95245.rst
> similarity index 100%
> rename from Documentation/hwmon/lm95245
> rename to Documentation/hwmon/lm95245.rst
> diff --git a/Documentation/hwmon/ltc2945 b/Documentation/hwmon/ltc2945.rst
> similarity index 100%
> rename from Documentation/hwmon/ltc2945
> rename to Documentation/hwmon/ltc2945.rst
> diff --git a/Documentation/hwmon/ltc2978 b/Documentation/hwmon/ltc2978.rst
> similarity index 100%
> rename from Documentation/hwmon/ltc2978
> rename to Documentation/hwmon/ltc2978.rst
> diff --git a/Documentation/hwmon/ltc2990 b/Documentation/hwmon/ltc2990.rst
> similarity index 100%
> rename from Documentation/hwmon/ltc2990
> rename to Documentation/hwmon/ltc2990.rst
> diff --git a/Documentation/hwmon/ltc3815 b/Documentation/hwmon/ltc3815.rst
> similarity index 100%
> rename from Documentation/hwmon/ltc3815
> rename to Documentation/hwmon/ltc3815.rst
> diff --git a/Documentation/hwmon/ltc4151 b/Documentation/hwmon/ltc4151.rst
> similarity index 100%
> rename from Documentation/hwmon/ltc4151
> rename to Documentation/hwmon/ltc4151.rst
> diff --git a/Documentation/hwmon/ltc4215 b/Documentation/hwmon/ltc4215.rst
> similarity index 100%
> rename from Documentation/hwmon/ltc4215
> rename to Documentation/hwmon/ltc4215.rst
> diff --git a/Documentation/hwmon/ltc4245 b/Documentation/hwmon/ltc4245.rst
> similarity index 100%
> rename from Documentation/hwmon/ltc4245
> rename to Documentation/hwmon/ltc4245.rst
> diff --git a/Documentation/hwmon/ltc4260 b/Documentation/hwmon/ltc4260.rst
> similarity index 100%
> rename from Documentation/hwmon/ltc4260
> rename to Documentation/hwmon/ltc4260.rst
> diff --git a/Documentation/hwmon/ltc4261 b/Documentation/hwmon/ltc4261.rst
> similarity index 100%
> rename from Documentation/hwmon/ltc4261
> rename to Documentation/hwmon/ltc4261.rst
> diff --git a/Documentation/hwmon/max16064 b/Documentation/hwmon/max16064.rst
> similarity index 96%
> rename from Documentation/hwmon/max16064
> rename to Documentation/hwmon/max16064.rst
> index 61ec679dc477..6d5e9538991f 100644
> --- a/Documentation/hwmon/max16064
> +++ b/Documentation/hwmon/max16064.rst
> @@ -21,7 +21,7 @@ This driver supports hardware monitoring for Maxim MAX16064 Quad Power-Supply
>  Controller with Active-Voltage Output Control and PMBus Interface.
>  
>  The driver is a client driver to the core PMBus driver.
> -Please see Documentation/hwmon/pmbus for details on PMBus client drivers.
> +Please see Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
>  
>  
>  Usage Notes
> diff --git a/Documentation/hwmon/max16065 b/Documentation/hwmon/max16065.rst
> similarity index 100%
> rename from Documentation/hwmon/max16065
> rename to Documentation/hwmon/max16065.rst
> diff --git a/Documentation/hwmon/max1619 b/Documentation/hwmon/max1619.rst
> similarity index 100%
> rename from Documentation/hwmon/max1619
> rename to Documentation/hwmon/max1619.rst
> diff --git a/Documentation/hwmon/max1668 b/Documentation/hwmon/max1668.rst
> similarity index 100%
> rename from Documentation/hwmon/max1668
> rename to Documentation/hwmon/max1668.rst
> diff --git a/Documentation/hwmon/max197 b/Documentation/hwmon/max197.rst
> similarity index 100%
> rename from Documentation/hwmon/max197
> rename to Documentation/hwmon/max197.rst
> diff --git a/Documentation/hwmon/max20751 b/Documentation/hwmon/max20751.rst
> similarity index 96%
> rename from Documentation/hwmon/max20751
> rename to Documentation/hwmon/max20751.rst
> index d546695900ef..aa4469be6674 100644
> --- a/Documentation/hwmon/max20751
> +++ b/Documentation/hwmon/max20751.rst
> @@ -23,7 +23,7 @@ This driver supports MAX20751 Multiphase Master with PMBus Interface
>  and Internal Buck Converter.
>  
>  The driver is a client driver to the core PMBus driver.
> -Please see Documentation/hwmon/pmbus for details on PMBus client drivers.
> +Please see Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
>  
>  
>  Usage Notes
> diff --git a/Documentation/hwmon/max31722 b/Documentation/hwmon/max31722.rst
> similarity index 100%
> rename from Documentation/hwmon/max31722
> rename to Documentation/hwmon/max31722.rst
> diff --git a/Documentation/hwmon/max31785 b/Documentation/hwmon/max31785.rst
> similarity index 100%
> rename from Documentation/hwmon/max31785
> rename to Documentation/hwmon/max31785.rst
> diff --git a/Documentation/hwmon/max31790 b/Documentation/hwmon/max31790.rst
> similarity index 100%
> rename from Documentation/hwmon/max31790
> rename to Documentation/hwmon/max31790.rst
> diff --git a/Documentation/hwmon/max34440 b/Documentation/hwmon/max34440.rst
> similarity index 98%
> rename from Documentation/hwmon/max34440
> rename to Documentation/hwmon/max34440.rst
> index 639838ef29fd..939138e12b02 100644
> --- a/Documentation/hwmon/max34440
> +++ b/Documentation/hwmon/max34440.rst
> @@ -76,7 +76,7 @@ based on GIN pins. The MAX34460 supports 12 voltage channels, and the MAX34461
>  supports 16 voltage channels.
>  
>  The driver is a client driver to the core PMBus driver. Please see
> -Documentation/hwmon/pmbus for details on PMBus client drivers.
> +Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
>  
>  
>  Usage Notes
> diff --git a/Documentation/hwmon/max6639 b/Documentation/hwmon/max6639.rst
> similarity index 100%
> rename from Documentation/hwmon/max6639
> rename to Documentation/hwmon/max6639.rst
> diff --git a/Documentation/hwmon/max6642 b/Documentation/hwmon/max6642.rst
> similarity index 100%
> rename from Documentation/hwmon/max6642
> rename to Documentation/hwmon/max6642.rst
> diff --git a/Documentation/hwmon/max6650 b/Documentation/hwmon/max6650.rst
> similarity index 100%
> rename from Documentation/hwmon/max6650
> rename to Documentation/hwmon/max6650.rst
> diff --git a/Documentation/hwmon/max6697 b/Documentation/hwmon/max6697.rst
> similarity index 100%
> rename from Documentation/hwmon/max6697
> rename to Documentation/hwmon/max6697.rst
> diff --git a/Documentation/hwmon/max8688 b/Documentation/hwmon/max8688.rst
> similarity index 97%
> rename from Documentation/hwmon/max8688
> rename to Documentation/hwmon/max8688.rst
> index 43da139234c1..009487759c61 100644
> --- a/Documentation/hwmon/max8688
> +++ b/Documentation/hwmon/max8688.rst
> @@ -21,7 +21,7 @@ This driver supports hardware monitoring for Maxim MAX8688 Digital Power-Supply
>  Controller/Monitor with PMBus Interface.
>  
>  The driver is a client driver to the core PMBus driver. Please see
> -Documentation/hwmon/pmbus for details on PMBus client drivers.
> +Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
>  
>  
>  Usage Notes
> diff --git a/Documentation/hwmon/mc13783-adc b/Documentation/hwmon/mc13783-adc.rst
> similarity index 100%
> rename from Documentation/hwmon/mc13783-adc
> rename to Documentation/hwmon/mc13783-adc.rst
> diff --git a/Documentation/hwmon/mcp3021 b/Documentation/hwmon/mcp3021.rst
> similarity index 100%
> rename from Documentation/hwmon/mcp3021
> rename to Documentation/hwmon/mcp3021.rst
> diff --git a/Documentation/hwmon/menf21bmc b/Documentation/hwmon/menf21bmc.rst
> similarity index 100%
> rename from Documentation/hwmon/menf21bmc
> rename to Documentation/hwmon/menf21bmc.rst
> diff --git a/Documentation/hwmon/mlxreg-fan b/Documentation/hwmon/mlxreg-fan.rst
> similarity index 100%
> rename from Documentation/hwmon/mlxreg-fan
> rename to Documentation/hwmon/mlxreg-fan.rst
> diff --git a/Documentation/hwmon/nct6683 b/Documentation/hwmon/nct6683.rst
> similarity index 100%
> rename from Documentation/hwmon/nct6683
> rename to Documentation/hwmon/nct6683.rst
> diff --git a/Documentation/hwmon/nct6775 b/Documentation/hwmon/nct6775.rst
> similarity index 100%
> rename from Documentation/hwmon/nct6775
> rename to Documentation/hwmon/nct6775.rst
> diff --git a/Documentation/hwmon/nct7802 b/Documentation/hwmon/nct7802.rst
> similarity index 100%
> rename from Documentation/hwmon/nct7802
> rename to Documentation/hwmon/nct7802.rst
> diff --git a/Documentation/hwmon/nct7904 b/Documentation/hwmon/nct7904.rst
> similarity index 100%
> rename from Documentation/hwmon/nct7904
> rename to Documentation/hwmon/nct7904.rst
> diff --git a/Documentation/hwmon/npcm750-pwm-fan b/Documentation/hwmon/npcm750-pwm-fan.rst
> similarity index 100%
> rename from Documentation/hwmon/npcm750-pwm-fan
> rename to Documentation/hwmon/npcm750-pwm-fan.rst
> diff --git a/Documentation/hwmon/nsa320 b/Documentation/hwmon/nsa320.rst
> similarity index 100%
> rename from Documentation/hwmon/nsa320
> rename to Documentation/hwmon/nsa320.rst
> diff --git a/Documentation/hwmon/ntc_thermistor b/Documentation/hwmon/ntc_thermistor.rst
> similarity index 100%
> rename from Documentation/hwmon/ntc_thermistor
> rename to Documentation/hwmon/ntc_thermistor.rst
> diff --git a/Documentation/hwmon/occ b/Documentation/hwmon/occ.rst
> similarity index 100%
> rename from Documentation/hwmon/occ
> rename to Documentation/hwmon/occ.rst
> diff --git a/Documentation/hwmon/pc87360 b/Documentation/hwmon/pc87360.rst
> similarity index 100%
> rename from Documentation/hwmon/pc87360
> rename to Documentation/hwmon/pc87360.rst
> diff --git a/Documentation/hwmon/pc87427 b/Documentation/hwmon/pc87427.rst
> similarity index 100%
> rename from Documentation/hwmon/pc87427
> rename to Documentation/hwmon/pc87427.rst
> diff --git a/Documentation/hwmon/pcf8591 b/Documentation/hwmon/pcf8591.rst
> similarity index 100%
> rename from Documentation/hwmon/pcf8591
> rename to Documentation/hwmon/pcf8591.rst
> diff --git a/Documentation/hwmon/pmbus-core b/Documentation/hwmon/pmbus-core.rst
> similarity index 100%
> rename from Documentation/hwmon/pmbus-core
> rename to Documentation/hwmon/pmbus-core.rst
> diff --git a/Documentation/hwmon/pmbus b/Documentation/hwmon/pmbus.rst
> similarity index 100%
> rename from Documentation/hwmon/pmbus
> rename to Documentation/hwmon/pmbus.rst
> diff --git a/Documentation/hwmon/powr1220 b/Documentation/hwmon/powr1220.rst
> similarity index 100%
> rename from Documentation/hwmon/powr1220
> rename to Documentation/hwmon/powr1220.rst
> diff --git a/Documentation/hwmon/pwm-fan b/Documentation/hwmon/pwm-fan.rst
> similarity index 100%
> rename from Documentation/hwmon/pwm-fan
> rename to Documentation/hwmon/pwm-fan.rst
> diff --git a/Documentation/hwmon/raspberrypi-hwmon b/Documentation/hwmon/raspberrypi-hwmon.rst
> similarity index 100%
> rename from Documentation/hwmon/raspberrypi-hwmon
> rename to Documentation/hwmon/raspberrypi-hwmon.rst
> diff --git a/Documentation/hwmon/sch5627 b/Documentation/hwmon/sch5627.rst
> similarity index 100%
> rename from Documentation/hwmon/sch5627
> rename to Documentation/hwmon/sch5627.rst
> diff --git a/Documentation/hwmon/sch5636 b/Documentation/hwmon/sch5636.rst
> similarity index 100%
> rename from Documentation/hwmon/sch5636
> rename to Documentation/hwmon/sch5636.rst
> diff --git a/Documentation/hwmon/scpi-hwmon b/Documentation/hwmon/scpi-hwmon.rst
> similarity index 100%
> rename from Documentation/hwmon/scpi-hwmon
> rename to Documentation/hwmon/scpi-hwmon.rst
> diff --git a/Documentation/hwmon/sht15 b/Documentation/hwmon/sht15.rst
> similarity index 100%
> rename from Documentation/hwmon/sht15
> rename to Documentation/hwmon/sht15.rst
> diff --git a/Documentation/hwmon/sht21 b/Documentation/hwmon/sht21.rst
> similarity index 100%
> rename from Documentation/hwmon/sht21
> rename to Documentation/hwmon/sht21.rst
> diff --git a/Documentation/hwmon/sht3x b/Documentation/hwmon/sht3x.rst
> similarity index 100%
> rename from Documentation/hwmon/sht3x
> rename to Documentation/hwmon/sht3x.rst
> diff --git a/Documentation/hwmon/shtc1 b/Documentation/hwmon/shtc1.rst
> similarity index 100%
> rename from Documentation/hwmon/shtc1
> rename to Documentation/hwmon/shtc1.rst
> diff --git a/Documentation/hwmon/sis5595 b/Documentation/hwmon/sis5595.rst
> similarity index 100%
> rename from Documentation/hwmon/sis5595
> rename to Documentation/hwmon/sis5595.rst
> diff --git a/Documentation/hwmon/smm665 b/Documentation/hwmon/smm665.rst
> similarity index 100%
> rename from Documentation/hwmon/smm665
> rename to Documentation/hwmon/smm665.rst
> diff --git a/Documentation/hwmon/smsc47b397 b/Documentation/hwmon/smsc47b397.rst
> similarity index 100%
> rename from Documentation/hwmon/smsc47b397
> rename to Documentation/hwmon/smsc47b397.rst
> diff --git a/Documentation/hwmon/smsc47m1 b/Documentation/hwmon/smsc47m1.rst
> similarity index 100%
> rename from Documentation/hwmon/smsc47m1
> rename to Documentation/hwmon/smsc47m1.rst
> diff --git a/Documentation/hwmon/smsc47m192 b/Documentation/hwmon/smsc47m192.rst
> similarity index 100%
> rename from Documentation/hwmon/smsc47m192
> rename to Documentation/hwmon/smsc47m192.rst
> diff --git a/Documentation/hwmon/submitting-patches b/Documentation/hwmon/submitting-patches.rst
> similarity index 98%
> rename from Documentation/hwmon/submitting-patches
> rename to Documentation/hwmon/submitting-patches.rst
> index 12540b7d9b50..f9796b9d9db6 100644
> --- a/Documentation/hwmon/submitting-patches
> +++ b/Documentation/hwmon/submitting-patches.rst
> @@ -39,7 +39,7 @@ increase the chances of your change being accepted.
>  2. Adding functionality to existing drivers
>  -------------------------------------------
>  
> -* Make sure the documentation in Documentation/hwmon/<driver_name> is up to
> +* Make sure the documentation in Documentation/hwmon/<driver_name>.rst is up to
>    date.
>  
>  * Make sure the information in Kconfig is up to date.
> @@ -61,7 +61,7 @@ increase the chances of your change being accepted.
>  
>  * Consider adding yourself to MAINTAINERS.
>  
> -* Document the driver in Documentation/hwmon/<driver_name>.
> +* Document the driver in Documentation/hwmon/<driver_name>.rst.
>  
>  * Add the driver to Kconfig and Makefile in alphabetical order.
>  
> @@ -134,7 +134,7 @@ increase the chances of your change being accepted.
>    non-standard attributes, or you believe you do, discuss it on the mailing list
>    first. Either case, provide a detailed explanation why you need the
>    non-standard attribute(s).
> -  Standard attributes are specified in Documentation/hwmon/sysfs-interface.
> +  Standard attributes are specified in Documentation/hwmon/sysfs-interface.rst.
>  
>  * When deciding which sysfs attributes to support, look at the chip's
>    capabilities. While we do not expect your driver to support everything the
> diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface.rst
> similarity index 100%
> rename from Documentation/hwmon/sysfs-interface
> rename to Documentation/hwmon/sysfs-interface.rst
> diff --git a/Documentation/hwmon/tc654 b/Documentation/hwmon/tc654.rst
> similarity index 100%
> rename from Documentation/hwmon/tc654
> rename to Documentation/hwmon/tc654.rst
> diff --git a/Documentation/hwmon/tc74 b/Documentation/hwmon/tc74.rst
> similarity index 100%
> rename from Documentation/hwmon/tc74
> rename to Documentation/hwmon/tc74.rst
> diff --git a/Documentation/hwmon/thmc50 b/Documentation/hwmon/thmc50.rst
> similarity index 100%
> rename from Documentation/hwmon/thmc50
> rename to Documentation/hwmon/thmc50.rst
> diff --git a/Documentation/hwmon/tmp102 b/Documentation/hwmon/tmp102.rst
> similarity index 93%
> rename from Documentation/hwmon/tmp102
> rename to Documentation/hwmon/tmp102.rst
> index 5e34821df4ab..b1f585531a88 100644
> --- a/Documentation/hwmon/tmp102
> +++ b/Documentation/hwmon/tmp102.rst
> @@ -28,4 +28,4 @@ The TMP102 has a programmable update rate that can select between 8, 4, 1, and
>  0.5 Hz. (Currently the driver only supports the default of 4 Hz).
>  
>  The driver provides the common sysfs-interface for temperatures (see
> -Documentation/hwmon/sysfs-interface under Temperatures).
> +Documentation/hwmon/sysfs-interface.rst under Temperatures).
> diff --git a/Documentation/hwmon/tmp103 b/Documentation/hwmon/tmp103.rst
> similarity index 92%
> rename from Documentation/hwmon/tmp103
> rename to Documentation/hwmon/tmp103.rst
> index 7682a795e38c..15d25806d585 100644
> --- a/Documentation/hwmon/tmp103
> +++ b/Documentation/hwmon/tmp103.rst
> @@ -27,7 +27,7 @@ Resolution: 8 Bits
>  Accuracy: ±1°C Typ (–10°C to +100°C)
>  
>  The driver provides the common sysfs-interface for temperatures (see
> -Documentation/hwmon/sysfs-interface under Temperatures).
> +Documentation/hwmon/sysfs-interface.rst under Temperatures).
>  
>  Please refer how to instantiate this driver:
>  Documentation/i2c/instantiating-devices
> diff --git a/Documentation/hwmon/tmp108 b/Documentation/hwmon/tmp108.rst
> similarity index 95%
> rename from Documentation/hwmon/tmp108
> rename to Documentation/hwmon/tmp108.rst
> index 7e08b7ef1e2f..5f4266a16cb2 100644
> --- a/Documentation/hwmon/tmp108
> +++ b/Documentation/hwmon/tmp108.rst
> @@ -38,4 +38,4 @@ and then the device is shut down automatically. (This driver only supports
>  continuous mode.)
>  
>  The driver provides the common sysfs-interface for temperatures (see
> -Documentation/hwmon/sysfs-interface under Temperatures).
> +Documentation/hwmon/sysfs-interface.rst under Temperatures).
> diff --git a/Documentation/hwmon/tmp401 b/Documentation/hwmon/tmp401.rst
> similarity index 97%
> rename from Documentation/hwmon/tmp401
> rename to Documentation/hwmon/tmp401.rst
> index bd865bbdb38d..6a05a0719bc7 100644
> --- a/Documentation/hwmon/tmp401
> +++ b/Documentation/hwmon/tmp401.rst
> @@ -68,7 +68,7 @@ supported by the driver so far, so using the default resolution of 0.5
>  degree).
>  
>  The driver provides the common sysfs-interface for temperatures (see
> -Documentation/hwmon/sysfs-interface under Temperatures).
> +Documentation/hwmon/sysfs-interface.rst under Temperatures).
>  
>  The TMP411 and TMP431 chips are compatible with TMP401. TMP411 provides
>  some additional features.
> diff --git a/Documentation/hwmon/tmp421 b/Documentation/hwmon/tmp421.rst
> similarity index 100%
> rename from Documentation/hwmon/tmp421
> rename to Documentation/hwmon/tmp421.rst
> diff --git a/Documentation/hwmon/tps40422 b/Documentation/hwmon/tps40422.rst
> similarity index 96%
> rename from Documentation/hwmon/tps40422
> rename to Documentation/hwmon/tps40422.rst
> index 359751eb5ed4..b691e30479dd 100644
> --- a/Documentation/hwmon/tps40422
> +++ b/Documentation/hwmon/tps40422.rst
> @@ -21,7 +21,7 @@ This driver supports TI TPS40422 Dual-Output or Two-Phase Synchronous Buck
>  Controller with PMBus
>  
>  The driver is a client driver to the core PMBus driver.
> -Please see Documentation/hwmon/pmbus for details on PMBus client drivers.
> +Please see Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
>  
>  
>  Usage Notes
> diff --git a/Documentation/hwmon/twl4030-madc-hwmon b/Documentation/hwmon/twl4030-madc-hwmon.rst
> similarity index 100%
> rename from Documentation/hwmon/twl4030-madc-hwmon
> rename to Documentation/hwmon/twl4030-madc-hwmon.rst
> diff --git a/Documentation/hwmon/ucd9000 b/Documentation/hwmon/ucd9000.rst
> similarity index 97%
> rename from Documentation/hwmon/ucd9000
> rename to Documentation/hwmon/ucd9000.rst
> index d69061b7312c..ebc4f2b3bfea 100644
> --- a/Documentation/hwmon/ucd9000
> +++ b/Documentation/hwmon/ucd9000.rst
> @@ -57,7 +57,7 @@ system-health monitor. The device integrates a 12-bit ADC for monitoring up to
>  13 power-supply voltage, current, or temperature inputs.
>  
>  This driver is a client driver to the core PMBus driver. Please see
> -Documentation/hwmon/pmbus for details on PMBus client drivers.
> +Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
>  
>  
>  Usage Notes
> @@ -72,7 +72,7 @@ Platform data support
>  ---------------------
>  
>  The driver supports standard PMBus driver platform data. Please see
> -Documentation/hwmon/pmbus for details.
> +Documentation/hwmon/pmbus.rst for details.
>  
>  
>  Sysfs entries
> diff --git a/Documentation/hwmon/ucd9200 b/Documentation/hwmon/ucd9200.rst
> similarity index 97%
> rename from Documentation/hwmon/ucd9200
> rename to Documentation/hwmon/ucd9200.rst
> index 44eda4a579b6..b819dfd75f71 100644
> --- a/Documentation/hwmon/ucd9200
> +++ b/Documentation/hwmon/ucd9200.rst
> @@ -33,7 +33,7 @@ dedicated circuitry for DC/DC loop management with flash memory and a serial
>  interface to support configuration, monitoring and management.
>  
>  This driver is a client driver to the core PMBus driver. Please see
> -Documentation/hwmon/pmbus for details on PMBus client drivers.
> +Documentation/hwmon/pmbus.rst for details on PMBus client drivers.
>  
>  
>  Usage Notes
> @@ -48,7 +48,7 @@ Platform data support
>  ---------------------
>  
>  The driver supports standard PMBus driver platform data. Please see
> -Documentation/hwmon/pmbus for details.
> +Documentation/hwmon/pmbus.rst for details.
>  
>  
>  Sysfs entries
> diff --git a/Documentation/hwmon/userspace-tools b/Documentation/hwmon/userspace-tools.rst
> similarity index 100%
> rename from Documentation/hwmon/userspace-tools
> rename to Documentation/hwmon/userspace-tools.rst
> diff --git a/Documentation/hwmon/vexpress b/Documentation/hwmon/vexpress.rst
> similarity index 100%
> rename from Documentation/hwmon/vexpress
> rename to Documentation/hwmon/vexpress.rst
> diff --git a/Documentation/hwmon/via686a b/Documentation/hwmon/via686a.rst
> similarity index 100%
> rename from Documentation/hwmon/via686a
> rename to Documentation/hwmon/via686a.rst
> diff --git a/Documentation/hwmon/vt1211 b/Documentation/hwmon/vt1211.rst
> similarity index 100%
> rename from Documentation/hwmon/vt1211
> rename to Documentation/hwmon/vt1211.rst
> diff --git a/Documentation/hwmon/w83627ehf b/Documentation/hwmon/w83627ehf.rst
> similarity index 100%
> rename from Documentation/hwmon/w83627ehf
> rename to Documentation/hwmon/w83627ehf.rst
> diff --git a/Documentation/hwmon/w83627hf b/Documentation/hwmon/w83627hf.rst
> similarity index 100%
> rename from Documentation/hwmon/w83627hf
> rename to Documentation/hwmon/w83627hf.rst
> diff --git a/Documentation/hwmon/w83773g b/Documentation/hwmon/w83773g.rst
> similarity index 100%
> rename from Documentation/hwmon/w83773g
> rename to Documentation/hwmon/w83773g.rst
> diff --git a/Documentation/hwmon/w83781d b/Documentation/hwmon/w83781d.rst
> similarity index 100%
> rename from Documentation/hwmon/w83781d
> rename to Documentation/hwmon/w83781d.rst
> diff --git a/Documentation/hwmon/w83791d b/Documentation/hwmon/w83791d.rst
> similarity index 99%
> rename from Documentation/hwmon/w83791d
> rename to Documentation/hwmon/w83791d.rst
> index a91f9e5fb0c6..3adaed39b157 100644
> --- a/Documentation/hwmon/w83791d
> +++ b/Documentation/hwmon/w83791d.rst
> @@ -102,7 +102,7 @@ This file is used for both legacy and new code.
>  
>  The sysfs interface to the beep bitmask has migrated from the original legacy
>  method of a single sysfs beep_mask file to a newer method using multiple
> -`*_beep` files as described in `Documentation/hwmon/sysfs-interface`.
> +`*_beep` files as described in `Documentation/hwmon/sysfs-interface.rst`.
>  
>  A similar change has occurred for the bitmap corresponding to the alarms. The
>  original legacy method used a single sysfs alarms file containing a bitmap
> diff --git a/Documentation/hwmon/w83792d b/Documentation/hwmon/w83792d.rst
> similarity index 100%
> rename from Documentation/hwmon/w83792d
> rename to Documentation/hwmon/w83792d.rst
> diff --git a/Documentation/hwmon/w83793 b/Documentation/hwmon/w83793.rst
> similarity index 100%
> rename from Documentation/hwmon/w83793
> rename to Documentation/hwmon/w83793.rst
> diff --git a/Documentation/hwmon/w83795 b/Documentation/hwmon/w83795.rst
> similarity index 100%
> rename from Documentation/hwmon/w83795
> rename to Documentation/hwmon/w83795.rst
> diff --git a/Documentation/hwmon/w83l785ts b/Documentation/hwmon/w83l785ts.rst
> similarity index 100%
> rename from Documentation/hwmon/w83l785ts
> rename to Documentation/hwmon/w83l785ts.rst
> diff --git a/Documentation/hwmon/w83l786ng b/Documentation/hwmon/w83l786ng.rst
> similarity index 100%
> rename from Documentation/hwmon/w83l786ng
> rename to Documentation/hwmon/w83l786ng.rst
> diff --git a/Documentation/hwmon/wm831x b/Documentation/hwmon/wm831x.rst
> similarity index 100%
> rename from Documentation/hwmon/wm831x
> rename to Documentation/hwmon/wm831x.rst
> diff --git a/Documentation/hwmon/wm8350 b/Documentation/hwmon/wm8350.rst
> similarity index 100%
> rename from Documentation/hwmon/wm8350
> rename to Documentation/hwmon/wm8350.rst
> diff --git a/Documentation/hwmon/xgene-hwmon b/Documentation/hwmon/xgene-hwmon.rst
> similarity index 100%
> rename from Documentation/hwmon/xgene-hwmon
> rename to Documentation/hwmon/xgene-hwmon.rst
> diff --git a/Documentation/hwmon/zl6100 b/Documentation/hwmon/zl6100.rst
> similarity index 98%
> rename from Documentation/hwmon/zl6100
> rename to Documentation/hwmon/zl6100.rst
> index 4029970bace4..41513bb7fe51 100644
> --- a/Documentation/hwmon/zl6100
> +++ b/Documentation/hwmon/zl6100.rst
> @@ -113,7 +113,7 @@ This driver supports hardware monitoring for Intersil / Zilker Labs ZL6100 and
>  compatible digital DC-DC controllers.
>  
>  The driver is a client driver to the core PMBus driver. Please see
> -Documentation/hwmon/pmbus and Documentation.hwmon/pmbus-core for details
> +Documentation/hwmon/pmbus.rst and Documentation.hwmon/pmbus-core for details
>  on PMBus client drivers.
>  
>  
> diff --git a/Documentation/index.rst b/Documentation/index.rst
> index 80a421cb935e..3a710dc24fc8 100644
> --- a/Documentation/index.rst
> +++ b/Documentation/index.rst
> @@ -83,6 +83,7 @@ needed).
>     media/index
>     networking/index
>     input/index
> +   hwmon/index
>     gpu/index
>     security/index
>     sound/index
> diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
> index 911399730c1c..c3fa500df92c 100644
> --- a/Documentation/thermal/sysfs-api.txt
> +++ b/Documentation/thermal/sysfs-api.txt
> @@ -316,7 +316,7 @@ ACPI thermal zones.
>      |---temp[1-*]_input:	The current temperature of thermal zone [1-*]
>      |---temp[1-*]_critical:	The critical trip point of thermal zone [1-*]
>  
> -Please read Documentation/hwmon/sysfs-interface for additional information.
> +Please read Documentation/hwmon/sysfs-interface.rst for additional information.
>  
>  ***************************
>  * Thermal zone attributes *
> diff --git a/MAINTAINERS b/MAINTAINERS
> index dc615cb76455..d258fb8e7e8e 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -468,7 +468,7 @@ ADM1025 HARDWARE MONITOR DRIVER
>  M:	Jean Delvare <jdelvare@suse.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/adm1025
> +F:	Documentation/hwmon/adm1025.rst
>  F:	drivers/hwmon/adm1025.c
>  
>  ADM1029 HARDWARE MONITOR DRIVER
> @@ -520,7 +520,7 @@ ADS1015 HARDWARE MONITOR DRIVER
>  M:	Dirk Eibach <eibach@gdsys.de>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/ads1015
> +F:	Documentation/hwmon/ads1015.rst
>  F:	drivers/hwmon/ads1015.c
>  F:	include/linux/platform_data/ads1015.h
>  
> @@ -533,7 +533,7 @@ ADT7475 HARDWARE MONITOR DRIVER
>  M:	Jean Delvare <jdelvare@suse.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/adt7475
> +F:	Documentation/hwmon/adt7475.rst
>  F:	drivers/hwmon/adt7475.c
>  
>  ADVANSYS SCSI DRIVER
> @@ -764,7 +764,7 @@ AMD FAM15H PROCESSOR POWER MONITORING DRIVER
>  M:	Huang Rui <ray.huang@amd.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Supported
> -F:	Documentation/hwmon/fam15h_power
> +F:	Documentation/hwmon/fam15h_power.rst
>  F:	drivers/hwmon/fam15h_power.c
>  
>  AMD FCH GPIO DRIVER
> @@ -2512,7 +2512,7 @@ ASC7621 HARDWARE MONITOR DRIVER
>  M:	George Joseph <george.joseph@fairview5.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/asc7621
> +F:	Documentation/hwmon/asc7621.rst
>  F:	drivers/hwmon/asc7621.c
>  
>  ASPEED VIDEO ENGINE DRIVER
> @@ -4043,7 +4043,7 @@ CORETEMP HARDWARE MONITORING DRIVER
>  M:	Fenghua Yu <fenghua.yu@intel.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/coretemp
> +F:	Documentation/hwmon/coretemp.rst
>  F:	drivers/hwmon/coretemp.c
>  
>  COSA/SRP SYNC SERIAL DRIVER
> @@ -4598,7 +4598,7 @@ DIALOG SEMICONDUCTOR DRIVERS
>  M:	Support Opensource <support.opensource@diasemi.com>
>  W:	http://www.dialog-semiconductor.com/products
>  S:	Supported
> -F:	Documentation/hwmon/da90??
> +F:	Documentation/hwmon/da90??.rst
>  F:	Documentation/devicetree/bindings/mfd/da90*.txt
>  F:	Documentation/devicetree/bindings/input/da90??-onkey.txt
>  F:	Documentation/devicetree/bindings/thermal/da90??-thermal.txt
> @@ -4749,7 +4749,7 @@ DME1737 HARDWARE MONITOR DRIVER
>  M:	Juerg Haefliger <juergh@gmail.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/dme1737
> +F:	Documentation/hwmon/dme1737.rst
>  F:	drivers/hwmon/dme1737.c
>  
>  DMI/SMBIOS SUPPORT
> @@ -5935,7 +5935,7 @@ F71805F HARDWARE MONITORING DRIVER
>  M:	Jean Delvare <jdelvare@suse.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/f71805f
> +F:	Documentation/hwmon/f71805f.rst
>  F:	drivers/hwmon/f71805f.c
>  
>  FADDR2LINE
> @@ -7618,7 +7618,7 @@ INA209 HARDWARE MONITOR DRIVER
>  M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/ina209
> +F:	Documentation/hwmon/ina209.rst
>  F:	Documentation/devicetree/bindings/hwmon/ina2xx.txt
>  F:	drivers/hwmon/ina209.c
>  
> @@ -7626,7 +7626,7 @@ INA2XX HARDWARE MONITOR DRIVER
>  M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/ina2xx
> +F:	Documentation/hwmon/ina2xx.rst
>  F:	drivers/hwmon/ina2xx.c
>  F:	include/linux/platform_data/ina2xx.h
>  
> @@ -8244,7 +8244,7 @@ IT87 HARDWARE MONITORING DRIVER
>  M:	Jean Delvare <jdelvare@suse.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/it87
> +F:	Documentation/hwmon/it87.rst
>  F:	drivers/hwmon/it87.c
>  
>  IT913X MEDIA DRIVER
> @@ -8288,7 +8288,7 @@ M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
>  F:	drivers/hwmon/jc42.c
> -F:	Documentation/hwmon/jc42
> +F:	Documentation/hwmon/jc42.rst
>  
>  JFS FILESYSTEM
>  M:	Dave Kleikamp <shaggy@kernel.org>
> @@ -8336,14 +8336,14 @@ K10TEMP HARDWARE MONITORING DRIVER
>  M:	Clemens Ladisch <clemens@ladisch.de>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/k10temp
> +F:	Documentation/hwmon/k10temp.rst
>  F:	drivers/hwmon/k10temp.c
>  
>  K8TEMP HARDWARE MONITORING DRIVER
>  M:	Rudolf Marek <r.marek@assembler.cz>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/k8temp
> +F:	Documentation/hwmon/k8temp.rst
>  F:	drivers/hwmon/k8temp.c
>  
>  KASAN
> @@ -9034,21 +9034,21 @@ LM78 HARDWARE MONITOR DRIVER
>  M:	Jean Delvare <jdelvare@suse.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/lm78
> +F:	Documentation/hwmon/lm78.rst
>  F:	drivers/hwmon/lm78.c
>  
>  LM83 HARDWARE MONITOR DRIVER
>  M:	Jean Delvare <jdelvare@suse.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/lm83
> +F:	Documentation/hwmon/lm83.rst
>  F:	drivers/hwmon/lm83.c
>  
>  LM90 HARDWARE MONITOR DRIVER
>  M:	Jean Delvare <jdelvare@suse.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/lm90
> +F:	Documentation/hwmon/lm90.rst
>  F:	Documentation/devicetree/bindings/hwmon/lm90.txt
>  F:	drivers/hwmon/lm90.c
>  F:	include/dt-bindings/thermal/lm90.h
> @@ -9057,7 +9057,7 @@ LM95234 HARDWARE MONITOR DRIVER
>  M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/lm95234
> +F:	Documentation/hwmon/lm95234.rst
>  F:	drivers/hwmon/lm95234.c
>  
>  LME2510 MEDIA DRIVER
> @@ -9131,7 +9131,7 @@ LTC4261 HARDWARE MONITOR DRIVER
>  M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/ltc4261
> +F:	Documentation/hwmon/ltc4261.rst
>  F:	drivers/hwmon/ltc4261.c
>  
>  LTC4306 I2C MULTIPLEXER DRIVER
> @@ -9362,7 +9362,7 @@ MAX16065 HARDWARE MONITOR DRIVER
>  M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/max16065
> +F:	Documentation/hwmon/max16065.rst
>  F:	drivers/hwmon/max16065.c
>  
>  MAX2175 SDR TUNER DRIVER
> @@ -9378,14 +9378,14 @@ F:	include/uapi/linux/max2175.h
>  MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
>  L:	linux-hwmon@vger.kernel.org
>  S:	Orphan
> -F:	Documentation/hwmon/max6650
> +F:	Documentation/hwmon/max6650.rst
>  F:	drivers/hwmon/max6650.c
>  
>  MAX6697 HARDWARE MONITOR DRIVER
>  M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/max6697
> +F:	Documentation/hwmon/max6697.rst
>  F:	Documentation/devicetree/bindings/hwmon/max6697.txt
>  F:	drivers/hwmon/max6697.c
>  F:	include/linux/platform_data/max6697.h
> @@ -10031,7 +10031,7 @@ F:	drivers/mfd/menf21bmc.c
>  F:	drivers/watchdog/menf21bmc_wdt.c
>  F:	drivers/leds/leds-menf21bmc.c
>  F:	drivers/hwmon/menf21bmc_hwmon.c
> -F:	Documentation/hwmon/menf21bmc
> +F:	Documentation/hwmon/menf21bmc.rst
>  
>  MEN Z069 WATCHDOG DRIVER
>  M:	Johannes Thumshirn <jth@kernel.org>
> @@ -10659,7 +10659,7 @@ NCT6775 HARDWARE MONITOR DRIVER
>  M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/nct6775
> +F:	Documentation/hwmon/nct6775.rst
>  F:	drivers/hwmon/nct6775.c
>  
>  NET_FAILOVER MODULE
> @@ -11753,7 +11753,7 @@ PC87360 HARDWARE MONITORING DRIVER
>  M:	Jim Cromie <jim.cromie@gmail.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/pc87360
> +F:	Documentation/hwmon/pc87360.rst
>  F:	drivers/hwmon/pc87360.c
>  
>  PC8736x GPIO DRIVER
> @@ -11765,7 +11765,7 @@ PC87427 HARDWARE MONITORING DRIVER
>  M:	Jean Delvare <jdelvare@suse.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/pc87427
> +F:	Documentation/hwmon/pc87427.rst
>  F:	drivers/hwmon/pc87427.c
>  
>  PCA9532 LED DRIVER
> @@ -12333,23 +12333,23 @@ S:	Maintained
>  F:	Documentation/devicetree/bindings/hwmon/ibm,cffps1.txt
>  F:	Documentation/devicetree/bindings/hwmon/max31785.txt
>  F:	Documentation/devicetree/bindings/hwmon/ltc2978.txt
> -F:	Documentation/hwmon/adm1275
> -F:	Documentation/hwmon/ibm-cffps
> -F:	Documentation/hwmon/ir35221
> -F:	Documentation/hwmon/lm25066
> -F:	Documentation/hwmon/ltc2978
> -F:	Documentation/hwmon/ltc3815
> -F:	Documentation/hwmon/max16064
> -F:	Documentation/hwmon/max20751
> -F:	Documentation/hwmon/max31785
> -F:	Documentation/hwmon/max34440
> -F:	Documentation/hwmon/max8688
> -F:	Documentation/hwmon/pmbus
> -F:	Documentation/hwmon/pmbus-core
> -F:	Documentation/hwmon/tps40422
> -F:	Documentation/hwmon/ucd9000
> -F:	Documentation/hwmon/ucd9200
> -F:	Documentation/hwmon/zl6100
> +F:	Documentation/hwmon/adm1275.rst
> +F:	Documentation/hwmon/ibm-cffps.rst
> +F:	Documentation/hwmon/ir35221.rst
> +F:	Documentation/hwmon/lm25066.rst
> +F:	Documentation/hwmon/ltc2978.rst
> +F:	Documentation/hwmon/ltc3815.rst
> +F:	Documentation/hwmon/max16064.rst
> +F:	Documentation/hwmon/max20751.rst
> +F:	Documentation/hwmon/max31785.rst
> +F:	Documentation/hwmon/max34440.rst
> +F:	Documentation/hwmon/max8688.rst
> +F:	Documentation/hwmon/pmbus.rst
> +F:	Documentation/hwmon/pmbus-core.rst
> +F:	Documentation/hwmon/tps40422.rst
> +F:	Documentation/hwmon/ucd9000.rst
> +F:	Documentation/hwmon/ucd9200.rst
> +F:	Documentation/hwmon/zl6100.rst
>  F:	drivers/hwmon/pmbus/
>  F:	include/linux/pmbus.h
>  
> @@ -12613,7 +12613,7 @@ M:	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Supported
>  F:	Documentation/devicetree/bindings/hwmon/pwm-fan.txt
> -F:	Documentation/hwmon/pwm-fan
> +F:	Documentation/hwmon/pwm-fan.rst
>  F:	drivers/hwmon/pwm-fan.c
>  
>  PWM IR Transmitter
> @@ -14278,21 +14278,21 @@ SMM665 HARDWARE MONITOR DRIVER
>  M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/smm665
> +F:	Documentation/hwmon/smm665.rst
>  F:	drivers/hwmon/smm665.c
>  
>  SMSC EMC2103 HARDWARE MONITOR DRIVER
>  M:	Steve Glendinning <steve.glendinning@shawell.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/emc2103
> +F:	Documentation/hwmon/emc2103.rst
>  F:	drivers/hwmon/emc2103.c
>  
>  SMSC SCH5627 HARDWARE MONITOR DRIVER
>  M:	Hans de Goede <hdegoede@redhat.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Supported
> -F:	Documentation/hwmon/sch5627
> +F:	Documentation/hwmon/sch5627.rst
>  F:	drivers/hwmon/sch5627.c
>  
>  SMSC UFX6000 and UFX7000 USB to VGA DRIVER
> @@ -14305,7 +14305,7 @@ SMSC47B397 HARDWARE MONITOR DRIVER
>  M:	Jean Delvare <jdelvare@suse.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/smsc47b397
> +F:	Documentation/hwmon/smsc47b397.rst
>  F:	drivers/hwmon/smsc47b397.c
>  
>  SMSC911x ETHERNET DRIVER
> @@ -15650,7 +15650,7 @@ TMP401 HARDWARE MONITOR DRIVER
>  M:	Guenter Roeck <linux@roeck-us.net>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/tmp401
> +F:	Documentation/hwmon/tmp401.rst
>  F:	drivers/hwmon/tmp401.c
>  
>  TMPFS (SHMEM FILESYSTEM)
> @@ -16675,7 +16675,7 @@ VT1211 HARDWARE MONITOR DRIVER
>  M:	Juerg Haefliger <juergh@gmail.com>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/vt1211
> +F:	Documentation/hwmon/vt1211.rst
>  F:	drivers/hwmon/vt1211.c
>  
>  VT8231 HARDWARE MONITOR DRIVER
> @@ -16703,14 +16703,14 @@ W83791D HARDWARE MONITORING DRIVER
>  M:	Marc Hulsman <m.hulsman@tudelft.nl>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/w83791d
> +F:	Documentation/hwmon/w83791d.rst
>  F:	drivers/hwmon/w83791d.c
>  
>  W83793 HARDWARE MONITORING DRIVER
>  M:	Rudolf Marek <r.marek@assembler.cz>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> -F:	Documentation/hwmon/w83793
> +F:	Documentation/hwmon/w83793.rst
>  F:	drivers/hwmon/w83793.c
>  
>  W83795 HARDWARE MONITORING DRIVER
> @@ -16819,7 +16819,7 @@ L:	patches@opensource.cirrus.com
>  T:	git https://github.com/CirrusLogic/linux-drivers.git
>  W:	https://github.com/CirrusLogic/linux-drivers/wiki
>  S:	Supported
> -F:	Documentation/hwmon/wm83??
> +F:	Documentation/hwmon/wm83??.rst
>  F:	Documentation/devicetree/bindings/extcon/extcon-arizona.txt
>  F:	Documentation/devicetree/bindings/regulator/arizona-regulator.txt
>  F:	Documentation/devicetree/bindings/mfd/arizona.txt
> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
> index 6f929bfa9fcd..74c6c95cb657 100644
> --- a/drivers/hwmon/Kconfig
> +++ b/drivers/hwmon/Kconfig
> @@ -17,7 +17,7 @@ menuconfig HWMON
>  
>  	  To find out which specific driver(s) you need, use the
>  	  sensors-detect script from the lm_sensors package.  Read
> -	  <file:Documentation/hwmon/userspace-tools> for details.
> +	  <file:Documentation/hwmon/userspace-tools.rst> for details.
>  
>  	  This support can also be built as a module. If so, the module
>  	  will be called hwmon.
> @@ -59,7 +59,7 @@ config SENSORS_ABITUGURU
>  	  chip can be found on Abit uGuru featuring motherboards (most modern
>  	  Abit motherboards from before end 2005). For more info and a list
>  	  of which motherboards have which revision see
> -	  Documentation/hwmon/abituguru
> +	  Documentation/hwmon/abituguru.rst
>  
>  	  This driver can also be built as a module. If so, the module
>  	  will be called abituguru.
> @@ -73,7 +73,7 @@ config SENSORS_ABITUGURU3
>  	  and their settings is supported. The third revision of the Abit
>  	  uGuru chip can be found on recent Abit motherboards (since end
>  	  2005). For more info and a list of which motherboards have which
> -	  revision see Documentation/hwmon/abituguru3
> +	  revision see Documentation/hwmon/abituguru3.rst
>  
>  	  This driver can also be built as a module. If so, the module
>  	  will be called abituguru3.
> @@ -643,7 +643,7 @@ config SENSORS_CORETEMP
>  	help
>  	  If you say yes here you get support for the temperature
>  	  sensor inside your CPU. Most of the family 6 CPUs
> -	  are supported. Check Documentation/hwmon/coretemp for details.
> +	  are supported. Check Documentation/hwmon/coretemp.rst for details.
>  
>  config SENSORS_IT87
>  	tristate "ITE IT87xx and compatibles"
> diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
> index 12c56d3783ed..545b635a104e 100644
> --- a/drivers/hwmon/ads7828.c
> +++ b/drivers/hwmon/ads7828.c
> @@ -8,7 +8,7 @@
>   *
>   * ADS7830 support, by Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
>   *
> - * For further information, see the Documentation/hwmon/ads7828 file.
> + * For further information, see the Documentation/hwmon/ads7828.rst file.
>   *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License as published by
> diff --git a/drivers/hwmon/max197.c b/drivers/hwmon/max197.c
> index 3d9e210beedf..dd6a35219a18 100644
> --- a/drivers/hwmon/max197.c
> +++ b/drivers/hwmon/max197.c
> @@ -8,7 +8,7 @@
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
>   *
> - * For further information, see the Documentation/hwmon/max197 file.
> + * For further information, see the Documentation/hwmon/max197.rst file.
>   */
>  
>  #include <linux/kernel.h>
> diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
> index 39b41e35c2bf..7f4a63959730 100644
> --- a/drivers/hwmon/sht15.c
> +++ b/drivers/hwmon/sht15.c
> @@ -10,7 +10,7 @@
>   *
>   * Copyright (c) 2007 Wouter Horre
>   *
> - * For further information, see the Documentation/hwmon/sht15 file.
> + * For further information, see the Documentation/hwmon/sht15.rst file.
>   */
>  
>  #include <linux/interrupt.h>
> diff --git a/include/linux/platform_data/ads7828.h b/include/linux/platform_data/ads7828.h
> index 3245f45f9d77..a3370a007702 100644
> --- a/include/linux/platform_data/ads7828.h
> +++ b/include/linux/platform_data/ads7828.h
> @@ -4,7 +4,7 @@
>   * Copyright (c) 2012 Savoir-faire Linux Inc.
>   *          Vivien Didelot <vivien.didelot@savoirfairelinux.com>
>   *
> - * For further information, see the Documentation/hwmon/ads7828 file.
> + * For further information, see the Documentation/hwmon/ads7828.rst file.
>   *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2 as
> diff --git a/include/linux/platform_data/ds620.h b/include/linux/platform_data/ds620.h
> index 6ef58bb77e46..f0ce22a78bb8 100644
> --- a/include/linux/platform_data/ds620.h
> +++ b/include/linux/platform_data/ds620.h
> @@ -14,7 +14,7 @@ struct ds620_platform_data {
>  	 *  1 = PO_LOW
>  	 *  2 = PO_HIGH
>  	 *
> -	 * (see Documentation/hwmon/ds620)
> +	 * (see Documentation/hwmon/ds620.rst)
>  	 */
>  	int pomode;
>  };
> diff --git a/include/linux/platform_data/ina2xx.h b/include/linux/platform_data/ina2xx.h
> index 9f0aa1b48c78..dde59fd3590f 100644
> --- a/include/linux/platform_data/ina2xx.h
> +++ b/include/linux/platform_data/ina2xx.h
> @@ -7,7 +7,7 @@
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
>   *
> - * For further information, see the Documentation/hwmon/ina2xx file.
> + * For further information, see the Documentation/hwmon/ina2xx.rst file.
>   */
>  
>  /**
> diff --git a/include/linux/platform_data/max197.h b/include/linux/platform_data/max197.h
> index 8da8f94ee15c..2bbd0919bc89 100644
> --- a/include/linux/platform_data/max197.h
> +++ b/include/linux/platform_data/max197.h
> @@ -8,7 +8,7 @@
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
>   *
> - * For further information, see the Documentation/hwmon/max197 file.
> + * For further information, see the Documentation/hwmon/max197.rst file.
>   */
>  
>  #ifndef _PDATA_MAX197_H
> diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h
> index ee03d429742b..5fa115d3ea4b 100644
> --- a/include/linux/platform_data/ntc_thermistor.h
> +++ b/include/linux/platform_data/ntc_thermistor.h
> @@ -42,7 +42,7 @@ struct ntc_thermistor_platform_data {
>  	 * read_uV()
>  	 *
>  	 * How to setup pullup_ohm, pulldown_ohm, and connect is
> -	 * described at Documentation/hwmon/ntc_thermistor
> +	 * described at Documentation/hwmon/ntc_thermistor.rst
>  	 *
>  	 * pullup/down_ohm: 0 for infinite / not-connected
>  	 *
> -- 
> 2.20.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply

* Re: [PATCH] Linux: Define struct termios2 in <termios.h> under _GNU_SOURCE [BZ #10339]
From: Adhemerval Zanella @ 2019-04-11 12:53 UTC (permalink / raw)
  To: Florian Weimer; +Cc: linux-api, libc-alpha, linuxppc-dev, hpa
In-Reply-To: <87imvker6t.fsf@oldenburg2.str.redhat.com>



On 11/04/2019 08:07, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> This allows us to adjust the baud rates to non-standard values using termios
>> interfaces without to resorting to add new headers and use a different API
>> (ioctl).
> 
> How much symbol versioning will be required for this change?

I think all interfaces that have termios as input for sparc and mips 
(tcgetattr, tcsetattr, cfmakeraw, cfgetispeed, cfgetospeed, cfsetispeed,
cfsetospeed, cfsetspeed).

Alpha will also need to use termios1 for pre-4.20 kernels.

> 
>> As Peter Anvin has indicated, he create a POC [1] with the aforementioned
>> new interfaces.  It has not been rebased against master, more specially against
>> my termios refactor to simplify the multiple architecture header definitions,
>> but I intend to use as a base.
> 
> Reference [1] is still missing. 8-(

Oops... it is https://git.zytor.com/users/hpa/glibc/termbaud.git/log/?h=wip.termbaud

> 
> Thanks,
> Florian
> 

^ permalink raw reply

* Re: [PATCH v2] powerpc/xmon: add read-only mode
From: Michael Ellerman @ 2019-04-11 12:37 UTC (permalink / raw)
  To: Christopher M Riedl, Oliver; +Cc: linuxppc-dev, Andrew Donnellan
In-Reply-To: <864072306.101924.1554863718473@privateemail.com>

Christopher M Riedl <cmr@informatik.wtf> writes:
>> On April 8, 2019 at 1:34 AM Oliver <oohall@gmail.com> wrote:
>> On Mon, Apr 8, 2019 at 1:06 PM Christopher M. Riedl <cmr@informatik.wtf> wrote:
...
>> >
>> > diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
>> > index 4e00cb0a5464..0c7f21476018 100644
>> > --- a/arch/powerpc/Kconfig.debug
>> > +++ b/arch/powerpc/Kconfig.debug
>> > @@ -117,6 +117,16 @@ config XMON_DISASSEMBLY
>> >           to say Y here, unless you're building for a memory-constrained
>> >           system.
>> >
>> 
>> > +config XMON_RW
>> > +       bool "Allow xmon read and write operations"
>> > +       depends on XMON
>> > +       default !STRICT_KERNEL_RWX
>> > +       help
>> > +         Allow xmon to read and write to memory and special-purpose registers.
>> > +          Conversely, prevent xmon write access when set to N. Read and write
>> > +          access can also be explicitly controlled with 'xmon=rw' or 'xmon=ro'
>> > +          (read-only) cmdline options. Default is !STRICT_KERNEL_RWX.
>> 
>> Maybe I am a dumb, but I found this *extremely* confusing.
>> Conventionally Kconfig options will control what code is and is not
>> included in the kernel (see XMON_DISASSEMBLY) rather than changing the
>> default behaviour of code. It's not wrong to do so and I'm going to
>> assume that you were following the pattern of XMON_DEFAULT, but I
>> think you need to be a little more clear about what option actually
>> does. Renaming it to XMON_DEFAULT_RO_MODE and re-wording the
>> description to indicate it's a only a mode change would help a lot.
>> 
>> Sorry if this comes across as pointless bikeshedding since it's the
>> opposite of what Christophe said in the last patch, but this was a bit
>> of a head scratcher.
>
> If anyone is dumb here it's me for making this confusing :)
> I chatted with Michael Ellerman about this, so let me try to explain this more clearly.

Yeah it's my fault :)

> There are two things I am trying to address with XMON_RW:
> 1) provide a default access mode for xmon based on system "security"

I think I've gone off this idea. Tying them together is just enforcing a
linkage that people may not want.

I think XMON_RW should just be an option that stands on its own. It
should probably be default n, to give people a safe default.

> 2) replace XMON in the decision to write-protect kernel text at compile-time

We should do that as a separate patch. That's actually a bug in the
current STRICT_KERNEL_RWX support.

ie. STRICT_KERNEL_RWX should always give you PAGE_KERNEL_ROX, regardless
of XMON or anything else.

> I think a single Kconfig for both of those things is sensible as ultimately the
> point is to allow xmon to operate in read-only mode on "secure" systems -- without
> violating any integrity/security guarantees (such as write-protected kernel text).
>
> Christophe suggested looking at STRICT_KERNEL_RWX and I think that option makes the
> most sense to base XMON_RW on since the description for STRICT_KERNEL_RWX states:

Once we fix the bugs in STRICT_KERNEL_RWX people are going to enable
that by default, so it will essentially be always on in future.


> With that said, I will remove the 'xmon=rw' cmdline option as it really doesn't work
> since kernel text is write-protected at compile time.

I think 'xmon=rw' still makes sense. Only some of the RW functionality
relies on being able to patch kernel text.

And once you have proccall() you can just call a function to make it
read/write anyway, or use memex to manually frob the page tables.

cheers

^ permalink raw reply

* Re: [PATCH] MAINTAINERS: Update remaining @linux.vnet.ibm.com addresses
From: Joe Perches @ 2019-04-11 12:27 UTC (permalink / raw)
  To: Michael Ellerman, Lukas Bulwahn, Tyrel Datwyler
  Cc: linux-pci, Paul E . McKenney, linuxppc-dev, linux-kernel,
	Josh Boyer
In-Reply-To: <87k1g0vj7f.fsf@concordia.ellerman.id.au>

On Thu, 2019-04-11 at 22:07 +1000, Michael Ellerman wrote:
> Joe Perches <joe@perches.com> writes:
> > On Thu, 2019-04-11 at 06:27 +0200, Lukas Bulwahn wrote:
> > > Paul McKenney attempted to update all email addresses @linux.vnet.ibm.com
> > > to @linux.ibm.com in commit 1dfddcdb95c4
> > > ("MAINTAINERS: Update from @linux.vnet.ibm.com to @linux.ibm.com"), but
> > > some still remained.
> > > 
> > > We update the remaining email addresses in MAINTAINERS, hopefully finally
> > > catching all cases for good.
> > 
> > Perhaps update all the similar addresses in other files too
> > 
> > $ git grep --name-only 'linux\.vnet\.ibm\.com' | wc -l
> > 315
> 
> A good number of them are no longer valid. So I'm not sure it's worth
> updating them en masse to addresses that won't ever work.
> 
> We have git now, we don't need email addresses in files, they're just
> prone to bitrot like this.
> 
> Should we just change them all like so?
> 
>   -arch/powerpc/boot/dts/bamboo.dts: * Josh Boyer <jwboyer@linux.vnet.ibm.com>
>   +arch/powerpc/boot/dts/bamboo.dts: * Josh Boyer (IBM)
> 
> To indicate the author was at IBM when they wrote it?

If that's desired, perhaps:

$ git grep -P --name-only '<?[\w\.]+(?:@| at )linux\.vnet\.ibm\.com>?' | \
  grep -vP '\.mailmap|MAINTAINERS' | \
  xargs perl -p -i -e 's/<?[\w\.]+(?:@|\ at\ )linux\.vnet\.ibm\.com>?/(IBM)/g'

> Or should we try and update them with current addresses? Though then the
> authors might start getting mails they don't want.

That'd be my preference.

If authors get emails they don't want, then those contact
emails should be removed.



^ permalink raw reply

* Re: [PATCH] MAINTAINERS: Update remaining @linux.vnet.ibm.com addresses
From: Michael Ellerman @ 2019-04-11 12:07 UTC (permalink / raw)
  To: Joe Perches, Lukas Bulwahn, Tyrel Datwyler
  Cc: linux-pci, Paul E . McKenney, linuxppc-dev, linux-kernel,
	Josh Boyer
In-Reply-To: <0702bc9a10703d53a46f27468b2c9ef2463e1c0b.camel@perches.com>

Joe Perches <joe@perches.com> writes:
> On Thu, 2019-04-11 at 06:27 +0200, Lukas Bulwahn wrote:
>> Paul McKenney attempted to update all email addresses @linux.vnet.ibm.com
>> to @linux.ibm.com in commit 1dfddcdb95c4
>> ("MAINTAINERS: Update from @linux.vnet.ibm.com to @linux.ibm.com"), but
>> some still remained.
>> 
>> We update the remaining email addresses in MAINTAINERS, hopefully finally
>> catching all cases for good.
>
> Perhaps update all the similar addresses in other files too
>
> $ git grep --name-only 'linux\.vnet\.ibm\.com' | wc -l
> 315

A good number of them are no longer valid. So I'm not sure it's worth
updating them en masse to addresses that won't ever work.

We have git now, we don't need email addresses in files, they're just
prone to bitrot like this.

Should we just change them all like so?

  -arch/powerpc/boot/dts/bamboo.dts: * Josh Boyer <jwboyer@linux.vnet.ibm.com>
  +arch/powerpc/boot/dts/bamboo.dts: * Josh Boyer (IBM)


To indicate the author was at IBM when they wrote it?

Or should we try and update them with current addresses? Though then the
authors might start getting mails they don't want.

cheers

^ permalink raw reply

* Re: [PATCH v5 16/16] KVM: PPC: Book3S HV: XIVE: introduce a 'release' device operation
From: Cédric Le Goater @ 2019-04-11 11:48 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: kvm, kvm-ppc, Paolo Bonzini, linuxppc-dev, David Gibson
In-Reply-To: <20190411102710.GD21252@blackberry>

On 4/11/19 12:27 PM, Paul Mackerras wrote:
> On Wed, Apr 10, 2019 at 07:04:48PM +0200, Cédric Le Goater wrote:
>> When a P9 sPAPR VM boots, the CAS negotiation process determines which
>> interrupt mode to use (XICS legacy or XIVE native) and invokes a
>> machine reset to activate the chosen mode.
>>
>> To be able to switch from one mode to another, we introduce the
>> capability to release a KVM device without destroying the VM. The KVM
>> device interface is extended with a new 'release' operation which is
>> called when the file descriptor of the device is closed.
> 
> Unfortunately, I think there is now a memory leak:
> 
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index ea2018ae1cd7..ea2619d5ca98 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -2938,6 +2938,19 @@ static int kvm_device_release(struct inode *inode, struct file *filp)
>>  	struct kvm_device *dev = filp->private_data;
>>  	struct kvm *kvm = dev->kvm;
>>  
>> +	if (!dev)
>> +		return -ENODEV;
>> +
>> +	if (dev->kvm != kvm)
>> +		return -EPERM;
>> +
>> +	if (dev->ops->release) {
>> +		mutex_lock(&kvm->lock);
>> +		list_del(&dev->vm_node);
> 
> Because the device is now no longer in the kvm->devices list,
> kvm_destroy_devices() won't find it there and therefore won't call the
> device's destroy method.  In fact now the device's destroy method will
> never get called; I can't see how kvmppc_xive_free() or
> kvmppc_xive_native_free() will ever get called.  Thus the memory for
> the kvmppc_xive structs will never get freed as far as I can see.

ah yes. indeed ...

> We could fix that by freeing both of the kvm->arch.xive_devices
> entries at VM destruction time.

That is what I was doing in the first patch I sent : 

    http://patchwork.ozlabs.org/patch/1082303/

It worked fine and then, I had this better (worse) idea which I included 
in v5. 
 
> If it is true that any device that has a release method will never see
> its destroy method being called, then that needs to be documented
> clearly somewhere.

Yes. Closing the fd should take care of it. I have to rework that patch.

Thanks,

C.

^ permalink raw reply

* [PATCH stable v4.9 35/35] powerpc/security: Fix spectre_v2 reporting
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

commit 92edf8df0ff2ae86cc632eeca0e651fd8431d40d upstream.

When I updated the spectre_v2 reporting to handle software count cache
flush I got the logic wrong when there's no software count cache
enabled at all.

The result is that on systems with the software count cache flush
disabled we print:

  Mitigation: Indirect branch cache disabled, Software count cache flush

Which correctly indicates that the count cache is disabled, but
incorrectly says the software count cache flush is enabled.

The root of the problem is that we are trying to handle all
combinations of options. But we know now that we only expect to see
the software count cache flush enabled if the other options are false.

So split the two cases, which simplifies the logic and fixes the bug.
We were also missing a space before "(hardware accelerated)".

The result is we see one of:

  Mitigation: Indirect branch serialisation (kernel only)
  Mitigation: Indirect branch cache disabled
  Mitigation: Software count cache flush
  Mitigation: Software count cache flush (hardware accelerated)

Fixes: ee13cb249fab ("powerpc/64s: Add support for software count cache flush")
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Michael Neuling <mikey@neuling.org>
Reviewed-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/security.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 43ce800e73bf..30542e833ebe 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -190,29 +190,22 @@ ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, c
 	bcs = security_ftr_enabled(SEC_FTR_BCCTRL_SERIALISED);
 	ccd = security_ftr_enabled(SEC_FTR_COUNT_CACHE_DISABLED);
 
-	if (bcs || ccd || count_cache_flush_type != COUNT_CACHE_FLUSH_NONE) {
-		bool comma = false;
+	if (bcs || ccd) {
 		seq_buf_printf(&s, "Mitigation: ");
 
-		if (bcs) {
+		if (bcs)
 			seq_buf_printf(&s, "Indirect branch serialisation (kernel only)");
-			comma = true;
-		}
 
-		if (ccd) {
-			if (comma)
-				seq_buf_printf(&s, ", ");
-			seq_buf_printf(&s, "Indirect branch cache disabled");
-			comma = true;
-		}
-
-		if (comma)
+		if (bcs && ccd)
 			seq_buf_printf(&s, ", ");
 
-		seq_buf_printf(&s, "Software count cache flush");
+		if (ccd)
+			seq_buf_printf(&s, "Indirect branch cache disabled");
+	} else if (count_cache_flush_type != COUNT_CACHE_FLUSH_NONE) {
+		seq_buf_printf(&s, "Mitigation: Software count cache flush");
 
 		if (count_cache_flush_type == COUNT_CACHE_FLUSH_HW)
-			seq_buf_printf(&s, "(hardware accelerated)");
+			seq_buf_printf(&s, " (hardware accelerated)");
 	} else if (btb_flush_enabled) {
 		seq_buf_printf(&s, "Mitigation: Branch predictor state flush");
 	} else {
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 34/35] powerpc/fsl: Fix the flush of branch predictor.
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Christophe Leroy <christophe.leroy@c-s.fr>

commit 27da80719ef132cf8c80eb406d5aeb37dddf78cc upstream.

The commit identified below adds MC_BTB_FLUSH macro only when
CONFIG_PPC_FSL_BOOK3E is defined. This results in the following error
on some configs (seen several times with kisskb randconfig_defconfig)

arch/powerpc/kernel/exceptions-64e.S:576: Error: Unrecognized opcode: `mc_btb_flush'
make[3]: *** [scripts/Makefile.build:367: arch/powerpc/kernel/exceptions-64e.o] Error 1
make[2]: *** [scripts/Makefile.build:492: arch/powerpc/kernel] Error 2
make[1]: *** [Makefile:1043: arch/powerpc] Error 2
make: *** [Makefile:152: sub-make] Error 2

This patch adds a blank definition of MC_BTB_FLUSH for other cases.

Fixes: 10c5e83afd4a ("powerpc/fsl: Flush the branch predictor at each kernel entry (64bit)")
Cc: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/exceptions-64e.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 79c6fee6368d..423b5257d3a1 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -348,6 +348,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 #define GEN_BTB_FLUSH
 #define CRIT_BTB_FLUSH
 #define DBG_BTB_FLUSH
+#define MC_BTB_FLUSH
 #define GDBELL_BTB_FLUSH
 #endif
 
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 33/35] powerpc/fsl: Fixed warning: orphan section `__btb_flush_fixup'
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Diana Craciun <diana.craciun@nxp.com>

commit 039daac5526932ec731e4499613018d263af8b3e upstream.

Fixed the following build warning:
powerpc-linux-gnu-ld: warning: orphan section `__btb_flush_fixup' from
`arch/powerpc/kernel/head_44x.o' being placed in section
`__btb_flush_fixup'.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/head_booke.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
index 384bb4d80520..7b98c7351f6c 100644
--- a/arch/powerpc/kernel/head_booke.h
+++ b/arch/powerpc/kernel/head_booke.h
@@ -31,6 +31,16 @@
  */
 #define THREAD_NORMSAVE(offset)	(THREAD_NORMSAVES + (offset * 4))
 
+#ifdef CONFIG_PPC_FSL_BOOK3E
+#define BOOKE_CLEAR_BTB(reg)									\
+START_BTB_FLUSH_SECTION								\
+	BTB_FLUSH(reg)									\
+END_BTB_FLUSH_SECTION
+#else
+#define BOOKE_CLEAR_BTB(reg)
+#endif
+
+
 #define NORMAL_EXCEPTION_PROLOG(intno)						     \
 	mtspr	SPRN_SPRG_WSCRATCH0, r10;	/* save one register */	     \
 	mfspr	r10, SPRN_SPRG_THREAD;					     \
@@ -42,9 +52,7 @@
 	andi.	r11, r11, MSR_PR;	/* check whether user or kernel    */\
 	mr	r11, r1;						     \
 	beq	1f;							     \
-START_BTB_FLUSH_SECTION					\
-	BTB_FLUSH(r11)						\
-END_BTB_FLUSH_SECTION					\
+	BOOKE_CLEAR_BTB(r11)						\
 	/* if from user, start at top of this thread's kernel stack */       \
 	lwz	r11, THREAD_INFO-THREAD(r10);				     \
 	ALLOC_STACK_FRAME(r11, THREAD_SIZE);				     \
@@ -130,9 +138,7 @@ END_BTB_FLUSH_SECTION					\
 	stw	r9,_CCR(r8);		/* save CR on stack		   */\
 	mfspr	r11,exc_level_srr1;	/* check whether user or kernel    */\
 	DO_KVM	BOOKE_INTERRUPT_##intno exc_level_srr1;		             \
-START_BTB_FLUSH_SECTION								\
-	BTB_FLUSH(r10)									\
-END_BTB_FLUSH_SECTION								\
+	BOOKE_CLEAR_BTB(r10)						\
 	andi.	r11,r11,MSR_PR;						     \
 	mfspr	r11,SPRN_SPRG_THREAD;	/* if from user, start at top of   */\
 	lwz	r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 32/35] powerpc/fsl: Update Spectre v2 reporting
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Diana Craciun <diana.craciun@nxp.com>

commit dfa88658fb0583abb92e062c7a9cd5a5b94f2a46 upstream.

Report branch predictor state flush as a mitigation for
Spectre variant 2.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/security.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 6dc5cdc2b87c..43ce800e73bf 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -213,8 +213,11 @@ ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, c
 
 		if (count_cache_flush_type == COUNT_CACHE_FLUSH_HW)
 			seq_buf_printf(&s, "(hardware accelerated)");
-	} else
+	} else if (btb_flush_enabled) {
+		seq_buf_printf(&s, "Mitigation: Branch predictor state flush");
+	} else {
 		seq_buf_printf(&s, "Vulnerable");
+	}
 
 	seq_buf_printf(&s, "\n");
 
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 31/35] powerpc/fsl: Enable runtime patching if nospectre_v2 boot arg is used
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Diana Craciun <diana.craciun@nxp.com>

commit 3bc8ea8603ae4c1e09aca8de229ad38b8091fcb3 upstream.

If the user choses not to use the mitigations, replace
the code sequence with nops.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/setup-common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index d5a128f54537..5e7d70c5d065 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -919,6 +919,7 @@ void __init setup_arch(char **cmdline_p)
 		ppc_md.setup_arch();
 
 	setup_barrier_nospec();
+	setup_spectre_v2();
 
 	paging_init();
 
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 30/35] powerpc/fsl: Flush branch predictor when entering KVM
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Diana Craciun <diana.craciun@nxp.com>

commit e7aa61f47b23afbec41031bc47ca8d6cb6516abc upstream.

Switching from the guest to host is another place
where the speculative accesses can be exploited.
Flush the branch predictor when entering KVM.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kvm/bookehv_interrupts.S | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
index 81bd8a07aa51..612b7f6a887f 100644
--- a/arch/powerpc/kvm/bookehv_interrupts.S
+++ b/arch/powerpc/kvm/bookehv_interrupts.S
@@ -75,6 +75,10 @@
 	PPC_LL	r1, VCPU_HOST_STACK(r4)
 	PPC_LL	r2, HOST_R2(r1)
 
+START_BTB_FLUSH_SECTION
+	BTB_FLUSH(r10)
+END_BTB_FLUSH_SECTION
+
 	mfspr	r10, SPRN_PID
 	lwz	r8, VCPU_HOST_PID(r4)
 	PPC_LL	r11, VCPU_SHARED(r4)
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 29/35] powerpc/fsl: Flush the branch predictor at each kernel entry (32 bit)
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Diana Craciun <diana.craciun@nxp.com>

commit 7fef436295bf6c05effe682c8797dfcb0deb112a upstream.

In order to protect against speculation attacks on
indirect branches, the branch predictor is flushed at
kernel entry to protect for the following situations:
- userspace process attacking another userspace process
- userspace process attacking the kernel
Basically when the privillege level change (i.e.the kernel
is entered), the branch predictor state is flushed.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/head_booke.h     |  6 ++++++
 arch/powerpc/kernel/head_fsl_booke.S | 15 +++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
index a620203f7de3..384bb4d80520 100644
--- a/arch/powerpc/kernel/head_booke.h
+++ b/arch/powerpc/kernel/head_booke.h
@@ -42,6 +42,9 @@
 	andi.	r11, r11, MSR_PR;	/* check whether user or kernel    */\
 	mr	r11, r1;						     \
 	beq	1f;							     \
+START_BTB_FLUSH_SECTION					\
+	BTB_FLUSH(r11)						\
+END_BTB_FLUSH_SECTION					\
 	/* if from user, start at top of this thread's kernel stack */       \
 	lwz	r11, THREAD_INFO-THREAD(r10);				     \
 	ALLOC_STACK_FRAME(r11, THREAD_SIZE);				     \
@@ -127,6 +130,9 @@
 	stw	r9,_CCR(r8);		/* save CR on stack		   */\
 	mfspr	r11,exc_level_srr1;	/* check whether user or kernel    */\
 	DO_KVM	BOOKE_INTERRUPT_##intno exc_level_srr1;		             \
+START_BTB_FLUSH_SECTION								\
+	BTB_FLUSH(r10)									\
+END_BTB_FLUSH_SECTION								\
 	andi.	r11,r11,MSR_PR;						     \
 	mfspr	r11,SPRN_SPRG_THREAD;	/* if from user, start at top of   */\
 	lwz	r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index bf4c6021515f..60a0aeefc4a7 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -452,6 +452,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 	mfcr	r13
 	stw	r13, THREAD_NORMSAVE(3)(r10)
 	DO_KVM	BOOKE_INTERRUPT_DTLB_MISS SPRN_SRR1
+START_BTB_FLUSH_SECTION
+	mfspr r11, SPRN_SRR1
+	andi. r10,r11,MSR_PR
+	beq 1f
+	BTB_FLUSH(r10)
+1:
+END_BTB_FLUSH_SECTION
 	mfspr	r10, SPRN_DEAR		/* Get faulting address */
 
 	/* If we are faulting a kernel address, we have to use the
@@ -546,6 +553,14 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 	mfcr	r13
 	stw	r13, THREAD_NORMSAVE(3)(r10)
 	DO_KVM	BOOKE_INTERRUPT_ITLB_MISS SPRN_SRR1
+START_BTB_FLUSH_SECTION
+	mfspr r11, SPRN_SRR1
+	andi. r10,r11,MSR_PR
+	beq 1f
+	BTB_FLUSH(r10)
+1:
+END_BTB_FLUSH_SECTION
+
 	mfspr	r10, SPRN_SRR0		/* Get faulting address */
 
 	/* If we are faulting a kernel address, we have to use the
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 28/35] powerpc/fsl: Flush the branch predictor at each kernel entry (64bit)
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Diana Craciun <diana.craciun@nxp.com>

commit 10c5e83afd4a3f01712d97d3bb1ae34d5b74a185 upstream.

In order to protect against speculation attacks on
indirect branches, the branch predictor is flushed at
kernel entry to protect for the following situations:
- userspace process attacking another userspace process
- userspace process attacking the kernel
Basically when the privillege level change (i.e. the
kernel is entered), the branch predictor state is flushed.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/entry_64.S       |  5 +++++
 arch/powerpc/kernel/exceptions-64e.S | 26 +++++++++++++++++++++++++-
 arch/powerpc/mm/tlb_low_64e.S        |  7 +++++++
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 6625cec9e7c0..390ebf4ef384 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -80,6 +80,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_TM)
 	std	r0,GPR0(r1)
 	std	r10,GPR1(r1)
 	beq	2f			/* if from kernel mode */
+#ifdef CONFIG_PPC_FSL_BOOK3E
+START_BTB_FLUSH_SECTION
+	BTB_FLUSH(r10)
+END_BTB_FLUSH_SECTION
+#endif
 	ACCOUNT_CPU_USER_ENTRY(r13, r10, r11)
 2:	std	r2,GPR2(r1)
 	std	r3,GPR3(r1)
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index ca03eb229a9a..79c6fee6368d 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -295,7 +295,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 	andi.	r10,r11,MSR_PR;		/* save stack pointer */	    \
 	beq	1f;			/* branch around if supervisor */   \
 	ld	r1,PACAKSAVE(r13);	/* get kernel stack coming from usr */\
-1:	cmpdi	cr1,r1,0;		/* check if SP makes sense */	    \
+1:	type##_BTB_FLUSH		\
+	cmpdi	cr1,r1,0;		/* check if SP makes sense */	    \
 	bge-	cr1,exc_##n##_bad_stack;/* bad stack (TODO: out of line) */ \
 	mfspr	r10,SPRN_##type##_SRR0;	/* read SRR0 before touching stack */
 
@@ -327,6 +328,29 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 #define SPRN_MC_SRR0	SPRN_MCSRR0
 #define SPRN_MC_SRR1	SPRN_MCSRR1
 
+#ifdef CONFIG_PPC_FSL_BOOK3E
+#define GEN_BTB_FLUSH			\
+	START_BTB_FLUSH_SECTION		\
+		beq 1f;			\
+		BTB_FLUSH(r10)			\
+		1:		\
+	END_BTB_FLUSH_SECTION
+
+#define CRIT_BTB_FLUSH			\
+	START_BTB_FLUSH_SECTION		\
+		BTB_FLUSH(r10)		\
+	END_BTB_FLUSH_SECTION
+
+#define DBG_BTB_FLUSH CRIT_BTB_FLUSH
+#define MC_BTB_FLUSH CRIT_BTB_FLUSH
+#define GDBELL_BTB_FLUSH GEN_BTB_FLUSH
+#else
+#define GEN_BTB_FLUSH
+#define CRIT_BTB_FLUSH
+#define DBG_BTB_FLUSH
+#define GDBELL_BTB_FLUSH
+#endif
+
 #define NORMAL_EXCEPTION_PROLOG(n, intnum, addition)			    \
 	EXCEPTION_PROLOG(n, intnum, GEN, addition##_GEN(n))
 
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S
index eb82d787d99a..b7e9c09dfe19 100644
--- a/arch/powerpc/mm/tlb_low_64e.S
+++ b/arch/powerpc/mm/tlb_low_64e.S
@@ -69,6 +69,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 	std	r15,EX_TLB_R15(r12)
 	std	r10,EX_TLB_CR(r12)
 #ifdef CONFIG_PPC_FSL_BOOK3E
+START_BTB_FLUSH_SECTION
+	mfspr r11, SPRN_SRR1
+	andi. r10,r11,MSR_PR
+	beq 1f
+	BTB_FLUSH(r10)
+1:
+END_BTB_FLUSH_SECTION
 	std	r7,EX_TLB_R7(r12)
 #endif
 	TLB_MISS_PROLOG_STATS
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 27/35] powerpc/fsl: Add nospectre_v2 command line argument
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Diana Craciun <diana.craciun@nxp.com>

commit f633a8ad636efb5d4bba1a047d4a0f1ef719aa06 upstream.

When the command line argument is present, the Spectre variant 2
mitigations are disabled.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/include/asm/setup.h |  5 +++++
 arch/powerpc/kernel/security.c   | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 23ee67e279ae..862ebce3ae54 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -65,6 +65,11 @@ void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
 static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { };
 #endif
 
+#ifdef CONFIG_PPC_FSL_BOOK3E
+void setup_spectre_v2(void);
+#else
+static inline void setup_spectre_v2(void) {};
+#endif
 void do_btb_flush_fixups(void);
 
 #endif /* !__ASSEMBLY__ */
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index fc41bccd9ab6..6dc5cdc2b87c 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -27,6 +27,10 @@ static enum count_cache_flush_type count_cache_flush_type = COUNT_CACHE_FLUSH_NO
 
 bool barrier_nospec_enabled;
 static bool no_nospec;
+static bool btb_flush_enabled;
+#ifdef CONFIG_PPC_FSL_BOOK3E
+static bool no_spectrev2;
+#endif
 
 static void enable_barrier_nospec(bool enable)
 {
@@ -102,6 +106,23 @@ static __init int barrier_nospec_debugfs_init(void)
 device_initcall(barrier_nospec_debugfs_init);
 #endif /* CONFIG_DEBUG_FS */
 
+#ifdef CONFIG_PPC_FSL_BOOK3E
+static int __init handle_nospectre_v2(char *p)
+{
+	no_spectrev2 = true;
+
+	return 0;
+}
+early_param("nospectre_v2", handle_nospectre_v2);
+void setup_spectre_v2(void)
+{
+	if (no_spectrev2)
+		do_btb_flush_fixups();
+	else
+		btb_flush_enabled = true;
+}
+#endif /* CONFIG_PPC_FSL_BOOK3E */
+
 #ifdef CONFIG_PPC_BOOK3S_64
 ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf)
 {
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 26/35] powerpc/fsl: Emulate SPRN_BUCSR register
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Diana Craciun <diana.craciun@nxp.com>

commit 98518c4d8728656db349f875fcbbc7c126d4c973 upstream.

In order to flush the branch predictor the guest kernel performs
writes to the BUCSR register which is hypervisor privilleged. However,
the branch predictor is flushed at each KVM entry, so the branch
predictor has been already flushed, so just return as soon as possible
to guest.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
[mpe: Tweak comment formatting]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kvm/e500_emulate.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
index 990db69a1d0b..fa88f641ac03 100644
--- a/arch/powerpc/kvm/e500_emulate.c
+++ b/arch/powerpc/kvm/e500_emulate.c
@@ -277,6 +277,13 @@ int kvmppc_core_emulate_mtspr_e500(struct kvm_vcpu *vcpu, int sprn, ulong spr_va
 		vcpu->arch.pwrmgtcr0 = spr_val;
 		break;
 
+	case SPRN_BUCSR:
+		/*
+		 * If we are here, it means that we have already flushed the
+		 * branch predictor, so just return to guest.
+		 */
+		break;
+
 	/* extra exceptions */
 #ifdef CONFIG_SPE_POSSIBLE
 	case SPRN_IVOR32:
-- 
2.20.1


^ permalink raw reply related

* [PATCH stable v4.9 25/35] powerpc/fsl: Fix spectre_v2 mitigations reporting
From: Michael Ellerman @ 2019-04-11 11:46 UTC (permalink / raw)
  To: stable, gregkh; +Cc: diana.craciun, linuxppc-dev, msuchanek
In-Reply-To: <20190411114630.4042-1-mpe@ellerman.id.au>

From: Diana Craciun <diana.craciun@nxp.com>

commit 7d8bad99ba5a22892f0cad6881289fdc3875a930 upstream.

Currently for CONFIG_PPC_FSL_BOOK3E the spectre_v2 file is incorrect:

  $ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2
  "Mitigation: Software count cache flush"

Which is wrong. Fix it to report vulnerable for now.

Fixes: ee13cb249fab ("powerpc/64s: Add support for software count cache flush")
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index fd4703b6ddc0..fc41bccd9ab6 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -23,7 +23,7 @@ enum count_cache_flush_type {
 	COUNT_CACHE_FLUSH_SW	= 0x2,
 	COUNT_CACHE_FLUSH_HW	= 0x4,
 };
-static enum count_cache_flush_type count_cache_flush_type;
+static enum count_cache_flush_type count_cache_flush_type = COUNT_CACHE_FLUSH_NONE;
 
 bool barrier_nospec_enabled;
 static bool no_nospec;
-- 
2.20.1


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox