* linux-next: manual merge of the kvm tree with Linus' tree
@ 2022-03-30 23:42 Stephen Rothwell
2022-03-31 2:04 ` 答复: " Li,Rongqing
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2022-03-30 23:42 UTC (permalink / raw)
To: Paolo Bonzini, KVM
Cc: Li RongQing, Linux Kernel Mailing List, Linux Next Mailing List,
Peter Zijlstra (Intel)
[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]
Hi all,
Today's linux-next merge of the kvm tree got a conflict in:
arch/x86/kernel/kvm.c
between commit:
c3b037917c6a ("x86/ibt,paravirt: Sprinkle ENDBR")
from Linus' tree and commit:
8c5649e00e00 ("KVM: x86: Support the vCPU preemption check with nopvspin and realtime hint")
from the kvm tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc arch/x86/kernel/kvm.c
index 79e0b8d63ffa,21933095a10e..000000000000
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@@ -752,6 -752,39 +752,40 @@@ static void kvm_crash_shutdown(struct p
}
#endif
+ #ifdef CONFIG_X86_32
+ __visible bool __kvm_vcpu_is_preempted(long cpu)
+ {
+ struct kvm_steal_time *src = &per_cpu(steal_time, cpu);
+
+ return !!(src->preempted & KVM_VCPU_PREEMPTED);
+ }
+ PV_CALLEE_SAVE_REGS_THUNK(__kvm_vcpu_is_preempted);
+
+ #else
+
+ #include <asm/asm-offsets.h>
+
+ extern bool __raw_callee_save___kvm_vcpu_is_preempted(long);
+
+ /*
+ * Hand-optimize version for x86-64 to avoid 8 64-bit register saving and
+ * restoring to/from the stack.
+ */
+ asm(
+ ".pushsection .text;"
+ ".global __raw_callee_save___kvm_vcpu_is_preempted;"
+ ".type __raw_callee_save___kvm_vcpu_is_preempted, @function;"
+ "__raw_callee_save___kvm_vcpu_is_preempted:"
++ASM_ENDBR
+ "movq __per_cpu_offset(,%rdi,8), %rax;"
+ "cmpb $0, " __stringify(KVM_STEAL_TIME_preempted) "+steal_time(%rax);"
+ "setne %al;"
-"ret;"
++ASM_RET
+ ".size __raw_callee_save___kvm_vcpu_is_preempted, .-__raw_callee_save___kvm_vcpu_is_preempted;"
+ ".popsection");
+
+ #endif
+
static void __init kvm_guest_init(void)
{
int i;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* 答复: linux-next: manual merge of the kvm tree with Linus' tree
2022-03-30 23:42 linux-next: manual merge of the kvm tree with Linus' tree Stephen Rothwell
@ 2022-03-31 2:04 ` Li,Rongqing
0 siblings, 0 replies; 2+ messages in thread
From: Li,Rongqing @ 2022-03-31 2:04 UTC (permalink / raw)
To: Stephen Rothwell, Paolo Bonzini, KVM
Cc: Linux Kernel Mailing List, Linux Next Mailing List,
Peter Zijlstra (Intel)
> Hi all,
>
> Today's linux-next merge of the kvm tree got a conflict in:
>
> arch/x86/kernel/kvm.c
>
> between commit:
>
> c3b037917c6a ("x86/ibt,paravirt: Sprinkle ENDBR")
>
> from Linus' tree and commit:
>
> 8c5649e00e00 ("KVM: x86: Support the vCPU preemption check with
> nopvspin and realtime hint")
>
> from the kvm tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far
> as linux-next is concerned, but any non trivial conflicts should be mentioned to
> your upstream maintainer when your tree is submitted for merging. You may
> also want to consider cooperating with the maintainer of the conflicting tree to
> minimise any particularly complex conflicts.
>
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc arch/x86/kernel/kvm.c
> index 79e0b8d63ffa,21933095a10e..000000000000
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@@ -752,6 -752,39 +752,40 @@@ static void kvm_crash_shutdown(struct p
> }
> #endif
>
> + #ifdef CONFIG_X86_32
> + __visible bool __kvm_vcpu_is_preempted(long cpu) {
> + struct kvm_steal_time *src = &per_cpu(steal_time, cpu);
> +
> + return !!(src->preempted & KVM_VCPU_PREEMPTED); }
> + PV_CALLEE_SAVE_REGS_THUNK(__kvm_vcpu_is_preempted);
> +
> + #else
> +
I am sorry; I see v3 is merged into next, this version will cause building failure, like reported in
https://www.spinics.net/lists/kvm/msg270607.html
I send a new version
https://patchwork.kernel.org/project/kvm/patch/1646891689-53368-1-git-send-email-lirongqing@baidu.com/
-Li
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-31 2:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-30 23:42 linux-next: manual merge of the kvm tree with Linus' tree Stephen Rothwell
2022-03-31 2:04 ` 答复: " Li,Rongqing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox