Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3424680ybi; Fri, 5 Jul 2019 07:07:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvFYhqM1w8kncPoxD4O1kKLuApNYdfQLHb0K6cm+o/pdyO1rsOHqm0QIg3xiEeKLRFtv9G X-Received: by 2002:a17:902:a417:: with SMTP id p23mr5630435plq.136.1562335674839; Fri, 05 Jul 2019 07:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562335674; cv=none; d=google.com; s=arc-20160816; b=sDK0hkWf3zyddl6GPO2DHpxiUxfX78gHA9jabvRXad7CpLdI7bSwlqC1JbDSaLW9Pt aqmByyd4+HMudDA7amo8BtpjFkGjuM9k7YT/yeQXOjblIzWWB5pZ3719JWu6pgE64LK7 ev6Eyvofzz8vUeuaaKd9hZCScQE850NVP0X2IQqjKlqz5eLiDm3e1WD+lT0UPlvGnwZP 84PknpynheQ9Tw9nTN/CxvoPJVRD9nybRr1ZU3VzTyhBG95zlSEiawkT2ykbMMc8twgA FdFp9RW8zinQB5KNC7HaGDxukyxOEy1HxS5V7QwPSNS2r5m614JkLiJzC13+ERR7inrm ZGTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=b+rUgDFc8Xj3OzxPRTReIh2TVRm86cFh+ybCvMQ5Hic=; b=QneV3b4WyemBqK1LjNfB41dm7bcpxyCxIlfli58S+gjwFH2S80ynDiw3xVjwWQbGLi RIBv5eL6HvxYs8X9K7UppbMMo6gh2LypMn+3eWjcwY0T1YGUzQT6zeXfa90f9f1z+ywu qzjQF63epQQggz/zj93a/Ksel4cuNY22EqtdU2Mqh7RChF2k9fA8MJG65lxLtjX6aTV/ KANZ+7Phrmvt8iAd7KDGqzeMWKkiS27KNuVVPIOL6h13KZn3PBMsUDa4TmOrCo5LyKv8 afkvWmIZ54ZQm5zxLW1C2us2duPSFlzR4b+qojgXzasGwZKyppeZ5n4dZBzadfabqwg8 LtkA== 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 b5si8387006pjo.26.2019.07.05.07.07.40; Fri, 05 Jul 2019 07:07:54 -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 S1728790AbfGEMqO (ORCPT + 99 others); Fri, 5 Jul 2019 08:46:14 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44124 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727991AbfGEMqO (ORCPT ); Fri, 5 Jul 2019 08:46:14 -0400 Received: by mail-wr1-f68.google.com with SMTP id b2so8583805wrx.11 for ; Fri, 05 Jul 2019 05:46:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=b+rUgDFc8Xj3OzxPRTReIh2TVRm86cFh+ybCvMQ5Hic=; b=os9KWC5kyC9si7+qqUNr4ehybHU8+frhGN/MZ1hBp9XEEE9u3rYEY33j5Q2hklh+6j 1bUmHOEsviDiz1Z/Hy95gWbjAj1strBcOg3W0zhO45lxd1LBe6Zc5uBuip+vJVI+tWk5 Dw8h21ceIVAgUhXwfzvwc/CwAccsV5lVhX0lDgwnHA2UvTPB7dr21TScOH/Q4zwlXJmx jv5YDVz94eDBRuCBNRTsnMEFpci59b2trL2AsbGwXo41KN9MuZ16+vSAyH/MCaaoy0rg tpvLUqIOVgENOn/8P5LbkRPxyAOYzect4+gMk7Url21zq1XNGG1Em1OZmXe+eAkRj8G8 NNyQ== X-Gm-Message-State: APjAAAX9K6mNPKEuFOI1Avixj9DArUgHoP5DZrEx71faSrkvumTiVIWu gcXJ/Li2n8F2AeUfofROm/HWGA== X-Received: by 2002:adf:91c2:: with SMTP id 60mr4271400wri.334.1562330771790; Fri, 05 Jul 2019 05:46:11 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:e943:5a4e:e068:244a? ([2001:b07:6468:f312:e943:5a4e:e068:244a]) by smtp.gmail.com with ESMTPSA id t140sm9922367wmt.0.2019.07.05.05.46.11 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 05:46:11 -0700 (PDT) Subject: Re: [PATCH] KVM: LAPIC: ARBPRI is a reserved register for x2APIC To: Liran Alon Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <1562328872-27659-1-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: Date: Fri, 5 Jul 2019 14:46:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/07/19 14:37, Liran Alon wrote: >> + u64 rmask = 0x43ff01ffffffe70cULL; > Why not rename this to “used_bits_mask” and calculate it properly by macros? > It seems a lot nicer than having a pre-calculated magic. Yes, I wanted to do the same but I didn't have time right now. I am planning to cleanup after the merge window, but if a patch comes soon I can apply it instead of course. :) Something like #define APIC_VALID_REG_MASK(reg) (1ull << ((reg) >> 4)) #define APIC_VALID_REGS_MASK(first, count) \ (APIC_VALID_REG_MASK(first) * (1ull << ((count) - 1))) followed by if (offset > 0x3f0 || !(valid_regs_mask & APIC_VALID_REG_MASK(offset)) Paolo > -Liran >