Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp791401imm; Mon, 2 Jul 2018 23:24:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFBD8qwUZJfjdg3obbl3XoWilMNo0w2w6evkxGudQIyVT84RCgPaloAMdPEjFMmkwqnYNL X-Received: by 2002:a17:902:8a4:: with SMTP id 33-v6mr28362168pll.343.1530599089878; Mon, 02 Jul 2018 23:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530599089; cv=none; d=google.com; s=arc-20160816; b=I9BZNLInJSv3+EhMgqZljwtw8o/+F+P7rFhnizljWwQhailFznoBZhy4vE3r4kcMon NeApmQrxzEy/cgHXB94cBrKoKvqI5lr35MiUauTo5DVJW22zQRuniuTJNFttKDFSW5h0 ZI6lM0evuv3T5GMWpqe21g9x4k/ebCbYy7oqyvi7pKkXYBtbWsfMMVUp2j8JbrUxllpt qtk4BtgbvSQdMrFUnsafefDxF/VQHvKf3JhmQp55NtecKixHYNVP50fcHWUnJ9nf8qbZ X80WAEaL2JQ3j28HAvboAlOCIG1hfIeVsd48bmJJmAwG4m8CzYIYSn6kahfxr/r2RoX/ 7Bxw== 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:arc-authentication-results; bh=DDljZacJxZG2OWdhiAliNYhkc3j//3d2iZVEuKfWFo4=; b=tTJRzkH3WgnjHa5ZEYIzp2KAiTrGX1OIcrA43Fh3sJMRV6UmJZZOZO5fEcViG3G07G aBYP7I5dHPDveSTzWSbu6FUdAEhwfm4DkTeIpJ6odhSo5ScSISqBnv3yg4tBx/OAB2Vc jJR2Je/f6lAaRr8ZlIIzPMk0T3ezgPIbMl14je0L+EpMI2doAgJ5AIxPTWzxfAhCcBqn sD2xCZwGtO42tooPzslzkqla+gFUhbRTMR08Ev/xK/N+5T4J66FJRe0wFIAx05YMfj2I 2rpJukcg2Onu3o/tE64TbiMuCGwCKGBlkRIShgVHz0reLuZxZkDVTtzbvQIkV6oZ87oz AduA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="I/nrV5AW"; 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 59-v6si379630plp.496.2018.07.02.23.24.35; Mon, 02 Jul 2018 23:24:49 -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="I/nrV5AW"; 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 S933259AbeGCGVn (ORCPT + 99 others); Tue, 3 Jul 2018 02:21:43 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36864 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932767AbeGCGVi (ORCPT ); Tue, 3 Jul 2018 02:21:38 -0400 Received: by mail-pg0-f68.google.com with SMTP id n15-v6so471051pgv.4; Mon, 02 Jul 2018 23:21:38 -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=DDljZacJxZG2OWdhiAliNYhkc3j//3d2iZVEuKfWFo4=; b=I/nrV5AWHmn3hbdm+GZ+A4U1iZ4B2yX74NbonysjR2Xv3HcCE42EfQFDO0ERICaCQR 54SzL+WePx/PqjympIbrAnG/GcFb6QGGOmmNquoJZ9cnIOASapLEyNg0Yi/A0humTn9n hZE+X4l/VkWLuhve8RhFhMMV9gfi+sGoLXuSUW7o4wT7r9AD6gyAglGroRCr2/u+e9Nx bOP04A2sNa9LCDvj+BiFFV3debUHFs396IBP4SXU32ETNDgiyCPIVJU5Khwp1BMLWqmd nMXKPBRe+XPeKpn6S5Vmcu3Fl7PxympUH/ZEUsgX9RROddFOxROSLv7TwpjJWzJdXY1w CRcg== 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=DDljZacJxZG2OWdhiAliNYhkc3j//3d2iZVEuKfWFo4=; b=N9FHXiiHJDuWsuG33osJnZBTX/SB32H0uCWvYr/OeDOZkC6V9mTYUxPHSvl253EIrj cB42bl6fR105cqCORkfQvB2QvEuWJwwTOLQszTFsJrdVB5zqH6CfJJ+oM4nnyoC9tudz VYx+GTGFeNKOeI/swfTeBOnygA9s/uFy+kl5ZZiITwukFhBqbJqhPmfnlSBLBI9ph0zt nLMcbJbmN/I+tyR2iRoP6FuozSi+n7LlrAvhkUE4I6bSvlywoMxgFx6CndJ2vkklXm22 /0p8mdbdwiGUtojReUiQGusoMCId4JPr8KG7p1HVZ86dgVP3pnxLoX+evBnCcGVJQrO1 XLAg== X-Gm-Message-State: APt69E1DP6UNFcvKfBa2Qg4doDq9yhK87C4XersKHgBMMyf4INjT/SyE yQRZnB6GxEtqTfHRVdabWm/vHw== X-Received: by 2002:a63:8749:: with SMTP id i70-v6mr24766888pge.325.1530598897708; Mon, 02 Jul 2018 23:21:37 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.123]) by smtp.googlemail.com with ESMTPSA id v89-v6sm1766427pfd.64.2018.07.02.23.21.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Jul 2018 23:21:37 -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?= , Vitaly Kuznetsov Subject: [PATCH v3 1/6] KVM: X86: Add kvm hypervisor init time platform setup callback Date: Tue, 3 Jul 2018 14:21:26 +0800 Message-Id: <1530598891-21370-2-git-send-email-wanpengli@tencent.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530598891-21370-1-git-send-email-wanpengli@tencent.com> References: <1530598891-21370-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 Add kvm hypervisor init time platform setup callback which will be used to replace native apic hooks by pararvirtual hooks. Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Vitaly Kuznetsov Signed-off-by: Wanpeng Li --- arch/x86/kernel/kvm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 5b2300b..591bcf2 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -624,12 +624,22 @@ static uint32_t __init kvm_detect(void) return kvm_cpuid_base(); } +static void __init kvm_apic_init(void) +{ +} + +static void __init kvm_init_platform(void) +{ + x86_platform.apic_post_init = kvm_apic_init; +} + const __initconst struct hypervisor_x86 x86_hyper_kvm = { .name = "KVM", .detect = kvm_detect, .type = X86_HYPER_KVM, .init.guest_late_init = kvm_guest_init, .init.x2apic_available = kvm_para_available, + .init.init_platform = kvm_init_platform, }; static __init int activate_jump_labels(void) -- 2.7.4