NetBSD-Bugs archive

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

Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon EC2 t2.micro



The following reply was made to PR port-amd64/55543; it has been noted by GNATS.

From: Manuel Bouyer <bouyer%antioche.eu.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Fri, 4 Sep 2020 18:02:07 +0200

 --d6Gm4EdcadzBjdND
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 hello,
 
 On Wed, Aug 05, 2020 at 02:00:01PM +0000, jmcneill%invisible.ca@localhost wrote:
 > [   1.0000030] mainbus0 (root)
 > [   1.0000030] Identified Guest XEN in HVM mode.
 > Xen HVM: Unable to obtain xencons page address
 
 can you try the attached patch ?
 
 -- 
 Manuel Bouyer <bouyer%antioche.eu.org@localhost>
      NetBSD: 26 ans d'experience feront toujours la difference
 --
 
 --d6Gm4EdcadzBjdND
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=diff
 
 ? include/xenmem.h
 ? xen/privcmd.c.hvm
 ? xen/xenmem.c
 Index: xen/hypervisor.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/xen/xen/hypervisor.c,v
 retrieving revision 1.86
 diff -u -p -u -r1.86 hypervisor.c
 --- xen/hypervisor.c	26 May 2020 10:37:25 -0000	1.86
 +++ xen/hypervisor.c	4 Sep 2020 15:59:23 -0000
 @@ -411,29 +413,31 @@ xen_hvm_init(void)
  	xen_hvm_param.index = HVM_PARAM_CONSOLE_PFN;
  	
  	if ( HYPERVISOR_hvm_op(HVMOP_get_param, &xen_hvm_param) < 0) {
 -		aprint_error(
 +		aprint_debug(
  		    "Xen HVM: Unable to obtain xencons page address\n");
 -		return 0;
 -	}
 -
 -	/* Re-use PV field */
 -	xen_start_info.console.domU.mfn = xen_hvm_param.value;
 -
 -	pmap_kenter_pa((vaddr_t) xencons_interface, ptoa(xen_start_info.console.domU.mfn),
 -	    VM_PROT_READ|VM_PROT_WRITE, 0);
 -
 -	xen_hvm_param.domid = DOMID_SELF;
 -	xen_hvm_param.index = HVM_PARAM_CONSOLE_EVTCHN;
 +		xen_start_info.console.domU.mfn = 0;
 +		xen_start_info.console.domU.evtchn = -1;
 +		xencons_interface = 0;
 +	} else {
 +		/* Re-use PV field */
 +		xen_start_info.console.domU.mfn = xen_hvm_param.value;
 +
 +		pmap_kenter_pa((vaddr_t) xencons_interface,
 +		    ptoa(xen_start_info.console.domU.mfn),
 +		    VM_PROT_READ|VM_PROT_WRITE, 0);
 +
 +		xen_hvm_param.domid = DOMID_SELF;
 +		xen_hvm_param.index = HVM_PARAM_CONSOLE_EVTCHN;
 +
 +		if ( HYPERVISOR_hvm_op(HVMOP_get_param, &xen_hvm_param) < 0) {
 +			aprint_error(
 +			    "Xen HVM: Unable to obtain xencons event channel\n");
 +			return 0;
 +		}
  
 -	if ( HYPERVISOR_hvm_op(HVMOP_get_param, &xen_hvm_param) < 0) {
 -		aprint_error(
 -		    "Xen HVM: Unable to obtain xencons event channel\n");
 -		return 0;
 +		xen_start_info.console.domU.evtchn = xen_hvm_param.value;
  	}
  
 -	xen_start_info.console.domU.evtchn = xen_hvm_param.value;
 -
 -
  	delay_func = x86_delay = xen_delay;
  	x86_initclock_func = xen_initclocks;
  
 @@ -662,9 +666,11 @@ hypervisor_attach(device_t parent, devic
  	config_found_ia(self, "xendevbus", &hac.hac_xenbus, hypervisor_print);
  #endif
  #if NXENCONS > 0
 -	memset(&hac, 0, sizeof(hac));
 -	hac.hac_xencons.xa_device = "xencons";
 -	config_found_ia(self, "xendevbus", &hac.hac_xencons, hypervisor_print);
 +	if (xencons_interface != 0) {
 +		memset(&hac, 0, sizeof(hac));
 +		hac.hac_xencons.xa_device = "xencons";
 +		config_found_ia(self, "xendevbus", &hac.hac_xencons, hypervisor_print);
 +	}
  #endif
  #if defined(XENPV) && defined(DOM0OPS)
  #if NPCI > 0
 
 --d6Gm4EdcadzBjdND--
 


Home | Main Index | Thread Index | Old Index