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

Re: [Xen-devel] [PATCH v2 7/7] amd/pvh: enable ACPI C1E disable quirk on PVH Dom0



>>> On 30.10.18 at 12:00, <roger.pau@xxxxxxxxxx> wrote:
> On Mon, Oct 29, 2018 at 08:19:20AM -0600, Jan Beulich wrote:
>> >>> On 19.10.18 at 17:20, <roger.pau@xxxxxxxxxx> wrote:
>> > --- a/xen/arch/x86/hvm/svm/svm.c
>> > +++ b/xen/arch/x86/hvm/svm/svm.c
>> > @@ -1272,6 +1272,24 @@ void svm_host_osvw_init()
>> >      spin_unlock(&osvw_lock);
>> >  }
>> >  
>> > +static int acpi_c1e_quirk(int dir, unsigned int port, unsigned int bytes,
>> > +                          uint32_t *val)
>> > +{
>> > +    ASSERT(bytes == 1 && port == acpi_smi_cmd);
>> > +
>> > +    if ( dir == IOREQ_READ )
>> > +    {
>> > +        *val = inb(port);
>> > +        return X86EMUL_OKAY;
>> > +    }
>> > +
>> > +    outb(*val, port);
>> > +    if ( *val == acpi_enable_value )
>> > +       on_each_cpu(amd_disable_c1e, NULL, 1);
>> > +
>> > +    return X86EMUL_OKAY;
>> > +}
>> 
>> Nothing in here nor ...
>> 
>> > @@ -1284,6 +1302,9 @@ static int svm_domain_initialise(struct domain *d)
>> >  
>> >      svm_guest_osvw_init(d);
>> >  
>> > +    if ( amd_acpi_c1e_quirk )
>> > +        register_portio_handler(d, acpi_smi_cmd, 1, acpi_c1e_quirk);
>> 
>> ... the registration here restricts this to Dom0.
> 
> Right, I got messed up with the permissions and completely forgot
> about limiting to Dom0.
> 
> The above needs to have a '&& is_hardware_domain(d)' IMO. I prefer to
> do this at hook registration rather than adding such check in the
> handler itself.

Of course. No point to register a handler that does nothing.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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