LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH V2] powerpc/pseries/svm: Drop unused align argument in alloc_shared_lppaca() function
From: Laurent Dufour @ 2020-06-16  8:24 UTC (permalink / raw)
  To: Satheesh Rajendran, linuxppc-dev
  Cc: Sukadev Bhattiprolu, Ram Pai, linux-kernel, Thiago Jung Bauermann
In-Reply-To: <20200612142953.135408-1-sathnaga@linux.vnet.ibm.com>

Le 12/06/2020 à 16:29, Satheesh Rajendran a écrit :
> Argument "align" in alloc_shared_lppaca() was unused inside the
> function. Let's drop it and update code comment for page alignment.
> 
> Cc: linux-kernel@vger.kernel.org
> Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com>
> Cc: Ram Pai <linuxram@us.ibm.com>
> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
> Cc: Laurent Dufour <ldufour@linux.ibm.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>

Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>

> Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> ---
> 
> V2:
> Added reviewed by Thiago.
> Dropped align argument as per Michael suggest.
> Modified commit msg.
> 
> V1: http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20200609113909.17236-1-sathnaga@linux.vnet.ibm.com/
> ---
>   arch/powerpc/kernel/paca.c | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
> index 8d96169c597e..a174d64d9b4d 100644
> --- a/arch/powerpc/kernel/paca.c
> +++ b/arch/powerpc/kernel/paca.c
> @@ -57,8 +57,8 @@ static void *__init alloc_paca_data(unsigned long size, unsigned long align,
>   
>   #define LPPACA_SIZE 0x400
>   
> -static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align,
> -					unsigned long limit, int cpu)
> +static void *__init alloc_shared_lppaca(unsigned long size, unsigned long limit,
> +					int cpu)
>   {
>   	size_t shared_lppaca_total_size = PAGE_ALIGN(nr_cpu_ids * LPPACA_SIZE);
>   	static unsigned long shared_lppaca_size;
> @@ -68,6 +68,12 @@ static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align,
>   	if (!shared_lppaca) {
>   		memblock_set_bottom_up(true);
>   
> +		/* See Documentation/powerpc/ultravisor.rst for mode details
> +		 *
> +		 * UV/HV data share is in PAGE granularity, In order to
> +		 * minimize the number of pages shared and maximize the
> +		 * use of a page, let's use page align.
> +		 */
>   		shared_lppaca =
>   			memblock_alloc_try_nid(shared_lppaca_total_size,
>   					       PAGE_SIZE, MEMBLOCK_LOW_LIMIT,
> @@ -122,7 +128,7 @@ static struct lppaca * __init new_lppaca(int cpu, unsigned long limit)
>   		return NULL;
>   
>   	if (is_secure_guest())
> -		lp = alloc_shared_lppaca(LPPACA_SIZE, 0x400, limit, cpu);
> +		lp = alloc_shared_lppaca(LPPACA_SIZE, limit, cpu);
>   	else
>   		lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu);
>   
> 


^ permalink raw reply

* Re: [PATCH 2/2] cpufreq: Specify default governor on command line
From: Quentin Perret @ 2020-06-16  8:31 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: juri.lelli, kernel-team, vincent.guittot, arnd, rafael, peterz,
	adharmap, linux-pm, rjw, linux-kernel, mingo, paulus,
	linuxppc-dev, tkjos
In-Reply-To: <20200616043143.obk5k3rv737j5dnd@vireshk-i7>

Hey Viresh,

On Tuesday 16 Jun 2020 at 10:01:43 (+0530), Viresh Kumar wrote:
> On 15-06-20, 17:55, Quentin Perret wrote:
> > +static void cpufreq_get_default_governor(void)
> > +{
> > +	default_governor = cpufreq_parse_governor(cpufreq_param_governor);
> > +	if (!default_governor) {
> > +		if (*cpufreq_param_governor)
> > +			pr_warn("Failed to find %s\n", cpufreq_param_governor);
> > +		default_governor = cpufreq_default_governor();
> 
> A module_get() never happened for this case and so maybe a
> module_put() should never get called.

Correct, however cpufreq_default_governor() being a weak function, we're
basically guaranteed the governor we get from there is builtin, so
gov->owner is NULL. That is, module_put() is not actively useful, but it
doesn't harm. So I figured that should be fine. That could definitely
use a comment, though :)

> > +	}
> > +}
> > +
> > +static void cpufreq_put_default_governor(void)
> > +{
> > +	if (!default_governor)
> > +		return;
> > +	module_put(default_governor->owner);
> > +	default_governor = NULL;
> > +}
> > +
> >  static int cpufreq_init_governor(struct cpufreq_policy *policy)
> >  {
> >  	int ret;
> > @@ -2701,6 +2721,8 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
> >  
> >  	if (driver_data->setpolicy)
> >  		driver_data->flags |= CPUFREQ_CONST_LOOPS;
> > +	else
> > +		cpufreq_get_default_governor();
> >  
> >  	if (cpufreq_boost_supported()) {
> >  		ret = create_boost_sysfs_file();
> > @@ -2769,6 +2791,7 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
> >  	subsys_interface_unregister(&cpufreq_interface);
> >  	remove_boost_sysfs_file();
> >  	cpuhp_remove_state_nocalls_cpuslocked(hp_online);
> > +	cpufreq_put_default_governor();
> >  
> >  	write_lock_irqsave(&cpufreq_driver_lock, flags);
> >  
> > @@ -2792,4 +2815,5 @@ static int __init cpufreq_core_init(void)
> >  	return 0;
> >  }
> 
> And since this is a per boot thing, there is perhaps no need of doing
> these at driver register/unregister, I would rather do it at:
> cpufreq_core_init() time itself and so we will never need to run
> cpufreq_put_default_governor() and so can be removed.

Right, so the reason I avoided cpufreq_core_init() was because it is
called at core_initcall() time, which means I can't really assume the
governors have been loaded by that time. By waiting for the driver to
probe before detecting the default gov, we get that nice ordering. But
yes, it feels odd to have it here :/

Thinking about it more, the natural fit for this would rather be the
register/unregister path for governors directly. If that sounds good to
you (?) I'll try to move it there in v2.

> And another thing I am not able to understand (despite you commenting
> about that in the commit log) is what happens if the default governor
> chosen is built as a module ?

So the answer is 'it depends'. If the driver is built as a module too,
then you should load the governor module first, and then the driver
module, and everything will work just fine.

But in the case where the governor is loaded _after_ the driver (either
because we got the module ordering wrong, or because the driver is
builtin), then the policies will be initialized with the builtin
default, and nothing special will happen when the governor module is
loaded.

That behaviour very much is open for discussion, though. A possible
alternative would be to automatically switch all policies to the default
governor upon loading. That would have the nice benefit or removing the
ordering dependency, but that is more involved and I didn't have a
use-case for it, so I went for the simpler option ('the-default
governor-needs-to-be-registered-before-the-policies-are-created').

Thoughts?

Thanks,
Quentin

^ permalink raw reply

* Re: [PATCH 1/2] cpufreq: Register governors at core_initcall
From: Quentin Perret @ 2020-06-16  8:31 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: juri.lelli, kernel-team, vincent.guittot, arnd, rafael, peterz,
	adharmap, linux-pm, rjw, linux-kernel, mingo, paulus,
	linuxppc-dev, tkjos
In-Reply-To: <20200616042831.3kazrpvvjhbahoaj@vireshk-i7>

On Tuesday 16 Jun 2020 at 09:58:31 (+0530), Viresh Kumar wrote:
> On 15-06-20, 17:55, Quentin Perret wrote:
> > Currently, most CPUFreq governors are registered at core_initcall time
> > when used as default, and module_init otherwise. In preparation for
> > letting users specify the default governor on the kernel command line,
> > change all of them to use core_initcall unconditionally, as is already
> > the case for schedutil and performance. This will enable us to assume
> > builtin governors have been registered before the builtin CPUFreq
> > drivers probe.
> > 
> > And since all governors now have similar init/exit patterns, introduce
> > two new macros cpufreq_governor_{init,exit}() to factorize the code.
> > 
> > Signed-off-by: Quentin Perret <qperret@google.com>
> > ---
> > Note: I couldn't boot-test the change to spudemand, by lack of hardware.
> > But I can confirm cell_defconfig compiles just fine.
> > ---
> >  .../platforms/cell/cpufreq_spudemand.c        | 26 ++-----------------
> >  drivers/cpufreq/cpufreq_conservative.c        | 22 ++++------------
> >  drivers/cpufreq/cpufreq_ondemand.c            | 24 +++++------------
> >  drivers/cpufreq/cpufreq_performance.c         | 14 ++--------
> >  drivers/cpufreq/cpufreq_powersave.c           | 18 +++----------
> >  drivers/cpufreq/cpufreq_userspace.c           | 18 +++----------
> >  include/linux/cpufreq.h                       | 14 ++++++++++
> >  kernel/sched/cpufreq_schedutil.c              |  6 +----
> >  8 files changed, 36 insertions(+), 106 deletions(-)
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Thanks!
Quentin

^ permalink raw reply

* Re: [PATCH v4 1/3] mm/slab: Use memzero_explicit() in kzfree()
From: Dan Carpenter @ 2020-06-16  9:08 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Jason A . Donenfeld, Jarkko Sakkinen, virtualization,
	David Howells, linux-mm, linux-sctp, keyrings, kasan-dev,
	linux-stm32, devel, linux-cifs, linux-scsi, James Morris,
	Matthew Wilcox, David Rientjes, Waiman Long, linux-pm, ecryptfs,
	linuxppc-dev, wireguard, linux-fscrypt, linux-mediatek,
	linux-amlogic, Andrew Morton, linux-nfs, Linus Torvalds,
	linux-wireless, David Sterba, stable, linux-kernel,
	linux-bluetooth, linux-security-module, target-devel,
	tipc-discussion, linux-crypto, Johannes Weiner, Joe Perches,
	linux-integrity, linux-wpan, netdev, linux-btrfs, linux-ppp
In-Reply-To: <20200616064208.GA9499@dhcp22.suse.cz>

On Tue, Jun 16, 2020 at 08:42:08AM +0200, Michal Hocko wrote:
> On Mon 15-06-20 21:57:16, Waiman Long wrote:
> > The kzfree() function is normally used to clear some sensitive
> > information, like encryption keys, in the buffer before freeing it back
> > to the pool. Memset() is currently used for the buffer clearing. However,
> > it is entirely possible that the compiler may choose to optimize away the
> > memory clearing especially if LTO is being used. To make sure that this
> > optimization will not happen, memzero_explicit(), which is introduced
> > in v3.18, is now used in kzfree() to do the clearing.
> > 
> > Fixes: 3ef0e5ba4673 ("slab: introduce kzfree()")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Waiman Long <longman@redhat.com>
> 
> Acked-by: Michal Hocko <mhocko@suse.com>
> 
> Although I am not really sure this is a stable material. Is there any
> known instance where the memset was optimized out from kzfree?

I told him to add the stable.  Otherwise it will just get reported to
me again.  It's a just safer to backport it before we forget.

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH 2/2] cpufreq: Specify default governor on command line
From: Viresh Kumar @ 2020-06-16  9:27 UTC (permalink / raw)
  To: Quentin Perret
  Cc: juri.lelli, kernel-team, vincent.guittot, arnd, rafael, peterz,
	adharmap, linux-pm, rjw, linux-kernel, mingo, paulus,
	linuxppc-dev, tkjos
In-Reply-To: <20200616083107.GA122049@google.com>

On 16-06-20, 09:31, Quentin Perret wrote:
> Right, so the reason I avoided cpufreq_core_init() was because it is
> called at core_initcall() time, which means I can't really assume the
> governors have been loaded by that time. By waiting for the driver to
> probe before detecting the default gov, we get that nice ordering. But
> yes, it feels odd to have it here :/
> 
> Thinking about it more, the natural fit for this would rather be the
> register/unregister path for governors directly. If that sounds good to
> you (?) I'll try to move it there in v2.

There is another problem here which we need to look at. Any governor
which is built as a module and isn't currently used, should be allowed
to unload. And this needs to be tested by you as well, should be easy
enough.

With the current implementation, you take a reference to the default
governor when the driver is registered and drop it only when the
driver goes away. Which means we won't be able to unload the module of
the governor even if it isn't used. Which is wrong. The solution I
proposed had the same issue as well.

You need to figure out a way where we don't need to keep holding the
module hostage even when it isn't used. I see two ways at least for
the same:

- Do that from the existing place: cpufreq_init_policy().

- And I think this can be done from governor-register/unregister as
  well.

Second one sounds good, if it is feasible to do that.

-- 
viresh

^ permalink raw reply

* Re: [PATCH v2 08/12] mm: Define pasid in mm
From: Jean-Philippe Brucker @ 2020-06-16  8:28 UTC (permalink / raw)
  To: Fenghua Yu
  Cc: Dave Hansen, H Peter Anvin, Dave Jiang, Ashok Raj, Joerg Roedel,
	x86, amd-gfx, Ingo Molnar, Ravi V Shankar, Yu-cheng Yu,
	Andrew Donnellan, Borislav Petkov, Sohil Mehta, Thomas Gleixner,
	Tony Luck, linuxppc-dev, Felix Kuehling, linux-kernel, iommu,
	Jacob Jun Pan, Frederic Barrat, David Woodhouse, Lu Baolu
In-Reply-To: <1592008893-9388-9-git-send-email-fenghua.yu@intel.com>

On Fri, Jun 12, 2020 at 05:41:29PM -0700, Fenghua Yu wrote:
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 64ede5f150dc..5778db3aa42d 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -538,6 +538,10 @@ struct mm_struct {
>  		atomic_long_t hugetlb_usage;
>  #endif
>  		struct work_struct async_put_work;
> +
> +#ifdef CONFIG_PCI_PASID

Non-PCI devices can also use a PASID (e.g. Arm's SubstreamID). How about
CONFIG_IOMMU_SUPPORT?

Thanks,
Jean

> +		unsigned int pasid;
> +#endif

^ permalink raw reply

* Re: [PATCH] scsi: target/sbp: remove firewire SBP target driver
From: Finn Thain @ 2020-06-16  9:42 UTC (permalink / raw)
  To: Chris Boot
  Cc: Bart Van Assche, linux-scsi, Chuhong Yuan, linux-kernel,
	Nicholas Bellinger, target-devel, Martin K . Petersen,
	linux1394-devel, linuxppc-dev, Stefan Richter
In-Reply-To: <8da0c285-d707-a3d2-063e-472af5cc560f@boo.tc>

On Mon, 15 Jun 2020, Chris Boot wrote:

> On 15/06/2020 00:28, Finn Thain wrote:
> > On Sun, 14 Jun 2020, Chris Boot wrote:
> > 
> >> I expect that if someone finds this useful it can stick around (but 
> >> that's not my call).
> > 
> > Who's call is that? If the patch had said "From: Martin K. Petersen" 
> > and "This driver is being removed because it has the following 
> > defects..." that would be some indication of a good-faith willingness 
> > to accept users as developers in the spirit of the GPL, which is what 
> > you seem to be alluding to (?).
> 
> If you're asking me, I'd say it was martin's call:
> 
> > SCSI TARGET SUBSYSTEM                                                          
> > M:      "Martin K. Petersen" <martin.petersen@oracle.com>                      
> [...]
> > F:      drivers/target/                                                        
> > F:      include/target/                                                        
> 

The question I asked you was intended to make you think. I wasn't asking 
you to search MAINTAINERS for "drivers/target" (I had already done so).

Chris, you can find my name in that file too. That's because I see my role 
as custodian of that particular code. That code lives in the kernel.org 
tree because others put it there and because users find it useful -- not 
merely because it happens to please the official glorious MAINTAINER of 
said code.

If you would ask, "who's call is it to delete drivers/nubus? or 
drivers/scsi/NCR5380.c?" my answer is, I have no idea.

> >> I just don't have the time or inclination or hardware to be able to 
> >> maintain it anymore, so someone else would have to pick it up.
> >>
> > 
> > Which is why most drivers get orphaned, right?
> 
> Sure, but that's not what Martin asked me to do, hence this patch.
> 

Martin said, "I'd appreciate a patch to remove it"

And Bart said, "do you want to keep this driver in the kernel tree?"

AFAICT both comments are quite ambiguous. I don't see an actionable 
request, just an expression of interest from people doing their jobs.

Note well: there is no pay check associated with having a MAINTAINERS file 
entry.

^ permalink raw reply

* Re: [PATCH 2/2] cpufreq: Specify default governor on command line
From: Quentin Perret @ 2020-06-16  9:48 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: juri.lelli, kernel-team, vincent.guittot, arnd, rafael, peterz,
	adharmap, linux-pm, rjw, linux-kernel, mingo, paulus,
	linuxppc-dev, tkjos
In-Reply-To: <20200616092759.rjnk3lef4tedfust@vireshk-i7>

On Tuesday 16 Jun 2020 at 14:57:59 (+0530), Viresh Kumar wrote:
> There is another problem here which we need to look at. Any governor
> which is built as a module and isn't currently used, should be allowed
> to unload. And this needs to be tested by you as well, should be easy
> enough.
> 
> With the current implementation, you take a reference to the default
> governor when the driver is registered and drop it only when the
> driver goes away. Which means we won't be able to unload the module of
> the governor even if it isn't used. Which is wrong. The solution I
> proposed had the same issue as well.
> 
> You need to figure out a way where we don't need to keep holding the
> module hostage even when it isn't used. I see two ways at least for
> the same:
> 
> - Do that from the existing place: cpufreq_init_policy().
> 
> - And I think this can be done from governor-register/unregister as
>   well.
> 
> Second one sounds good, if it is feasible to do that.

Good point.

I'm thinking something along the lines of:

---8<---
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 0f05caedc320..a9219404e07f 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2340,6 +2340,11 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
 		list_add(&governor->governor_list, &cpufreq_governor_list);
 	}
 
+	if (!strncasecmp(cpufreq_param_governor, governor->name, CPUFREQ_NAME_LEN))
+		default_governor = governor;
+	else if (!default_governor && cpufreq_default_governor() == governor)
+		default_governor = cpufreq_default_governor();
+
 	mutex_unlock(&cpufreq_governor_mutex);
 	return err;
 }
@@ -2368,6 +2373,8 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor)
 
 	mutex_lock(&cpufreq_governor_mutex);
 	list_del(&governor->governor_list);
+	if (governor == default_governor)
+		default_governor = cpufreq_default_governor();
 	mutex_unlock(&cpufreq_governor_mutex);
 }
 EXPORT_SYMBOL_GPL(cpufreq_unregister_governor);
--->8---

should do the trick. That removes the unnecessary reference count, and
feels like a good place to hook things -- that is how cpuidle does it
too IIRC.

I'll double check the locking/synchronization, but that shouldn't be too
bad (famous last words).

Cheers,
Quentin

^ permalink raw reply related

* Re: [PATCH 2/2] cpufreq: Specify default governor on command line
From: Viresh Kumar @ 2020-06-16  9:54 UTC (permalink / raw)
  To: Quentin Perret
  Cc: juri.lelli, kernel-team, vincent.guittot, arnd, rafael, peterz,
	adharmap, linux-pm, rjw, linux-kernel, mingo, paulus,
	linuxppc-dev, tkjos
In-Reply-To: <20200616094802.GA139416@google.com>

On 16-06-20, 10:48, Quentin Perret wrote:
> ---8<---
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 0f05caedc320..a9219404e07f 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2340,6 +2340,11 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
>  		list_add(&governor->governor_list, &cpufreq_governor_list);
>  	}
>  
> +	if (!strncasecmp(cpufreq_param_governor, governor->name, CPUFREQ_NAME_LEN))
> +		default_governor = governor;
> +	else if (!default_governor && cpufreq_default_governor() == governor)
> +		default_governor = cpufreq_default_governor();

Instead of the else part here, maybe just do this from
cpufreq_core_init() only once, and so we will always have
default_governor set.

> +
>  	mutex_unlock(&cpufreq_governor_mutex);
>  	return err;
>  }
> @@ -2368,6 +2373,8 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor)
>  
>  	mutex_lock(&cpufreq_governor_mutex);
>  	list_del(&governor->governor_list);
> +	if (governor == default_governor)
> +		default_governor = cpufreq_default_governor();
>  	mutex_unlock(&cpufreq_governor_mutex);
>  }
>  EXPORT_SYMBOL_GPL(cpufreq_unregister_governor);
> --->8---
> 
> should do the trick. That removes the unnecessary reference count, and
> feels like a good place to hook things -- that is how cpuidle does it
> too IIRC.
> 
> I'll double check the locking/synchronization, but that shouldn't be too
> bad (famous last words).
> 
> Cheers,
> Quentin

-- 
viresh

^ permalink raw reply

* Re: [PATCH 2/2] cpufreq: Specify default governor on command line
From: Quentin Perret @ 2020-06-16  9:56 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: juri.lelli, kernel-team, vincent.guittot, arnd, rafael, peterz,
	adharmap, linux-pm, rjw, linux-kernel, mingo, paulus,
	linuxppc-dev, tkjos
In-Reply-To: <20200616095438.v7wywhfq5ealvyih@vireshk-i7>

On Tuesday 16 Jun 2020 at 15:24:38 (+0530), Viresh Kumar wrote:
> On 16-06-20, 10:48, Quentin Perret wrote:
> > ---8<---
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index 0f05caedc320..a9219404e07f 100644
> > --- a/drivers/cpufreq/cpufreq.c
> > +++ b/drivers/cpufreq/cpufreq.c
> > @@ -2340,6 +2340,11 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
> >  		list_add(&governor->governor_list, &cpufreq_governor_list);
> >  	}
> >  
> > +	if (!strncasecmp(cpufreq_param_governor, governor->name, CPUFREQ_NAME_LEN))
> > +		default_governor = governor;
> > +	else if (!default_governor && cpufreq_default_governor() == governor)
> > +		default_governor = cpufreq_default_governor();
> 
> Instead of the else part here, maybe just do this from
> cpufreq_core_init() only once, and so we will always have
> default_governor set.

Sounds good.

Thanks!
Quentin

^ permalink raw reply

* [PATCH kernel] powerpc/powernv/ioda: Return correct error if TCE level allocation failed
From: Alexey Kardashevskiy @ 2020-06-16 10:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Alexey Kardashevskiy

The iommu_table_ops::xchg_no_kill() callback updates TCE. It is quite
possible that not entire table is allocated if it is huge and multilevel
so xchg may also allocate subtables. If failed, it returns H_HARDWARE
for failed allocation and H_TOO_HARD if it needs it but cannot do because
the alloc parameter is "false" (set when called with MMU=off to force
retry with MMU=on).

The problem is that having separate errors only matters in real mode
(MMU=off) but the only caller with alloc="false" does not check the exact
error code and simply returns H_TOO_HARD; and for every other mode
alloc is "true". Also, the function is also called from the ioctl()
handler of the VFIO SPAPR TCE IOMMU subdriver which does not expect
hypervisor error codes (H_xxx) and will expose them to the userspace.

This converts wrong error codes to a simple -1.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---

I could make it "return alloc ? -ENOMEM : -EBUSY" but
is EBUSY a good match for H_TOO_HARD?
---
 arch/powerpc/platforms/powernv/pci-ioda-tce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda-tce.c b/arch/powerpc/platforms/powernv/pci-ioda-tce.c
index f923359d8afc..59d73fdadeb9 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda-tce.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda-tce.c
@@ -166,7 +166,7 @@ int pnv_tce_xchg(struct iommu_table *tbl, long index,
 	if (!ptce) {
 		ptce = pnv_tce(tbl, false, idx, alloc);
 		if (!ptce)
-			return alloc ? H_HARDWARE : H_TOO_HARD;
+			return -1;
 	}
 
 	if (newtce & TCE_PCI_WRITE)
-- 
2.17.1


^ permalink raw reply related

* Re: [PATCH v3] ASoC: fsl_ssi: Fix bclk calculation for mono channel
From: Mark Brown @ 2020-06-16 11:40 UTC (permalink / raw)
  To: alsa-devel, timur, tiwai, Xiubo.Lee, nicoleotsuka, Shengjiu Wang,
	perex, festevam
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <034eff1435ff6ce300b6c781130cefd9db22ab9a.1592276147.git.shengjiu.wang@nxp.com>

On Tue, 16 Jun 2020 10:53:48 +0800, Shengjiu Wang wrote:
> For mono channel, SSI will switch to Normal mode.
> 
> In Normal mode and Network mode, the Word Length Control bits
> control the word length divider in clock generator, which is
> different with I2S Master mode (the word length is fixed to
> 32bit), it should be the value of params_width(hw_params).
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: fsl_ssi: Fix bclk calculation for mono channel
      commit: ed1220df6e666500ebf58c4f2fccc681941646fb

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply

* Re: [PATCH v4 6/7] KVM: MIPS: clean up redundant 'kvm_run' parameters
From: Tianjia Zhang @ 2020-06-16 11:54 UTC (permalink / raw)
  To: Paolo Bonzini, Huacai Chen
  Cc: wanpengli, kvm, david, heiko.carstens, Peter Xu, open list:MIPS,
	hpa, kvmarm, linux-s390, frankja, Marc Zyngier, joro, x86,
	borntraeger, mingo, julien.thierry.kdev, thuth, gor,
	suzuki.poulose, kvm-ppc, Borislav Petkov, Thomas Gleixner,
	linux-arm-kernel, jmattson, Thomas Bogendoerfer, cohuck,
	christoffer.dall, sean.j.christopherson, LKML, james.morse,
	vkuznets, linuxppc-dev
In-Reply-To: <30c2ac06-1a7e-2f85-fbe1-e9dc25bf2ae2@redhat.com>



On 2020/5/29 17:48, Paolo Bonzini wrote:
> On 27/05/20 08:24, Tianjia Zhang wrote:
>>>>
>>>>
>>
>> Hi Huacai,
>>
>> These two patches(6/7 and 7/7) should be merged into the tree of the
>> mips architecture separately. At present, there seems to be no good way
>> to merge the whole architecture patchs.
>>
>> For this series of patches, some architectures have been merged, some
>> need to update the patch.
> 
> Hi Tianjia, I will take care of this during the merge window.
> 
> Thanks,
> 
> Paolo
> 

Hi Paolo,

The following individual patch is the v5 version of 5/7 in this group of 
patches.

https://lkml.org/lkml/2020/5/28/106
([v5] KVM: PPC: clean up redundant kvm_run parameters in assembly)

Thanks and best,
Tianjia

^ permalink raw reply

* Re: powerpc/pci: [PATCH 1/1 V3] PCIE PHB reset
From: Michael Ellerman @ 2020-06-16 11:56 UTC (permalink / raw)
  To: wenxiong, linuxppc-dev; +Cc: brking, oohall, Wen Xiong, wenxiong
In-Reply-To: <1590499319-6472-1-git-send-email-wenxiong@linux.vnet.ibm.com>

wenxiong@linux.vnet.ibm.com writes:
> From: Wen Xiong <wenxiong@linux.vnet.ibm.com>
>
> Several device drivers hit EEH(Extended Error handling) when triggering
> kdump on Pseries PowerVM. This patch implemented a reset of the PHBs
> in pci general code when triggering kdump.

Actually it's in pseries specific PCI code, and the reset is done in the
2nd kernel as it boots, not when triggering the kdump.

You're doing it as a:

  machine_postcore_initcall(pseries, pseries_phb_reset);

But we do the EEH initialisation in:

  core_initcall_sync(eeh_init);

Which happens first.

So it seems to me that this should be called from pseries_eeh_init().

That would isolate the code in the right place, and allow you to use the
existing ibm_get_config_addr_info.

You probably can't use pseries_eeh_get_pe_addr(), because you won't have
a "pe" structure yet.

Instead you should add a helper that does the core of that logic but
accepts config_addr/buid as parameters, and then have your code and
pseries_eeh_get_pe_addr() call that.

> PHB reset stop all PCI
> transactions from normal kernel. We have tested the patch in several
> enviroments:
> - direct slot adapters
> - adapters under the switch
> - a VF adapter in PowerVM
> - a VF adapter/adapter in KVM guest.
>
> Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
>
> ---
>  arch/powerpc/platforms/pseries/pci.c | 152 +++++++++++++++++++++++++++
>  1 file changed, 152 insertions(+)
>
> diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
> index 911534b89c85..cb7e4276cf04 100644
> --- a/arch/powerpc/platforms/pseries/pci.c
> +++ b/arch/powerpc/platforms/pseries/pci.c
> @@ -11,6 +11,8 @@
>  #include <linux/kernel.h>
>  #include <linux/pci.h>
>  #include <linux/string.h>
> +#include <linux/crash_dump.h>
> +#include <linux/delay.h>
>  
>  #include <asm/eeh.h>
>  #include <asm/pci-bridge.h>
> @@ -354,3 +356,153 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
>  
>  	return 0;
>  }
> +
> +/**
> + * pseries_get_pdn_addr - Retrieve PHB address
> + * @pe: EEH PE

There is no "pe" parameter.

Oh but there is in pseries_eeh_get_pe_addr() which this is an almost
verbatim copy of.

> + *
> + * Retrieve the assocated PHB address. Actually, there're 2 RTAS
> + * function calls dedicated for the purpose. We need implement
> + * it through the new function and then the old one. Besides,
> + * you should make sure the config address is figured out from
> + * FDT node before calling the function.
> + *
> + */
> +static int pseries_get_pdn_addr(struct pci_controller *phb)
> +{
> +	int ret = -1;
> +	int rets[3];
> +	int ibm_get_config_addr_info;
> +	int ibm_get_config_addr_info2;
> +	int config_addr = 0;
> +	struct pci_dn *root_pdn, *pdn;
> +
> +	ibm_get_config_addr_info2   = rtas_token("ibm,get-config-addr-info2");
> +	ibm_get_config_addr_info    = rtas_token("ibm,get-config-addr-info");
> +
> +	root_pdn = PCI_DN(phb->dn);
> +	pdn = list_first_entry(&root_pdn->child_list, struct pci_dn, list);
> +	config_addr = (pdn->busno << 16) | (pdn->devfn << 8);
> +
> +	if (ibm_get_config_addr_info2 != RTAS_UNKNOWN_SERVICE) {
> +		/*
> +		 * First of all, we need to make sure there has one PE
> +		 * associated with the device. If option is 1, it
> +		 * queries if config address is supported in a PE or not.
> +		 * If option is 0, it returns PE config address or config
> +		 * address for the PE primary bus.
> +		 */
> +		ret = rtas_call(ibm_get_config_addr_info2, 4, 2, rets,
> +			config_addr, BUID_HI(pdn->phb->buid),
> +			BUID_LO(pdn->phb->buid), 1);
> +		if (ret || (rets[0] == 0)) {
> +			pr_warn("%s: Failed to get address for PHB#%x-PE# option=%d config_addr=%x\n",
> +				__func__, pdn->phb->global_number, 1, rets[0]);

Here you've hacked the existing pr_warn() to drop the PE number but left
"-PE#" in the format string.

See the original:
			pr_warn("%s: Failed to get address for PHB#%x-PE#%x\n",
				__func__, pe->phb->global_number, pe->config_addr);


> +			return -1;
> +		}
> +
> +		/* Retrieve the associated PE config address */
> +		ret = rtas_call(ibm_get_config_addr_info2, 4, 2, rets,
> +			config_addr, BUID_HI(pdn->phb->buid),
> +			BUID_LO(pdn->phb->buid), 0);
> +		if (ret) {
> +			pr_warn("%s: Failed to get address for PHB#%x-PE# option=%d config_addr=%x\n",
                                                                         ^
                                                                         and here

> +				__func__, pdn->phb->global_number, 0, rets[0]);
> +			return -1;
> +		}
> +		return rets[0];
> +	}
> +
> +	if (ibm_get_config_addr_info != RTAS_UNKNOWN_SERVICE) {
> +		ret = rtas_call(ibm_get_config_addr_info, 4, 2, rets,
> +			config_addr, BUID_HI(pdn->phb->buid),
> +			BUID_LO(pdn->phb->buid), 0);
> +		if (ret || rets[0]) {
> +			pr_warn("%s: Failed to get address for PHB#%x-PE# config_addr=%x\n",
                                                                         ^
                                                                         and here

> +				__func__, pdn->phb->global_number, rets[0]);
> +			return -1;
> +		}
> +		return rets[0];
> +	}
> +
> +	return ret;
> +}
> +
> +static int __init pseries_phb_reset(void)
> +{
> +	struct pci_controller *phb;
> +	int config_addr;
> +	int ibm_set_slot_reset;
> +	int ibm_configure_pe;
> +	int ret;
> +
> +	if (is_kdump_kernel() || reset_devices) {

This should be inverted and turned into an early return, allowing the
entire rest of the function to be de-indented.

> +		pr_info("Issue PHB reset ...\n");
> +		ibm_set_slot_reset = rtas_token("ibm,set-slot-reset");
> +		ibm_configure_pe = rtas_token("ibm,configure-pe");
> +
> +		if (ibm_set_slot_reset == RTAS_UNKNOWN_SERVICE ||
> +				ibm_configure_pe == RTAS_UNKNOWN_SERVICE) {
> +			pr_info("%s: EEH functionality not supported\n",
> +				__func__);

But then you just continue?

> +		}
> +
> +		list_for_each_entry(phb, &hose_list, list_node) {
> +			config_addr = pseries_get_pdn_addr(phb);
> +			if (config_addr == -1)
> +				continue;
> +
> +			ret = rtas_call(ibm_set_slot_reset, 4, 1, NULL,
> +				config_addr, BUID_HI(phb->buid),
> +				BUID_LO(phb->buid), EEH_RESET_FUNDAMENTAL);
> +
> +			/* If fundamental-reset not supported, try hot-reset */
> +			if (ret == -8)

Where does -8 come from?

Oh I see, it's copied from pseries_eeh_reset().

> +				ret = rtas_call(ibm_set_slot_reset, 4, 1, NULL,
> +					config_addr, BUID_HI(phb->buid),
> +					BUID_LO(phb->buid), EEH_RESET_HOT);
> +
> +			if (ret) {
> +				pr_err("%s: PHB#%x-PE# failed with rtas_call activate reset=%d\n",
                                                      ^
                                                      again missing PE number.

> +					__func__, phb->global_number, ret);
> +				continue;
> +			}
> +		}
> +		msleep(EEH_PE_RST_SETTLE_TIME);

So that loop is basically a copy of pseries_eeh_reset() but with the
sleep hoisted out of the loop.

I'd really prefer to see that refactored into a helper that takes the
config_addr and buid and doesn't do the sleep.

Then this loop could call that helper, and so could pseries_eeh_reset().

> +
> +		list_for_each_entry(phb, &hose_list, list_node) {
> +			config_addr = pseries_get_pdn_addr(phb);
> +			if (config_addr == -1)
> +				continue;
> +
> +			ret = rtas_call(ibm_set_slot_reset, 4, 1, NULL,
> +				config_addr, BUID_HI(phb->buid),
> +				BUID_LO(phb->buid), EEH_RESET_DEACTIVATE);
> +			if (ret) {
> +				pr_err("%s: PHB#%x-PE# failed with rtas_call deactive reset=%d\n",
> +					__func__, phb->global_number, ret);
> +				continue;
> +			}
> +		}
> +		msleep(EEH_PE_RST_SETTLE_TIME);
> +
> +		list_for_each_entry(phb, &hose_list, list_node) {
> +			config_addr = pseries_get_pdn_addr(phb);
> +			if (config_addr == -1)
> +				continue;
> +
> +			ret = rtas_call(ibm_configure_pe, 3, 1, NULL,
> +				config_addr, BUID_HI(phb->buid),
> +				BUID_LO(phb->buid));
> +			if (ret) {
> +				pr_err("%s: PHB#%x-PE# failed with rtas_call configure_pe =%d\n",
> +					__func__, phb->global_number, ret);
> +				continue;
> +			}
> +		}
> +	}
> +
> +	return 0;
> +}
> +machine_postcore_initcall(pseries, pseries_phb_reset);

cheers

^ permalink raw reply

* Re: [PATCH v4 1/3] mm/slab: Use memzero_explicit() in kzfree()
From: Waiman Long @ 2020-06-16 13:05 UTC (permalink / raw)
  To: Eric Biggers
  Cc: Jason A . Donenfeld, Michal Hocko, linux-btrfs, Jarkko Sakkinen,
	David Sterba, David Howells, linux-mm, linux-sctp, keyrings,
	kasan-dev, linux-stm32, devel, linux-cifs, linux-scsi,
	James Morris, Matthew Wilcox, linux-wpan, David Rientjes,
	Dan Carpenter, Serge E. Hallyn, linux-pm, ecryptfs, linux-fscrypt,
	linux-mediatek, linux-amlogic, virtualization, linux-integrity,
	linux-nfs, linuxppc-dev, linux-wireless, linux-kernel, stable,
	linux-bluetooth, linux-security-module, target-devel,
	tipc-discussion, linux-crypto, Johannes Weiner, Joe Perches,
	Andrew Morton, Linus Torvalds, netdev, wireguard, linux-ppp
In-Reply-To: <20200616033035.GB902@sol.localdomain>

On 6/15/20 11:30 PM, Eric Biggers wrote:
> On Mon, Jun 15, 2020 at 09:57:16PM -0400, Waiman Long wrote:
>> The kzfree() function is normally used to clear some sensitive
>> information, like encryption keys, in the buffer before freeing it back
>> to the pool. Memset() is currently used for the buffer clearing. However,
>> it is entirely possible that the compiler may choose to optimize away the
>> memory clearing especially if LTO is being used. To make sure that this
>> optimization will not happen, memzero_explicit(), which is introduced
>> in v3.18, is now used in kzfree() to do the clearing.
>>
>> Fixes: 3ef0e5ba4673 ("slab: introduce kzfree()")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Waiman Long <longman@redhat.com>
>> ---
>>   mm/slab_common.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/slab_common.c b/mm/slab_common.c
>> index 9e72ba224175..37d48a56431d 100644
>> --- a/mm/slab_common.c
>> +++ b/mm/slab_common.c
>> @@ -1726,7 +1726,7 @@ void kzfree(const void *p)
>>   	if (unlikely(ZERO_OR_NULL_PTR(mem)))
>>   		return;
>>   	ks = ksize(mem);
>> -	memset(mem, 0, ks);
>> +	memzero_explicit(mem, ks);
>>   	kfree(mem);
>>   }
>>   EXPORT_SYMBOL(kzfree);
> This is a good change, but the commit message isn't really accurate.  AFAIK, no
> one has found any case where this memset() gets optimized out.  And even with
> LTO, it would be virtually impossible due to all the synchronization and global
> data structures that kfree() uses.  (Remember that this isn't the C standard
> function "free()", so the compiler can't assign it any special meaning.)
> Not to mention that LTO support isn't actually upstream yet.
>
> I still agree with the change, but it might be helpful if the commit message
> were honest that this is really a hardening measure and about properly conveying
> the intent.  As-is this sounds like a critical fix, which might confuse people.

Yes, I agree that the commit log may look a bit scary. How about the 
following:

The kzfree() function is normally used to clear some sensitive
information, like encryption keys, in the buffer before freeing it back
to the pool. Memset() is currently used for buffer clearing. However
unlikely, there is still a non-zero probability that the compiler may
choose to optimize away the memory clearing especially if LTO is being
used in the future. To make sure that this optimization will never
happen, memzero_explicit(), which is introduced in v3.18, is now used
in kzfree() to future-proof it.

Cheers,
Longman


^ permalink raw reply

* [PATCH 1/2] powerpc/syscalls: Use the number when building SPU syscall table
From: Michael Ellerman @ 2020-06-16 13:56 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-arch, linux-kernel, arnd

Currently the macro that inserts entries into the SPU syscall table
doesn't actually use the "nr" (syscall number) parameter.

This does work, but it relies on the exact right number of syscall
entries being emitted in order for the syscal numbers to line up with
the array entries. If for example we had two entries with the same
syscall number we wouldn't get an error, it would just cause all
subsequent syscalls to be off by one in the spu_syscall_table.

So instead change the macro to assign to the specific entry of the
array, meaning any numbering overlap will be caught by the compiler.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20190116132714.20094-1-mpe@ellerman.id.au
---
 arch/powerpc/platforms/cell/spu_callbacks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index cbee3666da07..abdef9bcf432 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -35,7 +35,7 @@
  */
 
 static void *spu_syscall_table[] = {
-#define __SYSCALL(nr, entry)	entry,
+#define __SYSCALL(nr, entry) [nr] = entry,
 #include <asm/syscall_table_spu.h>
 #undef __SYSCALL
 };
-- 
2.25.1


^ permalink raw reply related

* [PATCH 2/2] powerpc/syscalls: Split SPU-ness out of ABI
From: Michael Ellerman @ 2020-06-16 13:56 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-arch, linux-kernel, arnd
In-Reply-To: <20200616135617.2937252-1-mpe@ellerman.id.au>

Using the ABI field to encode whether a syscall is usable by SPU
programs or not is a bit of kludge.

The ABI of the syscall doesn't change depending on the SPU-ness, but
in order to make the syscall generation work we have to pretend that
it does.

It also means we have more duplicated syscall lines than we need to,
and the SPU logic is not well contained, instead all of the syscall
generation targets need to know if they are spu or nospu.

So instead add a separate file which contains the information on which
syscalls are available for SPU programs. It's just a list of syscall
numbers with a single "spu" field. If the field has the value "spu"
then the syscall is available to SPU programs, any other value or no
entry entirely means the syscall is not available to SPU programs.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/syscalls/Makefile      |  16 +-
 arch/powerpc/kernel/syscalls/spu.tbl       | 430 +++++++++++++++++++++
 arch/powerpc/kernel/syscalls/syscall.tbl   | 195 ++++------
 arch/powerpc/kernel/syscalls/syscalltbl.sh |  10 +-
 4 files changed, 523 insertions(+), 128 deletions(-)
 create mode 100644 arch/powerpc/kernel/syscalls/spu.tbl


I'm inclined to put this in next and ask Linus to pull it before rc2, that seems
like the least disruptive way to get this in, unless anyone objects?

cheers


diff --git a/arch/powerpc/kernel/syscalls/Makefile b/arch/powerpc/kernel/syscalls/Makefile
index 27b48954808d..34d39b4a83f7 100644
--- a/arch/powerpc/kernel/syscalls/Makefile
+++ b/arch/powerpc/kernel/syscalls/Makefile
@@ -6,6 +6,7 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')	\
 	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
 
 syscall := $(srctree)/$(src)/syscall.tbl
+sputbl := $(srctree)/$(src)/spu.tbl
 syshdr := $(srctree)/$(src)/syscallhdr.sh
 systbl := $(srctree)/$(src)/syscalltbl.sh
 
@@ -19,32 +20,33 @@ quiet_cmd_systbl = SYSTBL  $@
       cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@'	\
 		   '$(systbl_abis_$(basetarget))'		\
 		   '$(systbl_abi_$(basetarget))'		\
-		   '$(systbl_offset_$(basetarget))'
+		   '$(systbl_offset_$(basetarget))'		\
+		    $(sputbl)
 
-syshdr_abis_unistd_32 := common,nospu,32
+syshdr_abis_unistd_32 := common,32
 $(uapi)/unistd_32.h: $(syscall) $(syshdr)
 	$(call if_changed,syshdr)
 
-syshdr_abis_unistd_64 := common,nospu,64
+syshdr_abis_unistd_64 := common,64
 $(uapi)/unistd_64.h: $(syscall) $(syshdr)
 	$(call if_changed,syshdr)
 
-systbl_abis_syscall_table_32 := common,nospu,32
+systbl_abis_syscall_table_32 := common,32
 systbl_abi_syscall_table_32 := 32
 $(kapi)/syscall_table_32.h: $(syscall) $(systbl)
 	$(call if_changed,systbl)
 
-systbl_abis_syscall_table_64 := common,nospu,64
+systbl_abis_syscall_table_64 := common,64
 systbl_abi_syscall_table_64 := 64
 $(kapi)/syscall_table_64.h: $(syscall) $(systbl)
 	$(call if_changed,systbl)
 
-systbl_abis_syscall_table_c32 := common,nospu,32
+systbl_abis_syscall_table_c32 := common,32
 systbl_abi_syscall_table_c32 := c32
 $(kapi)/syscall_table_c32.h: $(syscall) $(systbl)
 	$(call if_changed,systbl)
 
-systbl_abis_syscall_table_spu := common,spu
+systbl_abis_syscall_table_spu := common,64
 systbl_abi_syscall_table_spu := spu
 $(kapi)/syscall_table_spu.h: $(syscall) $(systbl)
 	$(call if_changed,systbl)
diff --git a/arch/powerpc/kernel/syscalls/spu.tbl b/arch/powerpc/kernel/syscalls/spu.tbl
new file mode 100644
index 000000000000..5eac04919303
--- /dev/null
+++ b/arch/powerpc/kernel/syscalls/spu.tbl
@@ -0,0 +1,430 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# The format is:
+# <number> <name> <spu>
+#
+# To indicate a syscall can be used by SPU programs use "spu" for the spu column.
+#
+# Syscalls that are not to be used by SPU programs can be left out of the file
+# entirely, or an entry with a value other than "spu" can be added.
+0	restart_syscall			-
+1	exit				-
+2	fork				-
+3	read				spu
+4	write				spu
+5	open				spu
+6	close				spu
+7	waitpid				spu
+8	creat				spu
+9	link				spu
+10	unlink				spu
+11	execve				-
+12	chdir				spu
+13	time				spu
+14	mknod				spu
+15	chmod				spu
+16	lchown				spu
+17	break				-
+18	oldstat				-
+19	lseek				spu
+20	getpid				spu
+21	mount				-
+22	umount				-
+23	setuid				spu
+24	getuid				spu
+25	stime				spu
+26	ptrace				-
+27	alarm				spu
+28	oldfstat			-
+29	pause				-
+30	utime				-
+31	stty				-
+32	gtty				-
+33	access				spu
+34	nice				spu
+35	ftime				-
+36	sync				spu
+37	kill				spu
+38	rename				spu
+39	mkdir				spu
+40	rmdir				spu
+41	dup				spu
+42	pipe				spu
+43	times				spu
+44	prof				-
+45	brk				spu
+46	setgid				spu
+47	getgid				spu
+48	signal				-
+49	geteuid				spu
+50	getegid				spu
+51	acct				-
+52	umount2				-
+53	lock				-
+54	ioctl				spu
+55	fcntl				spu
+56	mpx				-
+57	setpgid				spu
+58	ulimit				-
+59	oldolduname			-
+60	umask				spu
+61	chroot				spu
+62	ustat				-
+63	dup2				spu
+64	getppid				spu
+65	getpgrp				spu
+66	setsid				spu
+67	sigaction			-
+68	sgetmask			spu
+69	ssetmask			spu
+70	setreuid			spu
+71	setregid			spu
+72	sigsuspend			-
+73	sigpending			-
+74	sethostname			spu
+75	setrlimit			spu
+76	getrlimit			-
+77	getrusage			spu
+78	gettimeofday			spu
+79	settimeofday			spu
+80	getgroups			spu
+81	setgroups			spu
+82	select				-
+83	symlink				spu
+84	oldlstat			-
+85	readlink			spu
+86	uselib				-
+87	swapon				-
+88	reboot				-
+89	readdir				-
+90	mmap				spu
+91	munmap				spu
+92	truncate			spu
+93	ftruncate			spu
+94	fchmod				spu
+95	fchown				spu
+96	getpriority			spu
+97	setpriority			spu
+98	profil				-
+99	statfs				-
+100	fstatfs				-
+101	ioperm				-
+102	socketcall			spu
+103	syslog				spu
+104	setitimer			spu
+105	getitimer			spu
+106	stat				spu
+107	lstat				spu
+108	fstat				spu
+109	olduname			-
+110	iopl				-
+111	vhangup				spu
+112	idle				-
+113	vm86				-
+114	wait4				spu
+115	swapoff				-
+116	sysinfo				spu
+117	ipc				-
+118	fsync				spu
+119	sigreturn			-
+120	clone				-
+121	setdomainname			spu
+122	uname				spu
+123	modify_ldt			-
+124	adjtimex			spu
+125	mprotect			spu
+126	sigprocmask			-
+127	create_module			-
+128	init_module			-
+129	delete_module			-
+130	get_kernel_syms			-
+131	quotactl			-
+132	getpgid				spu
+133	fchdir				spu
+134	bdflush				spu
+135	sysfs				spu
+136	personality			spu
+137	afs_syscall			-
+138	setfsuid			spu
+139	setfsgid			spu
+140	_llseek				spu
+141	getdents			spu
+142	_newselect			spu
+143	flock				spu
+144	msync				spu
+145	readv				spu
+146	writev				spu
+147	getsid				spu
+148	fdatasync			spu
+149	_sysctl				-
+150	mlock				spu
+151	munlock				spu
+152	mlockall			spu
+153	munlockall			spu
+154	sched_setparam			spu
+155	sched_getparam			spu
+156	sched_setscheduler		spu
+157	sched_getscheduler		spu
+158	sched_yield			spu
+159	sched_get_priority_max		spu
+160	sched_get_priority_min		spu
+161	sched_rr_get_interval		spu
+162	nanosleep			spu
+163	mremap				spu
+164	setresuid			spu
+165	getresuid			spu
+166	query_module			-
+167	poll				spu
+168	nfsservctl			-
+169	setresgid			spu
+170	getresgid			spu
+171	prctl				spu
+172	rt_sigreturn			-
+173	rt_sigaction			-
+174	rt_sigprocmask			-
+175	rt_sigpending			-
+176	rt_sigtimedwait			-
+177	rt_sigqueueinfo			-
+178	rt_sigsuspend			-
+179	pread64				spu
+180	pwrite64			spu
+181	chown				spu
+182	getcwd				spu
+183	capget				spu
+184	capset				spu
+185	sigaltstack			-
+186	sendfile			spu
+187	getpmsg				-
+188	putpmsg				-
+189	vfork				-
+190	ugetrlimit			spu
+191	readahead			spu
+192	mmap2				-
+193	truncate64			-
+194	ftruncate64			-
+195	stat64				-
+196	lstat64				-
+197	fstat64				-
+198	pciconfig_read			-
+199	pciconfig_write			-
+200	pciconfig_iobase		-
+201	multiplexer			-
+202	getdents64			spu
+203	pivot_root			spu
+204	fcntl64				-
+205	madvise				spu
+206	mincore				spu
+207	gettid				spu
+208	tkill				spu
+209	setxattr			spu
+210	lsetxattr			spu
+211	fsetxattr			spu
+212	getxattr			spu
+213	lgetxattr			spu
+214	fgetxattr			spu
+215	listxattr			spu
+216	llistxattr			spu
+217	flistxattr			spu
+218	removexattr			spu
+219	lremovexattr			spu
+220	fremovexattr			spu
+221	futex				spu
+222	sched_setaffinity		spu
+223	sched_getaffinity		spu
+225	tuxcall				-
+226	sendfile64			-
+227	io_setup			spu
+228	io_destroy			spu
+229	io_getevents			spu
+230	io_submit			spu
+231	io_cancel			spu
+232	set_tid_address			-
+233	fadvise64			spu
+234	exit_group			-
+235	lookup_dcookie			-
+236	epoll_create			spu
+237	epoll_ctl			spu
+238	epoll_wait			spu
+239	remap_file_pages		spu
+240	timer_create			spu
+241	timer_settime			spu
+242	timer_gettime			spu
+243	timer_getoverrun		spu
+244	timer_delete			spu
+245	clock_settime			spu
+246	clock_gettime			spu
+247	clock_getres			spu
+248	clock_nanosleep			spu
+249	swapcontext			-
+250	tgkill				spu
+251	utimes				spu
+252	statfs64			spu
+253	fstatfs64			spu
+254	fadvise64_64			-
+255	rtas				spu
+256	sys_debug_setcontext		-
+258	migrate_pages			-
+259	mbind				-
+260	get_mempolicy			-
+261	set_mempolicy			-
+262	mq_open				-
+263	mq_unlink			-
+264	mq_timedsend			-
+265	mq_timedreceive			-
+266	mq_notify			-
+267	mq_getsetattr			-
+268	kexec_load			-
+269	add_key				-
+270	request_key			-
+271	keyctl				-
+272	waitid				-
+273	ioprio_set			-
+274	ioprio_get			-
+275	inotify_init			-
+276	inotify_add_watch		-
+277	inotify_rm_watch		-
+278	spu_run				-
+279	spu_create			-
+280	pselect6			-
+281	ppoll				-
+282	unshare				spu
+283	splice				spu
+284	tee				spu
+285	vmsplice			spu
+286	openat				spu
+287	mkdirat				spu
+288	mknodat				spu
+289	fchownat			spu
+290	futimesat			spu
+291	newfstatat			spu
+292	unlinkat			spu
+293	renameat			spu
+294	linkat				spu
+295	symlinkat			spu
+296	readlinkat			spu
+297	fchmodat			spu
+298	faccessat			spu
+299	get_robust_list			spu
+300	set_robust_list			spu
+301	move_pages			spu
+302	getcpu				spu
+303	epoll_pwait			-
+304	utimensat			spu
+305	signalfd			spu
+306	timerfd_create			spu
+307	eventfd				spu
+308	sync_file_range2		spu
+309	fallocate			-
+310	subpage_prot			-
+311	timerfd_settime			spu
+312	timerfd_gettime			spu
+313	signalfd4			spu
+314	eventfd2			spu
+315	epoll_create1			spu
+316	dup3				spu
+317	pipe2				spu
+318	inotify_init1			-
+319	perf_event_open			spu
+320	preadv				spu
+321	pwritev				spu
+322	rt_tgsigqueueinfo		-
+323	fanotify_init			-
+324	fanotify_mark			-
+325	prlimit64			spu
+326	socket				spu
+327	bind				spu
+328	connect				spu
+329	listen				spu
+330	accept				spu
+331	getsockname			spu
+332	getpeername			spu
+333	socketpair			spu
+334	send				spu
+335	sendto				spu
+336	recv				spu
+337	recvfrom			spu
+338	shutdown			spu
+339	setsockopt			spu
+340	getsockopt			spu
+341	sendmsg				spu
+342	recvmsg				spu
+343	recvmmsg			spu
+344	accept4				spu
+345	name_to_handle_at		spu
+346	open_by_handle_at		spu
+347	clock_adjtime			spu
+348	syncfs				spu
+349	sendmmsg			spu
+350	setns				spu
+351	process_vm_readv		-
+352	process_vm_writev		-
+353	finit_module			-
+354	kcmp				-
+355	sched_setattr			spu
+356	sched_getattr			spu
+357	renameat2			spu
+358	seccomp				spu
+359	getrandom			spu
+360	memfd_create			spu
+361	bpf				spu
+362	execveat			-
+363	switch_endian			-
+364	userfaultfd			spu
+365	membarrier			spu
+378	mlock2				-
+379	copy_file_range			-
+380	preadv2				spu
+381	pwritev2			spu
+382	kexec_file_load			-
+383	statx				-
+384	pkey_alloc			-
+385	pkey_free			-
+386	pkey_mprotect			-
+387	rseq				-
+388	io_pgetevents			-
+392	semtimedop			-
+393	semget				spu
+394	semctl				spu
+395	shmget				spu
+396	shmctl				spu
+397	shmat				spu
+398	shmdt				spu
+399	msgget				spu
+400	msgsnd				spu
+401	msgrcv				spu
+402	msgctl				spu
+403	clock_gettime64			-
+404	clock_settime64			-
+405	clock_adjtime64			-
+406	clock_getres_time64		-
+407	clock_nanosleep_time64		-
+408	timer_gettime64			-
+409	timer_settime64			-
+410	timerfd_gettime64		-
+411	timerfd_settime64		-
+412	utimensat_time64		-
+413	pselect6_time64			-
+414	ppoll_time64			-
+416	io_pgetevents_time64		-
+417	recvmmsg_time64			-
+418	mq_timedsend_time64		-
+419	mq_timedreceive_time64		-
+420	semtimedop_time64		-
+421	rt_sigtimedwait_time64		-
+422	futex_time64			-
+423	sched_rr_get_interval_time64	-
+424	pidfd_send_signal		spu
+425	io_uring_setup			spu
+426	io_uring_enter			spu
+427	io_uring_register		spu
+428	open_tree			spu
+429	move_mount			spu
+430	fsopen				spu
+431	fsconfig			spu
+432	fsmount				spu
+433	fspick				spu
+434	pidfd_open			spu
+435	clone3				-
+437	openat2				spu
+438	pidfd_getfd			spu
+439	faccessat2			spu
diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl
index f833a3190822..c0cdaacd770e 100644
--- a/arch/powerpc/kernel/syscalls/syscall.tbl
+++ b/arch/powerpc/kernel/syscalls/syscall.tbl
@@ -5,13 +5,12 @@
 # The format is:
 # <number> <abi> <name> <entry point> <compat entry point>
 #
-# The <abi> can be common, spu, nospu, 64, or 32 for this file.
+# The <abi> can be common, 64, or 32 for this file.
 #
-0	nospu	restart_syscall			sys_restart_syscall
-1	nospu	exit				sys_exit
+0	common	restart_syscall			sys_restart_syscall
+1	common	exit				sys_exit
 2	32	fork				ppc_fork			sys_fork
 2	64	fork				sys_fork
-2	spu	fork				sys_ni_syscall
 3	common	read				sys_read
 4	common	write				sys_write
 5	common	open				sys_open			compat_sys_open
@@ -20,35 +19,30 @@
 8	common	creat				sys_creat
 9	common	link				sys_link
 10	common	unlink				sys_unlink
-11	nospu	execve				sys_execve			compat_sys_execve
+11	common	execve				sys_execve			compat_sys_execve
 12	common	chdir				sys_chdir
 13	32	time				sys_time32
 13	64	time				sys_time
-13	spu	time				sys_time
 14	common	mknod				sys_mknod
 15	common	chmod				sys_chmod
 16	common	lchown				sys_lchown
 17	common	break				sys_ni_syscall
 18	32	oldstat				sys_stat			sys_ni_syscall
 18	64	oldstat				sys_ni_syscall
-18	spu	oldstat				sys_ni_syscall
 19	common	lseek				sys_lseek			compat_sys_lseek
 20	common	getpid				sys_getpid
-21	nospu	mount				sys_mount			compat_sys_mount
+21	common	mount				sys_mount			compat_sys_mount
 22	32	umount				sys_oldumount
 22	64	umount				sys_ni_syscall
-22	spu	umount				sys_ni_syscall
 23	common	setuid				sys_setuid
 24	common	getuid				sys_getuid
 25	32	stime				sys_stime32
 25	64	stime				sys_stime
-25	spu	stime				sys_stime
-26	nospu	ptrace				sys_ptrace			compat_sys_ptrace
+26	common	ptrace				sys_ptrace			compat_sys_ptrace
 27	common	alarm				sys_alarm
 28	32	oldfstat			sys_fstat			sys_ni_syscall
 28	64	oldfstat			sys_ni_syscall
-28	spu	oldfstat			sys_ni_syscall
-29	nospu	pause				sys_pause
+29	common	pause				sys_pause
 30	32	utime				sys_utime32
 30	64	utime				sys_utime
 31	common	stty				sys_ni_syscall
@@ -68,11 +62,11 @@
 45	common	brk				sys_brk
 46	common	setgid				sys_setgid
 47	common	getgid				sys_getgid
-48	nospu	signal				sys_signal
+48	common	signal				sys_signal
 49	common	geteuid				sys_geteuid
 50	common	getegid				sys_getegid
-51	nospu	acct				sys_acct
-52	nospu	umount2				sys_umount
+51	common	acct				sys_acct
+52	common	umount2				sys_umount
 53	common	lock				sys_ni_syscall
 54	common	ioctl				sys_ioctl			compat_sys_ioctl
 55	common	fcntl				sys_fcntl			compat_sys_fcntl
@@ -81,32 +75,27 @@
 58	common	ulimit				sys_ni_syscall
 59	32	oldolduname			sys_olduname
 59	64	oldolduname			sys_ni_syscall
-59	spu	oldolduname			sys_ni_syscall
 60	common	umask				sys_umask
 61	common	chroot				sys_chroot
-62	nospu	ustat				sys_ustat			compat_sys_ustat
+62	common	ustat				sys_ustat			compat_sys_ustat
 63	common	dup2				sys_dup2
 64	common	getppid				sys_getppid
 65	common	getpgrp				sys_getpgrp
 66	common	setsid				sys_setsid
 67	32	sigaction			sys_sigaction			compat_sys_sigaction
 67	64	sigaction			sys_ni_syscall
-67	spu	sigaction			sys_ni_syscall
 68	common	sgetmask			sys_sgetmask
 69	common	ssetmask			sys_ssetmask
 70	common	setreuid			sys_setreuid
 71	common	setregid			sys_setregid
 72	32	sigsuspend			sys_sigsuspend
 72	64	sigsuspend			sys_ni_syscall
-72	spu	sigsuspend			sys_ni_syscall
 73	32	sigpending			sys_sigpending			compat_sys_sigpending
 73	64	sigpending			sys_ni_syscall
-73	spu	sigpending			sys_ni_syscall
 74	common	sethostname			sys_sethostname
 75	common	setrlimit			sys_setrlimit			compat_sys_setrlimit
 76	32	getrlimit			sys_old_getrlimit		compat_sys_old_getrlimit
 76	64	getrlimit			sys_ni_syscall
-76	spu	getrlimit			sys_ni_syscall
 77	common	getrusage			sys_getrusage			compat_sys_getrusage
 78	common	gettimeofday			sys_gettimeofday		compat_sys_gettimeofday
 79	common	settimeofday			sys_settimeofday		compat_sys_settimeofday
@@ -114,18 +103,15 @@
 81	common	setgroups			sys_setgroups
 82	32	select				ppc_select			sys_ni_syscall
 82	64	select				sys_ni_syscall
-82	spu	select				sys_ni_syscall
 83	common	symlink				sys_symlink
 84	32	oldlstat			sys_lstat			sys_ni_syscall
 84	64	oldlstat			sys_ni_syscall
-84	spu	oldlstat			sys_ni_syscall
 85	common	readlink			sys_readlink
-86	nospu	uselib				sys_uselib
-87	nospu	swapon				sys_swapon
-88	nospu	reboot				sys_reboot
+86	common	uselib				sys_uselib
+87	common	swapon				sys_swapon
+88	common	reboot				sys_reboot
 89	32	readdir				sys_old_readdir			compat_sys_old_readdir
 89	64	readdir				sys_ni_syscall
-89	spu	readdir				sys_ni_syscall
 90	common	mmap				sys_mmap
 91	common	munmap				sys_munmap
 92	common	truncate			sys_truncate			compat_sys_truncate
@@ -135,8 +121,8 @@
 96	common	getpriority			sys_getpriority
 97	common	setpriority			sys_setpriority
 98	common	profil				sys_ni_syscall
-99	nospu	statfs				sys_statfs			compat_sys_statfs
-100	nospu	fstatfs				sys_fstatfs			compat_sys_fstatfs
+99	common	statfs				sys_statfs			compat_sys_statfs
+100	common	fstatfs				sys_fstatfs			compat_sys_fstatfs
 101	common	ioperm				sys_ni_syscall
 102	common	socketcall			sys_socketcall			compat_sys_socketcall
 103	common	syslog				sys_syslog
@@ -147,44 +133,38 @@
 108	common	fstat				sys_newfstat			compat_sys_newfstat
 109	32	olduname			sys_uname
 109	64	olduname			sys_ni_syscall
-109	spu	olduname			sys_ni_syscall
 110	common	iopl				sys_ni_syscall
 111	common	vhangup				sys_vhangup
 112	common	idle				sys_ni_syscall
 113	common	vm86				sys_ni_syscall
 114	common	wait4				sys_wait4			compat_sys_wait4
-115	nospu	swapoff				sys_swapoff
+115	common	swapoff				sys_swapoff
 116	common	sysinfo				sys_sysinfo			compat_sys_sysinfo
-117	nospu	ipc				sys_ipc				compat_sys_ipc
+117	common	ipc				sys_ipc				compat_sys_ipc
 118	common	fsync				sys_fsync
 119	32	sigreturn			sys_sigreturn			compat_sys_sigreturn
 119	64	sigreturn			sys_ni_syscall
-119	spu	sigreturn			sys_ni_syscall
 120	32	clone				ppc_clone			sys_clone
 120	64	clone				sys_clone
-120	spu	clone				sys_ni_syscall
 121	common	setdomainname			sys_setdomainname
 122	common	uname				sys_newuname
 123	common	modify_ldt			sys_ni_syscall
 124	32	adjtimex			sys_adjtimex_time32
 124	64	adjtimex			sys_adjtimex
-124	spu	adjtimex			sys_adjtimex
 125	common	mprotect			sys_mprotect
 126	32	sigprocmask			sys_sigprocmask			compat_sys_sigprocmask
 126	64	sigprocmask			sys_ni_syscall
-126	spu	sigprocmask			sys_ni_syscall
 127	common	create_module			sys_ni_syscall
-128	nospu	init_module			sys_init_module
-129	nospu	delete_module			sys_delete_module
+128	common	init_module			sys_init_module
+129	common	delete_module			sys_delete_module
 130	common	get_kernel_syms			sys_ni_syscall
-131	nospu	quotactl			sys_quotactl
+131	common	quotactl			sys_quotactl
 132	common	getpgid				sys_getpgid
 133	common	fchdir				sys_fchdir
 134	common	bdflush				sys_bdflush
 135	common	sysfs				sys_sysfs
 136	32	personality			sys_personality			ppc64_personality
 136	64	personality			ppc64_personality
-136	spu	personality			ppc64_personality
 137	common	afs_syscall			sys_ni_syscall
 138	common	setfsuid			sys_setfsuid
 139	common	setfsgid			sys_setfsgid
@@ -197,7 +177,7 @@
 146	common	writev				sys_writev			compat_sys_writev
 147	common	getsid				sys_getsid
 148	common	fdatasync			sys_fdatasync
-149	nospu	_sysctl				sys_sysctl			compat_sys_sysctl
+149	common	_sysctl				sys_sysctl			compat_sys_sysctl
 150	common	mlock				sys_mlock
 151	common	munlock				sys_munlock
 152	common	mlockall			sys_mlockall
@@ -211,10 +191,8 @@
 160	common	sched_get_priority_min		sys_sched_get_priority_min
 161	32	sched_rr_get_interval		sys_sched_rr_get_interval_time32
 161	64	sched_rr_get_interval		sys_sched_rr_get_interval
-161	spu	sched_rr_get_interval		sys_sched_rr_get_interval
 162	32	nanosleep			sys_nanosleep_time32
 162	64	nanosleep			sys_nanosleep
-162	spu	nanosleep			sys_nanosleep
 163	common	mremap				sys_mremap
 164	common	setresuid			sys_setresuid
 165	common	getresuid			sys_getresuid
@@ -224,29 +202,27 @@
 169	common	setresgid			sys_setresgid
 170	common	getresgid			sys_getresgid
 171	common	prctl				sys_prctl
-172	nospu	rt_sigreturn			sys_rt_sigreturn		compat_sys_rt_sigreturn
-173	nospu	rt_sigaction			sys_rt_sigaction		compat_sys_rt_sigaction
-174	nospu	rt_sigprocmask			sys_rt_sigprocmask		compat_sys_rt_sigprocmask
-175	nospu	rt_sigpending			sys_rt_sigpending		compat_sys_rt_sigpending
+172	common	rt_sigreturn			sys_rt_sigreturn		compat_sys_rt_sigreturn
+173	common	rt_sigaction			sys_rt_sigaction		compat_sys_rt_sigaction
+174	common	rt_sigprocmask			sys_rt_sigprocmask		compat_sys_rt_sigprocmask
+175	common	rt_sigpending			sys_rt_sigpending		compat_sys_rt_sigpending
 176	32	rt_sigtimedwait			sys_rt_sigtimedwait_time32	compat_sys_rt_sigtimedwait_time32
 176	64	rt_sigtimedwait			sys_rt_sigtimedwait
-177	nospu 	rt_sigqueueinfo			sys_rt_sigqueueinfo		compat_sys_rt_sigqueueinfo
-178	nospu 	rt_sigsuspend			sys_rt_sigsuspend		compat_sys_rt_sigsuspend
+177	common 	rt_sigqueueinfo			sys_rt_sigqueueinfo		compat_sys_rt_sigqueueinfo
+178	common 	rt_sigsuspend			sys_rt_sigsuspend		compat_sys_rt_sigsuspend
 179	common	pread64				sys_pread64			compat_sys_pread64
 180	common	pwrite64			sys_pwrite64			compat_sys_pwrite64
 181	common	chown				sys_chown
 182	common	getcwd				sys_getcwd
 183	common	capget				sys_capget
 184	common	capset				sys_capset
-185	nospu	sigaltstack			sys_sigaltstack			compat_sys_sigaltstack
+185	common	sigaltstack			sys_sigaltstack			compat_sys_sigaltstack
 186	32	sendfile			sys_sendfile			compat_sys_sendfile
 186	64	sendfile			sys_sendfile64
-186	spu	sendfile			sys_sendfile64
 187	common	getpmsg				sys_ni_syscall
 188	common 	putpmsg				sys_ni_syscall
 189	32	vfork				ppc_vfork			sys_vfork
 189	64	vfork				sys_vfork
-189	spu	vfork				sys_ni_syscall
 190	common	ugetrlimit			sys_getrlimit			compat_sys_getrlimit
 191	common	readahead			sys_readahead			compat_sys_readahead
 192	32	mmap2				sys_mmap2			compat_sys_mmap2
@@ -255,9 +231,9 @@
 195	32	stat64				sys_stat64
 196	32	lstat64				sys_lstat64
 197	32	fstat64				sys_fstat64
-198	nospu 	pciconfig_read			sys_pciconfig_read
-199	nospu 	pciconfig_write			sys_pciconfig_write
-200	nospu 	pciconfig_iobase		sys_pciconfig_iobase
+198	common 	pciconfig_read			sys_pciconfig_read
+199	common 	pciconfig_write			sys_pciconfig_write
+200	common 	pciconfig_iobase		sys_pciconfig_iobase
 201	common 	multiplexer			sys_ni_syscall
 202	common	getdents64			sys_getdents64
 203	common	pivot_root			sys_pivot_root
@@ -280,7 +256,6 @@
 220	common	fremovexattr			sys_fremovexattr
 221	32	futex				sys_futex_time32
 221	64	futex				sys_futex
-221	spu	futex				sys_futex
 222	common	sched_setaffinity		sys_sched_setaffinity		compat_sys_sched_setaffinity
 223	common	sched_getaffinity		sys_sched_getaffinity		compat_sys_sched_getaffinity
 # 224 unused
@@ -290,13 +265,12 @@
 228	common	io_destroy			sys_io_destroy
 229	32	io_getevents			sys_io_getevents_time32
 229	64	io_getevents			sys_io_getevents
-229	spu	io_getevents			sys_io_getevents
 230	common	io_submit			sys_io_submit			compat_sys_io_submit
 231	common	io_cancel			sys_io_cancel
-232	nospu	set_tid_address			sys_set_tid_address
+232	common	set_tid_address			sys_set_tid_address
 233	common	fadvise64			sys_fadvise64			ppc32_fadvise64
-234	nospu	exit_group			sys_exit_group
-235	nospu	lookup_dcookie			sys_lookup_dcookie		compat_sys_lookup_dcookie
+234	common	exit_group			sys_exit_group
+235	common	lookup_dcookie			sys_lookup_dcookie		compat_sys_lookup_dcookie
 236	common	epoll_create			sys_epoll_create
 237	common	epoll_ctl			sys_epoll_ctl
 238	common	epoll_wait			sys_epoll_wait
@@ -304,64 +278,54 @@
 240	common	timer_create			sys_timer_create		compat_sys_timer_create
 241	32	timer_settime			sys_timer_settime32
 241	64	timer_settime			sys_timer_settime
-241	spu	timer_settime			sys_timer_settime
 242	32	timer_gettime			sys_timer_gettime32
 242	64	timer_gettime			sys_timer_gettime
-242	spu	timer_gettime			sys_timer_gettime
 243	common	timer_getoverrun		sys_timer_getoverrun
 244	common	timer_delete			sys_timer_delete
 245	32	clock_settime			sys_clock_settime32
 245	64	clock_settime			sys_clock_settime
-245	spu	clock_settime			sys_clock_settime
 246	32	clock_gettime			sys_clock_gettime32
 246	64	clock_gettime			sys_clock_gettime
-246	spu	clock_gettime			sys_clock_gettime
 247	32	clock_getres			sys_clock_getres_time32
 247	64	clock_getres			sys_clock_getres
-247	spu	clock_getres			sys_clock_getres
 248	32	clock_nanosleep			sys_clock_nanosleep_time32
 248	64	clock_nanosleep			sys_clock_nanosleep
-248	spu	clock_nanosleep			sys_clock_nanosleep
 249	32	swapcontext			ppc_swapcontext			compat_sys_swapcontext
 249	64	swapcontext			sys_swapcontext
-249	spu	swapcontext			sys_ni_syscall
 250	common	tgkill				sys_tgkill
 251	32	utimes				sys_utimes_time32
 251	64	utimes				sys_utimes
-251	spu	utimes				sys_utimes
 252	common	statfs64			sys_statfs64			compat_sys_statfs64
 253	common	fstatfs64			sys_fstatfs64			compat_sys_fstatfs64
 254	32	fadvise64_64			ppc_fadvise64_64
-254	spu	fadvise64_64			sys_ni_syscall
 255	common	rtas				sys_rtas
 256	32	sys_debug_setcontext		sys_debug_setcontext		sys_ni_syscall
 256	64	sys_debug_setcontext		sys_ni_syscall
-256	spu	sys_debug_setcontext		sys_ni_syscall
 # 257 reserved for vserver
-258	nospu	migrate_pages			sys_migrate_pages		compat_sys_migrate_pages
-259	nospu	mbind				sys_mbind			compat_sys_mbind
-260	nospu	get_mempolicy			sys_get_mempolicy		compat_sys_get_mempolicy
-261	nospu	set_mempolicy			sys_set_mempolicy		compat_sys_set_mempolicy
-262	nospu	mq_open				sys_mq_open			compat_sys_mq_open
-263	nospu	mq_unlink			sys_mq_unlink
+258	common	migrate_pages			sys_migrate_pages		compat_sys_migrate_pages
+259	common	mbind				sys_mbind			compat_sys_mbind
+260	common	get_mempolicy			sys_get_mempolicy		compat_sys_get_mempolicy
+261	common	set_mempolicy			sys_set_mempolicy		compat_sys_set_mempolicy
+262	common	mq_open				sys_mq_open			compat_sys_mq_open
+263	common	mq_unlink			sys_mq_unlink
 264	32	mq_timedsend			sys_mq_timedsend_time32
 264	64	mq_timedsend			sys_mq_timedsend
 265	32	mq_timedreceive			sys_mq_timedreceive_time32
 265	64	mq_timedreceive			sys_mq_timedreceive
-266	nospu	mq_notify			sys_mq_notify			compat_sys_mq_notify
-267	nospu	mq_getsetattr			sys_mq_getsetattr		compat_sys_mq_getsetattr
-268	nospu	kexec_load			sys_kexec_load			compat_sys_kexec_load
-269	nospu	add_key				sys_add_key
-270	nospu	request_key			sys_request_key
-271	nospu	keyctl				sys_keyctl			compat_sys_keyctl
-272	nospu	waitid				sys_waitid			compat_sys_waitid
-273	nospu	ioprio_set			sys_ioprio_set
-274	nospu	ioprio_get			sys_ioprio_get
-275	nospu	inotify_init			sys_inotify_init
-276	nospu	inotify_add_watch		sys_inotify_add_watch
-277	nospu	inotify_rm_watch		sys_inotify_rm_watch
-278	nospu	spu_run				sys_spu_run
-279	nospu	spu_create			sys_spu_create
+266	common	mq_notify			sys_mq_notify			compat_sys_mq_notify
+267	common	mq_getsetattr			sys_mq_getsetattr		compat_sys_mq_getsetattr
+268	common	kexec_load			sys_kexec_load			compat_sys_kexec_load
+269	common	add_key				sys_add_key
+270	common	request_key			sys_request_key
+271	common	keyctl				sys_keyctl			compat_sys_keyctl
+272	common	waitid				sys_waitid			compat_sys_waitid
+273	common	ioprio_set			sys_ioprio_set
+274	common	ioprio_get			sys_ioprio_get
+275	common	inotify_init			sys_inotify_init
+276	common	inotify_add_watch		sys_inotify_add_watch
+277	common	inotify_rm_watch		sys_inotify_rm_watch
+278	common	spu_run				sys_spu_run
+279	common	spu_create			sys_spu_create
 280	32	pselect6			sys_pselect6_time32		compat_sys_pselect6_time32
 280	64	pselect6			sys_pselect6
 281	32	ppoll				sys_ppoll_time32		compat_sys_ppoll_time32
@@ -376,10 +340,8 @@
 289	common	fchownat			sys_fchownat
 290	32	futimesat			sys_futimesat_time32
 290	64	futimesat			sys_futimesat
-290	spu	utimesat			sys_futimesat
 291	32	fstatat64			sys_fstatat64
 291	64	newfstatat			sys_newfstatat
-291	spu	newfstatat			sys_newfstatat
 292	common	unlinkat			sys_unlinkat
 293	common	renameat			sys_renameat
 294	common	linkat				sys_linkat
@@ -391,34 +353,31 @@
 300	common	set_robust_list			sys_set_robust_list		compat_sys_set_robust_list
 301	common	move_pages			sys_move_pages			compat_sys_move_pages
 302	common	getcpu				sys_getcpu
-303	nospu	epoll_pwait			sys_epoll_pwait			compat_sys_epoll_pwait
+303	common	epoll_pwait			sys_epoll_pwait			compat_sys_epoll_pwait
 304	32	utimensat			sys_utimensat_time32
 304	64	utimensat			sys_utimensat
-304	spu	utimensat			sys_utimensat
 305	common	signalfd			sys_signalfd			compat_sys_signalfd
 306	common	timerfd_create			sys_timerfd_create
 307	common	eventfd				sys_eventfd
 308	common	sync_file_range2		sys_sync_file_range2		compat_sys_sync_file_range2
-309	nospu	fallocate			sys_fallocate			compat_sys_fallocate
-310	nospu	subpage_prot			sys_subpage_prot
+309	common	fallocate			sys_fallocate			compat_sys_fallocate
+310	common	subpage_prot			sys_subpage_prot
 311	32	timerfd_settime			sys_timerfd_settime32
 311	64	timerfd_settime			sys_timerfd_settime
-311	spu	timerfd_settime			sys_timerfd_settime
 312	32	timerfd_gettime			sys_timerfd_gettime32
 312	64	timerfd_gettime			sys_timerfd_gettime
-312	spu	timerfd_gettime			sys_timerfd_gettime
 313	common	signalfd4			sys_signalfd4			compat_sys_signalfd4
 314	common	eventfd2			sys_eventfd2
 315	common	epoll_create1			sys_epoll_create1
 316	common	dup3				sys_dup3
 317	common	pipe2				sys_pipe2
-318	nospu	inotify_init1			sys_inotify_init1
+318	common	inotify_init1			sys_inotify_init1
 319	common	perf_event_open			sys_perf_event_open
 320	common	preadv				sys_preadv			compat_sys_preadv
 321	common	pwritev				sys_pwritev			compat_sys_pwritev
-322	nospu	rt_tgsigqueueinfo		sys_rt_tgsigqueueinfo		compat_sys_rt_tgsigqueueinfo
-323	nospu	fanotify_init			sys_fanotify_init
-324	nospu	fanotify_mark			sys_fanotify_mark		compat_sys_fanotify_mark
+322	common	rt_tgsigqueueinfo		sys_rt_tgsigqueueinfo		compat_sys_rt_tgsigqueueinfo
+323	common	fanotify_init			sys_fanotify_init
+324	common	fanotify_mark			sys_fanotify_mark		compat_sys_fanotify_mark
 325	common	prlimit64			sys_prlimit64
 326	common	socket				sys_socket
 327	common	bind				sys_bind
@@ -439,20 +398,18 @@
 342	common	recvmsg				sys_recvmsg			compat_sys_recvmsg
 343	32	recvmmsg			sys_recvmmsg_time32		compat_sys_recvmmsg_time32
 343	64	recvmmsg			sys_recvmmsg
-343	spu	recvmmsg			sys_recvmmsg
 344	common	accept4				sys_accept4
 345	common	name_to_handle_at		sys_name_to_handle_at
 346	common	open_by_handle_at		sys_open_by_handle_at		compat_sys_open_by_handle_at
 347	32	clock_adjtime			sys_clock_adjtime32
 347	64	clock_adjtime			sys_clock_adjtime
-347	spu	clock_adjtime			sys_clock_adjtime
 348	common	syncfs				sys_syncfs
 349	common	sendmmsg			sys_sendmmsg			compat_sys_sendmmsg
 350	common	setns				sys_setns
-351	nospu	process_vm_readv		sys_process_vm_readv		compat_sys_process_vm_readv
-352	nospu	process_vm_writev		sys_process_vm_writev		compat_sys_process_vm_writev
-353	nospu	finit_module			sys_finit_module
-354	nospu	kcmp				sys_kcmp
+351	common	process_vm_readv		sys_process_vm_readv		compat_sys_process_vm_readv
+352	common	process_vm_writev		sys_process_vm_writev		compat_sys_process_vm_writev
+353	common	finit_module			sys_finit_module
+354	common	kcmp				sys_kcmp
 355	common	sched_setattr			sys_sched_setattr
 356	common	sched_getattr			sys_sched_getattr
 357	common	renameat2			sys_renameat2
@@ -460,23 +417,22 @@
 359	common	getrandom			sys_getrandom
 360	common	memfd_create			sys_memfd_create
 361	common	bpf				sys_bpf
-362	nospu	execveat			sys_execveat			compat_sys_execveat
+362	common	execveat			sys_execveat			compat_sys_execveat
 363	32	switch_endian			sys_ni_syscall
 363	64	switch_endian			sys_switch_endian
-363	spu	switch_endian			sys_ni_syscall
 364	common	userfaultfd			sys_userfaultfd
 365	common	membarrier			sys_membarrier
 # 366-377 originally left for IPC, now unused
-378	nospu	mlock2				sys_mlock2
-379	nospu	copy_file_range			sys_copy_file_range
+378	common	mlock2				sys_mlock2
+379	common	copy_file_range			sys_copy_file_range
 380	common	preadv2				sys_preadv2			compat_sys_preadv2
 381	common	pwritev2			sys_pwritev2			compat_sys_pwritev2
-382	nospu	kexec_file_load			sys_kexec_file_load
-383	nospu	statx				sys_statx
-384	nospu	pkey_alloc			sys_pkey_alloc
-385	nospu	pkey_free			sys_pkey_free
-386	nospu	pkey_mprotect			sys_pkey_mprotect
-387	nospu	rseq				sys_rseq
+382	common	kexec_file_load			sys_kexec_file_load
+383	common	statx				sys_statx
+384	common	pkey_alloc			sys_pkey_alloc
+385	common	pkey_free			sys_pkey_free
+386	common	pkey_mprotect			sys_pkey_mprotect
+387	common	rseq				sys_rseq
 388	32	io_pgetevents			sys_io_pgetevents_time32	compat_sys_io_pgetevents
 388	64	io_pgetevents			sys_io_pgetevents
 # room for arch specific syscalls
@@ -524,7 +480,6 @@
 434	common	pidfd_open			sys_pidfd_open
 435	32	clone3				ppc_clone3			sys_clone3
 435	64	clone3				sys_clone3
-435	spu	clone3				sys_ni_syscall
 437	common	openat2				sys_openat2
 438	common	pidfd_getfd			sys_pidfd_getfd
 439	common	faccessat2			sys_faccessat2
diff --git a/arch/powerpc/kernel/syscalls/syscalltbl.sh b/arch/powerpc/kernel/syscalls/syscalltbl.sh
index f7393a7b18aa..1a760242620c 100644
--- a/arch/powerpc/kernel/syscalls/syscalltbl.sh
+++ b/arch/powerpc/kernel/syscalls/syscalltbl.sh
@@ -6,6 +6,7 @@ out="$2"
 my_abis=`echo "($3)" | tr ',' '|'`
 my_abi="$4"
 offset="$5"
+spu_table="$6"
 
 emit() {
 	t_nxt="$1"
@@ -28,9 +29,16 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
 	while read nr abi name entry compat ; do
 		if [ "$my_abi" = "c32" ] && [ ! -z "$compat" ]; then
 			emit $((nxt+offset)) $((nr+offset)) $compat
+			nxt=$((nr+1))
+		elif [ "$my_abi" = "spu" ]; then
+			grep -E "^$nr[[:space:]]+$name[[:space:]]+spu[[:space:]]*$" "$spu_table" > /dev/null
+			if [ $? -eq 0 ]; then
+				emit $((nxt+offset)) $((nr+offset)) $entry
+				nxt=$((nr+1))
+			fi
 		else
 			emit $((nxt+offset)) $((nr+offset)) $entry
+			nxt=$((nr+1))
 		fi
-		nxt=$((nr+1))
 	done
 ) > "$out"
-- 
2.25.1


^ permalink raw reply related

* Re: [PATCH] scsi: target/sbp: remove firewire SBP target driver
From: Bart Van Assche @ 2020-06-16 14:08 UTC (permalink / raw)
  To: Finn Thain, Chris Boot
  Cc: Martin K . Petersen, linux-scsi, Chuhong Yuan, linux-kernel,
	Nicholas Bellinger, target-devel, linux1394-devel, linuxppc-dev,
	Stefan Richter
In-Reply-To: <alpine.LNX.2.22.394.2006161929380.8@nippy.intranet>

On 2020-06-16 02:42, Finn Thain wrote:
> Martin said, "I'd appreciate a patch to remove it"
> 
> And Bart said, "do you want to keep this driver in the kernel tree?"
> 
> AFAICT both comments are quite ambiguous. I don't see an actionable 
> request, just an expression of interest from people doing their jobs.
> 
> Note well: there is no pay check associated with having a MAINTAINERS file 
> entry.

Hi Finn,

As far as I know the sbp driver only has had one user ever and that user
is no longer user the sbp driver. So why to keep it in the kernel tree?
Restoring a kernel driver can be easy - the first step is a "git revert".

Thanks,

Bart.



^ permalink raw reply

* Re: [PATCH v4 2/3] mm, treewide: Rename kzfree() to kfree_sensitive()
From: Dan Carpenter @ 2020-06-16 14:26 UTC (permalink / raw)
  To: Waiman Long
  Cc: Jason A . Donenfeld, Michal Hocko, linux-btrfs, Jarkko Sakkinen,
	David Sterba, David Howells, linux-mm, linux-sctp, keyrings,
	kasan-dev, linux-stm32, devel, linux-cifs, linux-scsi,
	James Morris, Matthew Wilcox, linux-wpan, David Rientjes,
	Serge E. Hallyn, linux-pm, ecryptfs, linux-fscrypt,
	linux-mediatek, linux-amlogic, virtualization, linux-integrity,
	linux-nfs, Linus Torvalds, linux-wireless, linux-kernel,
	linux-bluetooth, linux-security-module, target-devel,
	tipc-discussion, linux-crypto, Johannes Weiner, Joe Perches,
	Andrew Morton, linuxppc-dev, netdev, wireguard, linux-ppp
In-Reply-To: <20200616015718.7812-3-longman@redhat.com>

Last time you sent this we couldn't decide which tree it should go
through.  Either the crypto tree or through Andrew seems like the right
thing to me.

Also the other issue is that it risks breaking things if people add
new kzfree() instances while we are doing the transition.  Could you
just add a "#define kzfree kfree_sensitive" so that things continue to
compile and we can remove it in the next kernel release?

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH v5 01/13] powerpc: Remove Xilinx PPC405/PPC440 support
From: Michal Simek @ 2020-06-16 14:45 UTC (permalink / raw)
  To: Nathan Chancellor, Christophe Leroy
  Cc: arnd, michal.simek, linux-kernel, clang-built-linux,
	Paul Mackerras, linuxppc-dev
In-Reply-To: <20200616002720.GA1307277@ubuntu-n2-xlarge-x86>



On 16. 06. 20 2:27, Nathan Chancellor wrote:
> On Thu, May 21, 2020 at 04:55:52PM +0000, Christophe Leroy wrote:
>> From: Michal Simek <michal.simek@xilinx.com>
>>
>> The latest Xilinx design tools called ISE and EDK has been released in
>> October 2013. New tool doesn't support any PPC405/PPC440 new designs.
>> These platforms are no longer supported and tested.
>>
>> PowerPC 405/440 port is orphan from 2013 by
>> commit cdeb89943bfc ("MAINTAINERS: Fix incorrect status tag") and
>> commit 19624236cce1 ("MAINTAINERS: Update Grant's email address and maintainership")
>> that's why it is time to remove the support fot these platforms.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> 
> This patch causes qemu-system-ppc to fail to load ppc44x_defconfig:
> 
> $ make -skj"$(nproc)" ARCH=powerpc CROSS_COMPILE=powerpc-linux- O=out/ppc distclean ppc44x_defconfig zImage
> 
> $ timeout --foreground 30s unbuffer \
> qemu-system-ppc \
> -machine bamboo \

Did you bisect it that you found that this patch is causing problem for
you on any bamboo machine?

Or this was caused by the whole series?

Thanks,
Michal

^ permalink raw reply

* Re: [PATCH v4 3/3] btrfs: Use kfree() in btrfs_ioctl_get_subvol_info()
From: David Sterba @ 2020-06-16 14:48 UTC (permalink / raw)
  To: Waiman Long
  Cc: Jason A . Donenfeld, Michal Hocko, linux-btrfs, Jarkko Sakkinen,
	David Sterba, David Howells, linux-mm, linux-sctp, keyrings,
	kasan-dev, linux-stm32, devel, linux-cifs, linux-scsi,
	James Morris, Matthew Wilcox, linux-wpan, David Rientjes,
	Dan Carpenter, Serge E. Hallyn, linux-pm, ecryptfs, linux-fscrypt,
	linux-mediatek, linux-amlogic, virtualization, linux-integrity,
	linux-nfs, linuxppc-dev, linux-wireless, linux-kernel,
	linux-bluetooth, linux-security-module, target-devel,
	tipc-discussion, linux-crypto, Johannes Weiner, Joe Perches,
	Andrew Morton, Linus Torvalds, netdev, wireguard, linux-ppp
In-Reply-To: <20200616015718.7812-4-longman@redhat.com>

On Mon, Jun 15, 2020 at 09:57:18PM -0400, Waiman Long wrote:
> In btrfs_ioctl_get_subvol_info(), there is a classic case where kzalloc()
> was incorrectly paired with kzfree(). According to David Sterba, there
> isn't any sensitive information in the subvol_info that needs to be
> cleared before freeing. So kfree_sensitive() isn't really needed,
> use kfree() instead.
> 
> Reported-by: David Sterba <dsterba@suse.cz>
> Signed-off-by: Waiman Long <longman@redhat.com>
> ---
>  fs/btrfs/ioctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index f1dd9e4271e9..e8f7c5f00894 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -2692,7 +2692,7 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp)
>  	btrfs_put_root(root);
>  out_free:
>  	btrfs_free_path(path);
> -	kfree_sensitive(subvol_info);
> +	kfree(subvol_info);

I would rather merge a patch doing to kzfree -> kfree instead of doing
the middle step to switch it to kfree_sensitive. If it would help
integration of your patchset I can push it to the next rc so there are
no kzfree left in the btrfs code. Treewide change like that can take
time so it would be one less problem to care about for you.

^ permalink raw reply

* Re: [PATCH v4 3/3] btrfs: Use kfree() in btrfs_ioctl_get_subvol_info()
From: Waiman Long @ 2020-06-16 15:05 UTC (permalink / raw)
  To: dsterba, Andrew Morton, David Howells, Jarkko Sakkinen,
	James Morris, Serge E. Hallyn, Linus Torvalds, Joe Perches,
	Matthew Wilcox, David Rientjes, Michal Hocko, Johannes Weiner,
	Dan Carpenter, Jason A . Donenfeld, linux-mm, keyrings,
	linux-kernel, linux-crypto, linux-pm, linux-stm32, linux-amlogic,
	linux-mediatek, linuxppc-dev, virtualization, netdev, linux-ppp,
	wireguard, linux-wireless, devel, linux-scsi, target-devel,
	linux-btrfs, linux-cifs, linux-fscrypt, ecryptfs, kasan-dev,
	linux-bluetooth, linux-wpan, linux-sctp, linux-nfs,
	tipc-discussion, linux-security-module, linux-integrity
In-Reply-To: <20200616144804.GD27795@twin.jikos.cz>

On 6/16/20 10:48 AM, David Sterba wrote:
> On Mon, Jun 15, 2020 at 09:57:18PM -0400, Waiman Long wrote:
>> In btrfs_ioctl_get_subvol_info(), there is a classic case where kzalloc()
>> was incorrectly paired with kzfree(). According to David Sterba, there
>> isn't any sensitive information in the subvol_info that needs to be
>> cleared before freeing. So kfree_sensitive() isn't really needed,
>> use kfree() instead.
>>
>> Reported-by: David Sterba <dsterba@suse.cz>
>> Signed-off-by: Waiman Long <longman@redhat.com>
>> ---
>>   fs/btrfs/ioctl.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
>> index f1dd9e4271e9..e8f7c5f00894 100644
>> --- a/fs/btrfs/ioctl.c
>> +++ b/fs/btrfs/ioctl.c
>> @@ -2692,7 +2692,7 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp)
>>   	btrfs_put_root(root);
>>   out_free:
>>   	btrfs_free_path(path);
>> -	kfree_sensitive(subvol_info);
>> +	kfree(subvol_info);
> I would rather merge a patch doing to kzfree -> kfree instead of doing
> the middle step to switch it to kfree_sensitive. If it would help
> integration of your patchset I can push it to the next rc so there are
> no kzfree left in the btrfs code. Treewide change like that can take
> time so it would be one less problem to care about for you.
>
Sure, I will move it forward in the patch series.

Thanks,
Longman


^ permalink raw reply

* Re: [PATCH v4 2/3] mm, treewide: Rename kzfree() to kfree_sensitive()
From: Waiman Long @ 2020-06-16 15:05 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jason A . Donenfeld, Michal Hocko, linux-btrfs, Jarkko Sakkinen,
	David Sterba, David Howells, linux-mm, linux-sctp, keyrings,
	kasan-dev, linux-stm32, devel, linux-cifs, linux-scsi,
	James Morris, Matthew Wilcox, linux-wpan, David Rientjes,
	Serge E. Hallyn, linux-pm, ecryptfs, linux-fscrypt,
	linux-mediatek, linux-amlogic, virtualization, linux-integrity,
	linux-nfs, Linus Torvalds, linux-wireless, linux-kernel,
	linux-bluetooth, linux-security-module, target-devel,
	tipc-discussion, linux-crypto, Johannes Weiner, Joe Perches,
	Andrew Morton, linuxppc-dev, netdev, wireguard, linux-ppp
In-Reply-To: <20200616142624.GO4282@kadam>

On 6/16/20 10:26 AM, Dan Carpenter wrote:
> Last time you sent this we couldn't decide which tree it should go
> through.  Either the crypto tree or through Andrew seems like the right
> thing to me.
>
> Also the other issue is that it risks breaking things if people add
> new kzfree() instances while we are doing the transition.  Could you
> just add a "#define kzfree kfree_sensitive" so that things continue to
> compile and we can remove it in the next kernel release?
>
> regards,
> dan carpenter
>
Yes, that make sure sense. Will send out v5 later today.

Cheers,
Longman


^ permalink raw reply

* Re: [PATCH v2 08/12] mm: Define pasid in mm
From: Fenghua Yu @ 2020-06-16 15:11 UTC (permalink / raw)
  To: Jean-Philippe Brucker
  Cc: Dave Hansen, H Peter Anvin, Dave Jiang, Ashok Raj, Joerg Roedel,
	x86, amd-gfx, Ingo Molnar, Ravi V Shankar, Yu-cheng Yu,
	Andrew Donnellan, Borislav Petkov, Sohil Mehta, Thomas Gleixner,
	Tony Luck, linuxppc-dev, Felix Kuehling, linux-kernel, iommu,
	Jacob Jun Pan, Frederic Barrat, David Woodhouse, Lu Baolu
In-Reply-To: <20200616082819.GA590740@myrica>

Hi, Jean,

On Tue, Jun 16, 2020 at 10:28:19AM +0200, Jean-Philippe Brucker wrote:
> On Fri, Jun 12, 2020 at 05:41:29PM -0700, Fenghua Yu wrote:
> > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> > index 64ede5f150dc..5778db3aa42d 100644
> > --- a/include/linux/mm_types.h
> > +++ b/include/linux/mm_types.h
> > @@ -538,6 +538,10 @@ struct mm_struct {
> >  		atomic_long_t hugetlb_usage;
> >  #endif
> >  		struct work_struct async_put_work;
> > +
> > +#ifdef CONFIG_PCI_PASID
> 
> Non-PCI devices can also use a PASID (e.g. Arm's SubstreamID). How about
> CONFIG_IOMMU_SUPPORT?

Sure. I will change it to CONFIG_IOMMU_SUPPORT.

Thanks.

-Fenghua

^ permalink raw reply

* [PATCH v5 0/2] mm, treewide: Rename kzfree() to kfree_sensitive()
From: Waiman Long @ 2020-06-16 15:43 UTC (permalink / raw)
  To: Andrew Morton, David Howells, Jarkko Sakkinen, James Morris,
	Serge E. Hallyn, Linus Torvalds, Joe Perches, Matthew Wilcox,
	David Rientjes
  Cc: Jason A . Donenfeld, Michal Hocko, virtualization, linux-mm,
	linux-sctp, target-devel, linux-stm32, devel, linux-cifs,
	linux-scsi, kasan-dev, linux-wpan, Waiman Long, Dan Carpenter,
	linux-pm, ecryptfs, linux-fscrypt, linux-mediatek, linux-amlogic,
	linux-nfs, netdev, linux-wireless, linux-kernel, linux-bluetooth,
	linux-security-module, keyrings, tipc-discussion, linux-crypto,
	Johannes Weiner, linux-integrity, linuxppc-dev, wireguard,
	linux-ppp

 v5:
  - Break the btrfs patch out as a separate patch to be processed
    independently.
  - Update the commit log of patch 1 to make it less scary.
  - Add a kzfree backward compatibility macro in patch 2.

 v4:
  - Break out the memzero_explicit() change as suggested by Dan Carpenter
    so that it can be backported to stable.
  - Drop the "crypto: Remove unnecessary memzero_explicit()" patch for
    now as there can be a bit more discussion on what is best. It will be
    introduced as a separate patch later on after this one is merged.

This patchset makes a global rename of the kzfree() to kfree_sensitive()
to highlight the fact buffer clearing is only needed if the data objects
contain sensitive information like encrpytion key. The fact that kzfree()
uses memset() to do the clearing isn't totally safe either as compiler
may compile out the clearing in their optimizer especially if LTO is
used. Instead, the new kfree_sensitive() uses memzero_explicit() which
won't get compiled out.


Waiman Long (2):
  mm/slab: Use memzero_explicit() in kzfree()
  mm, treewide: Rename kzfree() to kfree_sensitive()

 arch/s390/crypto/prng.c                       |  4 +--
 arch/x86/power/hibernate.c                    |  2 +-
 crypto/adiantum.c                             |  2 +-
 crypto/ahash.c                                |  4 +--
 crypto/api.c                                  |  2 +-
 crypto/asymmetric_keys/verify_pefile.c        |  4 +--
 crypto/deflate.c                              |  2 +-
 crypto/drbg.c                                 | 10 +++---
 crypto/ecc.c                                  |  8 ++---
 crypto/ecdh.c                                 |  2 +-
 crypto/gcm.c                                  |  2 +-
 crypto/gf128mul.c                             |  4 +--
 crypto/jitterentropy-kcapi.c                  |  2 +-
 crypto/rng.c                                  |  2 +-
 crypto/rsa-pkcs1pad.c                         |  6 ++--
 crypto/seqiv.c                                |  2 +-
 crypto/shash.c                                |  2 +-
 crypto/skcipher.c                             |  2 +-
 crypto/testmgr.c                              |  6 ++--
 crypto/zstd.c                                 |  2 +-
 .../allwinner/sun8i-ce/sun8i-ce-cipher.c      |  2 +-
 .../allwinner/sun8i-ss/sun8i-ss-cipher.c      |  2 +-
 drivers/crypto/amlogic/amlogic-gxl-cipher.c   |  4 +--
 drivers/crypto/atmel-ecc.c                    |  2 +-
 drivers/crypto/caam/caampkc.c                 | 28 +++++++--------
 drivers/crypto/cavium/cpt/cptvf_main.c        |  6 ++--
 drivers/crypto/cavium/cpt/cptvf_reqmanager.c  | 12 +++----
 drivers/crypto/cavium/nitrox/nitrox_lib.c     |  4 +--
 drivers/crypto/cavium/zip/zip_crypto.c        |  6 ++--
 drivers/crypto/ccp/ccp-crypto-rsa.c           |  6 ++--
 drivers/crypto/ccree/cc_aead.c                |  4 +--
 drivers/crypto/ccree/cc_buffer_mgr.c          |  4 +--
 drivers/crypto/ccree/cc_cipher.c              |  6 ++--
 drivers/crypto/ccree/cc_hash.c                |  8 ++---
 drivers/crypto/ccree/cc_request_mgr.c         |  2 +-
 drivers/crypto/marvell/cesa/hash.c            |  2 +-
 .../crypto/marvell/octeontx/otx_cptvf_main.c  |  6 ++--
 .../marvell/octeontx/otx_cptvf_reqmgr.h       |  2 +-
 drivers/crypto/mediatek/mtk-aes.c             |  2 +-
 drivers/crypto/nx/nx.c                        |  4 +--
 drivers/crypto/virtio/virtio_crypto_algs.c    | 12 +++----
 drivers/crypto/virtio/virtio_crypto_core.c    |  2 +-
 drivers/md/dm-crypt.c                         | 32 ++++++++---------
 drivers/md/dm-integrity.c                     |  6 ++--
 drivers/misc/ibmvmc.c                         |  6 ++--
 .../hisilicon/hns3/hns3pf/hclge_mbx.c         |  2 +-
 .../net/ethernet/intel/ixgbe/ixgbe_ipsec.c    |  6 ++--
 drivers/net/ppp/ppp_mppe.c                    |  6 ++--
 drivers/net/wireguard/noise.c                 |  4 +--
 drivers/net/wireguard/peer.c                  |  2 +-
 drivers/net/wireless/intel/iwlwifi/pcie/rx.c  |  2 +-
 .../net/wireless/intel/iwlwifi/pcie/tx-gen2.c |  6 ++--
 drivers/net/wireless/intel/iwlwifi/pcie/tx.c  |  6 ++--
 drivers/net/wireless/intersil/orinoco/wext.c  |  4 +--
 drivers/s390/crypto/ap_bus.h                  |  4 +--
 drivers/staging/ks7010/ks_hostif.c            |  2 +-
 drivers/staging/rtl8723bs/core/rtw_security.c |  2 +-
 drivers/staging/wlan-ng/p80211netdev.c        |  2 +-
 drivers/target/iscsi/iscsi_target_auth.c      |  2 +-
 fs/cifs/cifsencrypt.c                         |  2 +-
 fs/cifs/connect.c                             | 10 +++---
 fs/cifs/dfs_cache.c                           |  2 +-
 fs/cifs/misc.c                                |  8 ++---
 fs/crypto/keyring.c                           |  6 ++--
 fs/crypto/keysetup_v1.c                       |  4 +--
 fs/ecryptfs/keystore.c                        |  4 +--
 fs/ecryptfs/messaging.c                       |  2 +-
 include/crypto/aead.h                         |  2 +-
 include/crypto/akcipher.h                     |  2 +-
 include/crypto/gf128mul.h                     |  2 +-
 include/crypto/hash.h                         |  2 +-
 include/crypto/internal/acompress.h           |  2 +-
 include/crypto/kpp.h                          |  2 +-
 include/crypto/skcipher.h                     |  2 +-
 include/linux/slab.h                          |  4 ++-
 lib/mpi/mpiutil.c                             |  6 ++--
 lib/test_kasan.c                              |  6 ++--
 mm/slab_common.c                              | 10 +++---
 net/atm/mpoa_caches.c                         |  4 +--
 net/bluetooth/ecdh_helper.c                   |  6 ++--
 net/bluetooth/smp.c                           | 24 ++++++-------
 net/core/sock.c                               |  2 +-
 net/ipv4/tcp_fastopen.c                       |  2 +-
 net/mac80211/aead_api.c                       |  4 +--
 net/mac80211/aes_gmac.c                       |  2 +-
 net/mac80211/key.c                            |  2 +-
 net/mac802154/llsec.c                         | 20 +++++------
 net/sctp/auth.c                               |  2 +-
 net/sctp/socket.c                             |  2 +-
 net/sunrpc/auth_gss/gss_krb5_crypto.c         |  4 +--
 net/sunrpc/auth_gss/gss_krb5_keys.c           |  6 ++--
 net/sunrpc/auth_gss/gss_krb5_mech.c           |  2 +-
 net/tipc/crypto.c                             | 10 +++---
 net/wireless/core.c                           |  2 +-
 net/wireless/ibss.c                           |  4 +--
 net/wireless/lib80211_crypt_tkip.c            |  2 +-
 net/wireless/lib80211_crypt_wep.c             |  2 +-
 net/wireless/nl80211.c                        | 24 ++++++-------
 net/wireless/sme.c                            |  6 ++--
 net/wireless/util.c                           |  2 +-
 net/wireless/wext-sme.c                       |  2 +-
 scripts/coccinelle/free/devm_free.cocci       |  4 +--
 scripts/coccinelle/free/ifnullfree.cocci      |  4 +--
 scripts/coccinelle/free/kfree.cocci           |  6 ++--
 scripts/coccinelle/free/kfreeaddr.cocci       |  2 +-
 security/apparmor/domain.c                    |  4 +--
 security/apparmor/include/file.h              |  2 +-
 security/apparmor/policy.c                    | 24 ++++++-------
 security/apparmor/policy_ns.c                 |  6 ++--
 security/apparmor/policy_unpack.c             | 14 ++++----
 security/keys/big_key.c                       |  6 ++--
 security/keys/dh.c                            | 14 ++++----
 security/keys/encrypted-keys/encrypted.c      | 14 ++++----
 security/keys/trusted-keys/trusted_tpm1.c     | 34 +++++++++----------
 security/keys/user_defined.c                  |  6 ++--
 115 files changed, 323 insertions(+), 321 deletions(-)

-- 
2.18.1


^ permalink raw reply


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