[PATCH] block drivers/block: Use octal not symbolic permissions

2018-05-23 Thread Joe Perches
Convert the S_ symbolic permissions to their octal equivalents as using octal and not symbolic permissions is preferred by many as more readable. see: https://lkml.org/lkml/2016/8/2/1945 Done with automated conversion via: $ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace

Re: [PATCH] block drivers/block: Use octal not symbolic permissions

2018-05-23 Thread Joe Perches
On Wed, 2018-05-23 at 15:27 -0600, Jens Axboe wrote: > On 5/23/18 2:05 PM, Joe Perches wrote: > > Convert the S_ symbolic permissions to their octal equivalents as > > using octal and not symbolic permissions is preferred by many as more > > readable. > > > > see:

Re: [PATCH v3 23/27] x86/modules: Adapt module loading for PIE support

2018-05-23 Thread Randy Dunlap
On 05/23/2018 03:01 PM, Thomas Garnier wrote: > On Wed, May 23, 2018 at 2:27 PM Randy Dunlap wrote: > >> Hi, > >> (for several patches in this series:) >> The commit message is confusing. See below. > > Thanks for the edits, I will change the different commit messages.

Re: [PATCH] block drivers/block: Use octal not symbolic permissions

2018-05-23 Thread Joe Perches
On Wed, 2018-05-23 at 15:27 -0600, Jens Axboe wrote: > On 5/23/18 2:05 PM, Joe Perches wrote: > > Convert the S_ symbolic permissions to their octal equivalents as > > using octal and not symbolic permissions is preferred by many as more > > readable. > > > > see:

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-23 Thread Benjamin Herrenschmidt
On Wed, 2018-05-23 at 21:50 +0300, Michael S. Tsirkin wrote: > I re-read that discussion and I'm still unclear on the > original question, since I got several apparently > conflicting answers. > > I asked: > > Why isn't setting VIRTIO_F_IOMMU_PLATFORM on the > hypervisor side

Re: [PATCH v3 23/27] x86/modules: Adapt module loading for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
On Wed, May 23, 2018 at 2:27 PM Randy Dunlap wrote: > Hi, > (for several patches in this series:) > The commit message is confusing. See below. Thanks for the edits, I will change the different commit messages. > On 05/23/2018 12:54 PM, Thomas Garnier wrote: > >

Re: [PATCH v3 23/27] x86/modules: Adapt module loading for PIE support

2018-05-23 Thread Randy Dunlap
Hi, (for several patches in this series:) The commit message is confusing. See below. On 05/23/2018 12:54 PM, Thomas Garnier wrote: > Adapt module loading to support PIE relocations. Generate dynamic GOT if > a symbol requires it but no entry exist in the kernel GOT.

Re: [PATCH] block drivers/block: Use octal not symbolic permissions

2018-05-23 Thread Jens Axboe
On 5/23/18 2:05 PM, Joe Perches wrote: > Convert the S_ symbolic permissions to their octal equivalents as > using octal and not symbolic permissions is preferred by many as more > readable. > > see: https://lkml.org/lkml/2016/8/2/1945 > > Done with automated conversion via: > $

Re: [PATCH v3 16/27] compiler: Option to add PROVIDE_HIDDEN replacement for weak symbols

2018-05-23 Thread Randy Dunlap
On 05/23/2018 12:54 PM, Thomas Garnier wrote: > Provide an option to have a PROVIDE_HIDDEN (linker script) entry for > each weak symbol. This option solve an error in x86_64 where the linker solves > optimizes pie generate code to be non-pie because --emit-relocs

RE: [PATCH v3] virtio_blk: add DISCARD and WRIET ZEROES command support

2018-05-23 Thread Liu, Changpeng
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Thursday, March 29, 2018 6:07 PM > To: Liu, Changpeng > Cc: virtualization@lists.linux-foundation.org; cav...@redhat.com; > stefa...@redhat.com; jasow...@redhat.com;

[PATCH v3 27/27] x86/kaslr: Add option to extend KASLR range from 1GB to 3GB

2018-05-23 Thread Thomas Garnier via Virtualization
Add a new CONFIG_RANDOMIZE_BASE_LARGE option to benefit from PIE support. It increases the KASLR range from 1GB to 3GB. The new range stars at 0x just above the EFI memory region. This option is off by default. The boot code is adapted to create the appropriate page table spanning

[PATCH v3 26/27] x86/relocs: Add option to generate 64-bit relocations

2018-05-23 Thread Thomas Garnier via Virtualization
The x86 relocation tool generates a list of 32-bit signed integers. There was no need to use 64-bit integers because all addresses where above the 2G top of the memory. This change add a large-reloc option to generate 64-bit unsigned integers. It can be used when the kernel plan to go below the

[PATCH v3 25/27] x86/pie: Add option to build the kernel as PIE

2018-05-23 Thread Thomas Garnier via Virtualization
Add the CONFIG_X86_PIE option which builds the kernel as a Position Independent Executable (PIE). The kernel is currently build with the mcmodel=kernel option which forces it to stay on the top 2G of the virtual address space. With PIE, the kernel will be able to move below the current limit. The

[PATCH v3 24/27] x86/mm: Make the x86 GOT read-only

2018-05-23 Thread Thomas Garnier via Virtualization
The GOT is changed during early boot when relocations are applied. Make it read-only directly. This table exists only for PIE binary. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier

[PATCH v3 23/27] x86/modules: Adapt module loading for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Adapt module loading to support PIE relocations. Generate dynamic GOT if a symbol requires it but no entry exist in the kernel GOT. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier

[PATCH v3 22/27] x86/modules: Add option to start module section after kernel

2018-05-23 Thread Thomas Garnier via Virtualization
Add an option so the module section is just after the mapped kernel. It will ensure position independent modules are always at the right distance from the kernel and do not require mcmodule=large. It also optimize the available size for modules by getting rid of the empty space on kernel

[PATCH v3 21/27] x86/ftrace: Adapt function tracing for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
When using -fPIE/PIC with function tracing, the compiler generates a call through the GOT (call *__fentry__@GOTPCREL). This instruction takes 6 bytes instead of 5 on the usual relative call. If PIE is enabled, replace the 6th byte of the GOT call by a 1-byte nop so ftrace can handle the previous

[PATCH v3 20/27] x86: Support global stack cookie

2018-05-23 Thread Thomas Garnier via Virtualization
Add an off-by-default configuration option to use a global stack cookie instead of the default TLS. This configuration option will only be used with PIE binaries. For kernel stack cookie, the compiler uses the mcmodel=kernel to switch between the fs segment to gs segment. A PIE binary does not

[PATCH v3 19/27] kvm: Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. The new __ASM_MOVABS macro is used to get the address of a symbol on both 32 and 64-bit with PIE support. Position Independent Executable (PIE) support will allow to extended the KASLR

[PATCH v3 18/27] xen: Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change the assembly code to use the new _ASM_MOVABS macro which get a symbol reference while being PIE compatible. Adapt the relocation tool to ignore 32-bit Xen code. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit.

[PATCH v3 17/27] x86/relocs: Handle PIE relocations

2018-05-23 Thread Thomas Garnier via Virtualization
Change the relocation tool to correctly handle relocations generated by -fPIE option: - Add relocation for each entry of the .got section given the linker does not generate R_X86_64_GLOB_DAT on a simple link. - Ignore R_X86_64_GOTPCREL. Signed-off-by: Thomas Garnier

[PATCH v3 16/27] compiler: Option to add PROVIDE_HIDDEN replacement for weak symbols

2018-05-23 Thread Thomas Garnier via Virtualization
Provide an option to have a PROVIDE_HIDDEN (linker script) entry for each weak symbol. This option solve an error in x86_64 where the linker optimizes pie generate code to be non-pie because --emit-relocs was used instead of -pie (to reduce dynamic relocations). Signed-off-by: Thomas Garnier

[PATCH v3 15/27] compiler: Option to default to hidden symbols

2018-05-23 Thread Thomas Garnier via Virtualization
Provide an option to default visibility to hidden except for key symbols. This option is disabled by default and will be used by x86_64 PIE support to remove errors between compilation units. The default visibility is also enabled for external symbols that are compared as they maybe equals

[PATCH v3 14/27] x86/percpu: Adapt percpu for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Perpcu uses a clever design where the .percu ELF section has a virtual address of zero and the relocation code avoid relocating specific symbols. It makes the code simple and easily adaptable with or without SMP support. This design is incompatible with PIE because generated code always try to

[PATCH v3 13/27] x86/boot/64: Build head64.c as mcmodel large when PIE is enabled

2018-05-23 Thread Thomas Garnier via Virtualization
The __startup_64 function assumes all symbols have relocated addresses instead of the current boot virtual address. PIE generated code favor relative addresses making all virtual and physical address math incorrect. If PIE is enabled, build head64.c as mcmodel large instead to ensure absolute

[PATCH v3 12/27] x86/paravirt: Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
if PIE is enabled, switch the paravirt assembly constraints to be compatible. The %c/i constrains generate smaller code so is kept by default. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas

[PATCH v3 11/27] x86/power/64: Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier ---

[PATCH v3 10/27] x86/boot/64: Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. Early at boot, the kernel is mapped at a temporary address while preparing the page table. To know the changes needed for the page table with KASLR, the boot code calculate the difference

[PATCH v3 09/27] x86/acpi: Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier ---

[PATCH v3 08/27] x86/CPU: Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. Use the new _ASM_MOVABS macro instead of the 'mov $symbol, %dst' construct. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G

[PATCH v3 07/27] x86: pm-trace - Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change assembly to use the new _ASM_MOVABS macro instead of _ASM_MOV for the assembly to be PIE compatible. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier ---

[PATCH v3 06/27] x86/entry/64: Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier ---

[PATCH v3 05/27] x86: relocate_kernel - Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier ---

[PATCH v3 04/27] x86: Add macro to get symbol address for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Add a new _ASM_MOVABS macro to fetch a symbol address. It will be used to replace "_ASM_MOV $, %dst" code construct that are not compatible with PIE. Signed-off-by: Thomas Garnier --- arch/x86/include/asm/asm.h | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v3 03/27] x86: Use symbol name in jump table for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Replace the %c constraint with %P. The %c is incompatible with PIE because it implies an immediate value whereas %P reference a symbol. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier

[PATCH v3 02/27] x86: Use symbol name on bug table for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Replace the %c constraint with %P. The %c is incompatible with PIE because it implies an immediate value whereas %P reference a symbol. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier

[PATCH v3 00/27] x86: PIE support and option to extend KASLR randomization

2018-05-23 Thread Thomas Garnier via Virtualization
Changes: - patch v3: - Update on message to describe longer term PIE goal. - Minor change on ftrace if condition. - Changed code using xchgq. - patch v2: - Adapt patch to work post KPTI and compiler changes - Redo all performance testing with latest configs and compilers -

[PATCH v3 01/27] x86/crypto: Adapt assembly for PIE support

2018-05-23 Thread Thomas Garnier via Virtualization
Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier ---

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-23 Thread Michael S. Tsirkin
subj: s/virito/virtio/ On Tue, May 22, 2018 at 12:03:17PM +0530, Anshuman Khandual wrote: > This adds a hook which a platform can define in order to allow it to > force the use of the DMA API for all virtio devices even if they don't > have the VIRTIO_F_IOMMU_PLATFORM flag set. We want to use

Re: [PATCH RFCv2 0/4] virtio-mem: paravirtualized memory

2018-05-23 Thread David Hildenbrand
On 23.05.2018 20:24, David Hildenbrand wrote: > This is the Linux driver side of virtio-mem. Compared to the QEMU side, > it is in a pretty complete and clean state. > > virtio-mem is a paravirtualized mechanism of adding/removing memory to/from > a VM. We can do this on a 4MB granularity right

Re: [PATCH net V2 0/4] Fix several issues of virtio-net mergeable XDP

2018-05-23 Thread David Miller
From: Jason Wang Date: Tue, 22 May 2018 11:44:27 +0800 > Please review the patches that tries to fix sevreal issues of > virtio-net mergeable XDP. > > Changes from V1: > - check against 1 before decreasing instead of resetting to 1 > - typoe fixes Series applied and queued

Call for Papers - DSIC’18 - Montenegro

2018-05-23 Thread Maria Lemos
DSIC’18 – The 2018 International Conference on Digital Science 19 – 21 October 2018, Montenegro https://digscience.org/ SCOPE DSIC’18 – The 2018

Re: [PATCH net-next v11 2/5] netvsc: refactor notifier/event handling code to use the failover framework

2018-05-23 Thread Samudrala, Sridhar
On 5/22/2018 11:27 PM, Jiri Pirko wrote: Tue, May 22, 2018 at 10:54:29PM CEST, sridhar.samudr...@intel.com wrote: On 5/22/2018 9:12 AM, Jiri Pirko wrote: Fixing the subj, sorry about that. Tue, May 22, 2018 at 05:46:21PM CEST, m...@redhat.com wrote: On Tue, May 22, 2018 at 05:36:14PM +0200,

Re: [RFC V4 PATCH 7/8] vhost: packed ring support

2018-05-23 Thread Jason Wang
On 2018年05月23日 15:17, Wei Xu wrote: On Wed, May 23, 2018 at 09:39:28AM +0800, Jason Wang wrote: On 2018年05月23日 00:54, Wei Xu wrote: On Wed, May 16, 2018 at 08:32:20PM +0800, Jason Wang wrote: Signed-off-by: Jason Wang --- drivers/vhost/net.c | 3 +-

Re: [RFC V4 PATCH 7/8] vhost: packed ring support

2018-05-23 Thread Wei Xu
On Wed, May 23, 2018 at 09:39:28AM +0800, Jason Wang wrote: > > > On 2018年05月23日 00:54, Wei Xu wrote: > >On Wed, May 16, 2018 at 08:32:20PM +0800, Jason Wang wrote: > >>Signed-off-by: Jason Wang > >>--- > >> drivers/vhost/net.c | 3 +- > >> drivers/vhost/vhost.c | 539

Re: [PATCH net-next v11 2/5] netvsc: refactor notifier/event handling code to use the failover framework

2018-05-23 Thread Jiri Pirko
Tue, May 22, 2018 at 10:54:29PM CEST, sridhar.samudr...@intel.com wrote: > > >On 5/22/2018 9:12 AM, Jiri Pirko wrote: >> Fixing the subj, sorry about that. >> >> Tue, May 22, 2018 at 05:46:21PM CEST, m...@redhat.com wrote: >> > On Tue, May 22, 2018 at 05:36:14PM +0200, Jiri Pirko wrote: >> > >