[Bug 211746] [Hyper-V] UEFI VM can't boot from the iso installation disk

2017-03-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746

--- Comment #25 from Dexuan Cui  ---
Created attachment 180585
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=180585=edit
EFI mem map from Supermicro A1SRM-2758F host

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Bug 211746] [Hyper-V] UEFI VM can't boot from the iso installation disk

2017-03-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746

--- Comment #24 from Dexuan Cui  ---
(In reply to Dexuan Cui from comment #23)

FYI:
Let me attach another sample of unusual EFI memory map from Alex's Supermicro
A1SRM-2758F host. 

We can notice the 2MB range's type is BootServicesData instead of the usual
ConventionalMemory:
   BootServicesData 0020  0040 UC WC WT WB 

Luckily it seems we can write the staging area into this range without any
issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: Timer problems on FreeBSD 11R on KVM

2017-03-06 Thread Dmitry Marakasov
* Dmitry Marakasov (amd...@amdmi3.ru) wrote:

Virtualization problems keep raining on me. Or there seem to be exist
major FreeBSD problem when running under hypervisor.

Another VM under VMWare vSphere is now showing similar symptoms -
stable 33.3% intr load:

3 usersLoad  2.07  2.77  2.70  Mar  6 15:53
   Mem usage:  95%Phy 58%Kmem
Mem: KBREALVIRTUAL  VN PAGER   SWAP PAGER
Tot   Share  TotShareFree   in   out in   out
Act 1697056   15280  767263622792  739732  count
All 1700936   19060  769293642992  pages
Proc:Interrupts
  r   p   d   s   w   Csw  Trp  Sys  Int  Sof  Fltioflt   389 total
  2 166  1203  810  15k   20   92 cow atkbd0 1
  zfod 18 attimer0 0
 2.0%Sys  33.3%Intr  0.0%User  6.9%Nice 57.8%Idle ozfod   fdc0 6
||||||||||   %ozfod   ata1 15
=+--- daefr   mpt0 17
   dtbuf  prcfr 2 em0 18
Namei Name-cache   Dir-cache350812 desvn  totfr   103 cpu0:timer
   Callshits   %hits   %344853 numvn  react77 cpu2:timer
 326 326 100316930 frevn  pdwak   189 cpu1:timer
  219 pdpgs
Disks   da0   da1   da2   da3   cd0 pass0 pass1   intrn
KB/t   0.00  0.00  0.00  0.00  0.00  0.00  0.00  13835380 wire
tps   0 0 0 0 0 0 0544104 act
MB/s   0.00  0.00  0.00  0.00  0.00  0.00  0.00   1219264 inact
%busy 0 0 0 0 0 0 0   cache
   739732 free
  buf

Switching to i8254 doesn't help either, load does not change, just
intrrupts move to attimer0.

This is box is not production so I can do whatever I like with it.

Here's dtrace output from /usr/share/dtrace/toolkit/hotkernel, but I
doubt it's helpful:

kernel`in_pcbref  790   4.2%
kernel`__rw_try_rlock1054   5.6%
kernel`tcp_tw_2msl_scan  1419   7.5%
kernel`__rw_rlock1433   7.6%
kernel`in_pcbrele_wlocked1846   9.7%
kernel`_rw_runlock_cookie2362  12.5%
kernel`acpi_cpu_c1   8615  45.5%

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amd...@amdmi3.ru  ..:  jabber: amd...@jabber.ru  http://amdmi3.ru
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


[Differential] D9904: fix UEFI boot on physical machines

2017-03-06 Thread Phabricator
This revision was automatically updated to reflect the committed changes.
Closed by commit rS314770: loader.efi: fix recent UEFI-boot regression on 
physical machines (authored by dexuan).

CHANGED PRIOR TO COMMIT
  https://reviews.freebsd.org/D9904?vs=26023=26027#toc

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D9904?vs=26023=26027

REVISION DETAIL
  https://reviews.freebsd.org/D9904

AFFECTED FILES
  head/sys/boot/efi/loader/copy.c

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: decui_microsoft.com, imp, jhb, will, kib, delphij, emaste, marcel, 
honzhan_microsoft.com, howard0su_gmail.com, tsoome, gonzo, manu, andrew, 
sbruno, ambrisko, allanjude, bapt, cem, smh, ian, sepherosa_gmail.com
Cc: freebsd-virtualization-list
diff --git a/head/sys/boot/efi/loader/copy.c b/head/sys/boot/efi/loader/copy.c
--- a/head/sys/boot/efi/loader/copy.c
+++ b/head/sys/boot/efi/loader/copy.c
@@ -53,7 +53,7 @@
 	UINT32 dver;
 	EFI_STATUS status;
 	int i, ndesc;
-	unsigned long available_pages;
+	unsigned long available_pages = 0;
 
 	sz = 0;
 	status = BS->GetMemoryMap(, 0, , , );
@@ -70,7 +70,6 @@
 	}
 
 	ndesc = sz / dsz;
-
 	for (i = 0, p = map; i < ndesc;
 	 i++, p = NextMemoryDescriptor(p, dsz)) {
 		start = p->PhysicalStart;
@@ -81,20 +80,38 @@
 			continue;
 
 		if (p->Type != EfiConventionalMemory)
-			continue;
+			printf("Warning: wrong EFI memory type: %d\n",
+			p->Type);
 
 		available_pages = p->NumberOfPages -
 			((KERNEL_PHYSICAL_BASE - start) >> EFI_PAGE_SHIFT);
+		break;
+	}
+
+	if (available_pages == 0) {
+		printf("Can't find valid memory map for staging area!\n");
+		goto out;
+	}
 
-		if (*nr_pages > available_pages) {
-			printf("staging area size is reduced: %ld -> %ld!\n",
-			*nr_pages, available_pages);
-			*nr_pages = available_pages;
-		}
+	for ( ; i < ndesc;
+	 i++, p = NextMemoryDescriptor(p, dsz)) {
+		if (p->Type != EfiConventionalMemory &&
+		p->Type != EfiLoaderData)
+			break;
 
-		break;
+		if (p->PhysicalStart != end)
+			break;
+
+		end = p->PhysicalStart + p->NumberOfPages * EFI_PAGE_SIZE;
+
+		available_pages += p->NumberOfPages;
 	}
 
+	if (*nr_pages > available_pages) {
+		printf("Staging area's size is reduced: %ld -> %ld!\n",
+		*nr_pages, available_pages);
+		*nr_pages = available_pages;
+	}
 out:
 	free(map);
 }

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"

[Differential] D9904: fix UEFI boot on physical machines

2017-03-06 Thread sepherosa_gmail.com (Sepherosa Ziehau)
sepherosa_gmail.com accepted this revision.
This revision has a positive review.

REVISION DETAIL
  https://reviews.freebsd.org/D9904

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: decui_microsoft.com, imp, jhb, will, kib, delphij, emaste, marcel, 
honzhan_microsoft.com, howard0su_gmail.com, tsoome, gonzo, manu, andrew, 
sbruno, ambrisko, allanjude, bapt, cem, smh, ian, sepherosa_gmail.com
Cc: freebsd-virtualization-list
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"