On Fri, Dec 09, 2016 at 11:08:02AM -0600, Michael Roth wrote: > Quoting David Gibson (2016-12-08 20:23:11) > > This introduces stub implementations of the H_RESIZE_HPT_PREPARE and > > H_RESIZE_HPT_COMMIT hypercalls which we hope to add in a PAPR > > extension to allow run time resizing of a guest's hash page table. It > > also adds a new machine property for controlling whether this new > > facility is available, and logic to check that against availability > > with KVM (only supported with KVM PR for now). > > > > Finally, it adds a new string to the hypertas property in the device > > tree, advertising to the guest the availability of the HPT resizing > > hypercalls. This is a tentative suggested value, and would need to be > > standardized by PAPR before being merged. > > > > Signed-off-by: David Gibson <da...@gibson.dropbear.id.au> > > --- > > hw/ppc/spapr.c | 66 > > ++++++++++++++++++++++++++++++++++++++++++++++++++ > > hw/ppc/spapr_hcall.c | 36 +++++++++++++++++++++++++++ > > hw/ppc/trace-events | 2 ++ > > include/hw/ppc/spapr.h | 11 +++++++++ > > target-ppc/kvm.c | 26 ++++++++++++++++++++ > > target-ppc/kvm_ppc.h | 5 ++++ > > 6 files changed, 146 insertions(+) > > > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > index 0f25e83..ecb0822 100644 > > --- a/hw/ppc/spapr.c > > +++ b/hw/ppc/spapr.c > > @@ -760,6 +760,11 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, > > void *fdt) > > if (!kvm_enabled() || kvmppc_spapr_use_multitce()) { > > add_str(hypertas, "hcall-multi-tce"); > > } > > + > > + if (spapr->resize_hpt != SPAPR_RESIZE_HPT_DISABLED) { > > + add_str(hypertas, "hcall-hpt-resize"); > > + } > > + > > _FDT(fdt_setprop(fdt, rtas, "ibm,hypertas-functions", > > hypertas->str, hypertas->len)); > > g_string_free(hypertas, TRUE); > > @@ -1839,11 +1844,31 @@ static void ppc_spapr_init(MachineState *machine) > > long load_limit, fw_size; > > char *filename; > > int smt = kvmppc_smt_threads(); > > + Error *resize_hpt_err = NULL; > > > > msi_nonbroken = true; > > > > QLIST_INIT(&spapr->phbs); > > > > + /* Check HPT resizing availability */ > > + kvmppc_check_papr_resize_hpt(&resize_hpt_err); > > + if (spapr->resize_hpt == SPAPR_RESIZE_HPT_DEFAULT) { > > + if (resize_hpt_err) { > > + spapr->resize_hpt = SPAPR_RESIZE_HPT_DISABLED; > > + error_free(resize_hpt_err); > > + resize_hpt_err = NULL; > > + } else { > > + spapr->resize_hpt = smc->resize_hpt_default; > > + } > > + } > > + > > + assert(spapr->resize_hpt != SPAPR_RESIZE_HPT_DEFAULT); > > + > > + if ((spapr->resize_hpt != SPAPR_RESIZE_HPT_DISABLED) && > > resize_hpt_err) { > > + error_report_err(resize_hpt_err); > > + exit(1); > > + } > > I'm also a bit confused by this. Aren't semantics that HPT_ENABLED will allow > a fallback to non-resizable HPTs if the feature isn't available (whereas > HPT_REQUIRED won't)? I don't understand how such a fallback can ever be > reached > with this check in place.
We fall back if the _guest_ doesn't support HPT resizing. This error path is if the _host_ can't support HPT resizing. Some extra information about this in the reply I'll shortly send to Thomas. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature