From patchwork Wed Nov 13 23:09:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 3180141 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9D4829F432 for ; Wed, 13 Nov 2013 23:09:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A2D52094A for ; Wed, 13 Nov 2013 23:09:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5045C20948 for ; Wed, 13 Nov 2013 23:09:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752267Ab3KMXJY (ORCPT ); Wed, 13 Nov 2013 18:09:24 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:59257 "EHLO mnementh.archaic.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563Ab3KMXJW (ORCPT ); Wed, 13 Nov 2013 18:09:22 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VgjYZ-0002t7-Ee; Wed, 13 Nov 2013 23:09:07 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Richard Henderson , Andreas Tobler , Paolo Bonzini , Gleb Natapov , kvm@vger.kernel.org, Anthony Liguori Subject: [PATCH v2 for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid() Date: Wed, 13 Nov 2013 23:09:07 +0000 Message-Id: <1384384147-11076-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix build failures with clang when KVM is not enabled by providing a stub version of kvm_arch_get_supported_cpuid(). We retain the compile time check that this function isn't called when CONFIG_KVM is not set by guarding the stub with ifndef __OPTIMIZE__ (we assume that an optimizing build will do sufficient constant folding and dead code elimination to remove the calls before linking). Signed-off-by: Peter Maydell Reviewed-by: Stefan Weil --- Changes v1->v2: * guard stub with ifndef __OPTIMIZE__ * make stub abort() rather than return bogus value target-i386/kvm-stub.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target-i386/kvm-stub.c b/target-i386/kvm-stub.c index 11429c4..2b9e801 100644 --- a/target-i386/kvm-stub.c +++ b/target-i386/kvm-stub.c @@ -16,3 +16,15 @@ bool kvm_allows_irq0_override(void) { return 1; } + +#ifndef __OPTIMIZE__ +/* This function is only called inside conditionals which we + * rely on the compiler to optimize out when CONFIG_KVM is not + * defined. + */ +uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function, + uint32_t index, int reg) +{ + abort(); +} +#endif