Received: by 10.213.65.68 with SMTP id h4csp2532723imn; Mon, 2 Apr 2018 09:13:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/zEKYAOaizeO8j4VD8ChRY+e6rHQwymLtR7ltUAh0DS8E4UWCSjNIrXlKPRuwvGHZCybd3 X-Received: by 2002:a17:902:1a4:: with SMTP id b33-v6mr10452313plb.303.1522685612086; Mon, 02 Apr 2018 09:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522685612; cv=none; d=google.com; s=arc-20160816; b=NqyOP3RL0j8PVTSFa5XUPXLFVwGUrwp9lyWB40F5PJ6nCIzDxM88XBhzZGYMteO8xm xdOih7DZhkS7T74f8etEJtrwl8G6BocHk050TqF/fYcdvSr+utqmTuDbA4+3aMz5a9Cy f1UyHKwlHgebi1iXWUVjdIDO3v+QNXzv8kB8tiFosJNAmFRcwcmxZ/Xa8YPNUAr2La1N wvls3YxBoB/gUkwkeaPkFaWZ9Gd46FwDa5ch5IhVakhxOBg1r7O+gkSwqmFakhUJwnwi XzmdMPhcfvKBKOaP7hN75WhjDV3elF9pkfKniWMbTjTNjMxmYSkXlURVAdOLJpD5mu45 kJmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Gbc0fzjMHs5CSRjO2HR+uiQjOvAXCoNXFIkPhBsq+WY=; b=eoEcNRM/OQ39DH/oP/vTUmUohHcPqwiwtaa6JbiIUWmnPh/f7Rl3i9ILaDXUjVTDwJ vJq1CfLRvLDQv4zRwkloJi9xTvB2JtYnwMqxtPeDIHFWdCNXyrZ4OX7Mt4aTjxCtHxgF d5yn58/RPT5KbSaUKWFuaOM1Pb7ksT0Ou6C9yhY8pzXbYEnnWLwXwatO1H3t7SJcZizi i0MjiGDsBplLbEexXkel1bvEGhHJA5fGWr6+AFAtRLKpUrMLQqSLKQzhTuvarJ9JdMqZ z3vk/Zy+oUDW2QlpDDZT5m82ngq3+FPU9eei9aQnNJcIAu5VOF5JeypJ5MxMkvHr6Zk3 4PBw== ARC-Authentication-Results: i=1; mx.google.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19-v6si531570plo.708.2018.04.02.09.13.17; Mon, 02 Apr 2018 09:13:32 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753040AbeDBQLr (ORCPT + 99 others); Mon, 2 Apr 2018 12:11:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46740 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752842AbeDBQLG (ORCPT ); Mon, 2 Apr 2018 12:11:06 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 816F7402314E; Mon, 2 Apr 2018 16:11:05 +0000 (UTC) Received: from vitty.brq.redhat.com (ovpn-204-121.brq.redhat.com [10.40.204.121]) by smtp.corp.redhat.com (Postfix) with ESMTP id 702EFD7E12; Mon, 2 Apr 2018 16:11:03 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org Cc: x86@kernel.org, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , linux-kernel@vger.kernel.org Subject: [PATCH 2/5] KVM: x86: hyperv: use defines when parsing hypercall parameters Date: Mon, 2 Apr 2018 18:10:56 +0200 Message-Id: <20180402161059.8488-3-vkuznets@redhat.com> In-Reply-To: <20180402161059.8488-1-vkuznets@redhat.com> References: <20180402161059.8488-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 02 Apr 2018 16:11:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 02 Apr 2018 16:11:05 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkuznets@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid open-coding offsets for hypercall input parameters, we already have defines for them. Signed-off-by: Vitaly Kuznetsov --- arch/x86/kvm/hyperv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 98618e397342..3cb3bb68db7e 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -1339,9 +1339,9 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) #endif code = param & 0xffff; - fast = (param >> 16) & 0x1; - rep_cnt = (param >> 32) & 0xfff; - rep_idx = (param >> 48) & 0xfff; + fast = !!(param & HV_HYPERCALL_FAST_BIT); + rep_cnt = (param >> HV_HYPERCALL_REP_COMP_OFFSET) & 0xfff; + rep_idx = (param >> HV_HYPERCALL_REP_START_OFFSET) & 0xfff; trace_kvm_hv_hypercall(code, fast, rep_cnt, rep_idx, ingpa, outgpa); -- 2.14.3