From patchwork Mon Jun 13 20:28:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 69939 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1722383qgf; Mon, 13 Jun 2016 13:28:30 -0700 (PDT) X-Received: by 10.98.92.133 with SMTP id q127mr23831840pfb.103.1465849710334; Mon, 13 Jun 2016 13:28:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 125si33952587pfd.16.2016.06.13.13.28.29; Mon, 13 Jun 2016 13:28: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=@amdcloud.onmicrosoft.com; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753712AbcFMU22 (ORCPT + 30 others); Mon, 13 Jun 2016 16:28:28 -0400 Received: from mail-bl2on0081.outbound.protection.outlook.com ([65.55.169.81]:34843 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753623AbcFMU20 (ORCPT ); Mon, 13 Jun 2016 16:28:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nqBzhRFh7HBZHLwX8r0whopGo++bWRfLIecZX7YHE3I=; b=LpifhLUoHt3sTIY1vuzJSMpgwr9KRe7wvp/eFloHPeYhVDD0PIlJbI63SYI/kBE0nl8WCA+E6q31jKLQgrcYKOuTYQBQP2F/vDeS066DX+rdpu2I4P5mZwNPsEByGMSBlrByPek3BwpqoKWxJX1sVMAZa6tqBU10GBszJ5Iemfo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; Received: from ssuthiku-cz-dev.amd.com (165.204.77.1) by SN1PR12MB0447.namprd12.prod.outlook.com (10.162.105.140) with Microsoft SMTP Server (TLS) id 15.1.517.8; Mon, 13 Jun 2016 20:28:15 +0000 From: Suravee Suthikulpanit To: , CC: , , , , Suravee Suthikulpanit , Suravee Suthikulpanit Subject: [PATCH] x86/SVM: Fix implicit declaration issue for __default_cpu_present_to_apicid() Date: Mon, 13 Jun 2016 15:28:06 -0500 Message-ID: <1465849686-2586-1-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY1PR14CA0011.namprd14.prod.outlook.com (10.163.13.149) To SN1PR12MB0447.namprd12.prod.outlook.com (10.162.105.140) X-MS-Office365-Filtering-Correlation-Id: 45777767-01af-46e0-34fd-08d393c94303 X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0447; 2:pR48bqXYRzlK7UDfRB2CVF5+8qxoWHln/2T3JU8rVKLbz1xdWOrmAlJSSHUkyWdTLg8fpCjdpqjSSFsruYS07CkZnJ0bra0cEZ5PaF1xpxUDMQ0bZ2sVul1QUBlCxqg1+RkVOekah/M8tiEkQ6KAbTWuENdiq6qI78/vIu3XfosV3Ikt96xbtvqqDzv5pVEv; 3:Vw5ezLkazMp829AUqlcjQQcDkabY4jJna/SjqWTPs4+4iTMwdJBOUYve994G9d6R+9dtApYcusfFu3XqK9EIKrGt/XRk5JSbYwAXPUJGF3AgL3B81nco9sbPQaY4sdxZ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0447; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0447; 25:fb4OWSCcPlQqno2s65BTkbGENbt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8SU11qRCxJPupsRi/oLJnlh7m7fb4+eKqg/K9RoIsUSoxzKSQqOb2Ef34pK/m/z90S0LQHxh7cXbBRjbkhKdCsPQOiCnHa3dNnoKds9WG8P1RxcszgllJv7qJgYA8egNkbnCxazLvvna13cibZDMga/s6qs3ITlRAYDZaykT2WQzV0Nrr2Y4YyI019A9l9r7HpTj5V72a4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:SN1PR12MB0447; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0447; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0447; 4:wsdJNHT10p2CATvpnlNMXzILKFsZsJI+ui/LbrQMFpARCcjiWSqTHbKC6p62CSjy8bm+LlAFgKO9RHD2B9AZMCWHHkzNrJj9tAihVfpQZsOkFGoWu6ujPGwl/FD6ylUqHrBQi4H/DLtGL5JXVFFGfAQiOZRVPjvzLeNfGRNSyN5Z/yQd0Vc78TtwuU3x/UiAkzIb5zilnnmabeT6wH7L6bwh74XPDAQfpNuzi3Xh/D4MVEvMl3Gz+VWVH6N/Fo2izKM9tlHSefCMRf76sznqSC6vKD9gBAJe75wRCbE5nwMwVQ5nn9Ptbdul88ZCoPMZcKdcvBo3p/egugKl7gy8S7UTtL+iOSzCImt7JXs20y812F+nVGhLzqYorgXrrcf2R7jLNWn3noxJDrWCRlfHerLfbVkRFgn5LJafYodoU5wl1EVUnvIPBUqoq6FBxlF2jKBdSkFSHiazb8OTC9X/2w== X-Forefront-PRVS: 0972DEC1D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(50466002)(50226002)(5004730100002)(48376002)(42186005)(101416001)(53416004)(36756003)(5008740100001)(77096005)(97736004)(5001770100001)(19580395003)(19580405001)(81166006)(81156014)(8676002)(2906002)(4326007)(105586002)(106356001)(5003940100001)(92566002)(68736007)(66066001)(50986999)(189998001)(86362001)(586003)(229853001)(47776003)(3846002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0447; H:ssuthiku-cz-dev.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0447; 23:FUBiX6oalm98SUS6g8cjWyNWth5/aVV5rsxoBQfHw?= =?us-ascii?Q?tU6ctPZR+zD7VgbhMOuV3p9KZ4JXbjr/VF/OUPUEvwOaNmpEPYN4FKSnjYbO?= =?us-ascii?Q?t4UDnoYPmlSSAU5YWO8rcsDLHLFEHDnKVlY4vmZML4OXvcsddlIxsbuEPDbO?= =?us-ascii?Q?02aXhg0LeRRVmLwkCaPPZDi89+GDkS2s78Vvj84wI7o2tkHPX7KzzJtEkPfz?= =?us-ascii?Q?n0WCicgKum0M567PJWTFSMs85lvyzyCYALmjM9/64wH5XNFs6IPld5WyHlHo?= =?us-ascii?Q?+MRTTgwthe+BrIBq9lZ1S+ErAKketV34i2PPDdvipzkqH0DwCE8AR9jH7ZEV?= =?us-ascii?Q?3doiAmSvuhV2ftN6yvz2QtsWriLV//My6UDtlMeFX41Bfx2N57ksLKlzpZsx?= =?us-ascii?Q?0Zy5KaE588CU4K2Dbxiv4LijGwJtYeuSKbvNjykJKUEnuDy5yOhJl3mBpCJU?= =?us-ascii?Q?cu3kqO/OuRYdhKy0cQPt20c1Z2UpbhztXhTo48VXUqDJeSrwFrCAv0cGyRQB?= =?us-ascii?Q?yTUvFwBWnboyzz8UE8+83FsQG+BdRi9aj0wq+/UhjRF47IXJ6YkQ91h+QmEZ?= =?us-ascii?Q?5RnBxtA0gQOdqpDDsZdn62e2m0NyCr4We4yFIXUdl/OeiNqfl0a2973LkDea?= =?us-asc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z+1olxwffaDDkZ+xJ3Xl0GSc+J6j7vAhZ9vWI=; 7:ltMP3odLC0/ycIRG3FJafheG1ttnc4Dz9qAcQu5aQoZz2tiC3EjHE0TkXJohPZGZx9SgLY5ehKKRJLQbXAj4kqo2V1q+8mH74wRkCSAi90tPVu6ajXNMKwssOB3Njt0eVHqYFZR0XFcZ3Kf4lIcStRx+1VtzmdiRuoxJCh1R/IuahNinuUq6m1fr6MqIE/k6rt96x7K/SxbKOFTIOpmZBGFLAgOcLsmuLGyYKINlIyU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0447; 20:CdlZkBKr/1S12Bi2ZRmxju6nNHwXyOmoY3V68OmjsUY4R1XOAom6V7Vmkhys/XxqupYACUvCxQMF8VacU6UNFWcoWUaHxqHtYCZwPJLedAEsYfkH9VyA5XfAsGVly3Jcs+cLiwrtli+dcMULdaYmjklbJp9KOk8kUYdiQUYCvlKaZp9SEco1IN2jF9Zp8c/6GMMDNu97ramaGeZ9gtjJlAZS//uzP3Fp21j0TrzkFTiL+kECMZEZMG3mdp1SMseg X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2016 20:28:15.3783 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0447 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 8221c1370056 ("svm: Manage vcpu load/unload when enable AVIC") introduces a build error due to implicit function declaration with#ifdef CONFIG_X86_32 and #ifndef CONFIG_X86_LOCAL_APIC. with Kbuild test robot config file (i386-randconfig-x0-06121009). This patch fixes the issue by using the default_cpu_present_to_apicid(), adding necessary function declaration, and exporting the symbol. Reported-by: kbuild test robot Fixes: commit 8221c1370056 ("svm: Manage vcpu load/unload when enable AVIC") Signed-off-by: Suravee Suthikulpanit --- arch/x86/include/asm/apic.h | 5 +++++ arch/x86/kernel/setup.c | 1 + arch/x86/kvm/svm.c | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index bc27611..beb1d4a 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -631,6 +631,11 @@ extern int default_cpu_present_to_apicid(int mps_cpu); extern int default_check_phys_apicid_present(int phys_apicid); #endif +#else /* CONFIG_X86_LOCAL_APIC */ +static inline int default_cpu_present_to_apicid(int mps_cpu) +{ + return BAD_APICID; +} #endif /* CONFIG_X86_LOCAL_APIC */ extern void irq_enter(void); extern void irq_exit(void); diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index c4e7b39..90168be 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -137,6 +137,7 @@ int default_cpu_present_to_apicid(int mps_cpu) { return __default_cpu_present_to_apicid(mps_cpu); } +EXPORT_SYMBOL_GPL(default_cpu_present_to_apicid); int default_check_phys_apicid_present(int phys_apicid) { diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 5b12438..803351a 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1402,7 +1402,7 @@ avic_update_iommu(struct kvm_vcpu *vcpu, int cpu, phys_addr_t pa, bool r) static void avic_set_running(struct kvm_vcpu *vcpu, bool is_run) { u64 entry; - int h_physical_id = __default_cpu_present_to_apicid(vcpu->cpu); + int h_physical_id = default_cpu_present_to_apicid(vcpu->cpu); struct vcpu_svm *svm = to_svm(vcpu); if (!kvm_vcpu_apicv_active(vcpu)) @@ -1434,7 +1434,7 @@ static void avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu) { u64 entry; /* ID = 0xff (broadcast), ID > 0xff (reserved) */ - int h_physical_id = __default_cpu_present_to_apicid(cpu); + int h_physical_id = default_cpu_present_to_apicid(cpu); struct vcpu_svm *svm = to_svm(vcpu); if (!kvm_vcpu_apicv_active(vcpu)) @@ -4328,7 +4328,7 @@ static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec) if (avic_vcpu_is_running(vcpu)) wrmsrl(SVM_AVIC_DOORBELL, - __default_cpu_present_to_apicid(vcpu->cpu)); + default_cpu_present_to_apicid(vcpu->cpu)); else kvm_vcpu_wake_up(vcpu); }