Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2409082ybi; Mon, 17 Jun 2019 04:25:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKM6rhEFO/F7iSGGUe0dnc+vWWHog/FQ+0qFWKC6BPTXvaI29wYoGcuwQelW/dpJYNvXob X-Received: by 2002:a17:90a:ad86:: with SMTP id s6mr25837890pjq.42.1560770730544; Mon, 17 Jun 2019 04:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560770730; cv=none; d=google.com; s=arc-20160816; b=FZ85nssxZT3tfaem3zdiUUwc/tfc0sMchkEBj1HufIjmI5ZLFX+WQ6TL080RZUOTO9 E+Hqh261vwOwQNeYCtsOvbEYbnxJGMAGYZR2aDnkaz/+qc6ekebI3Bkq2BCoLQbUZoAC ipc0jPLTVXkH4CZfm1/3WY642ttKVXLvuDXJypXQPw+9bme8M8NxAQXOb2k6FncdOSkF VT1NydQhG7DMTRsqGsR0U23xtxFYVyC6SVosmawKLm+Je58KJ7ikHMJi6mQwylJbDPtt smo0UFNZC+FUkqCbAnmyCCZ4m2TYO7ON5hDeFoDByOGG4t4W04xU0WI1C1ocuDAz1/WL XZdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7cFKfAqTFnDsz7H72uAzwV5NxIhwkVRp3XlBceBAKto=; b=aqIEi2Qjp3wMIJO/q1l1tUcRT1WSeJvMfu2j7Hq+T9aac/bCcVZTn8WLZWC20Sr9QR 3NWyN/4/edc0kQOwYgmYCqI05+R+R/RdY3wu2U7n5byw2+arfPTiGiDfADKFewP28+FE 0vWoK9Jn9gQJ2/WtDBHXRLE5EtyD58MdKUA7gyJwszY++DgV/U9E6HhuV60FybdzfVFt 0lqTWzjns3h9ujfVWOvPnYOLAB451SjlZvmTz+812P7xuUwnKNBBUHkpx+5wnH7FvMyC sJ6pHWk2bcghBGevdfPMnflB0byS0JId/aAEKSyZ7e2xU87KlrM8wkqLtOs/cVrm03Sn cEDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YbDW0LZk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si10350100plx.200.2019.06.17.04.25.15; Mon, 17 Jun 2019 04:25:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YbDW0LZk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728222AbfFQLZC (ORCPT + 99 others); Mon, 17 Jun 2019 07:25:02 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:45294 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728074AbfFQLY7 (ORCPT ); Mon, 17 Jun 2019 07:24:59 -0400 Received: by mail-pg1-f195.google.com with SMTP id s21so5632461pga.12; Mon, 17 Jun 2019 04:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7cFKfAqTFnDsz7H72uAzwV5NxIhwkVRp3XlBceBAKto=; b=YbDW0LZkdWRsiM5Dr8udglnjGpETpGUzBFWSSfyJ59v7HU/GEPeH0CobuO0xSB1VyD zR7JmtWKDokWLP22mbpbUn9u3t3pFgpNREkIwj6DxEi39AriqjXGAGbG8Zes8ijQ8EBl /dbaHH9HIwfbISNeCxPlHq/S3IIL+5rMpe9whyshI4LXS6bQ/3jV3qjoKUCol83OTeGd L6xgAxizABgQKKuXz8kUT9ccb/DkVGgTL4FOZm9W30aPD5UT17adu7aqObVn1+mO/vVs J3xW5YgDXdJJ9M0vT4V+LuIS9o+0eLtkkYicEIuBP/a1tymfV6YNWrmDL+dpTCNZKiw/ uoQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7cFKfAqTFnDsz7H72uAzwV5NxIhwkVRp3XlBceBAKto=; b=LP5KMnKkHg+Ru1IjAbDDhgHJwHgmye98gwV1YcSq9JARNkVMaDoZYd+REeqKPqqDs3 uuMzCV/k3b0pO+e0gxFlSStAPDQZ7lcuVT1GiQNXDRm/rHTLztHmUOFheVvfCgbRCx66 mw0dx54M8X7BPqd854jzLWUghQ89qTLwlAs+/zGmkdti6gzvsMaFHxMh1ffzKPasQfq2 K6mqpoDjYaCRb4kjvRXNCXdY2Ow8JbyKJlUseRVDTHLBRn4i0Ml0h8RGp8+Jq4TwcmPV 2yOXswMfev7a6/q/KxcUczgZMC1kwA2d31ap358rBweZYbmezvghYZ8ulYQPZJXj44XH kfPg== X-Gm-Message-State: APjAAAWn/WQGFwo1nsqZII5cq6ahz+ii0C47UJ1jYyFHMNwzfkj1y7Ne SM9hd1HLoDH+UolgadY9m7PDvEqD X-Received: by 2002:a65:5344:: with SMTP id w4mr48331723pgr.8.1560770698865; Mon, 17 Jun 2019 04:24:58 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.123]) by smtp.googlemail.com with ESMTPSA id d4sm12535751pfc.149.2019.06.17.04.24.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jun 2019 04:24:58 -0700 (PDT) From: Wanpeng Li X-Google-Original-From: Wanpeng Li To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Marcelo Tosatti Subject: [PATCH v4 3/5] KVM: LAPIC: Ignore timer migration when lapic timer is injected by pi Date: Mon, 17 Jun 2019 19:24:45 +0800 Message-Id: <1560770687-23227-4-git-send-email-wanpengli@tencent.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560770687-23227-1-git-send-email-wanpengli@tencent.com> References: <1560770687-23227-1-git-send-email-wanpengli@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wanpeng Li When lapic timer is injected by posted-interrupt, the emulated timer is offload to the housekeeping cpu. The timer interrupt will be delivered properly, no need to migrate timer. Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Marcelo Tosatti Signed-off-by: Wanpeng Li --- arch/x86/kvm/lapic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 9ceeee5..665b1bb 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -2520,7 +2520,8 @@ void __kvm_migrate_apic_timer(struct kvm_vcpu *vcpu) { struct hrtimer *timer; - if (!lapic_in_kernel(vcpu)) + if (!lapic_in_kernel(vcpu) || + posted_interrupt_inject_timer(vcpu)) return; timer = &vcpu->arch.apic->lapic_timer.timer; -- 2.7.4