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: 21491 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B81D202E2 for ; Wed, 13 Nov 2013 23:09:17 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id xb12sf2193054pbc.6 for ; Wed, 13 Nov 2013 15:09:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=MaI8vd/DQZksgv6PHo+iREfanoEeF0hV9pniKbV6baQ=; b=LDugxdFPQmLHWYKIPYSsiyxUQSimDhbPbmKHJ1DtsoL9d46z3ZYe7biFNK6CDZ3N8t BAYkqBPUdCVYgG2/zOWXnfUnSL8Qq2L0gtd3bI0IZtxM9jXaJiPj479Z+4mdwSuxDXme D/UhVAHKAStZg0at+eHkrsNhSn0ZErkeDRVWHEOH81pzJST4guJLSYipLFxQOqv5eaON pDfwMauAuoNUVjRyfmfRZWBOqghNKCwjXRrSKAAc92KkzMXZqoTB5yiwhI0zn6YN5n+K 2wwSesROWDdQPV1v7QH/GQ+moPfPN4gwHBAcEBd1r2w5qt/wliPw7UDUxMoP4y6da9LC gEhQ== X-Gm-Message-State: ALoCoQnt4clKERZ3a62Pj83MA8vlgIDhC87/BA5/SEPA/R8KoucmErEcTzV+dutq1hUFbQFbXC28 X-Received: by 10.66.66.35 with SMTP id c3mr14826563pat.12.1384384156255; Wed, 13 Nov 2013 15:09:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.110.5 with SMTP id hw5ls723984qeb.56.gmail; Wed, 13 Nov 2013 15:09:16 -0800 (PST) X-Received: by 10.220.86.69 with SMTP id r5mr35910920vcl.9.1384384156055; Wed, 13 Nov 2013 15:09:16 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id x5si7600295vce.70.2013.11.13.15.09.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Nov 2013 15:09:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id c14so971310vea.18 for ; Wed, 13 Nov 2013 15:09:16 -0800 (PST) X-Received: by 10.58.255.233 with SMTP id at9mr17028058ved.20.1384384155927; Wed, 13 Nov 2013 15:09:15 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp273078vcz; Wed, 13 Nov 2013 15:09:15 -0800 (PST) X-Received: by 10.180.37.239 with SMTP id b15mr3112380wik.40.1384384154802; Wed, 13 Nov 2013 15:09:14 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id v4si14997326wja.101.2013.11.13.15.09.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 13 Nov 2013 15:09:14 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; 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 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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