[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN][PATCH] x86/hvm: vlapic: fix RO bits emulation in LVTx regs
- To: Jan Beulich <jbeulich@xxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
- From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
- Date: Fri, 26 Sep 2025 13:12:20 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fzajiwx0A3guhkdtw7jkMSY57vLA5gqRDVsAbJEPL/4=; b=lMpLd6vOfnE2HwwzWNacn62CU5pVDEkvd6t/c6+KQY4gvMOjN6vp9TebfGq2M34mOHsAQdI4PY0HgD2FvU3fxh7OX+lPMB+aX9VkcLDD3f+iuPCHDaXZswFJEdpR8MnvD11kTV8/p2LLRlAzPknZSdG7le+KPmlApH+E7iAfLn9kGs0mctZVYaLA/6x1DUeAemFeouHc1P7WAF0hDZCenQDDp/2eSM/SktOlKKDfraTwQ4Ao50y0oNFqW1nQMIi6PE7SvTdY+kgh3aeHU2KkbJjZxA46sPzCqvtqBonW4577ycmShvDIZu5c66DkadJTcYsv/RcoJG35la8ghKh5+A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QDJuvQ77FM2JpoDi+HD1AbBKRm/jV9eulBpJ4DxmFwITyGLM0wIeIojZN90BbFyytid6Goh4SzWiuxyaTv7iI7Tg3YcBsCp7w/oh2PvycigZM27Gw6LNrRGN5cgfuMQ69TKrHqczehVlXARyhl1382WDFT4Aj9vMBVC9xAb+lpwYWVBc6uUjnjcIiQn4Ol5cze+E1Aeq4LNzSJ03ymofR33HBBRKfpVNsWa7qFqR5sTMntYHvQAqY4GgraZZdhNysnCtP9daHAx6nzzezQxxF29Sj4J6RIMcxTyHpCdMIzM7BUD1bfdyaCRHK10CFut4yCOGzRxVQxsuLD208fTcSQ==
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 26 Sep 2025 11:12:41 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri Sep 26, 2025 at 12:52 PM CEST, Jan Beulich wrote:
> On 26.09.2025 12:38, Grygorii Strashko wrote:
>> On 26.09.25 11:17, Jan Beulich wrote:
>>> On 25.09.2025 21:55, Grygorii Strashko wrote:
>>>> From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
>>>>
>>>> The LAPIC LVTx registers have two RO bits:
>>>> - all: Delivery Status (DS) bit 12
>>>> - LINT0/LINT1: Remote IRR Flag (RIR) bit 14.
>>>> This bit is reserved for other LVTx regs with RAZ/WI access type
>>>> (MMIO), while
>>>> WRMSR (guest_wrmsr_x2apic()) has appropiate checks for reserved bits
>>>> (MBZ access type).
>>>
>>> Question is what the behavior is for writing the r/o (but not reserved)
>>> bits.
>>> I wasn't able to find any statement in the SDM.
>>
>> Me too. Usually RO/WI on most HW.
>> For example, LAPIC MMIO "Write" will be ignored (WRMSR will trigger
>> exception).
>
> My remark was specifically about WRMSR, and what you say here contradicts ...
Not quite what you're asking, but writing to the X2APIC_ID register does trigger
#GP(0), so one would hope writing to RO bits triggers an exception too rather
than being WI when mixed with RW bits in a register.
Now again, it might not in order to avoid #GP(0) on a race.
Definitely worth running a silly test with wrmsr_safe() to make sure. I could
see real hardware going either way.
Cheers,
Alejandro
|