2019-05-19 13:08:20 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-28 03:21:41 -07:00
|
|
|
|
|
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:29 +05:30
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
2023-10-16 12:41:27 +05:30
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-16 12:41:27 +05:30
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
2023-10-16 12:41:27 +05:30
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2009-05-21 10:09:46 +01:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
xen/privcmd: Add new syscall to get gsi from dev
On PVH dom0, when passthrough a device to domU, QEMU and xl tools
want to use gsi number to do pirq mapping, see QEMU code
xen_pt_realize->xc_physdev_map_pirq, and xl code
pci_add_dm_done->xc_physdev_map_pirq, but in current codes, the gsi
number is got from file /sys/bus/pci/devices/<sbdf>/irq, that is
wrong, because irq is not equal with gsi, they are in different
spaces, so pirq mapping fails.
And in current linux codes, there is no method to get gsi
for userspace.
For above purpose, record gsi of pcistub devices when init
pcistub and add a new syscall into privcmd to let userspace
can get gsi when they have a need.
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <20240924061437.2636766-4-Jiqian.Chen@amd.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
2024-09-24 14:14:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-20 15:42:14 +01:00
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
|
|
|
|
|
2024-06-11 16:54:05 -07:00
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
|
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-19 15:23:17 +00:00
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2009-05-21 10:09:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-17 13:37:49 -07:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2021-09-22 12:18:25 +02:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-08 21:33:25 -07:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-06 19:48:49 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-08 21:33:25 -07:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-14 22:35:40 -05:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
|
|
|
|
|
2013-01-14 22:35:40 -05:00
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
|
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
|
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
|
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2017-05-31 14:03:57 +01:00
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2013-01-14 22:35:40 -05:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2013-01-14 22:35:40 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-22 12:16:35 +02:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-01 10:33:26 +02:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-22 12:16:35 +02:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-09 15:39:26 -07:00
|
|
|
|
2009-03-08 04:10:00 -07:00
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove 'type' argument from access_ok() function
Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
of the user address range verification function since we got rid of the
old racy i386-only code to walk page tables by hand.
It existed because the original 80386 would not honor the write protect
bit when in kernel mode, so you had to do COW by hand before doing any
user access. But we haven't supported that in a long time, and these
days the 'type' argument is a purely historical artifact.
A discussion about extending 'user_access_begin()' to do the range
checking resulted this patch, because there is no way we're going to
move the old VERIFY_xyz interface to that model. And it's best done at
the end of the merge window when I've done most of my merges, so let's
just get this done once and for all.
This patch was mostly done with a sed-script, with manual fix-ups for
the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.
There were a couple of notable cases:
- csky still had the old "verify_area()" name as an alias.
- the iter_iov code had magical hardcoded knowledge of the actual
values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
really used it)
- microblaze used the type argument for a debug printout
but other than those oddities this should be a total no-op patch.
I tried to fix up all architectures, did fairly extensive grepping for
access_ok() uses, and the changes are trivial, but I may have missed
something. Any missed conversion should be trivially fixable, though.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-01-03 18:57:57 -08:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove 'type' argument from access_ok() function
Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
of the user address range verification function since we got rid of the
old racy i386-only code to walk page tables by hand.
It existed because the original 80386 would not honor the write protect
bit when in kernel mode, so you had to do COW by hand before doing any
user access. But we haven't supported that in a long time, and these
days the 'type' argument is a purely historical artifact.
A discussion about extending 'user_access_begin()' to do the range
checking resulted this patch, because there is no way we're going to
move the old VERIFY_xyz interface to that model. And it's best done at
the end of the merge window when I've done most of my merges, so let's
just get this done once and for all.
This patch was mostly done with a sed-script, with manual fix-ups for
the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.
There were a couple of notable cases:
- csky still had the old "verify_area()" name as an alias.
- the iter_iov code had magical hardcoded knowledge of the actual
values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
really used it)
- microblaze used the type argument for a debug printout
but other than those oddities this should be a total no-op patch.
I tried to fix up all architectures, did fairly extensive grepping for
access_ok() uses, and the changes are trivial, but I may have missed
something. Any missed conversion should be trivially fixable, though.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-01-03 18:57:57 -08:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-05 16:54:12 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-14 22:35:40 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2020-06-08 21:33:25 -07:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
2012-11-16 18:36:49 +00:00
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-05 16:54:12 +01:00
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
2013-01-14 22:35:40 -05:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2015-05-05 16:54:12 +01:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2020-06-08 21:33:25 -07:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2013-01-14 22:35:40 -05:00
|
|
|
|
|
|
|
|
|
2015-08-07 17:34:41 +01:00
|
|
|
|
2013-01-14 22:35:40 -05:00
|
|
|
|
2015-03-11 14:49:57 +00:00
|
|
|
|
|
|
|
|
|
2013-01-14 22:35:40 -05:00
|
|
|
|
|
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
|
|
|
|
|
2020-06-08 21:33:25 -07:00
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
2020-07-12 09:09:53 +05:30
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
2022-08-25 16:19:18 +02:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
2022-08-25 16:19:18 +02:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
2020-07-12 09:09:53 +05:30
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 16:19:18 +02:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-12 09:09:55 +05:30
|
|
|
|
2022-08-25 16:19:18 +02:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
2022-08-25 16:19:18 +02:00
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
2020-07-12 09:09:53 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 16:19:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-12 09:09:55 +05:30
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-12 09:09:53 +05:30
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove 'type' argument from access_ok() function
Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
of the user address range verification function since we got rid of the
old racy i386-only code to walk page tables by hand.
It existed because the original 80386 would not honor the write protect
bit when in kernel mode, so you had to do COW by hand before doing any
user access. But we haven't supported that in a long time, and these
days the 'type' argument is a purely historical artifact.
A discussion about extending 'user_access_begin()' to do the range
checking resulted this patch, because there is no way we're going to
move the old VERIFY_xyz interface to that model. And it's best done at
the end of the merge window when I've done most of my merges, so let's
just get this done once and for all.
This patch was mostly done with a sed-script, with manual fix-ups for
the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.
There were a couple of notable cases:
- csky still had the old "verify_area()" name as an alias.
- the iter_iov code had magical hardcoded knowledge of the actual
values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
really used it)
- microblaze used the type argument for a debug printout
but other than those oddities this should be a total no-op patch.
I tried to fix up all architectures, did fairly extensive grepping for
access_ok() uses, and the changes are trivial, but I may have missed
something. Any missed conversion should be trivially fixable, though.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-01-03 18:57:57 -08:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-12 09:09:53 +05:30
|
|
|
|
2022-08-25 16:19:18 +02:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 16:19:18 +02:00
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-12 12:53:58 +01:00
|
|
|
|
|
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-12 12:53:58 +01:00
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-12 12:53:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-08 21:33:25 -07:00
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-25 21:07:45 -08:00
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-22 09:46:29 +02:00
|
|
|
|
|
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-16 12:41:27 +05:30
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-22 09:46:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-22 12:17:48 +02:00
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
2021-09-22 12:17:48 +02:00
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
2021-09-22 12:17:48 +02:00
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
2021-09-22 12:18:25 +02:00
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-22 12:17:48 +02:00
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-08 21:33:25 -07:00
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xen/privcmd: Add new syscall to get gsi from dev
On PVH dom0, when passthrough a device to domU, QEMU and xl tools
want to use gsi number to do pirq mapping, see QEMU code
xen_pt_realize->xc_physdev_map_pirq, and xl code
pci_add_dm_done->xc_physdev_map_pirq, but in current codes, the gsi
number is got from file /sys/bus/pci/devices/<sbdf>/irq, that is
wrong, because irq is not equal with gsi, they are in different
spaces, so pirq mapping fails.
And in current linux codes, there is no method to get gsi
for userspace.
For above purpose, record gsi of pcistub devices when init
pcistub and add a new syscall into privcmd to let userspace
can get gsi when they have a need.
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <20240924061437.2636766-4-Jiqian.Chen@amd.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
2024-09-24 14:14:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-12 16:45:37 +08:00
|
|
|
|
xen/privcmd: Add new syscall to get gsi from dev
On PVH dom0, when passthrough a device to domU, QEMU and xl tools
want to use gsi number to do pirq mapping, see QEMU code
xen_pt_realize->xc_physdev_map_pirq, and xl code
pci_add_dm_done->xc_physdev_map_pirq, but in current codes, the gsi
number is got from file /sys/bus/pci/devices/<sbdf>/irq, that is
wrong, because irq is not equal with gsi, they are in different
spaces, so pirq mapping fails.
And in current linux codes, there is no method to get gsi
for userspace.
For above purpose, record gsi of pcistub devices when init
pcistub and add a new syscall into privcmd to let userspace
can get gsi when they have a need.
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <20240924061437.2636766-4-Jiqian.Chen@amd.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
2024-09-24 14:14:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-12 16:45:37 +08:00
|
|
|
|
xen/privcmd: Add new syscall to get gsi from dev
On PVH dom0, when passthrough a device to domU, QEMU and xl tools
want to use gsi number to do pirq mapping, see QEMU code
xen_pt_realize->xc_physdev_map_pirq, and xl code
pci_add_dm_done->xc_physdev_map_pirq, but in current codes, the gsi
number is got from file /sys/bus/pci/devices/<sbdf>/irq, that is
wrong, because irq is not equal with gsi, they are in different
spaces, so pirq mapping fails.
And in current linux codes, there is no method to get gsi
for userspace.
For above purpose, record gsi of pcistub devices when init
pcistub and add a new syscall into privcmd to let userspace
can get gsi when they have a need.
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <20240924061437.2636766-4-Jiqian.Chen@amd.com>
Signed-off-by: Juergen Gross <jgross@suse.com>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15:07 +05:30
|
|
|
|
2024-06-18 15:12:28 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:28 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:29 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
2024-07-20 01:48:34 -04:00
|
|
|
|
|
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-16 12:41:24 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-20 01:48:34 -04:00
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-31 14:12:01 -04:00
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
2024-07-20 01:48:34 -04:00
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:28 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:28 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:29 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
2024-06-18 15:12:28 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-31 14:12:01 -04:00
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:29 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:28 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:28 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-18 15:12:28 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-16 12:41:27 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:22 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2012-08-31 09:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:23 +00:00
|
|
|
|
|
|
|
|
|
2018-05-09 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-16 12:41:27 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xen/privcmd: Add new syscall to get gsi from dev
On PVH dom0, when passthrough a device to domU, QEMU and xl tools
want to use gsi number to do pirq mapping, see QEMU code
xen_pt_realize->xc_physdev_map_pirq, and xl code
pci_add_dm_done->xc_physdev_map_pirq, but in current codes, the gsi
number is got from file /sys/bus/pci/devices/<sbdf>/irq, that is
wrong, because irq is not equal with gsi, they are in different
spaces, so pirq mapping fails.
And in current linux codes, there is no method to get gsi
for userspace.
For above purpose, record gsi of pcistub devices when init
pcistub and add a new syscall into privcmd to let userspace
can get gsi when they have a need.
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <20240924061437.2636766-4-Jiqian.Chen@amd.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
2024-09-24 14:14:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-24 05:34:32 +05:30
|
|
|
|
2015-05-05 16:54:12 +01:00
|
|
|
|
2013-12-06 17:55:56 +00:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
2012-11-05 09:42:17 +03:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
2015-05-05 16:54:12 +01:00
|
|
|
|
2013-12-06 17:55:56 +00:00
|
|
|
|
2020-09-01 10:33:26 +02:00
|
|
|
|
2013-12-06 17:55:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-22 12:16:35 +02:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
|
|
|
|
|
2018-04-15 00:45:42 +05:30
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2009-03-06 09:56:59 -08:00
|
|
|
|
2017-02-24 14:56:41 -08:00
|
|
|
|
2016-12-14 15:07:01 -08:00
|
|
|
|
2009-03-06 09:56:59 -08:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-09 15:39:26 -07:00
|
|
|
|
2012-10-17 17:11:21 -07:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-11 12:37:43 -08:00
|
|
|
|
|
|
|
|
|
2023-01-26 11:37:49 -08:00
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-11 20:58:43 -07:00
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
mm: ptep_get() conversion
Convert all instances of direct pte_t* dereferencing to instead use
ptep_get() helper. This means that by default, the accesses change from a
C dereference to a READ_ONCE(). This is technically the correct thing to
do since where pgtables are modified by HW (for access/dirty) they are
volatile and therefore we should always ensure READ_ONCE() semantics.
But more importantly, by always using the helper, it can be overridden by
the architecture to fully encapsulate the contents of the pte. Arch code
is deliberately not converted, as the arch code knows best. It is
intended that arch code (arm64) will override the default with its own
implementation that can (e.g.) hide certain bits from the core code, or
determine young/dirty status by mixing in state from another source.
Conversion was done using Coccinelle:
----
// $ make coccicheck \
// COCCI=ptepget.cocci \
// SPFLAGS="--include-headers" \
// MODE=patch
virtual patch
@ depends on patch @
pte_t *v;
@@
- *v
+ ptep_get(v)
----
Then reviewed and hand-edited to avoid multiple unnecessary calls to
ptep_get(), instead opting to store the result of a single call in a
variable, where it is correct to do so. This aims to negate any cost of
READ_ONCE() and will benefit arch-overrides that may be more complex.
Included is a fix for an issue in an earlier version of this patch that
was pointed out by kernel test robot. The issue arose because config
MMU=n elides definition of the ptep helper functions, including
ptep_get(). HUGETLB_PAGE=n configs still define a simple
huge_ptep_clear_flush() for linking purposes, which dereferences the ptep.
So when both configs are disabled, this caused a build error because
ptep_get() is not defined. Fix by continuing to do a direct dereference
when MMU=n. This is safe because for this config the arch code cannot be
trying to virtualize the ptes because none of the ptep helpers are
defined.
Link: https://lkml.kernel.org/r/20230612151545.3317766-4-ryan.roberts@arm.com
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202305120142.yXsNEo6H-lkp@intel.com/
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Dave Airlie <airlied@gmail.com>
Cc: Dimitri Sivanich <dimitri.sivanich@hpe.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: SeongJae Park <sj@kernel.org>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-06-12 16:15:45 +01:00
|
|
|
|
2013-08-23 18:10:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
2017-02-13 17:03:24 +00:00
|
|
|
|
|
|
|
|
|
2009-02-09 12:05:49 -08:00
|
|
|
|
|
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-28 03:21:41 -07:00
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
|
|
|
|
|
2018-06-18 09:36:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-18 09:36:39 +02:00
|
|
|
|
|
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-16 12:41:27 +05:30
|
|
|
|
2023-08-22 15:15:07 +05:30
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
2018-06-18 09:36:39 +02:00
|
|
|
|
2011-12-16 11:34:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|