Merge tag 'uml-for-linus-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Mar 2023 17:13:00 +0000 (09:13 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Mar 2023 17:13:00 +0000 (09:13 -0800)
Pull UML updates from Richard Weinberger:

 - Add support for rust (yay!)

 - Add support for LTO

 - Add platform bus support to virtio-pci

 - Various virtio fixes

 - Coding style, spelling cleanups

* tag 'uml-for-linus-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux: (27 commits)
  Documentation: rust: Fix arch support table
  uml: vector: Remove unused definitions VECTOR_{WRITE,HEADERS}
  um: virt-pci: properly remove PCI device from bus
  um: virtio_uml: move device breaking into workqueue
  um: virtio_uml: mark device as unregistered when breaking it
  um: virtio_uml: free command if adding to virtqueue failed
  UML: define RUNTIME_DISCARD_EXIT
  virt-pci: add platform bus support
  um-virt-pci: Make max delay configurable
  um: virt-pci: implement pcibios_get_phb_of_node()
  um: Support LTO
  um: put power options in a menu
  um: Use CFLAGS_vmlinux
  um: Prevent building modules incompatible with MODVERSIONS
  um: Avoid pcap multiple definition errors
  um: Make the definition of cpu_data more compatible
  x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list
  rust: arch/um: Add support for CONFIG_RUST under x86_64 UML
  rust: arch/um: Disable FP/SIMD instruction to match x86
  rust: arch/um: Use 'pie' relocation mode under UML
  ...

1  2 
arch/x86/Makefile.um
fs/hostfs/hostfs_kern.c

diff --combined arch/x86/Makefile.um
index b89e2e0024c574fbec4b17c5a226a7d5d4e4879e,d2e95d1d4db775082541659c8c4d1641c2dbd568..b70559b821df80a1737d913c04a434d1b6511f79
@@@ -1,6 -1,12 +1,12 @@@
  # SPDX-License-Identifier: GPL-2.0
  core-y += arch/x86/crypto/
  
+ #
+ # Disable SSE and other FP/SIMD instructions to match normal x86
+ #
+ KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
+ KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
  ifeq ($(CONFIG_X86_32),y)
  START := 0x8048000
  
@@@ -17,7 -23,7 +23,7 @@@ LDS_EXTRA             := -Ui38
  export LDS_EXTRA
  
  # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
 -include arch/x86/Makefile_32.cpu
 +include $(srctree)/arch/x86/Makefile_32.cpu
  
  # prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
  cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
diff --combined fs/hostfs/hostfs_kern.c
index c18bb50c31b6f5cf4229cbf5499e169282058c50,609f692246430187b81bf33e47635da3a538a1f1..28b4f15c19eb03af3b5b598dac01ed70c2cb923e
@@@ -412,7 -412,7 +412,7 @@@ static int hostfs_writepage(struct pag
        if (page->index >= end_index)
                count = inode->i_size & (PAGE_SIZE-1);
  
-       buffer = kmap(page);
+       buffer = kmap_local_page(page);
  
        err = write_file(HOSTFS_I(inode)->fd, &base, buffer, count);
        if (err != count) {
        err = 0;
  
   out:
-       kunmap(page);
+       kunmap_local(buffer);
        unlock_page(page);
        return err;
  }
  
@@@ -441,7 -441,7 +441,7 @@@ static int hostfs_read_folio(struct fil
        loff_t start = page_offset(page);
        int bytes_read, ret = 0;
  
-       buffer = kmap(page);
+       buffer = kmap_local_page(page);
        bytes_read = read_file(FILE_HOSTFS_I(file)->fd, &start, buffer,
                        PAGE_SIZE);
        if (bytes_read < 0) {
  
   out:
        flush_dcache_page(page);
-       kunmap(page);
+       kunmap_local(buffer);
        unlock_page(page);
        return ret;
  }
  
@@@ -484,9 -485,9 +485,9 @@@ static int hostfs_write_end(struct fil
        unsigned from = pos & (PAGE_SIZE - 1);
        int err;
  
-       buffer = kmap(page);
+       buffer = kmap_local_page(page);
        err = write_file(FILE_HOSTFS_I(file)->fd, &pos, buffer + from, copied);
-       kunmap(page);
+       kunmap_local(buffer);
  
        if (!PageUptodate(page) && err == PAGE_SIZE)
                SetPageUptodate(page);
@@@ -559,7 -560,7 +560,7 @@@ static int read_name(struct inode *ino
        return 0;
  }
  
 -static int hostfs_create(struct user_namespace *mnt_userns, struct inode *dir,
 +static int hostfs_create(struct mnt_idmap *idmap, struct inode *dir,
                         struct dentry *dentry, umode_t mode, bool excl)
  {
        struct inode *inode;
@@@ -658,7 -659,7 +659,7 @@@ static int hostfs_unlink(struct inode *
        return err;
  }
  
 -static int hostfs_symlink(struct user_namespace *mnt_userns, struct inode *ino,
 +static int hostfs_symlink(struct mnt_idmap *idmap, struct inode *ino,
                          struct dentry *dentry, const char *to)
  {
        char *file;
        return err;
  }
  
 -static int hostfs_mkdir(struct user_namespace *mnt_userns, struct inode *ino,
 +static int hostfs_mkdir(struct mnt_idmap *idmap, struct inode *ino,
                        struct dentry *dentry, umode_t mode)
  {
        char *file;
@@@ -696,7 -697,7 +697,7 @@@ static int hostfs_rmdir(struct inode *i
        return err;
  }
  
 -static int hostfs_mknod(struct user_namespace *mnt_userns, struct inode *dir,
 +static int hostfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
                        struct dentry *dentry, umode_t mode, dev_t dev)
  {
        struct inode *inode;
        return err;
  }
  
 -static int hostfs_rename2(struct user_namespace *mnt_userns,
 +static int hostfs_rename2(struct mnt_idmap *idmap,
                          struct inode *old_dir, struct dentry *old_dentry,
                          struct inode *new_dir, struct dentry *new_dentry,
                          unsigned int flags)
        return err;
  }
  
 -static int hostfs_permission(struct user_namespace *mnt_userns,
 +static int hostfs_permission(struct mnt_idmap *idmap,
                             struct inode *ino, int desired)
  {
        char *name;
                err = access_file(name, r, w, x);
        __putname(name);
        if (!err)
 -              err = generic_permission(&init_user_ns, ino, desired);
 +              err = generic_permission(&nop_mnt_idmap, ino, desired);
        return err;
  }
  
 -static int hostfs_setattr(struct user_namespace *mnt_userns,
 +static int hostfs_setattr(struct mnt_idmap *idmap,
                          struct dentry *dentry, struct iattr *attr)
  {
        struct inode *inode = d_inode(dentry);
  
        int fd = HOSTFS_I(inode)->fd;
  
 -      err = setattr_prepare(&init_user_ns, dentry, attr);
 +      err = setattr_prepare(&nop_mnt_idmap, dentry, attr);
        if (err)
                return err;
  
            attr->ia_size != i_size_read(inode))
                truncate_setsize(inode, attr->ia_size);
  
 -      setattr_copy(&init_user_ns, inode, attr);
 +      setattr_copy(&nop_mnt_idmap, inode, attr);
        mark_inode_dirty(inode);
        return 0;
  }