Skip to content

Commit cc83e10

Browse files
committed
xenopsd: set xen-platform-pci-bar-uc key in xenstore
This patch add a new parameter named 'xen-platform-pci-bar-uc' in xenopsd config file who has a default value of 'true' to keep the default behavior of hvmloader. Putting 'false' to this parameter will tell xenopsd to add a xenstore key of '0' in: '/local/domain/<domid>/hvmloader/pci/xen-platform-pci-bar-uc'. Only this key set to 0 will change the behavior of hvmloader. This changeset is link to this xen commit: https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=22650d6054625be10172fe0c78b9cadd1a39bd63 Signed-off-by: Anthoine Bourgeois <[email protected]>
1 parent aa1653a commit cc83e10

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

ocaml/xenopsd/lib/xenopsd.ml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ let default_vbd_backend_kind = ref "vbd"
4949

5050
let ca_140252_workaround = ref false
5151

52+
let xen_platform_pci_bar_uc = ref true
53+
5254
let action_after_qemu_crash = ref None
5355

5456
let additional_ballooning_timeout = ref 120.
@@ -207,6 +209,14 @@ let options =
207209
, (fun () -> string_of_bool !ca_140252_workaround)
208210
, "Workaround for evtchn misalignment for legacy PV tools"
209211
)
212+
; ( "xen-platform-pci-bar-uc"
213+
, Arg.Bool (fun x -> xen_platform_pci_bar_uc := x)
214+
, (fun () -> string_of_bool !xen_platform_pci_bar_uc)
215+
, "Controls whether, when the VM starts in HVM mode, the Xen PCI MMIO used \
216+
by grant tables is mapped as Uncached (UC, the default) or WriteBack \
217+
(WB, the workaround). WB mapping could improve performance of devices \
218+
using grant tables. This is useful on AMD platform only."
219+
)
210220
; ( "additional-ballooning-timeout"
211221
, Arg.Set_float additional_ballooning_timeout
212222
, (fun () -> string_of_float !additional_ballooning_timeout)

ocaml/xenopsd/xc/domain.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ let make ~xc ~xs vm_info vcpus domain_config uuid final_uuid no_sharept =
501501
xs.Xs.writev (dom_path ^ "/bios-strings") vm_info.bios_strings ;
502502
if vm_info.is_uefi then
503503
xs.Xs.write (dom_path ^ "/hvmloader/bios") "ovmf" ;
504+
xs.Xs.write (dom_path ^ "/hvmloader/pci/xen-platform-pci-bar-uc")
505+
(if !Xenopsd.xen_platform_pci_bar_uc then "1" else "0") ;
504506
(* If a toolstack sees a domain which it should own in this state then the
505507
domain is not completely setup and should be shutdown. *)
506508
xs.Xs.write (dom_path ^ "/action-request") "poweroff" ;

ocaml/xenopsd/xenopsd.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,9 @@ disable-logging-for=http tracing tracing_export
108108
# time to wait for in-guest PV drivers to acknowledge a shutdown request
109109
# before we conclude that the drivers have failed
110110
# domain_shutdown_ack_timeout = 60
111+
112+
# Controls whether, when the VM starts in HVM mode, the Xen PCI MMIO used
113+
# by grant tables is mapped as Uncached (UC, the default) or WriteBack
114+
# (WB, the workaround). WB mapping could improve performance of devices
115+
# using grant tables. This is useful on AMD platform only.
116+
# xen-platform-pci-bar-uc=true

0 commit comments

Comments
 (0)