From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@bugzilla.kernel.org Subject: [Bug 115081] arch/x86/kvm/vmx.c:8719: Error: symbol `vmx_return' is already defined Date: Thu, 24 Mar 2016 03:54:00 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from mail.kernel.org ([198.145.29.136]:39590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752843AbcCXDyH (ORCPT ); Wed, 23 Mar 2016 23:54:07 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 104AB20374 for ; Thu, 24 Mar 2016 03:54:04 +0000 (UTC) Received: from bugzilla1.web.kernel.org (bugzilla1.web.kernel.org [172.20.200.51]) by mail.kernel.org (Postfix) with ESMTP id E4CC820376 for ; Thu, 24 Mar 2016 03:54:00 +0000 (UTC) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: https://bugzilla.kernel.org/show_bug.cgi?id=115081 --- Comment #4 from Linda Walsh --- Looking at this and not being very familiar w/the dialect of x86-64 assembler used, it looks like the intent of the extern with the extern const ulong vmx_return; was to create a forward reference for the C-statement: vmcs_writel(HOST_RIP, vmx_return); /* 22.2.5 */ With 'vmx_return' being defined in the assembler, below: ".pushsection .rodata \n\t" ".global vmx_return \n\t" "vmx_return: " _ASM_PTR " 2b \n\t" ".popsection" It appears with the "push+pop-section, the bit in between is not "inline", but placed in the separate "rodata" area. Is 2b supposed to be a value for initialization, or a size, or some number of _ASM_PTR's? Either way, it sorta looks it might be easier if the ASM code defining the symbol should come before the C-Reference. As it is now, the C-statement: [extern] const ulong vmx_return defines the "vmx_return" symbol as either an external reference, or as a global symbol (a "first" definition), with the ASM-code, ".global vmx_return \n\t" declaring a 2nd vmx_return that is global and and defined /allocated/initialized by the "vmx_return: " _ASM_PTR " 2b \n\t" statement. But I really don't know this asm dialect nor whether or not the usage of "vmx_return" in C must occur after the ASM definition or not. -- You are receiving this mail because: You are watching the assignee of the bug.