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

Re: [PATCH] x86/domain: Fix struct domain memory corruption when building PV guests


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 23 Aug 2022 09:21:14 +0200
  • 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=CAPQXkzhIff2CNVVOIYs7M9XH4MSGDROlNiJNRGHEUw=; b=DB4pv3xFi1qBpzGAUvc3kPaDQXNx9gfz83WXXw3iWBmhO01rwDirT2OjmXM3C/ESRGXM6nIVDLmojtIHrS8a68QaGe/kEP3VUCvA0EdaEZAOoO5D3ujgiBTEQtHjI3jq7aAwBp4eoSWC6Nip2mfrymM4t2+7hkTdbtSN8Udi9HaisaOwJELSiVnnIG0fyLjmWsPbdnoVZ78Zx5wvaBFfYAm2rkDC0jEyfl5WRSgpx0F4elS0arDhYI3JsWFYQR3gG6vcfg5iogLzpKsdPDASQW60JbvpQeXyHpgJ/zzCV0d3EBD59NtZMOI9dZHEoJNlCIza9BhKiJQvAWSqlxxcRg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YKv3isSmE5hY8/WnCFvWhwtfjQsHMy+PAfBIEPmTzFN6FJ+za42bj96pz2sRHBR0Sx1HoPgMVNd6qcb5sEdWNGAhmvGx/JhrRcnG93oKdIVcjSP08ESgtMtvMdBdi53y8cY/UK4/sYySjZ2MeZwoSsiv8bK7tT7quUfrMrarzCVHxUrkK6ynQyb+QgxmBzpqYU8CZgITi8MnhYwkrcxeM9cBHhudNgZ6OmkB9qO/As6kWrdGN5baSja1NBUGJaRMaFMoeubGaDq4i/kKtdxXbI4OlB41SFSTUtpFF99glJyxhUwcO8V/sVB3peeBobPrefDf1HOCW0JOzvGcqBs/fA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jane Malalane <jane.malalane@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 23 Aug 2022 07:21:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.08.2022 23:30, Andrew Cooper wrote:
> arch_domain_create() can't blindly write into d->arch.hvm union.  Move the
> logic into hvm_domain_initialise(), which involves passing config down.
> 
> Fixes: 2ce11ce249a3 ("x86/HVM: allow per-domain usage of hardware virtualized 
> APIC")
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
preferably with a small adjustment (see below).


> This does not fix XenServer's wall of red from testing, but I have at least
> figured out what's going on.  There's a piece of plain RAM in place of a
> working LAPIC MMIO mapping (accelerated or otherwise), which causes HVMLoader
> to spin in a tight loop waiting for CPU 1 to come up after failing to send an
> INIT-SIPI-SIPI.

Where's that page of plain RAM coming from? And do you meanwhile
understand why XenServer testing is exposing the issue while osstest
isn't?

> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -576,7 +576,8 @@ static int cf_check hvm_print_line(
>      return X86EMUL_OKAY;
>  }
>  
> -int hvm_domain_initialise(struct domain *d)
> +int hvm_domain_initialise(struct domain *d,
> +                          struct xen_domctl_createdomain *config)

May I ask for const to be added here? Unless you anticipate the
function might legitimately modify the config data?

Jan



 


Rackspace

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