Displaying 20 results from an estimated 34 matches for "pv_is_native_vcpu_is_preempted".
2018 Sep 07
2
[PATCH v2] x86/paravirt: Get rid of patch_site and patch_default labels
...---
2 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index d460cbcabcfe..af57f0d0789f 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -34,14 +34,16 @@ extern bool pv_is_native_vcpu_is_preempted(void);
unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
{
- const unsigned char *start, *end;
+ const unsigned char *start __maybe_unused, *end __maybe_unused;
unsigned ret;
#define PATCH_SITE(ops, x) \
case PARAVIRT_PATCH(ops.x): \
start = start_##...
2018 Sep 07
2
[PATCH v2] x86/paravirt: Get rid of patch_site and patch_default labels
...---
2 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index d460cbcabcfe..af57f0d0789f 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -34,14 +34,16 @@ extern bool pv_is_native_vcpu_is_preempted(void);
unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
{
- const unsigned char *start, *end;
+ const unsigned char *start __maybe_unused, *end __maybe_unused;
unsigned ret;
#define PATCH_SITE(ops, x) \
case PARAVIRT_PATCH(ops.x): \
start = start_##...
2018 Sep 08
2
[PATCH] x86/paravirt: Cleanup native_patch()
...---
2 files changed, 39 insertions(+), 58 deletions(-)
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index d460cbcabcfe..0865323c2716 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -34,14 +34,10 @@ extern bool pv_is_native_vcpu_is_preempted(void);
unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
{
- const unsigned char *start, *end;
- unsigned ret;
-
#define PATCH_SITE(ops, x) \
- case PARAVIRT_PATCH(ops.x): \
- start = start_##ops##_##x; \
- end = end_##ops##_##x; \
- goto patch_site
+...
2018 Sep 08
2
[PATCH] x86/paravirt: Cleanup native_patch()
...---
2 files changed, 39 insertions(+), 58 deletions(-)
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index d460cbcabcfe..0865323c2716 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -34,14 +34,10 @@ extern bool pv_is_native_vcpu_is_preempted(void);
unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
{
- const unsigned char *start, *end;
- unsigned ret;
-
#define PATCH_SITE(ops, x) \
- case PARAVIRT_PATCH(ops.x): \
- start = start_##ops##_##x; \
- end = end_##ops##_##x; \
- goto patch_site
+...
2018 Sep 11
1
[PATCH v2] x86/paravirt: Cleanup native_patch()
...---
2 files changed, 33 insertions(+), 57 deletions(-)
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index d460cbcabcfe..6368c22fa1fa 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -34,14 +34,10 @@ extern bool pv_is_native_vcpu_is_preempted(void);
unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
{
- const unsigned char *start, *end;
- unsigned ret;
-
#define PATCH_SITE(ops, x) \
- case PARAVIRT_PATCH(ops.x): \
- start = start_##ops##_##x; \
- end = end_##ops##_##x; \
- goto patch_site
+...
2016 Nov 15
2
[PATCH v7 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check
...9 +20,16 @@ bool pv_is_native_spin_unlock(void)
__raw_callee_save___native_queued_spin_unlock;
}
-static bool native_vcpu_is_preempted(int cpu)
+__visible bool __native_vcpu_is_preempted(int cpu)
{
- return 0;
+ return false;
+}
+PV_CALLEE_SAVE_REGS_THUNK(__native_vcpu_is_preempted);
+
+bool pv_is_native_vcpu_is_preempted(void)
+{
+ return pv_lock_ops.queued_spin_unlock.func ==
+ __raw_callee_save__native_vcpu_is_preempted;
}
struct pv_lock_ops pv_lock_ops = {
@@ -32,7 +38,7 @@ struct pv_lock_ops pv_lock_ops = {
.queued_spin_unlock = PV_CALLEE_SAVE(__native_queued_spin_unlock),
.wait = paravirt_nop,
.kick...
2016 Nov 15
2
[PATCH v7 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check
...9 +20,16 @@ bool pv_is_native_spin_unlock(void)
__raw_callee_save___native_queued_spin_unlock;
}
-static bool native_vcpu_is_preempted(int cpu)
+__visible bool __native_vcpu_is_preempted(int cpu)
{
- return 0;
+ return false;
+}
+PV_CALLEE_SAVE_REGS_THUNK(__native_vcpu_is_preempted);
+
+bool pv_is_native_vcpu_is_preempted(void)
+{
+ return pv_lock_ops.queued_spin_unlock.func ==
+ __raw_callee_save__native_vcpu_is_preempted;
}
struct pv_lock_ops pv_lock_ops = {
@@ -32,7 +38,7 @@ struct pv_lock_ops pv_lock_ops = {
.queued_spin_unlock = PV_CALLEE_SAVE(__native_queued_spin_unlock),
.wait = paravirt_nop,
.kick...
2018 Sep 10
2
[PATCH] x86/paravirt: Cleanup native_patch()
On Mon, Sep 10, 2018 at 08:54:12AM +0200, Juergen Gross wrote:
> > + case PARAVIRT_PATCH(lock.queued_spin_unlock):
> > + if (pv_is_native_spin_unlock())
> > + return paravirt_patch_insns(ibuf, len,
> > + start_lock_queued_spin_unlock,
> > + end_lock_queued_spin_unlock);
> > + else
> > + return paravirt_patch_default(type, ibuf,
2018 Sep 10
2
[PATCH] x86/paravirt: Cleanup native_patch()
On Mon, Sep 10, 2018 at 08:54:12AM +0200, Juergen Gross wrote:
> > + case PARAVIRT_PATCH(lock.queued_spin_unlock):
> > + if (pv_is_native_spin_unlock())
> > + return paravirt_patch_insns(ibuf, len,
> > + start_lock_queued_spin_unlock,
> > + end_lock_queued_spin_unlock);
> > + else
> > + return paravirt_patch_default(type, ibuf,
2018 Sep 07
2
[PATCH] x86/paravirt: Get rid of patch_site label
...rch/x86/kernel/paravirt_patch_64.c b/arch/x86/kernel/paravirt_patch_64.c
index 5ad5bcda9dc6..f09d264cbd2d 100644
--- a/arch/x86/kernel/paravirt_patch_64.c
+++ b/arch/x86/kernel/paravirt_patch_64.c
@@ -76,7 +76,8 @@ unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
if (pv_is_native_vcpu_is_preempted()) {
start = start_lock_vcpu_is_preempted;
end = end_lock_vcpu_is_preempted;
- goto patch_site;
+
+ return paravirt_patch_insns(ibuf, len, start, end);
}
goto patch_default;
#endif
@@ -86,7 +87,6 @@ patch_default: __maybe_unused
ret = paravirt_patch_default(type, ibuf,...
2018 Sep 07
2
[PATCH] x86/paravirt: Get rid of patch_site label
...rch/x86/kernel/paravirt_patch_64.c b/arch/x86/kernel/paravirt_patch_64.c
index 5ad5bcda9dc6..f09d264cbd2d 100644
--- a/arch/x86/kernel/paravirt_patch_64.c
+++ b/arch/x86/kernel/paravirt_patch_64.c
@@ -76,7 +76,8 @@ unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
if (pv_is_native_vcpu_is_preempted()) {
start = start_lock_vcpu_is_preempted;
end = end_lock_vcpu_is_preempted;
- goto patch_site;
+
+ return paravirt_patch_insns(ibuf, len, start, end);
}
goto patch_default;
#endif
@@ -86,7 +87,6 @@ patch_default: __maybe_unused
ret = paravirt_patch_default(type, ibuf,...
2016 Nov 16
0
[PATCH v7 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check
...raw_callee_save___native_queued_spin_unlock;
> }
>
> -static bool native_vcpu_is_preempted(int cpu)
> +__visible bool __native_vcpu_is_preempted(int cpu)
> {
> - return 0;
> + return false;
> +}
> +PV_CALLEE_SAVE_REGS_THUNK(__native_vcpu_is_preempted);
> +
> +bool pv_is_native_vcpu_is_preempted(void)
> +{
> + return pv_lock_ops.queued_spin_unlock.func ==
> + __raw_callee_save__native_vcpu_is_preempted;
> }
>
copy-paste issue...
> struct pv_lock_ops pv_lock_ops = {
> @@ -32,7 +38,7 @@ struct pv_lock_ops pv_lock_ops = {
> .queued_spin_unlock = PV_CALLEE_SAVE(__...
2018 Sep 08
0
[PATCH v2] x86/paravirt: Get rid of patch_site and patch_default labels
...tions(+), 22 deletions(-)
>
> diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
> index d460cbcabcfe..af57f0d0789f 100644
> --- a/arch/x86/kernel/paravirt_patch_32.c
> +++ b/arch/x86/kernel/paravirt_patch_32.c
> @@ -34,14 +34,16 @@ extern bool pv_is_native_vcpu_is_preempted(void);
>
> unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
> {
> - const unsigned char *start, *end;
> + const unsigned char *start __maybe_unused, *end __maybe_unused;
> unsigned ret;
>
> #define PATCH_SITE(ops, x) \
> case PA...
2018 Sep 10
0
[PATCH] x86/paravirt: Cleanup native_patch()
...tions(+), 58 deletions(-)
>
> diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
> index d460cbcabcfe..0865323c2716 100644
> --- a/arch/x86/kernel/paravirt_patch_32.c
> +++ b/arch/x86/kernel/paravirt_patch_32.c
> @@ -34,14 +34,10 @@ extern bool pv_is_native_vcpu_is_preempted(void);
>
> unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
> {
> - const unsigned char *start, *end;
> - unsigned ret;
> -
> #define PATCH_SITE(ops, x) \
> - case PARAVIRT_PATCH(ops.x): \
> - start = start_##ops##_##x; \
> -...
2017 Sep 05
7
[PATCH 0/4] make virt_spin_lock() a pvops function
With virt_spin_lock() being a pvops function the bare metal case can be
optimized by patching the call away completely. In case a kernel running
as a guest it can decide whether to use paravitualized spinlocks, the
current fallback to the unfair test-and-set scheme, or to mimic the
bare metal behavior.
Juergen Gross (4):
paravirt: add generic _paravirt_false() function
paravirt: switch
2017 Sep 05
7
[PATCH 0/4] make virt_spin_lock() a pvops function
With virt_spin_lock() being a pvops function the bare metal case can be
optimized by patching the call away completely. In case a kernel running
as a guest it can decide whether to use paravitualized spinlocks, the
current fallback to the unfair test-and-set scheme, or to mimic the
bare metal behavior.
Juergen Gross (4):
paravirt: add generic _paravirt_false() function
paravirt: switch
2016 Dec 08
0
[PATCH 1/2] x86,paravirt: Fix native_patch()
...x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -56,15 +56,19 @@ unsigned native_patch(u8 type, u16 clobb
end = end_pv_lock_ops_queued_spin_unlock;
goto patch_site;
}
+ goto patch_default;
+
case PARAVIRT_PATCH(pv_lock_ops.vcpu_is_preempted):
if (pv_is_native_vcpu_is_preempted()) {
start = start_pv_lock_ops_vcpu_is_preempted;
end = end_pv_lock_ops_vcpu_is_preempted;
goto patch_site;
}
+ goto patch_default;
#endif
default:
+patch_default:
ret = paravirt_patch_default(type, clobbers, ibuf, addr, len);
break;
--- a/arch/x86/kernel/paravir...
2016 Dec 08
3
[PATCH 0/2] Fix paravirt fail
Two patches that cure fallout from commit:
3cded4179481 ("x86/paravirt: Optimize native pv_lock_ops.vcpu_is_preempted()")
2016 Dec 08
3
[PATCH 0/2] Fix paravirt fail
Two patches that cure fallout from commit:
3cded4179481 ("x86/paravirt: Optimize native pv_lock_ops.vcpu_is_preempted()")
2016 Dec 14
1
[PATCH] arch: x86: kernel: fixed unused label issue
...se PARAVIRT_PATCH(pv_lock_ops.queued_spin_unlock):
+ if (pv_is_native_spin_unlock()) {
+ start = start_pv_lock_ops_queued_spin_unlock;
+ end = end_pv_lock_ops_queued_spin_unlock;
+ goto patch_site;
+ }
+ goto patch_default;
- case PARAVIRT_PATCH(pv_lock_ops.vcpu_is_preempted):
- if (pv_is_native_vcpu_is_preempted()) {
- start = start_pv_lock_ops_vcpu_is_preempted;
- end = end_pv_lock_ops_vcpu_is_preempted;
- goto patch_site;
- }
- goto patch_default;
-#endif
+ case PARAVIRT_PATCH(pv_lock_ops.vcpu_is_preempted):
+ if (pv_is_native_vcpu_is_preempted()) {
+ start = start_pv_lock_ops_vcpu_is_p...