Skip to content

Commit fc993be

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 36d7d36 + a51e3ac commit fc993be

File tree

221 files changed

+2993
-1440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+2993
-1440
lines changed

Documentation/filesystems/cifs/ksmbd.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ ksmbd.mountd (user space daemon)
5050
--------------------------------
5151

5252
ksmbd.mountd is userspace process to, transfer user account and password that
53-
are registered using ksmbd.adduser(part of utils for user space). Further it
53+
are registered using ksmbd.adduser (part of utils for user space). Further it
5454
allows sharing information parameters that parsed from smb.conf to ksmbd in
5555
kernel. For the execution part it has a daemon which is continuously running
5656
and connected to the kernel interface using netlink socket, it waits for the
57-
requests(dcerpc and share/user info). It handles RPC calls (at a minimum few
57+
requests (dcerpc and share/user info). It handles RPC calls (at a minimum few
5858
dozen) that are most important for file server from NetShareEnum and
5959
NetServerGetInfo. Complete DCE/RPC response is prepared from the user space
6060
and passed over to the associated kernel thread for the client.
@@ -154,11 +154,11 @@ Each layer
154154
1. Enable all component prints
155155
# sudo ksmbd.control -d "all"
156156

157-
2. Enable one of components(smb, auth, vfs, oplock, ipc, conn, rdma)
157+
2. Enable one of components (smb, auth, vfs, oplock, ipc, conn, rdma)
158158
# sudo ksmbd.control -d "smb"
159159

160-
3. Show what prints are enable.
161-
# cat/sys/class/ksmbd-control/debug
160+
3. Show what prints are enabled.
161+
# cat /sys/class/ksmbd-control/debug
162162
[smb] auth vfs oplock ipc conn [rdma]
163163

164164
4. Disable prints:

Documentation/filesystems/netfs_library.rst

Lines changed: 56 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. SPDX-License-Identifier: GPL-2.0
22
33
=================================
4-
NETWORK FILESYSTEM HELPER LIBRARY
4+
Network Filesystem Helper Library
55
=================================
66

77
.. Contents:
@@ -37,22 +37,22 @@ into a common call framework.
3737

3838
The following services are provided:
3939

40-
* Handles transparent huge pages (THPs).
40+
* Handle folios that span multiple pages.
4141

42-
* Insulates the netfs from VM interface changes.
42+
* Insulate the netfs from VM interface changes.
4343

44-
* Allows the netfs to arbitrarily split reads up into pieces, even ones that
45-
don't match page sizes or page alignments and that may cross pages.
44+
* Allow the netfs to arbitrarily split reads up into pieces, even ones that
45+
don't match folio sizes or folio alignments and that may cross folios.
4646

47-
* Allows the netfs to expand a readahead request in both directions to meet
48-
its needs.
47+
* Allow the netfs to expand a readahead request in both directions to meet its
48+
needs.
4949

50-
* Allows the netfs to partially fulfil a read, which will then be resubmitted.
50+
* Allow the netfs to partially fulfil a read, which will then be resubmitted.
5151

52-
* Handles local caching, allowing cached data and server-read data to be
52+
* Handle local caching, allowing cached data and server-read data to be
5353
interleaved for a single request.
5454

55-
* Handles clearing of bufferage that aren't on the server.
55+
* Handle clearing of bufferage that aren't on the server.
5656

5757
* Handle retrying of reads that failed, switching reads from the cache to the
5858
server as necessary.
@@ -70,22 +70,22 @@ Read Helper Functions
7070

7171
Three read helpers are provided::
7272

73-
* void netfs_readahead(struct readahead_control *ractl,
74-
const struct netfs_read_request_ops *ops,
75-
void *netfs_priv);``
76-
* int netfs_readpage(struct file *file,
77-
struct page *page,
78-
const struct netfs_read_request_ops *ops,
79-
void *netfs_priv);
80-
* int netfs_write_begin(struct file *file,
81-
struct address_space *mapping,
82-
loff_t pos,
83-
unsigned int len,
84-
unsigned int flags,
85-
struct page **_page,
86-
void **_fsdata,
87-
const struct netfs_read_request_ops *ops,
88-
void *netfs_priv);
73+
void netfs_readahead(struct readahead_control *ractl,
74+
const struct netfs_read_request_ops *ops,
75+
void *netfs_priv);
76+
int netfs_readpage(struct file *file,
77+
struct folio *folio,
78+
const struct netfs_read_request_ops *ops,
79+
void *netfs_priv);
80+
int netfs_write_begin(struct file *file,
81+
struct address_space *mapping,
82+
loff_t pos,
83+
unsigned int len,
84+
unsigned int flags,
85+
struct folio **_folio,
86+
void **_fsdata,
87+
const struct netfs_read_request_ops *ops,
88+
void *netfs_priv);
8989

9090
Each corresponds to a VM operation, with the addition of a couple of parameters
9191
for the use of the read helpers:
@@ -103,8 +103,8 @@ Both of these values will be stored into the read request structure.
103103
For ->readahead() and ->readpage(), the network filesystem should just jump
104104
into the corresponding read helper; whereas for ->write_begin(), it may be a
105105
little more complicated as the network filesystem might want to flush
106-
conflicting writes or track dirty data and needs to put the acquired page if an
107-
error occurs after calling the helper.
106+
conflicting writes or track dirty data and needs to put the acquired folio if
107+
an error occurs after calling the helper.
108108

109109
The helpers manage the read request, calling back into the network filesystem
110110
through the suppplied table of operations. Waits will be performed as
@@ -253,7 +253,7 @@ through which it can issue requests and negotiate::
253253
void (*issue_op)(struct netfs_read_subrequest *subreq);
254254
bool (*is_still_valid)(struct netfs_read_request *rreq);
255255
int (*check_write_begin)(struct file *file, loff_t pos, unsigned len,
256-
struct page *page, void **_fsdata);
256+
struct folio *folio, void **_fsdata);
257257
void (*done)(struct netfs_read_request *rreq);
258258
void (*cleanup)(struct address_space *mapping, void *netfs_priv);
259259
};
@@ -313,13 +313,14 @@ The operations are as follows:
313313

314314
There is no return value; the netfs_subreq_terminated() function should be
315315
called to indicate whether or not the operation succeeded and how much data
316-
it transferred. The filesystem also should not deal with setting pages
316+
it transferred. The filesystem also should not deal with setting folios
317317
uptodate, unlocking them or dropping their refs - the helpers need to deal
318318
with this as they have to coordinate with copying to the local cache.
319319

320-
Note that the helpers have the pages locked, but not pinned. It is possible
321-
to use the ITER_XARRAY iov iterator to refer to the range of the inode that
322-
is being operated upon without the need to allocate large bvec tables.
320+
Note that the helpers have the folios locked, but not pinned. It is
321+
possible to use the ITER_XARRAY iov iterator to refer to the range of the
322+
inode that is being operated upon without the need to allocate large bvec
323+
tables.
323324

324325
* ``is_still_valid()``
325326

@@ -330,15 +331,15 @@ The operations are as follows:
330331
* ``check_write_begin()``
331332

332333
[Optional] This is called from the netfs_write_begin() helper once it has
333-
allocated/grabbed the page to be modified to allow the filesystem to flush
334+
allocated/grabbed the folio to be modified to allow the filesystem to flush
334335
conflicting state before allowing it to be modified.
335336

336-
It should return 0 if everything is now fine, -EAGAIN if the page should be
337+
It should return 0 if everything is now fine, -EAGAIN if the folio should be
337338
regrabbed and any other error code to abort the operation.
338339

339340
* ``done``
340341

341-
[Optional] This is called after the pages in the request have all been
342+
[Optional] This is called after the folios in the request have all been
342343
unlocked (and marked uptodate if applicable).
343344

344345
* ``cleanup``
@@ -390,19 +391,19 @@ The read helpers work by the following general procedure:
390391
* If NETFS_SREQ_CLEAR_TAIL was set, a short read will be cleared to the
391392
end of the slice instead of reissuing.
392393

393-
* Once the data is read, the pages that have been fully read/cleared:
394+
* Once the data is read, the folios that have been fully read/cleared:
394395

395396
* Will be marked uptodate.
396397

397398
* If a cache is present, will be marked with PG_fscache.
398399

399400
* Unlocked
400401

401-
* Any pages that need writing to the cache will then have DIO writes issued.
402+
* Any folios that need writing to the cache will then have DIO writes issued.
402403

403404
* Synchronous operations will wait for reading to be complete.
404405

405-
* Writes to the cache will proceed asynchronously and the pages will have the
406+
* Writes to the cache will proceed asynchronously and the folios will have the
406407
PG_fscache mark removed when that completes.
407408

408409
* The request structures will be cleaned up when everything has completed.
@@ -452,6 +453,9 @@ operation table looks like the following::
452453
netfs_io_terminated_t term_func,
453454
void *term_func_priv);
454455

456+
int (*prepare_write)(struct netfs_cache_resources *cres,
457+
loff_t *_start, size_t *_len, loff_t i_size);
458+
455459
int (*write)(struct netfs_cache_resources *cres,
456460
loff_t start_pos,
457461
struct iov_iter *iter,
@@ -509,6 +513,14 @@ The methods defined in the table are:
509513
indicating whether the termination is definitely happening in the caller's
510514
context.
511515

516+
* ``prepare_write()``
517+
518+
[Required] Called to adjust a write to the cache and check that there is
519+
sufficient space in the cache. The start and length values indicate the
520+
size of the write that netfslib is proposing, and this can be adjusted by
521+
the cache to respect DIO boundaries. The file size is passed for
522+
information.
523+
512524
* ``write()``
513525

514526
[Required] Called to write to the cache. The start file offset is given
@@ -525,4 +537,9 @@ not the read request structure as they could be used in other situations where
525537
there isn't a read request structure as well, such as writing dirty data to the
526538
cache.
527539

540+
541+
API Function Reference
542+
======================
543+
528544
.. kernel-doc:: include/linux/netfs.h
545+
.. kernel-doc:: fs/netfs/read_helper.c

MAINTAINERS

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15994,6 +15994,7 @@ F: arch/mips/generic/board-ranchu.c
1599415994

1599515995
RANDOM NUMBER DRIVER
1599615996
M: "Theodore Ts'o" <[email protected]>
15997+
M: Jason A. Donenfeld <[email protected]>
1599715998
S: Maintained
1599815999
F: drivers/char/random.c
1599916000

@@ -16638,7 +16639,8 @@ F: drivers/iommu/s390-iommu.c
1663816639

1663916640
S390 IUCV NETWORK LAYER
1664016641
M: Julian Wiedmann <[email protected]>
16641-
M: Karsten Graul <[email protected]>
16642+
M: Alexandra Winter <[email protected]>
16643+
M: Wenjia Zhang <[email protected]>
1664216644
1664316645
1664416646
S: Supported
@@ -16649,7 +16651,8 @@ F: net/iucv/
1664916651

1665016652
S390 NETWORK DRIVERS
1665116653
M: Julian Wiedmann <[email protected]>
16652-
M: Karsten Graul <[email protected]>
16654+
M: Alexandra Winter <[email protected]>
16655+
M: Wenjia Zhang <[email protected]>
1665316656
1665416657
1665516658
S: Supported

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VERSION = 5
33
PATCHLEVEL = 16
44
SUBLEVEL = 0
5-
EXTRAVERSION = -rc2
5+
EXTRAVERSION = -rc3
66
NAME = Gobble Gobble
77

88
# *DOCUMENTATION*

arch/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,16 @@ config HAVE_ARCH_COMPAT_MMAP_BASES
991991
and vice-versa 32-bit applications to call 64-bit mmap().
992992
Required for applications doing different bitness syscalls.
993993

994+
config PAGE_SIZE_LESS_THAN_64KB
995+
def_bool y
996+
depends on !ARM64_64K_PAGES
997+
depends on !IA64_PAGE_SIZE_64KB
998+
depends on !PAGE_SIZE_64KB
999+
depends on !PARISC_PAGE_SIZE_64KB
1000+
depends on !PPC_64K_PAGES
1001+
depends on !PPC_256K_PAGES
1002+
depends on !PAGE_SIZE_256KB
1003+
9941004
# This allows to use a set of generic functions to determine mmap base
9951005
# address by giving priority to top-down scheme only if the process
9961006
# is not in legacy mode (compat task, unlimited stack size or

arch/arm64/include/asm/kvm_arm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
#define HCR_HOST_VHE_FLAGS (HCR_RW | HCR_TGE | HCR_E2H)
9292

9393
/* TCR_EL2 Registers bits */
94-
#define TCR_EL2_RES1 ((1 << 31) | (1 << 23))
94+
#define TCR_EL2_RES1 ((1U << 31) | (1 << 23))
9595
#define TCR_EL2_TBI (1 << 20)
9696
#define TCR_EL2_PS_SHIFT 16
9797
#define TCR_EL2_PS_MASK (7 << TCR_EL2_PS_SHIFT)
@@ -276,7 +276,7 @@
276276
#define CPTR_EL2_TFP_SHIFT 10
277277

278278
/* Hyp Coprocessor Trap Register */
279-
#define CPTR_EL2_TCPAC (1 << 31)
279+
#define CPTR_EL2_TCPAC (1U << 31)
280280
#define CPTR_EL2_TAM (1 << 30)
281281
#define CPTR_EL2_TTA (1 << 20)
282282
#define CPTR_EL2_TFP (1 << CPTR_EL2_TFP_SHIFT)

arch/arm64/kvm/hyp/include/hyp/switch.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ typedef bool (*exit_handler_fn)(struct kvm_vcpu *, u64 *);
403403

404404
static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm_vcpu *vcpu);
405405

406+
static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code);
407+
406408
/*
407409
* Allow the hypervisor to handle the exit with an exit handler if it has one.
408410
*
@@ -429,6 +431,18 @@ static inline bool kvm_hyp_handle_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
429431
*/
430432
static inline bool fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
431433
{
434+
/*
435+
* Save PSTATE early so that we can evaluate the vcpu mode
436+
* early on.
437+
*/
438+
vcpu->arch.ctxt.regs.pstate = read_sysreg_el2(SYS_SPSR);
439+
440+
/*
441+
* Check whether we want to repaint the state one way or
442+
* another.
443+
*/
444+
early_exit_filter(vcpu, exit_code);
445+
432446
if (ARM_EXCEPTION_CODE(*exit_code) != ARM_EXCEPTION_IRQ)
433447
vcpu->arch.fault.esr_el2 = read_sysreg_el2(SYS_ESR);
434448

arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ static inline void __sysreg_save_el1_state(struct kvm_cpu_context *ctxt)
7070
static inline void __sysreg_save_el2_return_state(struct kvm_cpu_context *ctxt)
7171
{
7272
ctxt->regs.pc = read_sysreg_el2(SYS_ELR);
73-
ctxt->regs.pstate = read_sysreg_el2(SYS_SPSR);
73+
/*
74+
* Guest PSTATE gets saved at guest fixup time in all
75+
* cases. We still need to handle the nVHE host side here.
76+
*/
77+
if (!has_vhe() && ctxt->__hyp_running_vcpu)
78+
ctxt->regs.pstate = read_sysreg_el2(SYS_SPSR);
7479

7580
if (cpus_have_final_cap(ARM64_HAS_RAS_EXTN))
7681
ctxt_sys_reg(ctxt, DISR_EL1) = read_sysreg_s(SYS_VDISR_EL2);

arch/arm64/kvm/hyp/nvhe/switch.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm_vcpu *vcpu)
233233
* Returns false if the guest ran in AArch32 when it shouldn't have, and
234234
* thus should exit to the host, or true if a the guest run loop can continue.
235235
*/
236-
static bool handle_aarch32_guest(struct kvm_vcpu *vcpu, u64 *exit_code)
236+
static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code)
237237
{
238238
struct kvm *kvm = kern_hyp_va(vcpu->kvm);
239239

@@ -248,10 +248,7 @@ static bool handle_aarch32_guest(struct kvm_vcpu *vcpu, u64 *exit_code)
248248
vcpu->arch.target = -1;
249249
*exit_code &= BIT(ARM_EXIT_WITH_SERROR_BIT);
250250
*exit_code |= ARM_EXCEPTION_IL;
251-
return false;
252251
}
253-
254-
return true;
255252
}
256253

257254
/* Switch to the guest for legacy non-VHE systems */
@@ -316,9 +313,6 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu)
316313
/* Jump in the fire! */
317314
exit_code = __guest_enter(vcpu);
318315

319-
if (unlikely(!handle_aarch32_guest(vcpu, &exit_code)))
320-
break;
321-
322316
/* And we're baaack! */
323317
} while (fixup_guest_exit(vcpu, &exit_code));
324318

arch/arm64/kvm/hyp/vhe/switch.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ static const exit_handler_fn *kvm_get_exit_handler_array(struct kvm_vcpu *vcpu)
112112
return hyp_exit_handlers;
113113
}
114114

115+
static void early_exit_filter(struct kvm_vcpu *vcpu, u64 *exit_code)
116+
{
117+
}
118+
115119
/* Switch to the guest for VHE systems running in EL2 */
116120
static int __kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
117121
{

0 commit comments

Comments
 (0)