Re: [RFC PATCH] x86/mm/fault: Allow stack access below %rsp

2018-11-04 Thread Andy Lutomirski
On Sun, Nov 4, 2018 at 9:11 PM Andy Lutomirski wrote: > > On Fri, Nov 2, 2018 at 3:28 PM Dave Hansen wrote: > > > > On 11/2/18 12:50 PM, Waiman Long wrote: > > > On 11/02/2018 03:44 PM, Dave Hansen wrote: > > >> On 11/2/18 12:40 PM, Waiman Long wrote: > > >>> The 64k+ limit check is kind of

Re: [RFC PATCH] x86/mm/fault: Allow stack access below %rsp

2018-11-04 Thread Andy Lutomirski
On Sun, Nov 4, 2018 at 9:11 PM Andy Lutomirski wrote: > > On Fri, Nov 2, 2018 at 3:28 PM Dave Hansen wrote: > > > > On 11/2/18 12:50 PM, Waiman Long wrote: > > > On 11/02/2018 03:44 PM, Dave Hansen wrote: > > >> On 11/2/18 12:40 PM, Waiman Long wrote: > > >>> The 64k+ limit check is kind of

Re: [RFC PATCH] x86/mm/fault: Allow stack access below %rsp

2018-11-04 Thread Andy Lutomirski
On Fri, Nov 2, 2018 at 3:28 PM Dave Hansen wrote: > > On 11/2/18 12:50 PM, Waiman Long wrote: > > On 11/02/2018 03:44 PM, Dave Hansen wrote: > >> On 11/2/18 12:40 PM, Waiman Long wrote: > >>> The 64k+ limit check is kind of arbitrary. So the check is now removed > >>> to just let expand_stack()

Re: [RFC PATCH] x86/mm/fault: Allow stack access below %rsp

2018-11-04 Thread Andy Lutomirski
On Fri, Nov 2, 2018 at 3:28 PM Dave Hansen wrote: > > On 11/2/18 12:50 PM, Waiman Long wrote: > > On 11/02/2018 03:44 PM, Dave Hansen wrote: > >> On 11/2/18 12:40 PM, Waiman Long wrote: > >>> The 64k+ limit check is kind of arbitrary. So the check is now removed > >>> to just let expand_stack()

Re: [PATCH] ext4: remove code duplication in update_ind/bind/tind_extent_range

2018-11-04 Thread Andreas Dilger
On Nov 4, 2018, at 9:41 AM, Vasily Averin wrote: > > update_ind/bind/tind_extent_page() differs by one variable and can be > replaced by unified function. These functions are called by similar way > and their caller function can be simplified too. The patch looks quite reasonable, though I'd

Re: [PATCH] ext4: remove code duplication in update_ind/bind/tind_extent_range

2018-11-04 Thread Andreas Dilger
On Nov 4, 2018, at 9:41 AM, Vasily Averin wrote: > > update_ind/bind/tind_extent_page() differs by one variable and can be > replaced by unified function. These functions are called by similar way > and their caller function can be simplified too. The patch looks quite reasonable, though I'd

Re: [PATCH 1/2] mm: use kvzalloc for swap_info_struct allocation

2018-11-04 Thread Vasily Averin
On 11/5/18 3:50 AM, Huang, Ying wrote: > Vasily Averin writes: > >> commit a2468cc9bfdf ("swap: choose swap device according to numa node") >> increased size of swap_info_struct up to 44 Kbytes, now it requires >> 4th order page. > > Why swap_info_struct could be so large? Because

Re: [PATCH 1/2] mm: use kvzalloc for swap_info_struct allocation

2018-11-04 Thread Vasily Averin
On 11/5/18 3:50 AM, Huang, Ying wrote: > Vasily Averin writes: > >> commit a2468cc9bfdf ("swap: choose swap device according to numa node") >> increased size of swap_info_struct up to 44 Kbytes, now it requires >> 4th order page. > > Why swap_info_struct could be so large? Because

Re: [PATCH RFC v2 1/3] pstore: map pstore types to names

2018-11-04 Thread Joel Fernandes
On Sat, Nov 03, 2018 at 04:38:16PM -0700, Joel Fernandes (Google) wrote: > In later patches we will need to map types to names, so create a table > for that which can also be used and reused in different parts of old and > new code. Also use it to save the type in the PRZ which will be useful > in

Re: [PATCH RFC v2 1/3] pstore: map pstore types to names

2018-11-04 Thread Joel Fernandes
On Sat, Nov 03, 2018 at 04:38:16PM -0700, Joel Fernandes (Google) wrote: > In later patches we will need to map types to names, so create a table > for that which can also be used and reused in different parts of old and > new code. Also use it to save the type in the PRZ which will be useful > in

Re: [RFC] doc: rcu: remove note on smp_mb during synchronize_rcu

2018-11-04 Thread Joel Fernandes
On Sun, Nov 04, 2018 at 07:43:30PM -0800, Paul E. McKenney wrote: [...] > > > > > > > > Also about GP memory ordering and RCU-tree-locking, I think you > > > > > > > > mentioned to > > > > > > > > me that the RCU reader-sections are virtually extended both > > > > > > > > forward and > > > > > >

Re: [RFC] doc: rcu: remove note on smp_mb during synchronize_rcu

2018-11-04 Thread Joel Fernandes
On Sun, Nov 04, 2018 at 07:43:30PM -0800, Paul E. McKenney wrote: [...] > > > > > > > > Also about GP memory ordering and RCU-tree-locking, I think you > > > > > > > > mentioned to > > > > > > > > me that the RCU reader-sections are virtually extended both > > > > > > > > forward and > > > > > >

Re: [PATCH 8/8] pstore/ram: Correctly calculate usable PRZ bytes

2018-11-04 Thread Joel Fernandes
Hi Kees, On Fri, Nov 02, 2018 at 01:00:08PM -0700, Kees Cook wrote: [..] > >> This corruption was visible with "ramoops.mem_size=204800 ramoops.ecc=1". > >> Any stored crashes would not be uncompressable (producing a pstorefs > >> "dmesg-*.enc.z" file), and triggering errors at boot: > >> > >>

Re: [PATCH 8/8] pstore/ram: Correctly calculate usable PRZ bytes

2018-11-04 Thread Joel Fernandes
Hi Kees, On Fri, Nov 02, 2018 at 01:00:08PM -0700, Kees Cook wrote: [..] > >> This corruption was visible with "ramoops.mem_size=204800 ramoops.ecc=1". > >> Any stored crashes would not be uncompressable (producing a pstorefs > >> "dmesg-*.enc.z" file), and triggering errors at boot: > >> > >>

Re: [PATCH RFC 2/3] mmc: sdhci-omap: Add using external dma

2018-11-04 Thread Kishon Vijay Abraham I
Hi, On 05/11/18 8:46 AM, Chunyan Zhang wrote: > sdhci-omap can support both external dma controllers via dmaengine > framework as well as ADMA in which the controller acts as DMA master. > > Signed-off-by: Chunyan Zhang > --- > drivers/mmc/host/sdhci-omap.c | 7 +++ > 1 file changed, 7

Re: [PATCH RFC 2/3] mmc: sdhci-omap: Add using external dma

2018-11-04 Thread Kishon Vijay Abraham I
Hi, On 05/11/18 8:46 AM, Chunyan Zhang wrote: > sdhci-omap can support both external dma controllers via dmaengine > framework as well as ADMA in which the controller acts as DMA master. > > Signed-off-by: Chunyan Zhang > --- > drivers/mmc/host/sdhci-omap.c | 7 +++ > 1 file changed, 7

[PATCH] rtc: hctosys: Add missing range error reporting

2018-11-04 Thread Maciej W. Rozycki
Fix an issue with the 32-bit range error path in `rtc_hctosys' where no error code is set and consequently the successful preceding call result from `rtc_read_time' is propagated to `rtc_hctosys_ret'. This in turn makes any subsequent call to `hctosys_show' incorrectly report in sysfs that

[PATCH] rtc: hctosys: Add missing range error reporting

2018-11-04 Thread Maciej W. Rozycki
Fix an issue with the 32-bit range error path in `rtc_hctosys' where no error code is set and consequently the successful preceding call result from `rtc_read_time' is propagated to `rtc_hctosys_ret'. This in turn makes any subsequent call to `hctosys_show' incorrectly report in sysfs that

Re: [RFC] doc: rcu: remove note on smp_mb during synchronize_rcu

2018-11-04 Thread Paul E. McKenney
On Sat, Nov 03, 2018 at 08:49:56PM -0700, Joel Fernandes wrote: > On Sat, Nov 03, 2018 at 04:22:59PM -0700, Paul E. McKenney wrote: > > On Fri, Nov 02, 2018 at 10:12:26PM -0700, Joel Fernandes wrote: > > > On Thu, Nov 01, 2018 at 09:13:07AM -0700, Paul E. McKenney wrote: > > > > On Wed, Oct 31,

Re: [RFC] doc: rcu: remove note on smp_mb during synchronize_rcu

2018-11-04 Thread Paul E. McKenney
On Sat, Nov 03, 2018 at 08:49:56PM -0700, Joel Fernandes wrote: > On Sat, Nov 03, 2018 at 04:22:59PM -0700, Paul E. McKenney wrote: > > On Fri, Nov 02, 2018 at 10:12:26PM -0700, Joel Fernandes wrote: > > > On Thu, Nov 01, 2018 at 09:13:07AM -0700, Paul E. McKenney wrote: > > > > On Wed, Oct 31,

[PATCH RFC 1/3] mmc: sdhci: add support for using external DMA devices

2018-11-04 Thread Chunyan Zhang
Some standard SD host controller can support both external dma controllers as well as ADMA in which the controller acts as DMA master. Currently the generic SDHCI code supports ADMA/SDMA integrated into the host controller but does not have any support for external DMA controllers implemented

[PATCH RFC 2/3] mmc: sdhci-omap: Add using external dma

2018-11-04 Thread Chunyan Zhang
sdhci-omap can support both external dma controllers via dmaengine framework as well as ADMA in which the controller acts as DMA master. Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci-omap.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/sdhci-omap.c

[PATCH RFC 1/3] mmc: sdhci: add support for using external DMA devices

2018-11-04 Thread Chunyan Zhang
Some standard SD host controller can support both external dma controllers as well as ADMA in which the controller acts as DMA master. Currently the generic SDHCI code supports ADMA/SDMA integrated into the host controller but does not have any support for external DMA controllers implemented

[PATCH RFC 2/3] mmc: sdhci-omap: Add using external dma

2018-11-04 Thread Chunyan Zhang
sdhci-omap can support both external dma controllers via dmaengine framework as well as ADMA in which the controller acts as DMA master. Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci-omap.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/sdhci-omap.c

[PATCH RFC 3/3] dt-bindings: sdhci-omap: Add example for using dmaengine

2018-11-04 Thread Chunyan Zhang
sdhci-omap can support both external dma controllers via dmaengine framework as well as ADMA in which the controller acts as DMA master. Signed-off-by: Chunyan Zhang --- Documentation/devicetree/bindings/mmc/sdhci-omap.txt | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH RFC 3/3] dt-bindings: sdhci-omap: Add example for using dmaengine

2018-11-04 Thread Chunyan Zhang
sdhci-omap can support both external dma controllers via dmaengine framework as well as ADMA in which the controller acts as DMA master. Signed-off-by: Chunyan Zhang --- Documentation/devicetree/bindings/mmc/sdhci-omap.txt | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH] PCI: Add HXT vendor ID and ACS quirk

2018-11-04 Thread Shunyong Yang
Add the HXT vendor ID to pci_ids.h and use it in quirks. As the design of HXT SD4800 ACS feature is the same as QCOM QDF2xxx, pci_quirk_qcom_rp_acs() is reused for SD4800 quirk. Cc: Joey Zheng Signed-off-by: Shunyong Yang --- drivers/pci/quirks.c| 2 ++ include/linux/pci_ids.h | 2 ++ 2

[PATCH] PCI: Add HXT vendor ID and ACS quirk

2018-11-04 Thread Shunyong Yang
Add the HXT vendor ID to pci_ids.h and use it in quirks. As the design of HXT SD4800 ACS feature is the same as QCOM QDF2xxx, pci_quirk_qcom_rp_acs() is reused for SD4800 quirk. Cc: Joey Zheng Signed-off-by: Shunyong Yang --- drivers/pci/quirks.c| 2 ++ include/linux/pci_ids.h | 2 ++ 2

[PATCH RFC 0/3] Add support for using external dma in SDHCI

2018-11-04 Thread Chunyan Zhang
Currently the generic SDHCI code in the Linux kernel supports the SD standard DMA integrated into the host controller but does not have any support for external DMA controllers implemented using dmaengine meaning that custom code is needed for any systems that use a generic DMA controller with

[PATCH RFC 0/3] Add support for using external dma in SDHCI

2018-11-04 Thread Chunyan Zhang
Currently the generic SDHCI code in the Linux kernel supports the SD standard DMA integrated into the host controller but does not have any support for external DMA controllers implemented using dmaengine meaning that custom code is needed for any systems that use a generic DMA controller with

The CONFIG_UNWINDER_ORC bug is back.

2018-11-04 Thread Rob Landley
Do "make defconfig" on x86-64, fire up menuconfig and select the frame pointer uwinder (under kernel hacking -> choose unwinder) and: $ make Makefile:966: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.

The CONFIG_UNWINDER_ORC bug is back.

2018-11-04 Thread Rob Landley
Do "make defconfig" on x86-64, fire up menuconfig and select the frame pointer uwinder (under kernel hacking -> choose unwinder) and: $ make Makefile:966: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.

Re: linux-next: Tree for Oct 31 (vboxguest)

2018-11-04 Thread Masahiro Yamada
On Mon, Nov 5, 2018 at 9:54 AM Changbin Du wrote: > > On Sun, Nov 04, 2018 at 11:43:44AM +0900, Masahiro Yamada wrote: > > On Sat, Nov 3, 2018 at 12:55 AM Arnd Bergmann wrote: > > > > > > On 11/2/18, Masahiro Yamada wrote: > > > > On Thu, Nov 1, 2018 at 11:32 PM Changbin Du > > > > wrote: > >

Re: linux-next: Tree for Oct 31 (vboxguest)

2018-11-04 Thread Masahiro Yamada
On Mon, Nov 5, 2018 at 9:54 AM Changbin Du wrote: > > On Sun, Nov 04, 2018 at 11:43:44AM +0900, Masahiro Yamada wrote: > > On Sat, Nov 3, 2018 at 12:55 AM Arnd Bergmann wrote: > > > > > > On 11/2/18, Masahiro Yamada wrote: > > > > On Thu, Nov 1, 2018 at 11:32 PM Changbin Du > > > > wrote: > >

Re: Grant

2018-11-04 Thread M. M. Fridman
I, Mikhail Fridman have selected you specifically as one of my beneficiaries for my Charitable Donation of $5 Million Dollars, Check the link below for confirmation: https://www.rt.com/business/343781-mikhail-fridman-will-charity/ I await your earliest response for further directives. Best

Re: Grant

2018-11-04 Thread M. M. Fridman
I, Mikhail Fridman have selected you specifically as one of my beneficiaries for my Charitable Donation of $5 Million Dollars, Check the link below for confirmation: https://www.rt.com/business/343781-mikhail-fridman-will-charity/ I await your earliest response for further directives. Best

[PATCH] kbuild: consolidate Clang compiler flags

2018-11-04 Thread Masahiro Yamada
Add basic options for Clang such as --target, --prefix, --gcc-toolchain, -no-integrated-as to a single variable CLANG_FLAGS. Signed-off-by: Masahiro Yamada --- Makefile | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 93315eb..58c838a

[PATCH] kbuild: consolidate Clang compiler flags

2018-11-04 Thread Masahiro Yamada
Add basic options for Clang such as --target, --prefix, --gcc-toolchain, -no-integrated-as to a single variable CLANG_FLAGS. Signed-off-by: Masahiro Yamada --- Makefile | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 93315eb..58c838a

[PATCH] kernel/resource.c: fix new kernel-doc warnings

2018-11-04 Thread Randy Dunlap
From: Randy Dunlap Fix kernel-doc warnings in kernel/resource.c. The first group of warnings is caused by a "/**" kernel-doc notation marker but the function comments are not in kernel-doc format. Also add another error return value here. ../kernel/resource.c:337: warning: Function parameter or

[PATCH] kernel/resource.c: fix new kernel-doc warnings

2018-11-04 Thread Randy Dunlap
From: Randy Dunlap Fix kernel-doc warnings in kernel/resource.c. The first group of warnings is caused by a "/**" kernel-doc notation marker but the function comments are not in kernel-doc format. Also add another error return value here. ../kernel/resource.c:337: warning: Function parameter or

[PATCH] mtd: nand: drop kernel-doc notation for a deleted function parameter

2018-11-04 Thread Randy Dunlap
From: Randy Dunlap Remove kernel-doc notation for a deleted function parameter to prevent a kernel-doc warning: ../drivers/mtd/nand/raw/nand_base.c:603: warning: Excess function parameter 'mtd' description in 'panic_nand_wait' Fixes: f1d46942e823 ("mtd: rawnand: Pass a nand_chip object to

[PATCH] mtd: nand: drop kernel-doc notation for a deleted function parameter

2018-11-04 Thread Randy Dunlap
From: Randy Dunlap Remove kernel-doc notation for a deleted function parameter to prevent a kernel-doc warning: ../drivers/mtd/nand/raw/nand_base.c:603: warning: Excess function parameter 'mtd' description in 'panic_nand_wait' Fixes: f1d46942e823 ("mtd: rawnand: Pass a nand_chip object to

[PATCH RCU -stable] Make need_resched() respond to urgent RCU-QS needs

2018-11-04 Thread Paul E. McKenney
commit 92aa39e9dc77 upstream. The per-CPU rcu_dynticks.rcu_urgent_qs variable communicates an urgent need for an RCU quiescent state from the force-quiescent-state processing within the grace-period kthread to context switches and to cond_resched(). Unfortunately, such urgent needs are not

[PATCH RCU -stable] Make need_resched() respond to urgent RCU-QS needs

2018-11-04 Thread Paul E. McKenney
commit 92aa39e9dc77 upstream. The per-CPU rcu_dynticks.rcu_urgent_qs variable communicates an urgent need for an RCU quiescent state from the force-quiescent-state processing within the grace-period kthread to context switches and to cond_resched(). Unfortunately, such urgent needs are not

Re: [PATCH] cpufreq: imx6q: add return value check for voltage scale

2018-11-04 Thread Viresh Kumar
On 05-11-18, 00:59, Anson Huang wrote: > Add return value check for voltage scale when ARM clock > rate change fail. > > Signed-off-by: Anson Huang > --- > drivers/cpufreq/imx6q-cpufreq.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH] cpufreq: imx6q: add return value check for voltage scale

2018-11-04 Thread Viresh Kumar
On 05-11-18, 00:59, Anson Huang wrote: > Add return value check for voltage scale when ARM clock > rate change fail. > > Signed-off-by: Anson Huang > --- > drivers/cpufreq/imx6q-cpufreq.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH 7/7] ARM: dts: imx6: add mmdc ipg clock

2018-11-04 Thread Shawn Guo
On Fri, Aug 31, 2018 at 03:53:18PM +0800, Anson Huang wrote: > i.MX6 SoCs has MMDC clock gates in CCM CCGR, add > clock property for MMDC driver's clock operation. > > Signed-off-by: Anson Huang Applied, thanks.

Re: [PATCH 7/7] ARM: dts: imx6: add mmdc ipg clock

2018-11-04 Thread Shawn Guo
On Fri, Aug 31, 2018 at 03:53:18PM +0800, Anson Huang wrote: > i.MX6 SoCs has MMDC clock gates in CCM CCGR, add > clock property for MMDC driver's clock operation. > > Signed-off-by: Anson Huang Applied, thanks.

Re: [PATCH v3] ARM: dts: imx6sx-sdb: Fix enet phy regulator

2018-11-04 Thread Shawn Guo
On Mon, Oct 08, 2018 at 03:28:01PM +, Leonard Crestez wrote: > Bindings for "fixed-regulator" only explicitly support "gpio" property, > not "gpios". Fix by correcting the property name. > > The enet PHYs on imx6sx-sdb needs to be explicitly reset after a power > cycle, this can be handled by

Re: [PATCH v3] ARM: dts: imx6sx-sdb: Fix enet phy regulator

2018-11-04 Thread Shawn Guo
On Mon, Oct 08, 2018 at 03:28:01PM +, Leonard Crestez wrote: > Bindings for "fixed-regulator" only explicitly support "gpio" property, > not "gpios". Fix by correcting the property name. > > The enet PHYs on imx6sx-sdb needs to be explicitly reset after a power > cycle, this can be handled by

RE: [Resend PATCH v13 08/12] KVM: x86: Add Intel PT context switch for each vcpu

2018-11-04 Thread Kang, Luwei
> >> If you "have to enable or disable anything" it means you have to > >> override the default. But the default in this patches is "no change > >> compared to before the patches", leaving tracing of both host and > >> guest entirely to the host, so I don't understand your remark. What > >>

Re: [PATCH] misc: mic: fix a DMA pool free failure

2018-11-04 Thread Sudeep Dutt
On Thu, 2018-10-18 at 14:46 -0500, Wenwen Wang wrote: > In _scif_prog_signal(), a DMA pool is allocated if the MIC Coprocessor is > not X100, i.e., the boolean variable 'x100' is false. This DMA pool will be > freed eventually through the callback function scif_prog_signal_cb() with > the

RE: [Resend PATCH v13 08/12] KVM: x86: Add Intel PT context switch for each vcpu

2018-11-04 Thread Kang, Luwei
> >> If you "have to enable or disable anything" it means you have to > >> override the default. But the default in this patches is "no change > >> compared to before the patches", leaving tracing of both host and > >> guest entirely to the host, so I don't understand your remark. What > >>

Re: [PATCH] misc: mic: fix a DMA pool free failure

2018-11-04 Thread Sudeep Dutt
On Thu, 2018-10-18 at 14:46 -0500, Wenwen Wang wrote: > In _scif_prog_signal(), a DMA pool is allocated if the MIC Coprocessor is > not X100, i.e., the boolean variable 'x100' is false. This DMA pool will be > freed eventually through the callback function scif_prog_signal_cb() with > the

multiplexing /dev/console to all console= entries

2018-11-04 Thread Dusty Mabe
Hi Greg, Jiri, I'd like to bring up a question about multiplexing /dev/console to all specified console= devices on the kernel command line rather than just the last entry. In my personal experience using linux systems and also in my experience dealing with users of various server images

multiplexing /dev/console to all console= entries

2018-11-04 Thread Dusty Mabe
Hi Greg, Jiri, I'd like to bring up a question about multiplexing /dev/console to all specified console= devices on the kernel command line rather than just the last entry. In my personal experience using linux systems and also in my experience dealing with users of various server images

[PATCH v3 14/16] tpm: introduce tpm_chip_start() and tpm_chip_stop()

2018-11-04 Thread Jarkko Sakkinen
Encapsulate power gating and locality functionality to tpm_chip_start() and tpm_chip_stop() in order to clean up the branching mess in tpm_transmit(). Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-chip.c | 110 +++ drivers/char/tpm/tpm-interface.c |

[PATCH v3 16/16] tpm: remove @flags from tpm_transmit()

2018-11-04 Thread Jarkko Sakkinen
Remove @flags from tpm_transmit() API. It is no longer used for anything. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-chip.c | 32 ++--- drivers/char/tpm/tpm-dev-common.c | 2 +- drivers/char/tpm/tpm-interface.c | 18 drivers/char/tpm/tpm-sysfs.c

[PATCH v3 14/16] tpm: introduce tpm_chip_start() and tpm_chip_stop()

2018-11-04 Thread Jarkko Sakkinen
Encapsulate power gating and locality functionality to tpm_chip_start() and tpm_chip_stop() in order to clean up the branching mess in tpm_transmit(). Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-chip.c | 110 +++ drivers/char/tpm/tpm-interface.c |

[PATCH v3 16/16] tpm: remove @flags from tpm_transmit()

2018-11-04 Thread Jarkko Sakkinen
Remove @flags from tpm_transmit() API. It is no longer used for anything. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-chip.c | 32 ++--- drivers/char/tpm/tpm-dev-common.c | 2 +- drivers/char/tpm/tpm-interface.c | 18 drivers/char/tpm/tpm-sysfs.c

[PATCH v3 15/16] tpm: take TPM chip power gating out of tpm_transmit()

2018-11-04 Thread Jarkko Sakkinen
Call tpm_chip_start() and tpm_chip_stop() in * tpm_try_get_ops() and tpm_put_ops() * tpm_chip_register() * tpm2_del_space() And remove these calls from tpm_transmit(). The core reason for this change is that in tpm_vtpm_proxy a locality change requires a virtual TPM command (a command made up

[PATCH v3 15/16] tpm: take TPM chip power gating out of tpm_transmit()

2018-11-04 Thread Jarkko Sakkinen
Call tpm_chip_start() and tpm_chip_stop() in * tpm_try_get_ops() and tpm_put_ops() * tpm_chip_register() * tpm2_del_space() And remove these calls from tpm_transmit(). The core reason for this change is that in tpm_vtpm_proxy a locality change requires a virtual TPM command (a command made up

[PATCH v3 12/16] tpm: use tpm_try_get_ops() in tpm-sysfs.c.

2018-11-04 Thread Jarkko Sakkinen
Use tpm_try_get_ops() in tpm-sysfs.c so that we can consider moving other decorations (locking, localities, power management for example) inside it. This direction can be of course taken only after other call sites for tpm_transmit() have been treated in the same way. Signed-off-by: Jarkko

[PATCH v3 13/16] tpm: remove TPM_TRANSMIT_UNLOCKED flag

2018-11-04 Thread Jarkko Sakkinen
Added locking as part of tpm_try_get_ops() and tpm_put_ops() as they are anyway used in most of the call sites except in tpmrm_release() where we take the locks manually. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-chip.c | 2 ++ drivers/char/tpm/tpm-dev-common.c | 4 +---

[PATCH v3 12/16] tpm: use tpm_try_get_ops() in tpm-sysfs.c.

2018-11-04 Thread Jarkko Sakkinen
Use tpm_try_get_ops() in tpm-sysfs.c so that we can consider moving other decorations (locking, localities, power management for example) inside it. This direction can be of course taken only after other call sites for tpm_transmit() have been treated in the same way. Signed-off-by: Jarkko

[PATCH v3 13/16] tpm: remove TPM_TRANSMIT_UNLOCKED flag

2018-11-04 Thread Jarkko Sakkinen
Added locking as part of tpm_try_get_ops() and tpm_put_ops() as they are anyway used in most of the call sites except in tpmrm_release() where we take the locks manually. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-chip.c | 2 ++ drivers/char/tpm/tpm-dev-common.c | 4 +---

[PATCH v3 10/16] tpm: move TPM space code out of tpm_transmit()

2018-11-04 Thread Jarkko Sakkinen
Prepare and commit TPM space before and after calling tpm_transmit() instead of doing that inside tpm_transmit(). After this change we can remove TPM_TRANSMIT_NESTED flag from tpm2_prepare_space() and tpm2_commit_space() and replace it with TPM_TRANSMIT_UNLOCKED. Signed-off-by: Jarkko Sakkinen

[PATCH v3 08/16] tpm: move tpm_validate_commmand() to tpm2-space.c

2018-11-04 Thread Jarkko Sakkinen
Move tpm_validate_command() to tpm2-space.c and make it part of the tpm2_prepare_space() flow. Make cc resolution as part of the TPM space functionality in order to detach it from rest of the tpm_transmit() flow. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 72

[PATCH v3 09/16] tpm: encapsulate tpm_dev_transmit()

2018-11-04 Thread Jarkko Sakkinen
Encapsulate tpm_transmit() call pattern to tpm_dev_transmit() because it is identically used from two places. Use unlocked version of tpm_transmit() so that we are able to move the calls to tpm2_prepare_space() and tpm2_commit_space() later on to this new function. Signed-off-by: Jarkko Sakkinen

[PATCH v3 08/16] tpm: move tpm_validate_commmand() to tpm2-space.c

2018-11-04 Thread Jarkko Sakkinen
Move tpm_validate_command() to tpm2-space.c and make it part of the tpm2_prepare_space() flow. Make cc resolution as part of the TPM space functionality in order to detach it from rest of the tpm_transmit() flow. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 72

[PATCH v3 09/16] tpm: encapsulate tpm_dev_transmit()

2018-11-04 Thread Jarkko Sakkinen
Encapsulate tpm_transmit() call pattern to tpm_dev_transmit() because it is identically used from two places. Use unlocked version of tpm_transmit() so that we are able to move the calls to tpm2_prepare_space() and tpm2_commit_space() later on to this new function. Signed-off-by: Jarkko Sakkinen

[PATCH v3 10/16] tpm: move TPM space code out of tpm_transmit()

2018-11-04 Thread Jarkko Sakkinen
Prepare and commit TPM space before and after calling tpm_transmit() instead of doing that inside tpm_transmit(). After this change we can remove TPM_TRANSMIT_NESTED flag from tpm2_prepare_space() and tpm2_commit_space() and replace it with TPM_TRANSMIT_UNLOCKED. Signed-off-by: Jarkko Sakkinen

[PATCH v3 03/16] tpm: return 0 from pcrs_show() when tpm1_pcr_read() fails

2018-11-04 Thread Jarkko Sakkinen
Do not print partial list of PCRs when tpm1_pcr_read() fails but instead return 0 from pcrs_show(). This is consistent behavior with other sysfs functions. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-sysfs.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v3 06/16] tpm: clean up tpm_try_transmit() error handling flow

2018-11-04 Thread Jarkko Sakkinen
Move locking, locality handling and power management to tpm_transmit() in order to simplify the flow. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 90 ++-- 1 file changed, 39 insertions(+), 51 deletions(-) diff --git

[PATCH v3 07/16] tpm: access command header through struct in tpm_try_transmit()

2018-11-04 Thread Jarkko Sakkinen
Instead of accessing fields of the command header through offsets to the raw buffer, it is a better idea to use the header struct pointer that is already used elsewhere in the function. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 4 ++-- 1 file changed, 2

[PATCH v3 04/16] tpm: call tpm2_flush_space() on error in tpm_try_transmit()

2018-11-04 Thread Jarkko Sakkinen
Always call tpm2_flush_space() on failure in tpm_try_transmit() so that the volatile memory of the TPM gets cleared. If /dev/tpm0 does not have sufficient permissions (usually it has), this could leak to the leakage of TPM objects. Through /dev/tpmrm0 this issue does not raise new security

[PATCH v3 02/16] tpm: fix invalid return value in pubek_show()

2018-11-04 Thread Jarkko Sakkinen
Return zero when tpm_buf_init() fails as we do for other functions in tpm-sysfs.c. Fixes: da379f3c1db0c ("tpm: migrate pubek_show to struct tpm_buf") Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-sysfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[PATCH v3 05/16] tpm: print tpm2_commit_space() error inside tpm2_commit_space()

2018-11-04 Thread Jarkko Sakkinen
The error logging for tpm2_commit_space() is in a wrong place. This commit moves it inside that function. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm2-space.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm2-space.c

[PATCH v3 03/16] tpm: return 0 from pcrs_show() when tpm1_pcr_read() fails

2018-11-04 Thread Jarkko Sakkinen
Do not print partial list of PCRs when tpm1_pcr_read() fails but instead return 0 from pcrs_show(). This is consistent behavior with other sysfs functions. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-sysfs.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v3 06/16] tpm: clean up tpm_try_transmit() error handling flow

2018-11-04 Thread Jarkko Sakkinen
Move locking, locality handling and power management to tpm_transmit() in order to simplify the flow. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 90 ++-- 1 file changed, 39 insertions(+), 51 deletions(-) diff --git

[PATCH v3 07/16] tpm: access command header through struct in tpm_try_transmit()

2018-11-04 Thread Jarkko Sakkinen
Instead of accessing fields of the command header through offsets to the raw buffer, it is a better idea to use the header struct pointer that is already used elsewhere in the function. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 4 ++-- 1 file changed, 2

[PATCH v3 04/16] tpm: call tpm2_flush_space() on error in tpm_try_transmit()

2018-11-04 Thread Jarkko Sakkinen
Always call tpm2_flush_space() on failure in tpm_try_transmit() so that the volatile memory of the TPM gets cleared. If /dev/tpm0 does not have sufficient permissions (usually it has), this could leak to the leakage of TPM objects. Through /dev/tpmrm0 this issue does not raise new security

[PATCH v3 02/16] tpm: fix invalid return value in pubek_show()

2018-11-04 Thread Jarkko Sakkinen
Return zero when tpm_buf_init() fails as we do for other functions in tpm-sysfs.c. Fixes: da379f3c1db0c ("tpm: migrate pubek_show to struct tpm_buf") Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-sysfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[PATCH v3 05/16] tpm: print tpm2_commit_space() error inside tpm2_commit_space()

2018-11-04 Thread Jarkko Sakkinen
The error logging for tpm2_commit_space() is in a wrong place. This commit moves it inside that function. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm2-space.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm2-space.c

[PATCH v3 00/16] Remove nested TPM operations

2018-11-04 Thread Jarkko Sakkinen
[was Detach TPM space code out of the tpm_transmit() flow but the scope expanded a bit.] Make the changes necessary to detach TPM space code and TPM activation code out of the tpm_transmit() flow because of both of these can cause nested tpm_transmit() calls. The nesteds calls make the whole

[PATCH v3 01/16] tpm: use tpm_buf in tpm_transmit_cmd() as the IO parameter

2018-11-04 Thread Jarkko Sakkinen
Since we pass an initialized struct tpm_buf instance in every call site now, it is cleaner to pass that directly to the tpm_transmit_cmd() as the TPM command/response buffer. Fine-tune a little bit tpm_transmit() and tpm_transmit_cmd() comments while doing this. Signed-off-by: Jarkko Sakkinen

[PATCH v3 00/16] Remove nested TPM operations

2018-11-04 Thread Jarkko Sakkinen
[was Detach TPM space code out of the tpm_transmit() flow but the scope expanded a bit.] Make the changes necessary to detach TPM space code and TPM activation code out of the tpm_transmit() flow because of both of these can cause nested tpm_transmit() calls. The nesteds calls make the whole

[PATCH v3 01/16] tpm: use tpm_buf in tpm_transmit_cmd() as the IO parameter

2018-11-04 Thread Jarkko Sakkinen
Since we pass an initialized struct tpm_buf instance in every call site now, it is cleaner to pass that directly to the tpm_transmit_cmd() as the TPM command/response buffer. Fine-tune a little bit tpm_transmit() and tpm_transmit_cmd() comments while doing this. Signed-off-by: Jarkko Sakkinen

[PATCH 12/12] VFS: locks: remove unnecessary white space.

2018-11-04 Thread NeilBrown
- spaces before tabs, - spaces at the end of lines, - multiple blank lines, - blank lines before EXPORT_SYMBOL, can all go. Signed-off-by: NeilBrown --- fs/locks.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/fs/locks.c

[PATCH 11/12] locks: merge posix_unblock_lock() and locks_delete_block()

2018-11-04 Thread NeilBrown
posix_unblock_lock() is not specific to posix locks, and behaves nearly identically to locks_delete_block() - the former returning a status while the later doesn't. So discard posix_unblock_lock() and use locks_delete_block() instead, after giving that function an appropriate return value.

[PATCH 12/12] VFS: locks: remove unnecessary white space.

2018-11-04 Thread NeilBrown
- spaces before tabs, - spaces at the end of lines, - multiple blank lines, - blank lines before EXPORT_SYMBOL, can all go. Signed-off-by: NeilBrown --- fs/locks.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/fs/locks.c

[PATCH 11/12] locks: merge posix_unblock_lock() and locks_delete_block()

2018-11-04 Thread NeilBrown
posix_unblock_lock() is not specific to posix locks, and behaves nearly identically to locks_delete_block() - the former returning a status while the later doesn't. So discard posix_unblock_lock() and use locks_delete_block() instead, after giving that function an appropriate return value.

[PATCH 08/12] fs/locks: always delete_block after waiting.

2018-11-04 Thread NeilBrown
Now that requests can block other requests, we need to be careful to always clean up those blocked requests. Any time that we wait for a request, we might have other requests attached, and when we stop waiting, we must clean them up. If the lock was granted, the requests might have been moved to

[PATCH 06/12] locks: use properly initialized file_lock when unlocking.

2018-11-04 Thread NeilBrown
Both locks_remove_posix() and locks_remove_flock() use a struct file_lock without calling locks_init_lock() on it. This means the various list_heads are not initialized, which will become a problem with a later patch. So change them both to initialize properly. For flock locks, this involves

[PATCH 08/12] fs/locks: always delete_block after waiting.

2018-11-04 Thread NeilBrown
Now that requests can block other requests, we need to be careful to always clean up those blocked requests. Any time that we wait for a request, we might have other requests attached, and when we stop waiting, we must clean them up. If the lock was granted, the requests might have been moved to

[PATCH 06/12] locks: use properly initialized file_lock when unlocking.

2018-11-04 Thread NeilBrown
Both locks_remove_posix() and locks_remove_flock() use a struct file_lock without calling locks_init_lock() on it. This means the various list_heads are not initialized, which will become a problem with a later patch. So change them both to initialize properly. For flock locks, this involves

[PATCH 10/12] fs/locks: create a tree of dependent requests.

2018-11-04 Thread NeilBrown
When we find an existing lock which conflicts with a request, and the request wants to wait, we currently add the request to a list. When the lock is removed, the whole list is woken. This can cause the thundering-herd problem. To reduce the problem, we make use of the (new) fact that a pending

[PATCH 07/12] fs/locks: allow a lock request to block other requests.

2018-11-04 Thread NeilBrown
Currently, a lock can block pending requests, but all pending requests are equal. If lots of pending requests are mutually exclusive, this means they will all be woken up and all but one will fail. This can hurt performance. So we will allow pending requests to block other requests. Only the

[PATCH 09/12] fs/locks: change all *_conflict() functions to return bool.

2018-11-04 Thread NeilBrown
posix_locks_conflict() and flock_locks_conflict() both return int. leases_conflict() returns bool. This inconsistency will cause problems for the next patch if not fixed. So change posix_locks_conflict() and flock_locks_conflict() to return bool. Also change the locks_conflict() helper. And

[PATCH 07/12] fs/locks: allow a lock request to block other requests.

2018-11-04 Thread NeilBrown
Currently, a lock can block pending requests, but all pending requests are equal. If lots of pending requests are mutually exclusive, this means they will all be woken up and all but one will fail. This can hurt performance. So we will allow pending requests to block other requests. Only the

<    1   2   3   4   5   6   7   8   9   >