From patchwork Fri May 25 11:53:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 10427169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9757D602D8 for ; Fri, 25 May 2018 11:54:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 952CD295B7 for ; Fri, 25 May 2018 11:54:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 856692965D; Fri, 25 May 2018 11:54:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AB2C295B7 for ; Fri, 25 May 2018 11:54:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966409AbeEYLyG (ORCPT ); Fri, 25 May 2018 07:54:06 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:37439 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966158AbeEYLyF (ORCPT ); Fri, 25 May 2018 07:54:05 -0400 Received: by mail-oi0-f68.google.com with SMTP id w123-v6so4330872oia.4 for ; Fri, 25 May 2018 04:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AUvq8qirfPdPAQw9s76k5LR8DK2HJO9QnUSRbUJ8gxc=; b=Wl0H8UkgbXFIOuCl1hDznn10/OXS9WXsqdZCzb24HqfTJZgLln/mQ10ocR2CF43ZBS pX71tqMEzLM6x6q5YvDwxqn2sP6cQ9qMcir57TIdT1PlOl5TE9Je01Ud/HJrZ2j33Ncl vovvg5bDX2Mze4G90SNcdx1gVw5mZslfzld7Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AUvq8qirfPdPAQw9s76k5LR8DK2HJO9QnUSRbUJ8gxc=; b=lsybWh+Rmdb7TV0X9HAH7NEDvOW5ms1NitsJOzqp7QOzXZ0j5PDtS1+KWReKpMg7FQ 8UNc/GlQvac8BMq7NM+g0iqBqrEJ1YPzwI/a1vPpqFXxvuRDQU7Vdxw901jX7QJ9GZv7 3vXLKJOuu2FSNZk6IOK4rgTRh5ZFwAglPDtizjlWuJWisTF3nsLC1uvKvBi5B3SJSGo+ N0Ts1y1sTIirMuvra7PpOHVqhzEO5d9eOr8buukATli8UUUmzuOaR3IhYD6YrviN/d26 2pnp6IoSgwRS4Xd4Q89A4/VWpqftCjVRd1v6JzQBv+1ZxU6yjd95dD8z2Li1uZwZwcpR nO7A== X-Gm-Message-State: ALKqPwfnBHz9AtXm0S8XyMroLsPbqVdO5aR3SAsWm0VKmg3Zmr4v4Yj9 DILgBde7K/nQmv97XysNZIjcGZuqvvA5qx3JUFp+cg== X-Google-Smtp-Source: ADUXVKKvWpYOBbG+gK/IAEielx3Yi7fIWx8ROYMsW4WSZ4Y7vp/4ihYFp1wu3leDT0Kl+50Odabbma6ycZCTeh7uT5A= X-Received: by 2002:aca:f141:: with SMTP id p62-v6mr1160135oih.80.1527249244979; Fri, 25 May 2018 04:54:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:40d3:0:0:0:0:0 with HTTP; Fri, 25 May 2018 04:53:44 -0700 (PDT) In-Reply-To: References: <1527086545-68024-1-git-send-email-mst@redhat.com> <1527086545-68024-8-git-send-email-mst@redhat.com> From: Peter Maydell Date: Fri, 25 May 2018 12:53:44 +0100 Message-ID: Subject: Re: [PULL 07/28] x86/cpu: use standard-headers/asm-x86.kvm_para.h To: "Michael S. Tsirkin" Cc: QEMU Developers , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Marcelo Tosatti , kvm-devel Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 25 May 2018 at 12:06, Peter Maydell wrote: > On 23 May 2018 at 15:43, Michael S. Tsirkin wrote: >> Switch to the header we imported from Linux, >> this allows us to drop a hack in kvm_i386.h. >> More code will be dropped in the next patch. >> >> Signed-off-by: Michael S. Tsirkin > >> --- a/target/i386/cpu.h >> +++ b/target/i386/cpu.h >> @@ -688,8 +688,6 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS]; >> #define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) /* Speculation Control */ >> #define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31) /* Speculative Store Bypass Disable */ >> >> -#define KVM_HINTS_DEDICATED (1U << 0) >> - >> #define CPUID_8000_0008_EBX_IBPB (1U << 12) /* Indirect Branch Prediction Barrier */ >> >> #define CPUID_XSAVE_XSAVEOPT (1U << 0) > > Hi -- this seems like it will break compilation when we next > update our copy of the Linux kernel headers, because (as of > 4.17-rc6, at least), asm-x86/kvm_para.h doesn't define > KVM_HINTS_DEDICATED. For the moment I'm using this workaround (I wanted to do a header update for something else I'm working on): thanks -- PMM --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -48,6 +48,11 @@ #include "exec/memattrs.h" #include "trace.h" +/* Work around this kernel header constant changing its name */ +#ifndef KVM_HINTS_REALTIME +#define KVM_HINTS_REALTIME KVM_HINTS_DEDICATED +#endif + //#define DEBUG_KVM #ifdef DEBUG_KVM @@ -387,7 +392,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function, ret &= ~(1U << KVM_FEATURE_PV_UNHALT); } } else if (function == KVM_CPUID_FEATURES && reg == R_EDX) { - ret |= 1U << KVM_HINTS_DEDICATED; + ret |= 1U << KVM_HINTS_REALTIME; found = 1; }