[PATCH v4 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-30 Thread Juergen Gross via Virtualization
to be adapted to patch calls at alternative patching sites instead of paravirt calls. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/alternative.h| 5 +++-- arch/x86/include/asm/paravirt.h | 9 ++--- arch/x86/include/asm/paravirt_types.h | 26

[PATCH v4 5/5] x86/paravirt: remove no longer needed paravirt patching code

2023-10-30 Thread Juergen Gross via Virtualization
Now that paravirt is using the alternatives patching infrastructure, remove the paravirt patching code. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/paravirt.h | 18 arch/x86/include/asm/paravirt_types.h | 40 arch/x86

[PATCH v4 3/5] x86/paravirt: introduce ALT_NOT_XEN

2023-10-30 Thread Juergen Gross via Virtualization
Introduce the macro ALT_NOT_XEN as a short form of ALT_NOT(X86_FEATURE_XENPV). Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Juergen Gross --- V3: - split off from next patch --- arch/x86/include/asm/paravirt.h | 42 --- arch/x86/include/asm/paravirt_types.h

[PATCH v4 0/5] x86/paravirt: Get rid of paravirt patching

2023-10-30 Thread Juergen Gross via Virtualization
bugs found by kernel test robot (patch 2) Changes in V3: - split v2 patch 3 into 2 patches as requested by Peter and Ingo Changes in V2: - split last patch into 2 - rebase of patch 2 as suggested by Peter - addressed Peter's comments for patch 3 Juergen Gross (5): x86/paravirt: move some

[PATCH v4 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-30 Thread Juergen Gross via Virtualization
As a preparation for replacing paravirt patching completely by alternative patching, move some backend functions and #defines to alternative code and header. Signed-off-by: Juergen Gross --- V4: - rename x86_nop() to nop_func() and x86_BUG() to BUG_func() (Boris Petkov) --- arch/x86/include

Re: [PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-30 Thread Juergen Gross via Virtualization
On 25.10.23 12:34, Borislav Petkov wrote: On Thu, Oct 19, 2023 at 11:15:16AM +0200, Juergen Gross wrote: +/* Low-level backend functions usable from alternative code replacements. */ +DEFINE_ASM_FUNC(x86_nop, "", .entry.text); +EXPORT_SYMBOL_GPL(x86_nop); This is all x86 code so

Re: [PATCH v3 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-26 Thread Juergen Gross via Virtualization
https://github.com/intel-lab-lkp/linux/commits/Juergen-Gross/x86-paravirt-move-some-functions-and-defines-to-alternative/20231019-171709 base: https://git.kernel.org/cgit/virt/kvm/kvm.git queue patch link: https://lore.kernel.org/all/20231019091520.14540-5-jgr...@suse.com/ patch subject: [PATCH

Re: [PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-25 Thread Juergen Gross via Virtualization
On 25.10.23 15:44, Borislav Petkov wrote: On Wed, Oct 25, 2023 at 03:31:07PM +0200, Juergen Gross wrote: There is #define nop() asm volatile ("nop") in arch/x86/include/asm/special_insns.h already. Then call it "nop_func" or so. Okay. It might not be needed now,

Re: [PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-25 Thread Juergen Gross via Virtualization
On 25.10.23 12:34, Borislav Petkov wrote: On Thu, Oct 19, 2023 at 11:15:16AM +0200, Juergen Gross wrote: +/* Low-level backend functions usable from alternative code replacements. */ +DEFINE_ASM_FUNC(x86_nop, "", .entry.text); +EXPORT_SYMBOL_GPL(x86_nop); This is all x86 code so

[PATCH v3 5/5] x86/paravirt: remove no longer needed paravirt patching code

2023-10-19 Thread Juergen Gross via Virtualization
Now that paravirt is using the alternatives patching infrastructure, remove the paravirt patching code. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/paravirt.h | 18 arch/x86/include/asm/paravirt_types.h | 40 arch/x86

[PATCH v3 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-19 Thread Juergen Gross via Virtualization
to be adapted to patch calls at alternative patching sites instead of paravirt calls. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/alternative.h| 5 +++-- arch/x86/include/asm/paravirt.h | 9 ++--- arch/x86/include/asm/paravirt_types.h | 26

[PATCH v3 3/5] x86/paravirt: introduce ALT_NOT_XEN

2023-10-19 Thread Juergen Gross via Virtualization
Introduce the macro ALT_NOT_XEN as a short form of ALT_NOT(X86_FEATURE_XENPV). Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Juergen Gross --- V3: - split off from next patch --- arch/x86/include/asm/paravirt.h | 42 --- arch/x86/include/asm/paravirt_types.h

[PATCH v3 0/5] x86/paravirt: Get rid of paravirt patching

2023-10-19 Thread Juergen Gross via Virtualization
by Peter and Ingo Changes in V2: - split last patch into 2 - rebase of patch 2 as suggested by Peter - addressed Peter's comments for patch 3 Juergen Gross (5): x86/paravirt: move some functions and defines to alternative x86/alternative: add indirect call patching x86/paravirt: introduce

[PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-19 Thread Juergen Gross via Virtualization
As a preparation for replacing paravirt patching completely by alternative patching, move some backend functions and #defines to alternative code and header. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/alternative.h| 16 arch/x86

Re: [PATCH v2 3/4] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-18 Thread Juergen Gross via Virtualization
On 18.10.23 13:34, Ingo Molnar wrote: * Juergen Gross wrote: On 16.10.23 16:29, Peter Zijlstra wrote: On Mon, Oct 16, 2023 at 02:39:32PM +0200, Juergen Gross wrote: Instead of stacking alternative and paravirt patching, use the new ALT_FLAG_CALL flag to switch those mixed calls to pure

Re: [PATCH v2 3/4] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-16 Thread Juergen Gross via Virtualization
On 16.10.23 16:29, Peter Zijlstra wrote: On Mon, Oct 16, 2023 at 02:39:32PM +0200, Juergen Gross wrote: Instead of stacking alternative and paravirt patching, use the new ALT_FLAG_CALL flag to switch those mixed calls to pure alternative handling. This eliminates the need to be careful

[PATCH v2 4/4] x86/paravirt: remove no longer needed paravirt patching code

2023-10-16 Thread Juergen Gross via Virtualization
Now that paravirt is using the alternatives patching infrastructure, remove the paravirt patching code. Signed-off-by: Juergen Gross --- arch/x86/include/asm/paravirt.h | 18 arch/x86/include/asm/paravirt_types.h | 40 arch/x86/include/asm/text-patching.h | 12

[PATCH v2 3/4] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-16 Thread Juergen Gross via Virtualization
to be adapted to patch calls at alternative patching sites instead of paravirt calls. Signed-off-by: Juergen Gross --- arch/x86/include/asm/alternative.h| 5 +-- arch/x86/include/asm/paravirt.h | 49 +-- arch/x86/include/asm/paravirt_types.h | 29

[PATCH v2 1/4] x86/paravirt: move some functions and defines to alternative

2023-10-16 Thread Juergen Gross via Virtualization
As a preparation for replacing paravirt patching completely by alternative patching, move some backend functions and #defines to alternative code and header. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/alternative.h| 16 arch/x86

[PATCH v2 0/4] x86/paravirt: Get rid of paravirt patching

2023-10-16 Thread Juergen Gross via Virtualization
as suggested by Peter - addressed Peter's comments for patch 3 Juergen Gross (4): x86/paravirt: move some functions and defines to alternative x86/alternative: add indirect call patching x86/paravirt: switch mixed paravirt/alternative calls to alternative_2 x86/paravirt: remove no longer

Weird locking hierarchy in virtcrypto

2023-09-22 Thread Juergen Gross via Virtualization
While backporting an upstream patch to one of our older distro kernels I've found a weird locking hierarchy in the virtio crypto driver: virtio_config_changed(): spin_lock_irqsave() ->__virtio_config_changed() ->drv->config_changed() <- assume drv == virtio_crypto_driver

Re: [RFC PATCH 3/3] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-09-20 Thread Juergen Gross via Virtualization
On 20.09.23 16:52, Peter Zijlstra wrote: On Thu, Jun 08, 2023 at 04:03:33PM +0200, Juergen Gross wrote: Instead of stacking alternative and paravirt patching, use the new ALT_FLAG_CALL flag to switch those mixed calls to pure alternative handling. This eliminates the need to be careful

Re: [PATCH 2/3] x86/xen: move paravirt lazy code

2023-09-13 Thread Juergen Gross via Virtualization
On 13.09.23 15:26, Steven Rostedt wrote: On Wed, 13 Sep 2023 13:38:27 +0200 Juergen Gross wrote: diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index 44a3f565264d..0577f0cdd231 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h @@ -6,26 +6,26

[PATCH 0/3] xen: cleanup and fix lazy mode handling

2023-09-13 Thread Juergen Gross via Virtualization
This small series is cleaning up Xen lazy mode handling by removing unused stuff and moving purely Xen-specific code away from general kernel code. The last patch is fixing a regression which was introduced in the 6.6 merge window. Juergen Gross (3): arm/xen: remove lazy mode related

[PATCH 2/3] x86/xen: move paravirt lazy code

2023-09-13 Thread Juergen Gross via Virtualization
change. Signed-off-by: Juergen Gross --- arch/x86/include/asm/paravirt_types.h | 15 -- arch/x86/include/asm/xen/hypervisor.h | 26 +++ arch/x86/kernel/paravirt.c| 67 --- arch/x86/xen/enlighten_pv.c | 39 +--- a

Re: [RFC PATCH 0/3] x86/paravirt: Get rid of paravirt patching

2023-08-24 Thread Juergen Gross via Virtualization
PING! On 10.07.23 14:29, Juergen Gross wrote: Any comments? On 08.06.23 16:03, Juergen Gross wrote: This is a small series getting rid of paravirt patching by switching completely to alternative patching for the same functionality. The basic idea is to add the capability to switch from

Re: [PATCH] x86/paravirt: Fix tlb_remove_table function callback prototype warning

2023-07-26 Thread Juergen Gross via Virtualization
-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307260332.pjntwr6o-...@intel.com/ Cc: Juergen Gross Cc: Peter Zijlstra Cc: Sami Tolvanen Cc: Nathan Chancellor Cc: Ajay Kaher Cc: Alexey Makhalov Cc: VMware PV-Drivers Reviewers Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav

Re: [RFC PATCH 0/3] x86/paravirt: Get rid of paravirt patching

2023-07-10 Thread Juergen Gross via Virtualization
Any comments? On 08.06.23 16:03, Juergen Gross wrote: This is a small series getting rid of paravirt patching by switching completely to alternative patching for the same functionality. The basic idea is to add the capability to switch from indirect to direct calls via a special alternative

Re: [PATCH] Documentation: virt: clean up paravirt_ops doc.

2023-06-11 Thread Juergen Gross via Virtualization
On 10.06.23 07:43, Randy Dunlap wrote: Clarify language. Clean up grammar. Hyphenate some words. Change "low-ops" to "low-level" since "low-ops" isn't defined or even mentioned anywhere else in the kernel source tree. Signed-off-by: Randy Dunlap Cc: Juergen Gro

Re: [PATCH 2/2] x86/paravirt: Make the struct paravirt_patch_site packed

2023-06-09 Thread Juergen Gross via Virtualization
On 09.06.23 11:45, Hou Wenlong wrote: Similar to struct alt_instr, make the struct paravirt_patch_site packed and get rid of all the .align directives. This could save 2 bytes for one entry on X86_64. Suggested-by: Nadav Amit Signed-off-by: Hou Wenlong Reviewed-by: Juergen Gross Juergen

[RFC PATCH 3/3] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-06-08 Thread Juergen Gross via Virtualization
to be adapted to patch calls at alternative patching sites instead of paravirt calls. Remove the no longer needed paravirt patching and related code. Signed-off-by: Juergen Gross --- arch/x86/include/asm/alternative.h| 5 ++- arch/x86/include/asm/paravirt.h | 27 +++ arch/x86

[RFC PATCH 1/3] x86/paravirt: move some functions and defines to alternative

2023-06-08 Thread Juergen Gross via Virtualization
As a preparation for replacing paravirt patching completely by alternative patching, move some backend functions and #defines to alternative code and header. Signed-off-by: Juergen Gross --- arch/x86/include/asm/alternative.h| 16 arch/x86/include/asm/paravirt.h

[RFC PATCH 0/3] x86/paravirt: Get rid of paravirt patching

2023-06-08 Thread Juergen Gross via Virtualization
tested the series on bare metal and as Xen PV domain to still work. RFC because I'm quite sure there will be some objtool work needed (at least removing the specific paravirt handling). Juergen Gross (3): x86/paravirt: move some functions and defines to alternative x86/alternative: add

Re: [PATCH RFC 13/43] x86/paravirt: Use relative reference for original instruction

2023-06-01 Thread Juergen Gross via Virtualization
relocation metadata on relocatable builds. And the alignment could be hard coded to be 4 now. Signed-off-by: Hou Wenlong Cc: Thomas Garnier Cc: Lai Jiangshan Cc: Kees Cook Reviewed-by: Juergen Gross I think this patch should be taken even without the series. Juergen

Re: [PATCH 1/3] MAINTAINERS: Update maintainers for paravirt-ops

2023-05-13 Thread Juergen Gross via Virtualization
ravirt-ops. Remove Srivatsa from the maintainers entry and add Ajay Kaher as an additional reviewer for paravirt-ops. Also, add an entry to CREDITS for Srivatsa. Signed-off-by: Srivatsa S. Bhat (VMware) Acked-by: Alexey Makhalov Acked-by: Ajay Kaher Acked-by: Juergen Gross

[PATCH v2] x86/paravirt: convert simple paravirt functions to asm

2023-03-17 Thread Juergen Gross via Virtualization
expectedly zeroed registers at the call site of the related paravirt functions. Replace the C functions with DEFINE_PARAVIRT_ASM() constructs using the same instructions as the related paravirt calls in the PVOP_ALT_[V]CALLEE*() macros. Signed-off-by: Juergen Gross --- V2: - use noinstr sect

Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-16 Thread Juergen Gross via Virtualization
On 16.03.23 21:14, Peter Zijlstra wrote: On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: +DEFINE_PARAVIRT_ASM(pv_native_irq_disable, "cli", .text); +DEFINE_PARAVIRT_ASM(pv_native_irq_enable, "sti", .text); +DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %

Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-09 Thread Juergen Gross via Virtualization
On 09.03.23 14:39, Borislav Petkov wrote: On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: All functions referenced via __PV_IS_CALLEE_SAVE() need to be assembler functions, as those functions calls are hidden from gcc. In case the kernel is compiled with "-fzero-call-used

[PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-08 Thread Juergen Gross via Virtualization
expectedly zeroed registers at the call site of the related paravirt functions. Replace the C functions with DEFINE_PARAVIRT_ASM() constructs using the same instructions as the related paravirt calls in the PVOP_ALT_[V]CALLEE*() macros. Signed-off-by: Juergen Gross --- arch/x86/i

Re: [PATCH v2] x86/paravirt: merge activate_mm and dup_mmap callbacks

2023-02-23 Thread Juergen Gross via Virtualization
On 07.02.23 22:09, Srivatsa S. Bhat wrote: On 2/6/23 11:59 PM, Juergen Gross wrote: The two paravirt callbacks .mmu.activate_mm and .mmu.dup_mmap are sharing the same implementations in all cases: for Xen PV guests they are pinning the PGD of the new mm_struct, and for all other cases

[PATCH v2] x86/paravirt: merge activate_mm and dup_mmap callbacks

2023-02-06 Thread Juergen Gross via Virtualization
-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky --- V2: - expand commit message (Srivatsa S. Bhat) --- arch/x86/include/asm/mmu_context.h| 4 ++-- arch/x86/include/asm/paravirt.h | 14 +++--- arch/x86/include/asm/paravirt_types.h | 7 ++- arch/x86/kernel/paravirt.c

Re: [PATCH v2] x86/hotplug: Do not put offline vCPUs in mwait idle state

2023-01-16 Thread Juergen Gross via Virtualization
el J. Wysocki" Cc: "Paul E. McKenney" Cc: Wyes Karny Cc: Lewis Caroll Cc: Tom Lendacky Cc: Alexey Makhalov Cc: Juergen Gross Cc: x...@kernel.org Cc: VMware PV-Drivers Reviewers Cc: virtualization@lists.linux-foundation.org Cc: k...@vger.kernel.org Cc: xen-de...@lists.xen

Re: [PATCH] x86/paravirt: merge activate_mm and dup_mmap callbacks

2023-01-15 Thread Juergen Gross via Virtualization
On 16.01.23 05:27, Srivatsa S. Bhat wrote: Hi Juergen, On 1/12/23 7:21 AM, Juergen Gross wrote: The two paravirt callbacks .mmu.activate_mm and .mmu.dup_mmap are sharing the same implementations in all cases: for Xen PV guests they are pinning the PGD of the new mm_struct, and for all other

[PATCH] x86/paravirt: merge activate_mm and dup_mmap callbacks

2023-01-12 Thread Juergen Gross via Virtualization
to the corresponding already existing .mmu.exit_mmap). As the first parameter of the old callbacks isn't used, drop it from the replacement one. Signed-off-by: Juergen Gross --- arch/x86/include/asm/mmu_context.h| 4 ++-- arch/x86/include/asm/paravirt.h | 14 +++--- arch/x86/include/asm

Re: [PATCH v2] x86/paravirt: Use relative reference for original instruction

2022-11-24 Thread Juergen Gross via Virtualization
relocation metadata on relocatable builds. And the alignment could be hard coded to be 4 now. Signed-off-by: Hou Wenlong Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: [PATCH] x86/paravirt: Use relative reference for original instruction

2022-11-24 Thread Juergen Gross via Virtualization
On 24.11.22 12:06, Hou Wenlong wrote: On Thu, Nov 24, 2022 at 11:18:52AM +0100, Juergen Gross wrote: On 24.11.22 09:51, Hou Wenlong wrote: Similar to the alternative patching, use relative reference for original instruction rather than absolute one, which saves 8 bytes for one entry on x86_64

Re: [PATCH] x86/paravirt: Use relative reference for original instruction

2022-11-24 Thread Juergen Gross via Virtualization
On 24.11.22 09:51, Hou Wenlong wrote: Similar to the alternative patching, use relative reference for original instruction rather than absolute one, which saves 8 bytes for one entry on x86_64. And it could generate R_X86_64_PC32 relocation instead of 8 bytes saved? I think those are 4 bytes

Re: [PATCH v2] x86/paravirt: use common macro for creating simple asm paravirt functions

2022-11-16 Thread Juergen Gross via Virtualization
On 16.11.22 12:04, Peter Zijlstra wrote: On Wed, Nov 09, 2022 at 02:44:18PM +0100, Juergen Gross wrote: There are some paravirt assembler functions which are sharing a common pattern. Introduce a macro DEFINE_PARAVIRT_ASM() for creating them. Note that this macro is including explicit

[PATCH v2] x86/paravirt: use common macro for creating simple asm paravirt functions

2022-11-09 Thread Juergen Gross via Virtualization
() and paravirt_ret0() to be aligned at 4 byte boundaries now. The explicit _paravirt_nop() prototype in paravirt.c isn't needed, as it is included in paravirt_types.h already. Signed-off-by: Juergen Gross Reviewed-by: Srivatsa S. Bhat (VMware) --- V2: - expanded commit message (Srivatsa S. Bhat

Re: [PATCH] x86/paravirt: use common macro for creating simple asm paravirt functions

2022-11-08 Thread Juergen Gross via Virtualization
On 09.11.22 06:16, Srivatsa S. Bhat wrote: Hi Juergen, Sorry for the delay in reviewing this patch! On 10/20/22 2:19 AM, Juergen Gross wrote: There are some paravirt assembler functions which are sharing a common pattern. Introduce a macro DEFINE_PARAVIRT_ASM() for creating them

Re: [PATCH] x86/paravirt: use common macro for creating simple asm paravirt functions

2022-11-07 Thread Juergen Gross via Virtualization
Ping? On 20.10.22 11:19, Juergen Gross wrote: There are some paravirt assembler functions which are sharing a common pattern. Introduce a macro DEFINE_PARAVIRT_ASM() for creating them. The explicit _paravirt_nop() prototype in paravirt.c isn't needed, as it is included in paravirt_types.h

Re: [PATCH] locking/paravirt: Fix performance regression on core bonded vCPU

2022-11-03 Thread Juergen Gross via Virtualization
On 03.11.22 14:58, johnnyaiai wrote: Thanks for reply! I think nopvspin parameters controls pvspinlock or native spinlock. a vm guest always running on virtspin wheather nopvspin sets or not when EXITS_HALT not supported by hypervisor. So provide a missing parameter 'novirtspin'. Your patch is

Re: [PATCH] locking/paravirt: Fix performance regression on core bonded vCPU

2022-11-03 Thread Juergen Gross via Virtualization
On 03.11.22 13:13, johnnyaiai wrote: From: johnnyaiai virt_spin_lock() is preferred over native qspinlock when vCPU is preempted. But brings a lot of regression while vCPU is not preempted. Provide a early param 'novirtlock' to choose would be better. will-it-scale/lock2_threads -s 10 -t 64

[PATCH] x86/paravirt: use common macro for creating simple asm paravirt functions

2022-10-20 Thread Juergen Gross via Virtualization
There are some paravirt assembler functions which are sharing a common pattern. Introduce a macro DEFINE_PARAVIRT_ASM() for creating them. The explicit _paravirt_nop() prototype in paravirt.c isn't needed, as it is included in paravirt_types.h already. Signed-off-by: Juergen Gross --- arch/x86

Re: [PATCH] smp/hotplug, x86/vmware: Put offline vCPUs in halt instead of mwait

2022-09-23 Thread Juergen Gross via Virtualization
On 23.09.22 09:05, Peter Zijlstra wrote: On Thu, Jul 21, 2022 at 01:44:33PM -0700, Srivatsa S. Bhat wrote: From: Srivatsa S. Bhat (VMware) VMware ESXi allows enabling a passthru mwait CPU-idle state in the guest using the following VMX option: monitor_control.mwait_in_guest = "TRUE" This

Re: [PATCH v2 30/44] cpuidle,xenpv: Make more PARAVIRT_XXL noinstr clean

2022-09-19 Thread Juergen Gross via Virtualization
: call to HYPERVISOR_sched_op.constprop.0() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Srivatsa S. Bhat (VMware) Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP

Re: [PATCH v2] jailhouse: Hold reference returned from of_find_xxx API

2022-09-16 Thread Juergen Gross via Virtualization
Signed-off-by: Liang He Co-developed-by: Kelin Wang Signed-off-by: Kelin Wang Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature ___ Virt

Re: [PATCH] jailhouse: Hold reference returned from of_find_xxx API

2022-09-15 Thread Juergen Gross via Virtualization
Signed-off-by: Liang He Signed-off-by: Kelin Wang Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature ___ Virtualization mailing list Virt

Re: [PATCH v2 1/1] x86/paravirt: write paravirt ident function in assembly

2022-09-15 Thread Juergen Gross via Virtualization
along. Link: https://github.com/KSPP/linux/issues/192 Cc: Kees Cook Cc: Nick Desaulniers Cc: Juergen Gross Cc: "Srivatsa S. Bhat (VMware)" Cc: Alexey Makhalov Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: VMware PV-Driv

Re: [PATCH] x86/paravirt: Remove clobber bitmask from .parainstructions

2022-09-05 Thread Juergen Gross via Virtualization
d CLBR_* macros. Cc: Juergen Gross Cc: "Srivatsa S. Bhat (VMware)" Cc: Alexey Makhalov Cc: VMware PV-Drivers Reviewers Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x...@kernel.org Cc: "H. Peter Anvin" Cc: Bill Wendling Cc: virtualizati

Re: [PATCH v4 12/21] xen/gntdev: Prepare to dynamic dma-buf locking specification

2022-08-31 Thread Juergen Gross via Virtualization
On 31.08.22 17:37, Dmitry Osipenko wrote: Prepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Signed-off-by: Dmitry Osipenko Acked-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description

Re: [PATCH v3 0/3] virtio: support requiring restricted access per device

2022-07-05 Thread Juergen Gross via Virtualization
On 22.06.22 08:38, Juergen Gross wrote: Instead of an all or nothing approach add support for requiring restricted memory access per device. Changes in V3: - new patches 1 + 2 - basically complete rework of patch 3 Juergen Gross (3): virtio: replace restricted mem access flag with callback

Re: [PATCH v4] x86/paravirt: useless assignment instructions cause Unixbench full core performance degradation

2022-06-27 Thread Juergen Gross via Virtualization
6.2 System Benchmarks Index Score8157.8 Signed-off-by: Guo Hui Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signat

Re: [PATCH v2] x86/paravirt: useless assignment instructions cause Unixbench full core performance degradation

2022-06-26 Thread Juergen Gross via Virtualization
On 27.06.22 04:13, Guo Hui wrote: The instructions assigned to the vcpu_is_preempted function parameter in the X86 architecture physical machine are redundant instructions, causing the multi-core performance of Unixbench to drop by about 4% to 5%. The C function is as follows: static bool

[PATCH v3 0/3] virtio: support requiring restricted access per device

2022-06-22 Thread Juergen Gross via Virtualization
Instead of an all or nothing approach add support for requiring restricted memory access per device. Changes in V3: - new patches 1 + 2 - basically complete rework of patch 3 Juergen Gross (3): virtio: replace restricted mem access flag with callback kernel: remove platform_has

[PATCH v3 1/3] virtio: replace restricted mem access flag with callback

2022-06-22 Thread Juergen Gross via Virtualization
a callback always returning false. As the callback needs to be set in early init code already, add a virtio anchor which is builtin in case virtio is enabled. Signed-off-by: Juergen Gross --- arch/s390/mm/init.c | 4 ++-- arch/x86/mm/mem_encrypt_amd.c| 4 ++-- drivers/virtio/Kconfig

Re: [PATCH V4 0/8] virtio: Solution to restrict memory access under Xen using xen-grant DMA-mapping layer

2022-06-07 Thread Juergen Gross via Virtualization
On 02.06.22 21:23, Oleksandr Tyshchenko wrote: From: Oleksandr Tyshchenko Hello all. The purpose of this patch series is to add support for restricting memory access under Xen using specific grant table [1] based DMA-mapping layer. Patch series is based on Juergen Gross’ initial work [2

Re: [PATCH v3 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-05-19 Thread Juergen Gross via Virtualization
On 04.05.22 17:57, Juergen Gross wrote: Instead of using arch_has_restricted_virtio_memory_access() together with CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS, replace those with platform_has() and a new platform feature PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS. Signed-off-by: Juergen Gross

[PATCH v3 0/2] kernel: add new infrastructure for platform_has() support

2022-05-04 Thread Juergen Gross via Virtualization
. The platform_has() function is using a simple test_bit() call for now, further optimization might be added when needed. [1]: https://lore.kernel.org/lkml/1650646263-22047-1-git-send-email-olekst...@gmail.com/T/#t Juergen Gross (2): kernel: add platform_has() infrastructure virtio: replace

[PATCH v3 1/2] kernel: add platform_has() infrastructure

2022-05-04 Thread Juergen Gross via Virtualization
Add a simple infrastructure for setting, resetting and querying platform feature flags. Flags can be either global or architecture specific. Signed-off-by: Juergen Gross --- V2: - rename set/reset functions to platform_[set|clear]() (Boris Petkov, Heiko Carstens) - move function

[PATCH v3 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-05-04 Thread Juergen Gross via Virtualization
Instead of using arch_has_restricted_virtio_memory_access() together with CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS, replace those with platform_has() and a new platform feature PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS. Signed-off-by: Juergen Gross --- V2: - move setting

Re: [PATCH v2] arm64: paravirt: Use RCU read locks to guard stolen_time

2022-05-04 Thread Juergen Gross via Virtualization
nline") Cc: sta...@vger.kernel.org Signed-off-by: Prakruthi Deepak Heragu Signed-off-by: Elliot Berman Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital

Re: [PATCH v2] arm64: paravirt: Use RCU read locks to guard stolen_time

2022-05-04 Thread Juergen Gross via Virtualization
On 04.05.22 11:45, Will Deacon wrote: On Thu, Apr 28, 2022 at 11:35:36AM -0700, Elliot Berman wrote: From: Prakruthi Deepak Heragu During hotplug, the stolen time data structure is unmapped and memset. There is a possibility of the timer IRQ being triggered before memset and stolen time is

Re: [PATCH v2 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-04-27 Thread Juergen Gross via Virtualization
On 27.04.22 18:30, Michael Kelley (LINUX) wrote: From: Juergen Gross Sent: Wednesday, April 27, 2022 8:34 AM Instead of using arch_has_restricted_virtio_memory_access() together with CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS, replace those with platform_has() and a new platform feature

[PATCH v2 1/2] kernel: add platform_has() infrastructure

2022-04-27 Thread Juergen Gross via Virtualization
Add a simple infrastructure for setting, resetting and querying platform feature flags. Flags can be either global or architecture specific. Signed-off-by: Juergen Gross --- V2: - rename set/reset functions to platform_[set|clear]() (Boris Petkov, Heiko Carstens) - move function

[PATCH v2 0/2] kernel: add new infrastructure for platform_has() support

2022-04-27 Thread Juergen Gross via Virtualization
. The platform_has() function is using a simple test_bit() call for now, further optimization might be added when needed. [1]: https://lore.kernel.org/lkml/1650646263-22047-1-git-send-email-olekst...@gmail.com/T/#t Juergen Gross (2): kernel: add platform_has() infrastructure virtio: replace

[PATCH v2 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-04-27 Thread Juergen Gross via Virtualization
Instead of using arch_has_restricted_virtio_memory_access() together with CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS, replace those with platform_has() and a new platform feature PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS. Signed-off-by: Juergen Gross --- V2: - move setting

Re: [PATCH 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-04-27 Thread Juergen Gross via Virtualization
On 27.04.22 16:09, Tom Lendacky wrote: On 4/27/22 07:37, Juergen Gross wrote: On 27.04.22 14:28, Borislav Petkov wrote: On Wed, Apr 27, 2022 at 08:37:31AM +0200, Juergen Gross wrote: On 26.04.22 19:35, Borislav Petkov wrote: On Tue, Apr 26, 2022 at 03:40:21PM +0200, Juergen Gross wrote

Re: [PATCH 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-04-27 Thread Juergen Gross via Virtualization
On 27.04.22 14:26, Borislav Petkov wrote: On Wed, Apr 27, 2022 at 08:40:08AM +0200, Juergen Gross wrote: I was planning to look at the x86 cpu features to see whether some of those might be candidates to be switched to platform features instead. I'd say "never touch a running system&qu

Re: [PATCH 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-04-27 Thread Juergen Gross via Virtualization
On 27.04.22 14:28, Borislav Petkov wrote: On Wed, Apr 27, 2022 at 08:37:31AM +0200, Juergen Gross wrote: On 26.04.22 19:35, Borislav Petkov wrote: On Tue, Apr 26, 2022 at 03:40:21PM +0200, Juergen Gross wrote: /* protected virtualization */ static void pv_init(void

Re: [PATCH 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-04-27 Thread Juergen Gross via Virtualization
On 26.04.22 21:51, Heiko Carstens wrote: On Tue, Apr 26, 2022 at 07:35:43PM +0200, Borislav Petkov wrote: On Tue, Apr 26, 2022 at 03:40:21PM +0200, Juergen Gross wrote: /* protected virtualization */ static void pv_init(void) { if (!is_prot_virt_guest()) return

Re: [PATCH 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-04-27 Thread Juergen Gross via Virtualization
On 26.04.22 19:35, Borislav Petkov wrote: On Tue, Apr 26, 2022 at 03:40:21PM +0200, Juergen Gross wrote: /* protected virtualization */ static void pv_init(void) { if (!is_prot_virt_guest()) return; + platform_set_feature(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS

Re: [PATCH 1/2] kernel: add platform_has() infrastructure

2022-04-27 Thread Juergen Gross via Virtualization
On 26.04.22 19:31, Borislav Petkov wrote: On Tue, Apr 26, 2022 at 03:40:20PM +0200, Juergen Gross wrote: diff --git a/kernel/platform-feature.c b/kernel/platform-feature.c new file mode 100644 index ..2d52f8442cd5 --- /dev/null +++ b/kernel/platform-feature.c @@ -0,0 +1,7

[PATCH 0/2] kernel: add new infrastructure for platform_has() support

2022-04-26 Thread Juergen Gross via Virtualization
. The platform_has() function is using a simple test_bit() call for now, further optimization might be added when needed. [1]: https://lore.kernel.org/lkml/1650646263-22047-1-git-send-email-olekst...@gmail.com/T/#t Juergen Gross (2): kernel: add platform_has() infrastructure virtio: replace

[PATCH 2/2] virtio: replace arch_has_restricted_virtio_memory_access()

2022-04-26 Thread Juergen Gross via Virtualization
Instead of using arch_has_restricted_virtio_memory_access() together with CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS, replace those with platform_has() and a new platform feature PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS. Signed-off-by: Juergen Gross --- I've only done a compile test on x86

[PATCH 1/2] kernel: add platform_has() infrastructure

2022-04-26 Thread Juergen Gross via Virtualization
Add a simple infrastructure for setting, resetting and querying platform feature flags. Flags can be either global or architecture specific. Signed-off-by: Juergen Gross --- MAINTAINERS| 8 +++ include/asm-generic/Kbuild | 1 + include/asm-generic

Re: [PATCH] arm64: paravirt: Disable IRQs during stolen_time_cpu_down_prepare

2022-04-21 Thread Juergen Gross via Virtualization
crash, but are you sure that para_steal_clock() can't be called from another cpu concurrently? In case you verified this can't happen, you can add my: Reviewed-by: Juergen Gross Otherwise you either need to use RCU for doing the memunmap(), or a lock to protect stolen_time_region. Juergen

Re: [PATCH V2 03/11] perf/x86: Add support for TSC in nanoseconds as a perf event clock

2022-03-07 Thread Juergen Gross via Virtualization
On 07.03.22 11:38, Peter Zijlstra wrote: On Mon, Mar 07, 2022 at 11:06:46AM +0100, Juergen Gross wrote: diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 4420499f7bb4..a1f179ed39bf 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -145,6

Re: [PATCH V2 03/11] perf/x86: Add support for TSC in nanoseconds as a perf event clock

2022-03-07 Thread Juergen Gross via Virtualization
On 07.03.22 10:50, Peter Zijlstra wrote: On Fri, Mar 04, 2022 at 08:27:45PM +0200, Adrian Hunter wrote: On 04/03/2022 15:41, Peter Zijlstra wrote: On Mon, Feb 14, 2022 at 01:09:06PM +0200, Adrian Hunter wrote: Currently, when Intel PT is used within a VM guest, it is not possible to make use

Re: [PATCH] x86/paravirt: use %rip-relative addressing in hook calls

2022-01-10 Thread Juergen Gross via Virtualization
On 23.11.21 10:52, Juergen Gross via Virtualization wrote: On 23.11.21 10:29, Jan Beulich wrote: On 05.10.2021 09:43, Juergen Gross wrote: On 30.09.21 14:40, Jan Beulich via Virtualization wrote: While using a plain (constant) address works, its use needlessly invokes a SIB addressing mode

Re: [PATCH] x86/paravirt: use %rip-relative addressing in hook calls

2021-11-23 Thread Juergen Gross via Virtualization
On 23.11.21 10:29, Jan Beulich wrote: On 05.10.2021 09:43, Juergen Gross wrote: On 30.09.21 14:40, Jan Beulich via Virtualization wrote: While using a plain (constant) address works, its use needlessly invokes a SIB addressing mode, making every call site one byte larger than necessary

Re: [PATCH v3 3/3] MAINTAINERS: Mark VMware mailing list entries as email aliases

2021-11-11 Thread Juergen Gross via Virtualization
access like open mailing lists, which makes them more like email aliases instead (to reach out to reviewers). So update all the VMware mailing list references in the MAINTAINERS file to mark them as such, using "R: email-al...@vmware.com". Signed-off-by: Srivatsa S. Bhat (VMware) Acked-b

Re: [PATCH 2/2] MAINTAINERS: Mark VMware mailing list entries as private

2021-11-08 Thread Juergen Gross via Virtualization
On 08.11.21 21:30, Srivatsa S. Bhat wrote: From: Srivatsa S. Bhat (VMware) VMware mailing lists in the MAINTAINERS file are private lists meant for VMware-internal review/notification for patches to the respective subsystems. So, in an earlier discussion [1][2], it was recommended to mark them

Re: [PATCH 1/2] MAINTAINERS: Update maintainers for paravirt ops and VMware hypervisor interface

2021-11-08 Thread Juergen Gross via Virtualization
this change. Signed-off-by: Srivatsa S. Bhat (VMware) Acked-by: Alexey Makhalov Acked-by: Deep Shah Cc: sta...@vger.kernel.org Acked-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Which tree for paravirt related patches?

2021-11-03 Thread Juergen Gross via Virtualization
A recent patch modifying the core paravirt-ops functionality is highlighting some missing MAINTAINERS information for PARAVIRT_OPS: there is no information which tree is to be used for taking those patches per default. In the past this was mostly handled by the tip tree, and I think this is fine.

[PATCH v3 2/2] x86/xen: switch initial pvops IRQ functions to dummy ones

2021-10-28 Thread Juergen Gross via Virtualization
. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Boris Ostrovsky --- V3: - make paravirt_BUG() noinstr --- arch/x86/include/asm/paravirt_types.h | 2 + arch/x86/kernel/paravirt.c| 13 +- arch/x86/xen/enlighten.c | 19 + arch/x86/xen

[PATCH v3 0/2] x86/xen: simplify irq pvops

2021-10-28 Thread Juergen Gross via Virtualization
The pvops function for Xen PV guests handling the interrupt flag are much more complex than needed. With the supported Xen hypervisor versions they can be simplified a lot, especially by removing the need for disabling preemption. Juergen Gross (2): x86/xen: remove xen_have_vcpu_info_placement

Re: [PATCH] x86/paravirt: use %rip-relative addressing in hook calls

2021-10-05 Thread Juergen Gross via Virtualization
Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature ___ Virtualization mailing list Virtualization@lists.linux-

Re: [PATCH v2 2/2] x86/xen: switch initial pvops IRQ functions to dummy ones

2021-09-22 Thread Juergen Gross via Virtualization
On 22.09.21 23:49, Boris Ostrovsky wrote: On 9/22/21 6:31 AM, Juergen Gross wrote: The initial pvops functions handling irq flags will only ever be called before interrupts are being enabled. So make the __init and switch them to be dummy functions: What are you making __init? Oh, sorry

[PATCH v2 2/2] x86/xen: switch initial pvops IRQ functions to dummy ones

2021-09-22 Thread Juergen Gross via Virtualization
for that purpose. Signed-off-by: Juergen Gross --- arch/x86/include/asm/paravirt_types.h | 2 + arch/x86/kernel/paravirt.c| 13 +- arch/x86/xen/enlighten.c | 19 + arch/x86/xen/irq.c| 61 ++- 4 files changed, 20

  1   2   3   4   5   >