[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 4/4] x86/APIC: make connections between seemingly arbitrary numbers


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Mar 2022 09:19:01 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FcHUJUWBjb4wEBCuUAYWXA1O8KtGAoONnd+8DFGM3jw=; b=bPFpDltMNvZRdjj6AEORJMEJT4HijcSZxilnaDiEJSXkbPAs/0hRttmn8J+VtHK6qNLYViX2HWoRo5nvn+uqQlYFv5XrBkb6myw+kaWAR+m8zyP2gvaC04cpVXJF+X87iRMsd3Fqn+K57XBUbNxWNlkChQV4gkcu3K3N4FPHJRYHfsOJ/wRie7JL15T0jQzLQP0NtUDNfFvmAt1Y8uPuUkxrhjN/q8ebwUaRUeg9Zt4cKcDThfxWZNSmEZXNFL5WYlNt46D3TuRJ/DW6cagRCIHfVgsC9WNlQBmCkMjO8pzlPnhbLut/lIPUpUCcy26LUc1Uc/QyfSeuNXWHKvIA9g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Axi9sqgfuU3uBfpXBI5Qhsm2iKbGYeSnXVDtpcX/Ij4gYaKzA6a2HgC2uMLpflH9oBIRvzcRHo2E1mVLtrA5br9110wvyO6inHawN61UlHxDnIT9xumdGktMOTHREJnSp+OdqDVOW9RWYYwebMJIt0OkkVTNk+rEz5USV9s63bGMXwg/u/DNOTK6mpgaRUNHZzS5/ddW5DvHMAUEC6DlGfctwU+fx+wIc4NoJB52E8rF7T9IQp6Xz1AdRzqvhMhwS5ZVM8u3N7C1IY0Z4uUU7SLAfMlJe4TB6+cXSBphn+233GBgDWHBdZfk5CwTWPmAi/pg3+KUrWG6tXLeV1eN3Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 14 Mar 2022 08:19:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.03.2022 15:24, Roger Pau Monné wrote:
> On Mon, Feb 14, 2022 at 10:25:57AM +0100, Jan Beulich wrote:
>> Making adjustments to arbitrarily chosen values shouldn't require
>> auditing the code for possible derived numbers - such a change should
>> be doable in a single place, having an effect on all code depending on
>> that choice.
>>
>> For one make the TDCR write actually use APIC_DIVISOR. With the
>> necessary mask constant introduced, also use that in vLAPIC code. While
>> introducing the constant, drop APIC_TDR_DIV_TMBASE: The bit has been
>> undefined in halfway recent SDM and PM versions.
>>
>> And then introduce a constant tying together the scale used when
>> converting nanoseconds to bus clocks.
>>
>> No functional change intended.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks.

>> ---
>> I thought we have a generic "glue" macro, but I couldn't find one. Hence
>> I'm (ab)using _AC().
> 
> I would be fine if you want to introduce something right in this
> commit to cover those needs, using _AC is not overly nice (or
> clear) IMO.

Hmm, I was rather hoping that you (or someone else) would point me
at what I thought I'm overlooking. If anything I'd likely clone
Linux'es __PASTE() (avoiding the leading underscores), but their
placement in linux/compiler_types.h seems pretty arbitrary and
hence not a good guideline for placement in our tree. To be honest
the only thing that would seem halfway consistent to me would be a
separate header, yet that seems somewhat overkill ... Or wait -
maybe xen/lib.h could be viewed as kind of suitable. Of course
there's then the immediate question of whether to make _AC() use
the new macro instead of open-coding it.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.