[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] amd/msr: implement VIRT_SPEC_CTRL for HVM guests using legacy SSBD
- To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 14 Mar 2022 16:52:25 +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=r6vE5WWcQP6eabTvZAxGrySwv542C5lwLueZFCRXq2s=; b=AK++5qtpy54MBt4Rye3dyKe0Ze8oS/s8U8oCTIuf7omptJkv9Kud5idKGN0XI1JTRQEg6npFhA27kjpm6MdPC2Zb/cffdSVka3Qm9l7UO0WVlb9h0/EYP3Y/Ym1Ajpw8W/lvabuSojLZkK6Z6I9+X2gRtYMVGR5U5AAdGQ0yLhuXgIvIy0a0+vAYrvbyZrOSexsveeHuEo7jfpNS0LAfhYqZ+TVyMk2uCh4OWVjjgmdtdSfiuNjggPVY31bDvRYLfyBqXk2RRQxcfkZLHJS2fA1wir5HQ3F7PnZcKo8KU72CxvGnu613RPiuOEh8G3Da+sUVIDDI7Y9D+r4b7gE7Qg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MwiNYeFQuUoGS8s4knv1aES06J5OijafuATSUFN/qL6XFGc4hrmzMiz/vpALA4xO6sfVr7T1/u49m1ucE8VD2UX19A5YVs5Ecm1V4Q8g1iJtKFo+cAf5MgYNO2UtJNiodWClhqFDiGcmFcQ0o17PYl5iALhQc6UIZoloNTJEyR4z+skOEwki61Sp2gEmbEl/kQ9zPYNqFzw2FJF471M09e9uX8gJg3pjkQpLVksc9EshC/l7ezLeCt42vV6mRe20W6Lr9vrbv26yK7xDq9OqmbjCtMcbeXGqqXJcFa5GSVRLAjKbDWsEv+12BOHq8bGDrTi7CpoMUd2qxT3PPYIsrw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Mon, 14 Mar 2022 15:52:39 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 14.03.2022 16:32, Roger Pau Monné wrote:
> On Mon, Feb 14, 2022 at 05:44:01PM +0100, Jan Beulich wrote:
>> On 01.02.2022 17:46, Roger Pau Monne wrote:
>>> + ASSERT(core->count <= c->x86_num_siblings);
>>> + if ((enable && core->count == 1) ||
>>> + (!enable && core->count == 0))
>>
>> Maybe simply "if ( core->count == enable )"? Or do compilers not like
>> comparisons with booleans?
>
> I had it like that, but decided to switch to the current code just
> before sending because I think it's clearer. I didn't get complaints
> from compilers, but I felt it was kind of abusing to compare a boolean
> with and integer.
>
> If you wish I can restore to that form.
Well, if you don't like that alternative form, and since I don't like
the redundancy, how about
if ( enable ? core->count == 1 : !core->count )
? It was actually via this transformation how I landed at what I did
suggest.
Jan
|