On 2021-04-08 11:38 p.m., Jan Beulich wrote:
On 09.04.2021 08:08, Ankur Arora wrote:
I'm working on somewhat related optimizations on Linux (clear_page(),
going in the opposite direction, from REP STOSB to MOVNT) and have
some comments/questions below.
Interesting.
On 4/8/2021 6:58 AM, Jan
Hi Jan,
I'm working on somewhat related optimizations on Linux (clear_page(),
going in the opposite direction, from REP STOSB to MOVNT) and have
some comments/questions below.
(Discussion on v1 here:
https://lore.kernel.org/lkml/20201014083300.19077-1-ankur.a.ar...@oracle.com/)
On 4/8/2021 6:58
On 2020-04-08 7:12 a.m., Thomas Gleixner wrote:
Ankur Arora writes:
A KVM host (or another hypervisor) might advertise paravirtualized
features and optimization hints (ex KVM_HINTS_REALTIME) which might
become stale over the lifetime of the guest. For instance, the
host might go from being
On 2020-04-08 5:28 a.m., Jürgen Groß wrote:
On 08.04.20 07:02, Ankur Arora wrote:
[ snip ]
Quite a lot of code churn and hacks for a problem which should not
occur on a well administrated machine.
Yeah, I agree the patch set is pretty large and clearly the NMI or
the stop_machine
On 2020-04-08 5:08 a.m., Peter Zijlstra wrote:
On Tue, Apr 07, 2020 at 10:02:57PM -0700, Ankur Arora wrote:
A KVM host (or another hypervisor) might advertise paravirtualized
features and optimization hints (ex KVM_HINTS_REALTIME) which might
become stale over the lifetime of the guest
So, first thanks for the quick comments even though some of my choices
were straight NAKs (or maybe because of that!)
Second, I clearly did a bad job of motivating the series. Let me try
to address the motivation comments first and then I can address the
technical concerns separately.
[ I'm
KVM pv-ops are dependent on KVM features/hints which are exposed
via CPUID. Decouple the probing and the enabling of these ops from
__init so they can be called post-init as well.
Signed-off-by: Ankur Arora
---
arch/x86/Kconfig | 1 +
arch/x86/kernel/kvm.c | 87
registered a
callback via MSR_KVM_HINT_VECTOR, the hint change is notified to it by
means of a callback triggered via vcpu ioctl KVM_CALLBACK.
Signed-off-by: Ankur Arora
---
The callback vector is currently tied in with the hint notification
and can (should) be made more generic such that we
are non-reentrant.
This allows __text_do_poke() to be safely called from an INT3
context with __text_poke_map()/_unmap() being called at the
start and the end of the patching of a call-site instead of
doing that for each stage of the three patching stages.
Signed-off-by: Ankur Arora
---
arch/x86
Define PVRT* macros which can be used to put pv-ops in
.parainstructions.runtime.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/paravirt_types.h | 49 +++
1 file changed, 49 insertions(+)
diff --git a/arch/x86/include/asm/paravirt_types.h
b/arch/x86/include/asm
or not there.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/alternative.h | 13 ++-
arch/x86/kernel/alternative.c | 55 --
2 files changed, 32 insertions(+), 36 deletions(-)
diff --git a/arch/x86/include/asm/alternative.h
b/arch/x86/include/asm
012] */
sync_one() sync_one()
ack()ack()
wait_for_acks()
... ...
smp_store_release(>state, PATCH_DONE)
Signed-off-by: Ankur Arora
---
arch/x86/kernel/alternative.c
paravirt_worker() */...
/* for each patch-site */
generate_paravirt()
runtime_patch()
text_poke_site()
poke_sync()
__text_do_poke()
sync_one()
ack()
wait_for_acks()
...
Signed-off-by: Ankur Arora
---
arch/x86/i
in their active
status.
Signed-off-by: Ankur Arora
---
arch/x86/Kconfig| 1 +
arch/x86/entry/entry_64.S | 5 +++
arch/x86/include/asm/kvm_para.h | 7
arch/x86/kernel/kvm.c | 58 ++---
include/asm-generic/kvm_para.h | 4 +++
include
Add a blocking notifier that triggers when the host sends a hint
change notification.
Suggested-by: Joao Martins
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/kvm_para.h | 10 ++
arch/x86/kernel/kvm.c | 16
include/asm-generic/kvm_para.h | 8
ack()sync_one()
wait_for_acks() ack()
... ...
smp_store_release(>state, PATCH_DONE)
Signed-off-by: Ankur Arora
---
arch/x86/kernel/alternative.c | 145 --
1 file changed, 137 inserti
;state, PATCH_DONE)
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/text-patching.h | 2 +
arch/x86/kernel/alternative.c| 98 +++-
2 files changed, 99 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/text-patching.h
b/arch/x86/include/asm/text-patc
Make __pv_init_lock_hash() conditional on either paravirt spinlocks
being enabled (via kvm_pv_spinlock()) or if paravirt spinlocks
might get enabled (runtime patching via CONFIG_PARAVIRT_RUNTIME.)
Also add a handler for CPUID reprobe which can trigger this patching.
Signed-off-by: Ankur Arora
. Note that
we do need to be careful that we do not try to modify the poking_addr
from multiple contexts simultaneously (ex. INT3 or NMI context.)
Signed-off-by: Ankur Arora
---
arch/x86/kernel/alternative.c | 9 -
include/linux/mm.h| 16 ++--
mm/memory.c
Intended to handle scenarios where we might want to patch arbitrary
instructions (ex. inlined opcodes in pv_lock_ops.)
Users for native mode (as opposed to emulated) are introduced in
later patches.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/text-patching.h | 4 +-
arch/x86/kernel
in the primary and secondary
patching code which are hit while during the patching process.
Signed-off-by: Ankur Arora
---
arch/x86/Kconfig.debug| 13 ++
arch/x86/kernel/Makefile | 1 +
arch/x86/kernel/alternative.c | 20 +++
arch/x86/kernel/kvm.c | 4 +-
arch/x86
ite() */
poke_sync()
... ...
smp_store_release(>state, PATCH_DONE)
Commits further on flesh out the rest of the code.
Signed-off-by: Ankur Arora
---
sync_one() uses the following for pipeline synchronization:
+ if (
(), the migration
thread would flush out any kernel threads preempted in the host.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/paravirt.h | 10 +-
arch/x86/kernel/paravirt_patch.c | 12
kernel/locking/lock_events.c | 2 +-
3 files changed, 18 insertions(+), 6
pv-ops such
that they can be used for runtime patching.
Signed-off-by: Ankur Arora
---
arch/x86/Kconfig | 12
arch/x86/include/asm/paravirt_types.h | 5 +
arch/x86/include/asm/text-patching.h | 5 +
arch/x86/kernel/alternative.c | 2 ++
arch
Add paravirt_stage_alt() which conditionally selects between a paravirt
or native pv-op and then stages it for later patching.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/paravirt_types.h | 6 +++
arch/x86/include/asm/text-patching.h | 3 ++
arch/x86/kernel/alternative.c | 58
__start_parainstructions and __stop_parainstructions aren't
defined, remove them.
Signed-off-by: Ankur Arora
---
arch/x86/kernel/alternative.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 4157f848b537..09e4ee0e09a2
Rename alternatives_smp_module_*(), smp_alt_module to reflect
their new purpose.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/alternative.h | 10 +++---
arch/x86/kernel/alternative.c | 54 +++---
arch/x86/kernel/module.c | 8 ++---
3 files changed
.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/paravirt_types.h | 8 +
arch/x86/kernel/paravirt.c| 6 +---
arch/x86/kernel/paravirt_patch.c | 49 +++
include/linux/preempt.h | 17 ++
4 files changed, 75 insertions(+), 5
Allow PVOP macros to specify a subsection such that _paravirt_alt() can
optionally put sites in .parainstructions.*.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/paravirt_types.h | 158 +-
1 file changed, 102 insertions(+), 56 deletions(-)
diff --git a/arch/x86
s.runtime cd2c ffff828a5140
028a5140 01ca5140 2**3
$ size vmlinux
text data bssdec hex filename
13726196 12302814 14094336 40123346 2643bd2 vmlinux
Ankur Arora (26):
x
of the .parainstructions.runtime
section.)
$ size vmlinux
text data bssdec hex filename
13726196 12302814 14094336 40123346 2643bd2 vmlinux
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/alternative.h | 1 +
arch/x86/kernel/alternative.c | 16
Introduce native_pv_ops where we stash the pv_ops array before
hypervisor specific hooks have modified it.
native_pv_ops get used when switching between paravirt and native
pv-ops at runtime.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/paravirt_types.h | 4
arch/x86/kernel
Various text_poke() variants don't return a useful value. Remove it.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/text-patching.h | 4 ++--
arch/x86/kernel/alternative.c| 11 +--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/x86/include/asm/text
On 6/17/19 3:14 AM, Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
For the most part, we now pass xenhost_t * as a parameter.
Co-developed-by: Joao Martins
Signed-off-by: Ankur Arora
I don't see how this can be a patch on its own.
Yes, the reason this was separate
On 6/17/19 3:55 AM, Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
Xenhost type xenhost_r0 does not support standard GNTTABOP_map_grant_ref
semantics (map a gref onto a specified host_addr). That's because
since the hypervisor is local (same address space as the caller
On 6/17/19 3:07 AM, Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
Mechanical changes, now most of these calls take xenhost_t *
as parameter.
Co-developed-by: Joao Martins
Signed-off-by: Ankur Arora
---
drivers/xen/cpu_hotplug.c | 14 ++---
drivers/xen/gntalloc.c
On 6/17/19 2:50 AM, Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
As part of xenbus init, both frontend, backend interfaces need to talk
on the correct xenbus. This might be a local xenstore (backend) or might
be a XS_PV/XS_HVM interface (frontend) which needs to talk over xenbus
On 6/17/19 2:36 AM, Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
Largely mechanical changes: the exported grant table symbols now take
xenhost_t * as a parameter. Also, move the grant table global state
inside xenhost_t.
If there's more than one xenhost, then initialize both
On 6/17/19 2:28 AM, Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
Xen ballooning uses hollow struct pages (with the underlying GFNs being
populated/unpopulated via hypercalls) which are used by the grant logic
to map grants from other domains.
This patch allows the default
On 2019-06-14 4:53 a.m., Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
Abstract out xen_vcpu_id probing via (*probe_vcpu_id)(). Once that is
availab,e the vcpu_info registration happens via the VCPUOP hypercall.
Note that for the nested case, there are two vcpu_ids, and two
On 2019-06-14 5:04 a.m., Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
Largely mechanical patch that adds a new param, xenhost_t * to the
evtchn interfaces. The evtchn port instead of being domain unique, is
now scoped to xenhost_t.
As part of upcall handling we now look at all
On 2019-06-12 2:15 p.m., Andrew Cooper wrote:
On 09/05/2019 18:25, Ankur Arora wrote:
Allow for different hypercall implementations for different xenhost types.
Nested xenhost, which has two underlying xenhosts, can use both
simultaneously.
The hypercall macros (HYPERVISOR_*) implicitly use
On 2019-06-07 9:21 a.m., Juergen Gross wrote:
On 07.06.19 17:22, Joao Martins wrote:
On 6/7/19 3:51 PM, Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
Hi all,
This is an RFC for xenhost support, outlined here by Juergen here:
https://lkml.org/lkml/2019/4/8/67.
First: thanks
On 2019-06-07 7:51 a.m., Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
Hi all,
This is an RFC for xenhost support, outlined here by Juergen here:
https://lkml.org/lkml/2019/4/8/67.
First: thanks for all the effort you've put into this series!
The high level idea is to provide
On 2019-06-07 8:08 a.m., Juergen Gross wrote:
On 09.05.19 19:25, Ankur Arora wrote:
HYPERVISOR_shared_info is used for irq/evtchn communication between the
guest and the host. Abstract out the setup/reset in xenhost_t such that
nested configurations can use both xenhosts simultaneously.
I
For the most part, we now pass xenhost_t * as parameter.
Co-developed-by: Joao Martins
Signed-off-by: Ankur Arora
---
drivers/net/xen-netback/hash.c | 7 +-
drivers/net/xen-netback/interface.c | 7 +-
drivers/net/xen-netback/netback.c | 11 +--
drivers/net/xen-netback/rx.c
visibility
into related events/hypercalls in the default hypervisor.
TODO:
- percpu data structures for xen_vcpu
Signed-off-by: Ankur Arora
---
arch/x86/xen/enlighten.c | 93 +---
arch/x86/xen/enlighten_hvm.c | 87 ++
arch/x86
the IF flag
maps onto the xh_default->vcpu_info->evtchn_upcall_mask.
However, we still update the xh_remote->vcpu_info->evtchn_upcall_mask
on a best effort basis to minimize unnecessary work in remote xenhost.
TODO:
- direct pv_ops.irq are disabled.
Signed-off-by: Ankur Arora
---
xen_cpuid_base() is used to probe and setup features early in a
guest's lifetime.
We want this to behave differently depending on xenhost->type: for
instance, local xenhosts cannot intercept the cpuid instruction at all.
Add op (*cpuid_base)() in xenhost_ops_t.
Signed-off-by: Ankur Ar
For the most part, we now pass xenhost_t * as a parameter.
Co-developed-by: Joao Martins
Signed-off-by: Ankur Arora
---
drivers/block/xen-blkback/blkback.c | 34 +
drivers/block/xen-blkback/common.h | 2 +-
drivers/block/xen-blkback/xenbus.c | 63 -
drivers/block
the
right thing.
TODO:
- Multicalls for now assume the default xenhost
- xen_hypercall_* symbols are only generated for the default xenhost.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/xen/hypercall.h | 233 ++-
arch/x86/xen/enlighten.c | 3
to be useful for local xenhosts
(type xenhost_r0) because unlike Xen, where there is an external
hypervisor which can change the memory underneath a GFN, that is not
possible when the hypervisor is running in the same address space
as the entity doing the ballooning.
Co-developed-by: Ankur Arora
Signed
.
Also add xenhost_register() and stub registration in the various guest
types.
Signed-off-by: Ankur Arora
---
arch/x86/xen/Makefile| 1 +
arch/x86/xen/enlighten_hvm.c | 13 +
arch/x86/xen/enlighten_pv.c | 16 ++
arch/x86/xen/enlighten_pvh.c | 12 +
arch/x86/xen/xenhost.c
Largely mechanical changes: the exported grant table symbols now take
xenhost_t * as a parameter. Also, move the grant table global state
inside xenhost_t.
If there's more than one xenhost, then initialize both.
Signed-off-by: Ankur Arora
---
arch/x86/xen/grant-table.c | 71 +++--
drivers/xen
.
The rest of patch is just changing the interfaces where needed.
Signed-off-by: Ankur Arora
---
drivers/block/xen-blkback/blkback.c| 10 +-
drivers/net/xen-netfront.c | 14 +-
drivers/pci/xen-pcifront.c | 4 +-
drivers/xen/cpu_hotplug.c | 4
Mechanical changes, now most of these calls take xenhost_t *
as parameter.
Co-developed-by: Joao Martins
Signed-off-by: Ankur Arora
---
drivers/xen/cpu_hotplug.c | 14 ++---
drivers/xen/gntalloc.c| 13
drivers/xen/gntdev.c | 16 +++
drivers
Signed-off-by: Ankur Arora
---
drivers/block/xen-blkback/blkback.c | 14 +-
drivers/xen/gntdev.c| 2 +-
drivers/xen/grant-table.c | 20 ++--
include/xen/grant_table.h | 11 ++-
4 files changed, 38 insertions(+), 9 deletions
Make hypercall_page a generic interface which can be implemented
by other hypervisors. With this change, hypercall_page now points to
the newly introduced xen_hypercall_page which is seeded by Xen, or
to one that is filled in by a different hypervisor.
Signed-off-by: Ankur Arora
---
arch/x86
this
event handling is largley unchanged.
Note that the IPI, timer, VIRQ, FUNCTION, PMU etc vectors remain
attached to xh_default. Only interdomain evtchns are allowable as
xh_remote.
TODO:
- to minimize the changes, evtchn FIFO is disabled for now.
Signed-off-by: Ankur Arora
---
arch/x86/pci
to get feedback before
proceeding further. Also note that the FIFO logic and some Xen drivers
(input, pciback, scsi etc) are mostly unchanged, so will not build.
Please take a look.
Thanks
Ankur
Ankur Arora (16):
x86/xen: add xenhost_t interface
x86/xen: cpuid support in xenhost_t
state. For both of those, remote xenhost is not
of interest so we only use the default xenhost.
Signed-off-by: Ankur Arora
---
arch/x86/include/asm/xen/hypervisor.h | 1 -
arch/x86/xen/enlighten.c | 10 ++-
arch/x86/xen/enlighten_hvm.c | 38
because we do feature
validation early which guarantees that the features of interest are
compatible. Features not of interest, are related to MMU, clock, pirq, etc where
the interface to L0-Xen should not matter.
Signed-off-by: Ankur Arora
---
arch/x86/xen/enlighten_hvm.c | 15
On 2019-04-08 10:04 p.m., Juergen Gross wrote:
On 08/04/2019 19:31, Joao Martins wrote:
On 4/8/19 11:42 AM, Juergen Gross wrote:
On 08/04/2019 12:36, Joao Martins wrote:
On 4/8/19 7:44 AM, Juergen Gross wrote:
On 12/03/2019 18:14, Joao Martins wrote:
On 2/22/19 4:59 PM, Paolo Bonzini wrote:
On 2019-04-08 5:35 p.m., Stefano Stabellini wrote:
On Mon, 8 Apr 2019, Joao Martins wrote:
On 4/8/19 11:42 AM, Juergen Gross wrote:
On 08/04/2019 12:36, Joao Martins wrote:
On 4/8/19 7:44 AM, Juergen Gross wrote:
On 12/03/2019 18:14, Joao Martins wrote:
On 2/22/19 4:59 PM, Paolo Bonzini
On 2/20/19 3:39 PM, Marek Marczykowski-Górecki wrote:
On Wed, Feb 20, 2019 at 08:15:30PM +, Joao Martins wrote:
2. PV Driver support (patches 17 - 39)
We start by redirecting hypercalls from the backend to routines
which emulate the behaviour that PV backends expect i.e. grant
On 2/20/19 1:09 PM, Paolo Bonzini wrote:
On 20/02/19 21:15, Joao Martins wrote:
2. PV Driver support (patches 17 - 39)
We start by redirecting hypercalls from the backend to routines
which emulate the behaviour that PV backends expect i.e. grant
table and interdomain events. Next, we
66 matches
Mail list logo