mhi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const
@ 2023-07-22 23:08 Lars-Peter Clausen
  2023-07-22 23:08 ` [PATCH 2/5] PCI: endpoint: pci-epf-mhi: Constify pci_epf_ops and pci_epf_event_ops Lars-Peter Clausen
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Lars-Peter Clausen @ 2023-07-22 23:08 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Krzysztof Wilczyński
  Cc: Manivannan Sadhasivam, Kishon Vijay Abraham I, Bjorn Helgaas,
	Jon Mason, Dave Jiang, Allen Hubbe, linux-pci, mhi, ntb,
	Lars-Peter Clausen

The pci_epf_ops struct contains a set of callbacks that are used by the
pci_epf_driver. The ops struct is never modified by the epf core itself.

Marking the ops pointer const allows epf drivers to declare their
pci_epf_ops struct to be const. This allows the struct to be placed in the
read-only section. Which for example brings some security benefits as the
callbacks can not be overwritten.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 include/linux/pci-epf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/pci-epf.h b/include/linux/pci-epf.h
index 3f44b6aec477..34be3f1da46c 100644
--- a/include/linux/pci-epf.h
+++ b/include/linux/pci-epf.h
@@ -98,7 +98,7 @@ struct pci_epf_driver {
 	void	(*remove)(struct pci_epf *epf);
 
 	struct device_driver	driver;
-	struct pci_epf_ops	*ops;
+	const struct pci_epf_ops *ops;
 	struct module		*owner;
 	struct list_head	epf_group;
 	const struct pci_epf_device_id	*id_table;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/5] PCI: endpoint: pci-epf-mhi: Constify pci_epf_ops and pci_epf_event_ops
  2023-07-22 23:08 [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Lars-Peter Clausen
@ 2023-07-22 23:08 ` Lars-Peter Clausen
  2023-07-24  6:01   ` Manivannan Sadhasivam
  2023-07-22 23:08 ` [PATCH 3/5] PCI: endpoint: pci-epf-ntb: Constify pci_epf_ops Lars-Peter Clausen
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2023-07-22 23:08 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Krzysztof Wilczyński
  Cc: Manivannan Sadhasivam, Kishon Vijay Abraham I, Bjorn Helgaas,
	Jon Mason, Dave Jiang, Allen Hubbe, linux-pci, mhi, ntb,
	Lars-Peter Clausen

Both the pci_epf_ops and pci_epf_evnt_ops structs for the PCI endpoint mhi
driver are never modified. Mark them as const so they can be placed in the
read-only section.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/pci/endpoint/functions/pci-epf-mhi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
index 9c1f5a154fbd..bb1c8e502a09 100644
--- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
+++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
@@ -389,7 +389,7 @@ static void pci_epf_mhi_unbind(struct pci_epf *epf)
 	pci_epc_clear_bar(epc, epf->func_no, epf->vfunc_no, epf_bar);
 }
 
-static struct pci_epc_event_ops pci_epf_mhi_event_ops = {
+static const struct pci_epc_event_ops pci_epf_mhi_event_ops = {
 	.core_init = pci_epf_mhi_core_init,
 	.link_up = pci_epf_mhi_link_up,
 	.link_down = pci_epf_mhi_link_down,
@@ -428,7 +428,7 @@ static const struct pci_epf_device_id pci_epf_mhi_ids[] = {
 	{},
 };
 
-static struct pci_epf_ops pci_epf_mhi_ops = {
+static const struct pci_epf_ops pci_epf_mhi_ops = {
 	.unbind	= pci_epf_mhi_unbind,
 	.bind	= pci_epf_mhi_bind,
 };
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/5] PCI: endpoint: pci-epf-ntb: Constify pci_epf_ops
  2023-07-22 23:08 [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Lars-Peter Clausen
  2023-07-22 23:08 ` [PATCH 2/5] PCI: endpoint: pci-epf-mhi: Constify pci_epf_ops and pci_epf_event_ops Lars-Peter Clausen
@ 2023-07-22 23:08 ` Lars-Peter Clausen
  2023-07-24  6:02   ` Manivannan Sadhasivam
  2023-07-22 23:08 ` [PATCH 4/5] PCI: endpoint: pci-epf-vntb: " Lars-Peter Clausen
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2023-07-22 23:08 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Krzysztof Wilczyński
  Cc: Manivannan Sadhasivam, Kishon Vijay Abraham I, Bjorn Helgaas,
	Jon Mason, Dave Jiang, Allen Hubbe, linux-pci, mhi, ntb,
	Lars-Peter Clausen

The pci_epf_ops struct for the PCI endpoint ntb driver is never modified.
Mark it as const so it can be placed in the read-only section.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/pci/endpoint/functions/pci-epf-ntb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-ntb.c b/drivers/pci/endpoint/functions/pci-epf-ntb.c
index 9aac2c6f3bb9..630181469720 100644
--- a/drivers/pci/endpoint/functions/pci-epf-ntb.c
+++ b/drivers/pci/endpoint/functions/pci-epf-ntb.c
@@ -2099,7 +2099,7 @@ static int epf_ntb_probe(struct pci_epf *epf,
 	return 0;
 }
 
-static struct pci_epf_ops epf_ntb_ops = {
+static const struct pci_epf_ops epf_ntb_ops = {
 	.bind	= epf_ntb_bind,
 	.unbind	= epf_ntb_unbind,
 	.add_cfs = epf_ntb_add_cfs,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/5] PCI: endpoint: pci-epf-vntb: Constify pci_epf_ops
  2023-07-22 23:08 [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Lars-Peter Clausen
  2023-07-22 23:08 ` [PATCH 2/5] PCI: endpoint: pci-epf-mhi: Constify pci_epf_ops and pci_epf_event_ops Lars-Peter Clausen
  2023-07-22 23:08 ` [PATCH 3/5] PCI: endpoint: pci-epf-ntb: Constify pci_epf_ops Lars-Peter Clausen
@ 2023-07-22 23:08 ` Lars-Peter Clausen
  2023-07-24  6:02   ` Manivannan Sadhasivam
  2023-07-22 23:08 ` [PATCH 5/5] PCI: endpoint: pci-epf-test: " Lars-Peter Clausen
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2023-07-22 23:08 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Krzysztof Wilczyński
  Cc: Manivannan Sadhasivam, Kishon Vijay Abraham I, Bjorn Helgaas,
	Jon Mason, Dave Jiang, Allen Hubbe, linux-pci, mhi, ntb,
	Lars-Peter Clausen

The pci_epf_ops struct for the PCI endpoint vntb driver is never modified.
Mark it as const so it can be placed in the read-only section.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/pci/endpoint/functions/pci-epf-vntb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
index c8b423c3c26e..ff4b43af4487 100644
--- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
+++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
@@ -1387,7 +1387,7 @@ static void epf_ntb_unbind(struct pci_epf *epf)
 }
 
 // EPF driver probe
-static struct pci_epf_ops epf_ntb_ops = {
+static const struct pci_epf_ops epf_ntb_ops = {
 	.bind   = epf_ntb_bind,
 	.unbind = epf_ntb_unbind,
 	.add_cfs = epf_ntb_add_cfs,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/5] PCI: endpoint: pci-epf-test: Constify pci_epf_ops
  2023-07-22 23:08 [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Lars-Peter Clausen
                   ` (2 preceding siblings ...)
  2023-07-22 23:08 ` [PATCH 4/5] PCI: endpoint: pci-epf-vntb: " Lars-Peter Clausen
@ 2023-07-22 23:08 ` Lars-Peter Clausen
  2023-07-24  6:03   ` Manivannan Sadhasivam
  2023-07-24  6:00 ` [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Manivannan Sadhasivam
  2023-12-18 22:43 ` Krzysztof Wilczyński
  5 siblings, 1 reply; 11+ messages in thread
From: Lars-Peter Clausen @ 2023-07-22 23:08 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Krzysztof Wilczyński
  Cc: Manivannan Sadhasivam, Kishon Vijay Abraham I, Bjorn Helgaas,
	Jon Mason, Dave Jiang, Allen Hubbe, linux-pci, mhi, ntb,
	Lars-Peter Clausen

The pci_epf_ops struct for the PCI endpoint test driver is never modified.
Mark it as const so it can be placed in the read-only section.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 1f0d2b84296a..7cc1c5c70afc 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -973,7 +973,7 @@ static int pci_epf_test_probe(struct pci_epf *epf,
 	return 0;
 }
 
-static struct pci_epf_ops ops = {
+static const struct pci_epf_ops ops = {
 	.unbind	= pci_epf_test_unbind,
 	.bind	= pci_epf_test_bind,
 };
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const
  2023-07-22 23:08 [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Lars-Peter Clausen
                   ` (3 preceding siblings ...)
  2023-07-22 23:08 ` [PATCH 5/5] PCI: endpoint: pci-epf-test: " Lars-Peter Clausen
@ 2023-07-24  6:00 ` Manivannan Sadhasivam
  2023-12-18 22:43 ` Krzysztof Wilczyński
  5 siblings, 0 replies; 11+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-24  6:00 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Bjorn Helgaas, Jon Mason, Dave Jiang,
	Allen Hubbe, linux-pci, mhi, ntb

On Sat, Jul 22, 2023 at 04:08:44PM -0700, Lars-Peter Clausen wrote:
> The pci_epf_ops struct contains a set of callbacks that are used by the
> pci_epf_driver. The ops struct is never modified by the epf core itself.
> 
> Marking the ops pointer const allows epf drivers to declare their
> pci_epf_ops struct to be const. This allows the struct to be placed in the
> read-only section. Which for example brings some security benefits as the
> callbacks can not be overwritten.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

- Mani

> ---
>  include/linux/pci-epf.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/pci-epf.h b/include/linux/pci-epf.h
> index 3f44b6aec477..34be3f1da46c 100644
> --- a/include/linux/pci-epf.h
> +++ b/include/linux/pci-epf.h
> @@ -98,7 +98,7 @@ struct pci_epf_driver {
>  	void	(*remove)(struct pci_epf *epf);
>  
>  	struct device_driver	driver;
> -	struct pci_epf_ops	*ops;
> +	const struct pci_epf_ops *ops;
>  	struct module		*owner;
>  	struct list_head	epf_group;
>  	const struct pci_epf_device_id	*id_table;
> -- 
> 2.39.2
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/5] PCI: endpoint: pci-epf-mhi: Constify pci_epf_ops and pci_epf_event_ops
  2023-07-22 23:08 ` [PATCH 2/5] PCI: endpoint: pci-epf-mhi: Constify pci_epf_ops and pci_epf_event_ops Lars-Peter Clausen
@ 2023-07-24  6:01   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 11+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-24  6:01 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Bjorn Helgaas, Jon Mason, Dave Jiang,
	Allen Hubbe, linux-pci, mhi, ntb

On Sat, Jul 22, 2023 at 04:08:45PM -0700, Lars-Peter Clausen wrote:
> Both the pci_epf_ops and pci_epf_evnt_ops structs for the PCI endpoint mhi
> driver are never modified. Mark them as const so they can be placed in the
> read-only section.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

- Mani

> ---
>  drivers/pci/endpoint/functions/pci-epf-mhi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
> index 9c1f5a154fbd..bb1c8e502a09 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
> @@ -389,7 +389,7 @@ static void pci_epf_mhi_unbind(struct pci_epf *epf)
>  	pci_epc_clear_bar(epc, epf->func_no, epf->vfunc_no, epf_bar);
>  }
>  
> -static struct pci_epc_event_ops pci_epf_mhi_event_ops = {
> +static const struct pci_epc_event_ops pci_epf_mhi_event_ops = {
>  	.core_init = pci_epf_mhi_core_init,
>  	.link_up = pci_epf_mhi_link_up,
>  	.link_down = pci_epf_mhi_link_down,
> @@ -428,7 +428,7 @@ static const struct pci_epf_device_id pci_epf_mhi_ids[] = {
>  	{},
>  };
>  
> -static struct pci_epf_ops pci_epf_mhi_ops = {
> +static const struct pci_epf_ops pci_epf_mhi_ops = {
>  	.unbind	= pci_epf_mhi_unbind,
>  	.bind	= pci_epf_mhi_bind,
>  };
> -- 
> 2.39.2
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/5] PCI: endpoint: pci-epf-ntb: Constify pci_epf_ops
  2023-07-22 23:08 ` [PATCH 3/5] PCI: endpoint: pci-epf-ntb: Constify pci_epf_ops Lars-Peter Clausen
@ 2023-07-24  6:02   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 11+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-24  6:02 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Bjorn Helgaas, Jon Mason, Dave Jiang,
	Allen Hubbe, linux-pci, mhi, ntb

On Sat, Jul 22, 2023 at 04:08:46PM -0700, Lars-Peter Clausen wrote:
> The pci_epf_ops struct for the PCI endpoint ntb driver is never modified.
> Mark it as const so it can be placed in the read-only section.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

- Mani

> ---
>  drivers/pci/endpoint/functions/pci-epf-ntb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-ntb.c b/drivers/pci/endpoint/functions/pci-epf-ntb.c
> index 9aac2c6f3bb9..630181469720 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-ntb.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-ntb.c
> @@ -2099,7 +2099,7 @@ static int epf_ntb_probe(struct pci_epf *epf,
>  	return 0;
>  }
>  
> -static struct pci_epf_ops epf_ntb_ops = {
> +static const struct pci_epf_ops epf_ntb_ops = {
>  	.bind	= epf_ntb_bind,
>  	.unbind	= epf_ntb_unbind,
>  	.add_cfs = epf_ntb_add_cfs,
> -- 
> 2.39.2
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/5] PCI: endpoint: pci-epf-vntb: Constify pci_epf_ops
  2023-07-22 23:08 ` [PATCH 4/5] PCI: endpoint: pci-epf-vntb: " Lars-Peter Clausen
@ 2023-07-24  6:02   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 11+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-24  6:02 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Bjorn Helgaas, Jon Mason, Dave Jiang,
	Allen Hubbe, linux-pci, mhi, ntb

On Sat, Jul 22, 2023 at 04:08:47PM -0700, Lars-Peter Clausen wrote:
> The pci_epf_ops struct for the PCI endpoint vntb driver is never modified.
> Mark it as const so it can be placed in the read-only section.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

- Mani

> ---
>  drivers/pci/endpoint/functions/pci-epf-vntb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> index c8b423c3c26e..ff4b43af4487 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> @@ -1387,7 +1387,7 @@ static void epf_ntb_unbind(struct pci_epf *epf)
>  }
>  
>  // EPF driver probe
> -static struct pci_epf_ops epf_ntb_ops = {
> +static const struct pci_epf_ops epf_ntb_ops = {
>  	.bind   = epf_ntb_bind,
>  	.unbind = epf_ntb_unbind,
>  	.add_cfs = epf_ntb_add_cfs,
> -- 
> 2.39.2
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 5/5] PCI: endpoint: pci-epf-test: Constify pci_epf_ops
  2023-07-22 23:08 ` [PATCH 5/5] PCI: endpoint: pci-epf-test: " Lars-Peter Clausen
@ 2023-07-24  6:03   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 11+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-24  6:03 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Bjorn Helgaas, Jon Mason, Dave Jiang,
	Allen Hubbe, linux-pci, mhi, ntb

On Sat, Jul 22, 2023 at 04:08:48PM -0700, Lars-Peter Clausen wrote:
> The pci_epf_ops struct for the PCI endpoint test driver is never modified.
> Mark it as const so it can be placed in the read-only section.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

- Mani

> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index 1f0d2b84296a..7cc1c5c70afc 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -973,7 +973,7 @@ static int pci_epf_test_probe(struct pci_epf *epf,
>  	return 0;
>  }
>  
> -static struct pci_epf_ops ops = {
> +static const struct pci_epf_ops ops = {
>  	.unbind	= pci_epf_test_unbind,
>  	.bind	= pci_epf_test_bind,
>  };
> -- 
> 2.39.2
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const
  2023-07-22 23:08 [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Lars-Peter Clausen
                   ` (4 preceding siblings ...)
  2023-07-24  6:00 ` [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Manivannan Sadhasivam
@ 2023-12-18 22:43 ` Krzysztof Wilczyński
  5 siblings, 0 replies; 11+ messages in thread
From: Krzysztof Wilczyński @ 2023-12-18 22:43 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Lorenzo Pieralisi, Manivannan Sadhasivam, Kishon Vijay Abraham I,
	Bjorn Helgaas, Jon Mason, Dave Jiang, Allen Hubbe, linux-pci,
	mhi, ntb

Hello,

> The pci_epf_ops struct contains a set of callbacks that are used by the
> pci_epf_driver. The ops struct is never modified by the epf core itself.
> 
> Marking the ops pointer const allows epf drivers to declare their
> pci_epf_ops struct to be const. This allows the struct to be placed in the
> read-only section. Which for example brings some security benefits as the
> callbacks can not be overwritten.

Applied to endpoint, thank you!

[01/05] PCI: endpoint: Make struct pci_epf_ops in pci_epf_driver const
        https://git.kernel.org/pci/pci/c/86362293044b
[02/05] PCI: endpoint: pci-epf-mhi: Make structs pci_epf_ops and pci_epf_event_ops const
        https://git.kernel.org/pci/pci/c/150d04ddf386
[03/05] PCI: endpoint: pci-epf-ntb: Make struct pci_epf_ops const
        https://git.kernel.org/pci/pci/c/54f22c9758dc
[04/05] PCI: endpoint: pci-epf-vntb: Make struct pci_epf_ops const
        https://git.kernel.org/pci/pci/c/c21b53deda09
[05/05] PCI: endpoint: pci-epf-test: Make struct pci_epf_ops const
        https://git.kernel.org/pci/pci/c/6f517e044096

	Krzysztof

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-12-18 22:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-22 23:08 [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Lars-Peter Clausen
2023-07-22 23:08 ` [PATCH 2/5] PCI: endpoint: pci-epf-mhi: Constify pci_epf_ops and pci_epf_event_ops Lars-Peter Clausen
2023-07-24  6:01   ` Manivannan Sadhasivam
2023-07-22 23:08 ` [PATCH 3/5] PCI: endpoint: pci-epf-ntb: Constify pci_epf_ops Lars-Peter Clausen
2023-07-24  6:02   ` Manivannan Sadhasivam
2023-07-22 23:08 ` [PATCH 4/5] PCI: endpoint: pci-epf-vntb: " Lars-Peter Clausen
2023-07-24  6:02   ` Manivannan Sadhasivam
2023-07-22 23:08 ` [PATCH 5/5] PCI: endpoint: pci-epf-test: " Lars-Peter Clausen
2023-07-24  6:03   ` Manivannan Sadhasivam
2023-07-24  6:00 ` [PATCH 1/5] PCI: endpoint: Make pci_epf_ops in pci_epf_driver const Manivannan Sadhasivam
2023-12-18 22:43 ` Krzysztof Wilczyński

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).