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

Re: [PATCH 2/2] xen/x86/pvh: copy ACPI tables to Dom0 instead of mapping


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>
  • Date: Thu, 18 May 2023 10:24:10 +0300
  • 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
  • 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=6SNJs7fPg68exoDmqAEaEtOXRxw5Tkn1OXE+a9gCg30=; b=XdPNXvpExShLMrENNkHBc5xmRzojkh72mSw4SLiqswmCNQP5EPUc99fiYoTTIqjz6RNY5wrpWJCTdqM0xb+UX/Cd8uC1P/fa0Gu9qY8MBU1H+pxct3MiPmDKvR1llsCO+QUbkbHKwj4o0RBqqkweIG7Y/7Hz7yM6iohjy6bdzwOtDk/nR0YbFfkxoiFggcCIOUfCLKpLZ8FuyCoZ01BrINop7jp0sHRlAwNhSefedlLKJcsedZ7h96ip3YxnX26yOuhYGsm3Fe8CWAfhU/tQaxaZjDvWq/A4cgj4dnC9XKkRIkVm4da3fQ8+Qjv0xtO00Xv702qqv/snPHtZrr74qw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dFPQPwBrsbqjLisvRs4nBw3vMETRfQkPh/bJ0Qcm/pcEQJWo0c3gGrAXik+cdmxkY7Pdhlx9p8FJzPaNM4YDD+mXZ7tao0k0xbZwp6ZJu6tM1/jODoRzFRKUS0zjJSMm/nON0KnowMg280+GN/ebYaX58k7xs5Yk8JA+iXALlb1V2AolbM8dmpOl2MH21rwHY5uD8ZV+iWBBYL47c9Y2YzyJ7fNefUuJpRbewthr+KaO5R4pD9N0M0lR54+7wghRIfa98l2xrrJoaIhIpDeu8fwa/nWeInuXcUv5ynIH0vnVq7J0Qh95UufHqp47yJdt5HKMOA/eDxi0XDfs8tsufA==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>, <roger.pau@xxxxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Thu, 18 May 2023 07:24:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 15/5/23 17:17, Jan Beulich wrote:
On 13.05.2023 03:17, Stefano Stabellini wrote:
From: Stefano Stabellini <stefano.stabellini@xxxxxxx>

Mapping the ACPI tables to Dom0 PVH 1:1 leads to memory corruptions of
the tables in the guest. Instead, copy the tables to Dom0.
Do you really mean "in the guest" (i.e. from Xen's perspective, i.e.
ignoring that when running on qemu it is kind of a guest itself)?

I also consider the statement too broad anyway: Various people have
run PVH Dom0 without running into such an issue, so it's clearly not
just "leads to".

In my opinion the issue is broader.

In pvh_setup_acpi(), the code adding the ACPI tables to dom0 memory map does not check the return value of pvh_add_mem_range(). If there is an overlap and the overlapping region is marked as E820_ACPI, it maps not just the allowed tables but the entire overlapping range , while if the overlapping range is marked as E820_RESERVED, it does not map the tables at all (the issue that Stefano saw with qemu). Since dom0 memory map is initialized based on the native one, the code adding the ACPI table memory ranges will naturally fall into one of the two cases above.

So even when not running into this issue, pvh_add_mem_range() still fails and the memory range mapped is wider than the allowed one.

Xenia




 


Rackspace

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