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

Re: [PATCH v3 3/4] tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE


  • To: Henry Wang <xin.wang2@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 20 May 2024 14:23:52 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=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=uTrotKv/YbafHCsyE2adcCRyYL0l3sH9ww95U5n1sEQ=; b=kgpEsC5MxNU9gui0wLsH8R7WD9le3KIfGEcnXpgQaI+Wsyr2r/4cIPP21Vm1M9xHF/JPM3fqR/2BI7dNnIDLDhRkLglwkHHrwkZTW/K8w+XyV3ISEDs7fcGhUIdL8NF1hce1rgnaXD/DlVh0DX32vbxBfuuYt3tH3000T3i7auUNlZz4ngkJwusVGkVpn2RtjfP7Z0YSoKpJgYPdGsO4qvMw1URadaRxGxC6x8NGW9DKKcsdkcftdfhqFq3tP9LmO2oz+0cwj4p9Z5yGkVtTHy1CaW6fm2/yPYH31o+UR9lWrG7TXbbaMDPf9DSN3AMzDVu29VFjKVpOtMngdADLng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fOS6Br0hJH6xewZ16FFHrA1Sg7hvksSKWcWGf43XIM1s/tUxepTNB7qfAEn5f7RnPB6tu6KSnWFAzSLMw6G/w9glGEN5H4UI47UfQouZ73yXszAMhJ/69h/taOPAlnaKdRjs2Ppz0b7flpkkxUHPF1V85bOVakHgbp9ZIVb8da03ywYqRWaIlH/ozTNumJo8xh8WcSIeVttH3pix2WIeunUN+IQlFPW/Zu2z1V0S62XPulmpe+Zv0ZuMPc6NmSBs5t6BeDUb9oL/S0RkDB/3CEBwkb2W8e978kCytr7GczmZD2S02EwMhL8H1vLjljXsWilP+YGW3SqEID3+TVMncQ==
  • Cc: Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Alec Kwapis <alec.kwapis@xxxxxxxxxxxxx>
  • Delivery-date: Mon, 20 May 2024 18:24:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-05-16 23:21, Henry Wang wrote:
Currently the GUEST_MAGIC_BASE in the init-dom0less application is
hardcoded, which will lead to failures for 1:1 direct-mapped Dom0less
DomUs.

Since the guest magic region allocation from init-dom0less is for
XenStore, and the XenStore page is now allocated from the hypervisor,
instead of hardcoding the guest magic pages region, use
xc_hvm_param_get() to get the XenStore page PFN. Rename alloc_xs_page()
to get_xs_page() to reflect the changes.

With this change, some existing code is not needed anymore, including:
(1) The definition of the XenStore page offset.
(2) Call to xc_domain_setmaxmem() and xc_clear_domain_page() as we
     don't need to set the max mem and clear the page anymore.
(3) Foreign mapping of the XenStore page, setting of XenStore interface
     status and HVM_PARAM_STORE_PFN from init-dom0less, as they are set
     by the hypervisor.

Take the opportunity to do some coding style improvements when possible.

Reported-by: Alec Kwapis <alec.kwapis@xxxxxxxxxxxxx>
Signed-off-by: Henry Wang <xin.wang2@xxxxxxx>

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

Thanks,
Jason



 


Rackspace

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