[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 10/13] vpci/header: reset the command register when adding devices
- To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 7 Feb 2022 08:29:43 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=jvASHfV8EVi/c7V/xCEFY/mhTVJcHzBNIBTR+4OJZ5U=; b=WjgQ+FZlcH21hZY6Y+j1HwZKvwHusH51+q1AgwuBT9VrZdFZF0iTYAeOmb8qq4DEYkS9JTHDgsMcKbmhkuT9A124phY/vj/6d2pTLhY6YLJXD3rMo+3E0LEOZokGjLZ+h7ROuHZICkNZ4oi5WZPlHW6L/HfEf3qfEZ+1mWZbqPMl0BEaLaJW9BVQ/Lp06hUwClB+iREPP8JWvqgd6LzxMgrMEm1Xjy/0Uso1lOGvl2UhNWTqN9M33GJlmQNNrMBXHmIi5CgcC6RXSbXu2aqGQudao8iQgNu07Fr4eLNJtc+a9ZFzF5nK04c7jGqw8YRKCUB/BtVeDPTwfneHJDKk0Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n8Lh958Gaa1f1tfPhgD1QDCh9Tdo544c8QqIC9zalGmAKzgliLlFSBm0zzuG9AcKni7OKBKlRnToA0SNdV+0LpAH2zdrOQbAxdbNn2H/iXKa/NfxK27NHsd5XT90EEaxgGX4wXbEhlrjMsfXCbr4em/0jq7D2km76JatVL4khHcxMUJfW4Lba6j32RT5EyA7hXHlGhwZ1urkQczWxeIkpoW186Tb3BOXUldYHbkFYUa51q/I0+539z2Vs74wtbYMc4TxjZ+gX3p1FIXWbbU48kEU0bLi3vuvWmCcPvSdQ+eMOvDq7HMmB9s6Wc2PjzxgWT47uBZVFkxY9tYYbX4c0g==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 07 Feb 2022 07:29:59 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 04.02.2022 15:37, Oleksandr Andrushchenko wrote:
> On 04.02.22 16:30, Jan Beulich wrote:
>> On 04.02.2022 07:34, Oleksandr Andrushchenko wrote:
>>> Reset the command register when assigning a PCI device to a guest:
>>> according to the PCI spec the PCI_COMMAND register is typically all 0's
>>> after reset.
>> It's not entirely clear to me whether setting the hardware register to
>> zero is okay. What wants to be zero is the value the guest observes
>> initially.
> "the PCI spec says the PCI_COMMAND register is typically all 0's after reset."
> Why wouldn't it be ok? What is the exact concern here?
The concern is - as voiced is similar ways before, perhaps in other
contexts - that you need to consider bit-by-bit whether overwriting
with 0 what is currently there is okay. Xen and/or Dom0 may have put
values there which they expect to remain unaltered. I guess
PCI_COMMAND_SERR is a good example: While the guest's view of this
will want to be zero initially, the host having set it to 1 may not
easily be overwritten with 0, or else you'd effectively imply giving
the guest control of the bit.
Jan
|